:root {
  --paper: #f5f7fb;
  --paper-strong: #edf2f8;
  --sand: #d7e1f0;
  --sand-deep: #9fb1ca;
  --ink: #172033;
  --muted: #657086;
  --line: #dbe4ef;
  --soft: #ffffff;
  --accent: #2857ce;
  --accent-strong: #1f46b5;
  --blue: #2857ce;
  --green: #25815b;
  --amber: #785dcc;
  --shadow: 0 18px 45px rgba(30, 47, 80, 0.1);
  --shadow-strong: 0 26px 70px rgba(20, 33, 59, 0.2);
  --glass: rgba(255, 255, 255, 0.76);
  font-family: Manrope, Inter, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

h1,
h2,
.brand {
  font-family: "Cormorant Garamond", Georgia, serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px clamp(18px, 4vw, 54px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #e3e9f2;
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  font-weight: 800;
  line-height: 1.15;
}

.brand-mark,
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 800;
}

.main-nav,
.topbar-actions,
.contact-icons,
.hero-actions,
.dashboard-actions,
.portal-tabs,
.form-row,
.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.main-nav {
  justify-content: center;
  flex: 1;
}

.main-nav a {
  padding: 8px 10px;
  color: var(--muted);
  font-weight: 600;
}

.main-nav a:hover {
  color: var(--ink);
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.contact-icons {
  gap: 6px;
}

.contact-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  overflow: hidden;
}

.contact-icons img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-icons .phone-link {
  width: auto;
  padding: 0 12px;
  overflow: visible;
  font-family: Manrope, Inter, sans-serif;
}

.contact-icons a:hover {
  background: var(--ink);
  color: var(--paper);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.menu-button span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
}

.dark-button,
.accent-button,
.danger-button,
.ghost-button,
.light-button,
.outline-button,
.tab-button,
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  max-width: 100%;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.dark-button {
  background: var(--ink);
  color: var(--paper);
}

.danger-button {
  background: #fff6f6;
  border-color: #e4aab2;
  color: var(--accent);
}

.danger-button:hover {
  background: #f2d6da;
}

.accent-button {
  background: var(--accent);
  color: #fff7f7;
  box-shadow: 0 12px 28px rgba(138, 45, 59, 0.22);
}

.accent-button:hover {
  background: var(--accent-strong);
}

.ghost-button,
.outline-button,
.tab-button,
.nav-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.light-button {
  background: var(--soft);
  color: var(--ink);
}

.dark-button:hover,
.accent-button:hover,
.danger-button:hover,
.ghost-button:hover,
.light-button:hover,
.outline-button:hover,
.tab-button:hover,
.nav-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(28, 48, 82, 0.1);
}

.hero {
  position: relative;
  min-height: 86vh;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: clamp(22px, 5vw, 74px);
  align-items: center;
  overflow: hidden;
  padding: 118px clamp(24px, 6vw, 96px) 94px;
  background:
    linear-gradient(rgba(238, 243, 251, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 243, 251, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 84% 20%, rgba(224, 199, 160, 0.16), transparent 28%),
    linear-gradient(135deg, #050505 0%, #15110c 58%, #050505 100%);
  background-size: auto, 42px 42px, auto, auto;
}

#mathCanvas,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.98), rgba(17, 13, 9, 0.8) 46%, rgba(5, 5, 5, 0.42)),
    linear-gradient(180deg, rgba(5, 5, 5, 0.12), rgba(5, 5, 5, 0.88));
}

.hero::after {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  animation: heroTextIn 900ms ease both;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  max-width: 1040px;
  font-size: clamp(3.6rem, 9.6vw, 8.8rem);
  line-height: 0.9;
  font-weight: 800;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4.5vw, 4.2rem);
  line-height: 1.04;
  font-weight: 800;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
  line-height: 1.2;
}

h4 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.2;
}

.hero-copy {
  max-width: 900px;
  color: #e3ecfb;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-city {
  margin-bottom: 18px;
  color: var(--sand);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 800;
}

.hero .eyebrow {
  color: var(--sand);
}

.hero h1 {
  width: 100%;
  max-width: none;
  color: var(--paper);
  text-wrap: balance;
}

.hero-learning-scene {
  position: relative;
  z-index: 2;
  min-height: 430px;
  display: grid;
  align-items: center;
  justify-items: center;
  animation: heroSceneIn 900ms ease 120ms both;
}

.lesson-preview {
  position: relative;
  width: min(100%, 420px);
  padding: 24px;
  border: 1px solid rgba(238, 243, 251, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(234, 215, 189, 0.82));
  box-shadow: var(--shadow-strong);
  transform: rotate(-2deg);
}

.lesson-preview::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 8px;
  pointer-events: none;
}

.lesson-preview-top,
.lesson-preview-row,
.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lesson-preview-top {
  margin-bottom: 28px;
  color: var(--muted);
  font-weight: 800;
}

.lesson-preview-top strong,
.lesson-preview-row strong {
  color: var(--accent);
  font-size: 1.35rem;
}

.lesson-preview-main h3 {
  max-width: 320px;
  margin: 12px 0 8px;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
}

.lesson-preview-main p,
.platform-copy p {
  color: var(--muted);
}

.mini-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #111111;
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 800;
}

.preview-progress {
  height: 9px;
  margin: 30px 0 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.1);
}

.preview-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--sand-deep));
  animation: progressGrow 1300ms ease 500ms both;
}

.formula-ticket {
  position: absolute;
  right: min(1vw, 10px);
  top: 18%;
  padding: 12px 16px;
  border: 1px solid rgba(238, 243, 251, 0.18);
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.66);
  color: var(--paper);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  animation: floatTicket 5s ease-in-out infinite;
}

.formula-ticket.second {
  top: auto;
  right: auto;
  left: 0;
  bottom: 16%;
  color: var(--sand);
  animation-delay: -2.2s;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 36px 0 0;
}

.hero-metrics div {
  min-width: 140px;
  padding: 14px 18px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.hero-metrics dt {
  font-size: 1.65rem;
  font-weight: 800;
}

.hero-metrics dd {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.section,
.portal-preview {
  position: relative;
  padding: clamp(56px, 8vw, 104px) clamp(18px, 6vw, 86px);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 28px;
}

.feature-grid,
.price-grid,
.format-grid,
.review-grid,
.stats-grid,
.student-grid,
.lesson-grid,
.homework-grid,
.material-grid,
.payment-grid,
.lead-grid {
  display: grid;
  gap: 16px;
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card,
.price-card,
.format-card,
.review-card,
.data-card,
.metric-card,
.lesson-card,
.homework-card,
.material-card,
.payment-card,
.test-card,
.lead-item,
.email-item,
.timeline div,
.profile-box {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  box-shadow: var(--shadow);
}

.data-card,
.lesson-card,
.homework-card,
.material-card,
.payment-card,
.test-card,
.lead-item,
.email-item {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.data-card:hover,
.lesson-card:hover,
.homework-card:hover,
.material-card:hover,
.payment-card:hover,
.test-card:hover,
.lead-item:hover,
.email-item:hover {
  border-color: rgba(138, 45, 59, 0.22);
  box-shadow: 0 20px 48px rgba(28, 48, 82, 0.13);
}

.feature-card,
.price-card,
.format-card,
.review-card,
.data-card,
.metric-card,
.lesson-card,
.homework-card,
.material-card,
.payment-card,
.test-card,
.lead-item,
.email-item {
  padding: 20px;
}

.feature-card,
.price-card,
.format-card,
.review-card,
.journey-card,
.platform-showcase {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.feature-card:hover,
.price-card:hover,
.format-card:hover,
.review-card:hover,
.journey-card:hover {
  transform: translateY(-4px);
  border-color: rgba(138, 45, 59, 0.28);
  box-shadow: 0 24px 62px rgba(28, 48, 82, 0.16);
}

.journey-section {
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.04) 1px, transparent 1px),
    linear-gradient(#f5f8fd, #eef3fb);
  background-size: 48px 48px, auto;
}

.journey-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.journey-card {
  position: relative;
  min-height: 260px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.journey-card::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--accent), var(--sand-deep));
  opacity: 0.78;
}

.journey-card span {
  display: inline-flex;
  margin-bottom: 32px;
  color: var(--accent);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.journey-card p {
  color: var(--muted);
}

.platform-section {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 1.14fr);
  gap: clamp(26px, 6vw, 76px);
  align-items: center;
  background: #111111;
  color: var(--paper);
}

.platform-section .eyebrow {
  color: var(--sand);
}

.platform-copy p {
  max-width: 660px;
  color: #b8c7de;
  font-size: 1.08rem;
}

.platform-showcase {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  min-height: 380px;
  overflow: hidden;
  border: 1px solid rgba(238, 243, 251, 0.16);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(238, 243, 251, 0.94), rgba(224, 199, 160, 0.82));
  box-shadow: var(--shadow-strong);
}

.showcase-sidebar {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 24px 18px;
  background: #0a0a0a;
}

.showcase-sidebar span {
  height: 42px;
  border-radius: 8px;
  background: rgba(238, 243, 251, 0.18);
}

.showcase-sidebar span:first-child {
  background: var(--sand);
}

.showcase-main {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 24px;
  color: var(--ink);
}

.showcase-header {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
}

.showcase-header span {
  color: var(--accent);
  font-weight: 900;
}

.showcase-lesson {
  min-height: 150px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 22px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(28, 48, 82, 0.1);
}

.showcase-lesson span,
.showcase-grid span {
  color: var(--muted);
  font-weight: 800;
}

.showcase-lesson strong {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.02;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.showcase-grid span {
  min-height: 72px;
  display: grid;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.feature-number {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--sand-deep);
  font-weight: 800;
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  gap: clamp(24px, 5vw, 60px);
  align-items: center;
  background: #f8fafc;
}

.about-copy p:last-child {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.about-stats article {
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  box-shadow: var(--shadow);
}

.about-stats strong {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 0.95;
}

.about-stats span {
  color: #3f352c;
  font-weight: 800;
}

.format-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.format-card {
  min-height: 240px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(240, 224, 202, 0.74));
}

.format-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 38px;
}

.format-card .format-badges span {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 800;
}

.review-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reviews-section {
  background: #111;
  color: var(--paper);
}

.reviews-section .section-heading .eyebrow {
  color: var(--sand);
}

.review-card {
  display: grid;
  align-content: space-between;
  min-height: 230px;
  padding: 24px;
  background: #1e1b18;
  border-color: #3c342b;
}

.review-card p {
  color: #dbe4ef;
  font-size: 1.05rem;
}

.review-card strong {
  color: var(--sand);
}

.review-stars {
  margin-bottom: 14px;
  color: var(--sand);
  font-size: 1.05rem;
  letter-spacing: 2px;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(24px, 5vw, 60px);
  align-items: start;
  background: #111;
  color: var(--paper);
}

.split-section p {
  color: #e3ecfb;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline div {
  background: #1e1b18;
  border-color: #3c342b;
  padding: 20px;
}

.timeline span {
  color: var(--sand);
  font-weight: 800;
}

.price-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.price-grid-small {
  grid-template-columns: minmax(260px, 360px);
}

.price-block {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.price-block h3 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.price-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.price-card.highlighted {
  background: #f8fafc;
  border-color: var(--accent);
}

.price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 2rem;
  font-weight: 800;
}

.price del {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.referral-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 22px;
  margin-top: 32px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(224, 199, 160, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(17, 17, 17, 0.98), rgba(45, 34, 25, 0.96)),
    #111;
  box-shadow: 0 24px 60px rgba(17, 17, 17, 0.18);
  color: var(--paper);
}

.referral-banner::after {
  content: "%";
  position: absolute;
  right: clamp(18px, 4vw, 46px);
  bottom: -42px;
  color: rgba(238, 243, 251, 0.08);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(7rem, 16vw, 14rem);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.referral-banner strong {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
}

.referral-banner span {
  position: relative;
  z-index: 1;
  max-width: 620px;
  color: #e3ecfb;
  font-size: clamp(1.25rem, 2.6vw, 2.15rem);
  font-weight: 800;
}

.portal-preview {
  padding-bottom: 24px;
}

.portal-tabs {
  flex-wrap: wrap;
}

.tab-button.active {
  background: var(--ink);
  color: var(--paper);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  padding: 0 clamp(18px, 6vw, 86px) clamp(70px, 8vw, 110px);
}

.sidebar {
  position: sticky;
  top: 86px;
  align-self: start;
  display: grid;
  gap: 14px;
}

.profile-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.profile-box strong,
.profile-box span:last-child {
  display: block;
}

.profile-box span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  position: relative;
  justify-content: flex-start;
  width: 100%;
  min-height: 46px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.nav-button.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.nav-button.active::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 2px;
  border-radius: 50%;
  background: var(--sand);
  box-shadow: 0 0 0 4px rgba(224, 199, 160, 0.16);
}

.dashboard {
  min-width: 0;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 246, 235, 0.78));
  box-shadow: var(--shadow);
}

.dashboard-head {
  position: relative;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(201, 214, 232, 0.72);
}

.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.dashboard-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 243, 251, 0.9));
}

.metric-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--accent), var(--sand-deep));
  opacity: 0.72;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
  line-height: 1.1;
}

.student-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.lesson-grid,
.homework-grid,
.material-grid,
.payment-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #dbe4ef;
  color: #44372b;
  font-size: 0.85rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  white-space: normal;
}

.pill.green {
  background: #dbeadf;
  color: var(--green);
}

.pill.blue {
  background: #dfe8f7;
  color: var(--blue);
}

.pill.amber {
  background: #e8eef7;
  color: var(--amber);
}

.pill.red {
  background: #f2d6da;
  color: var(--accent);
}

.form-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f1f5fc);
  box-shadow: 0 12px 30px rgba(28, 48, 82, 0.08);
}

.form-panel h3 {
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #3f352c;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #9fb1ca;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(138, 45, 59, 0.12);
  background: #ffffff;
}

.data-card h3,
.lesson-card h3,
.homework-card h3,
.material-card h3,
.payment-card h3,
.test-card h3,
.lead-item h3,
.email-item h3,
.data-card p,
.lesson-card p,
.homework-card p,
.material-card p,
.payment-card p,
.test-card p,
.lead-item p,
.email-item p,
.test-options legend {
  overflow-wrap: anywhere;
  word-break: break-word;
}

textarea {
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #dbe4ef;
  font-size: 0.86rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.progress-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3ecfb;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(72px, 1fr));
  gap: 8px;
}

.calendar-day {
  min-height: 92px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.calendar-day strong {
  display: block;
  margin-bottom: 8px;
}

.calendar-day span {
  display: block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
}

.test-options {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.test-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.test-options input {
  width: auto;
  min-height: auto;
}

.lead-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  gap: clamp(24px, 5vw, 60px);
  align-items: start;
  background: #dbe4ef;
}

.lead-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lead-form label:nth-child(6),
.lead-form button {
  grid-column: 1 / -1;
}

.footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 6vw, 86px);
  background: var(--ink);
  color: var(--paper);
}

.footer p {
  margin: 6px 0 0;
  color: var(--sand);
}

.footer-links {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.footer-links a {
  color: var(--paper);
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 20px;
  top: 18px;
  bottom: auto;
  z-index: 420;
  max-width: min(360px, calc(100vw - 40px));
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast[data-tone="success"] { background: #0f7b55; }
.toast[data-tone="error"] { background: #b4233a; }
.toast[data-tone="info"] { background: var(--ink); }

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.reveal-ready .section,
.reveal-ready .feature-card,
.reveal-ready .format-card,
.reveal-ready .price-card,
.reveal-ready .review-card,
.reveal-ready .journey-card,
.reveal-ready .platform-showcase {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 620ms ease, transform 620ms ease;
}

.reveal-ready .section.in-view,
.reveal-ready .feature-card.in-view,
.reveal-ready .format-card.in-view,
.reveal-ready .price-card.in-view,
.reveal-ready .review-card.in-view,
.reveal-ready .journey-card.in-view,
.reveal-ready .platform-showcase.in-view {
  opacity: 1;
  transform: translateY(0);
}

@keyframes heroTextIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroSceneIn {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes progressGrow {
  from {
    width: 0;
  }
}

@keyframes floatTicket {
  0%,
  100% {
    transform: translateY(0) rotate(3deg);
  }
  50% {
    transform: translateY(-14px) rotate(-2deg);
  }
}

@keyframes contentLift {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .hero,
  .platform-section {
    grid-template-columns: 1fr;
  }

  .hero-learning-scene {
    min-height: 320px;
    justify-items: start;
  }

  .journey-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid,
  .price-grid,
  .format-grid,
  .review-grid,
  .stats-grid,
  .lesson-grid,
  .homework-grid,
  .material-grid,
  .payment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .dashboard-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    flex-wrap: wrap;
  }

  .menu-button {
    display: inline-block;
  }

  .main-nav,
  .topbar-actions {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar.open .main-nav,
  .topbar.open .topbar-actions {
    display: flex;
  }

  .hero {
    min-height: 78vh;
    padding-top: 70px;
  }

  .hero-learning-scene {
    display: none;
  }

  .split-section,
  .about-section,
  .lead-section,
  .platform-section {
    grid-template-columns: 1fr;
  }

  .price-grid,
  .format-grid,
  .review-grid,
  .student-grid,
  .journey-grid,
  .showcase-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .lead-form {
    grid-template-columns: 1fr;
  }

  .dashboard-head,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-items: start;
  }

  .compact-grid,
  .student-schedule-item {
    grid-template-columns: 1fr;
  }

  .student-schedule-item {
    align-items: stretch;
  }
}

/* File drop and clipboard affordances. */
.file-drop-zone {
  min-width: 0;
}

.file-drop-zone input[type="file"] {
  box-sizing: border-box;
  max-width: 100%;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.file-drop-hint {
  display: block;
  min-width: 0;
  margin-top: 5px;
  color: #7a8799;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.file-drop-zone.is-dragover input[type="file"] {
  border-color: #2f63df !important;
  background: #eef4ff !important;
  box-shadow: 0 0 0 3px rgba(47, 99, 223, 0.12);
}

.file-drop-zone.is-dragover .file-drop-hint {
  color: #2456cb;
}

.file-drop-zone.has-file input[type="file"] {
  border-style: solid;
  border-color: #9dc9b3;
  background: #f5fbf8;
}

.file-drop-zone.has-file .file-drop-hint {
  color: #277257;
}

.file-drop-zone.is-file-error input[type="file"] {
  border-color: #e18a9b !important;
  background: #fff7f8 !important;
}

.teacher-ai-attach.file-drop-zone .file-drop-hint {
  display: none;
}

/* Floating Math AI for the teacher workspace */
.teacher-ai-shell {
  position: fixed;
  top: 76px;
  right: 16px;
  z-index: 1500;
  display: grid;
  justify-items: end;
  gap: 10px;
  pointer-events: none;
}

.teacher-ai-launcher,
.teacher-ai-panel {
  pointer-events: auto;
}

.teacher-ai-launcher {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 122px;
  min-height: 48px;
  padding: 6px 10px 6px 7px;
  overflow: visible;
  border: 1px solid #cbd9f4;
  border-radius: 12px;
  color: #17233a;
  background: #fff;
  box-shadow: 0 10px 28px rgba(27, 49, 91, .12);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.teacher-ai-launcher:hover,
.teacher-ai-shell.is-open .teacher-ai-launcher {
  border-color: #7f9fee;
  box-shadow: 0 13px 34px rgba(36, 78, 175, .17);
  transform: translateY(-1px);
}

.teacher-ai-launcher .math-ai-avatar {
  position: relative;
  z-index: 2;
  width: 36px !important;
  height: 36px !important;
}

.teacher-ai-launcher-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.teacher-ai-launcher-copy strong { font-size: 12px; }
.teacher-ai-launcher-copy small { display: none; }

.teacher-ai-launcher-orbit {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(47, 99, 223, .18);
  border-radius: 50%;
  animation: teacher-ai-orbit 5.5s linear infinite;
}

.teacher-ai-launcher-orbit i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1db6a2;
  box-shadow: 0 0 0 3px rgba(29, 182, 162, .09);
}

.teacher-ai-launcher-orbit i:nth-child(1) { top: -3px; left: 18px; background: #f4b740; }
.teacher-ai-launcher-orbit i:nth-child(2) { right: -2px; bottom: 8px; width: 4px; height: 4px; background: #ee6683; }
.teacher-ai-launcher-orbit i:nth-child(3) { bottom: 0; left: 3px; width: 3px; height: 3px; background: #28a9e6; }

@keyframes teacher-ai-orbit { to { transform: rotate(360deg); } }

.teacher-ai-panel {
  display: grid;
  grid-template-rows: auto auto minmax(180px, 1fr) auto;
  width: min(388px, calc(100vw - 28px));
  height: min(642px, calc(100vh - 148px));
  min-height: 400px;
  overflow: hidden;
  border: 1px solid #d5dfef;
  border-radius: 12px;
  color: #17233a;
  background: #fff;
  box-shadow: 0 20px 58px rgba(22, 39, 73, .18);
  transform-origin: top right;
}

.teacher-ai-panel[hidden] {
  display: none !important;
}

.teacher-ai-shell.is-opening .teacher-ai-panel {
  animation: teacher-ai-panel-in 180ms ease-out;
}

@keyframes teacher-ai-panel-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.teacher-ai-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid #e3e9f2;
}

.teacher-ai-panel-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.teacher-ai-panel-head > div > span { display: grid; gap: 1px; }
.teacher-ai-panel-head strong { font-size: 13px; }
.teacher-ai-panel-head small { color: #6f7e95; font-size: 10px; }
.teacher-ai-panel-head .icon-button { width: 30px; height: 30px; border-color: transparent; font-size: 20px; font-weight: 400; }

.teacher-ai-context {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  color: #61718a;
  background: #f8fafc;
  font-size: 10px;
  font-weight: 650;
}

.teacher-ai-context > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #29a86b;
  box-shadow: 0 0 0 4px rgba(41, 168, 107, .1);
}

.teacher-ai-messages {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e4 transparent;
}

.teacher-ai-intro {
  display: grid;
  gap: 7px;
  margin: auto 0;
  text-align: center;
}

.teacher-ai-intro h3 { margin: 0; font-size: 18px; }
.teacher-ai-intro p { width: min(100%, 300px); margin: 0 auto; color: #687790; font-size: 12px; line-height: 1.5; }

.teacher-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 7px;
}

.teacher-ai-suggestions button {
  padding: 7px 9px;
  border: 1px solid #d7e0ef;
  border-radius: 7px;
  color: #335993;
  background: #f8faff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.teacher-ai-suggestions button:hover { border-color: #9eb5e8; background: #f0f5ff; }

.teacher-ai-message {
  display: flex;
  gap: 9px;
  width: 100%;
  animation: teacher-ai-message-in 160ms ease-out;
}

@keyframes teacher-ai-message-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.teacher-ai-message.is-user { justify-content: flex-end; }
.teacher-ai-message > .math-ai-avatar { flex: 0 0 auto; margin-top: 2px; }

.teacher-ai-message-body {
  min-width: 0;
  max-width: calc(100% - 40px);
  padding: 9px 11px;
  border: 1px solid #dde5f1;
  border-radius: 9px 9px 9px 4px;
  background: #fff;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.teacher-ai-message.is-user .teacher-ai-message-body {
  max-width: 86%;
  border-color: #2f63df;
  border-radius: 9px 9px 4px 9px;
  color: #fff;
  background: #2f63df;
}

.teacher-ai-message-body > span {
  display: block;
  margin-bottom: 3px;
  color: #2f63df;
  font-size: 10px;
  font-weight: 800;
}

.teacher-ai-message-file {
  display: block;
  margin-top: 7px;
  color: inherit;
  opacity: .76;
}

.teacher-ai-proposal {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dce5f3;
}

.teacher-ai-proposal header { display: flex; align-items: center; gap: 8px; }
.teacher-ai-proposal header > span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; color: #148251; background: #eaf8f1; font-weight: 900; }
.teacher-ai-proposal header div { display: grid; }
.teacher-ai-proposal header strong { font-size: 12px; }
.teacher-ai-proposal header small { color: #6c7a90; font-size: 10px; }
.teacher-ai-proposal ul { display: grid; gap: 5px; margin: 0; padding-left: 18px; color: #43516a; font-size: 11px; }
.teacher-ai-proposal-actions { display: flex; gap: 7px; }
.teacher-ai-proposal-actions button { min-height: 34px; padding: 7px 11px; font-size: 11px; }

.teacher-ai-thinking {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  padding: 8px 10px;
  border: 1px solid #dce5f2;
  border-radius: 9px 9px 9px 4px;
  background: #f8faff;
}

.teacher-ai-thinking > div { display: flex; align-items: center; gap: 9px; }
.teacher-ai-thinking strong { color: #465673; font-size: 11px; }
.teacher-ai-thinking div > span { display: flex; gap: 3px; }
.teacher-ai-thinking i { width: 5px; height: 5px; border-radius: 50%; background: #2f63df; animation: teacher-ai-dot 1.1s ease-in-out infinite; }
.teacher-ai-thinking i:nth-child(2) { animation-delay: 140ms; }
.teacher-ai-thinking i:nth-child(3) { animation-delay: 280ms; }

@keyframes teacher-ai-dot {
  0%, 65%, 100% { opacity: .25; transform: translateY(0); }
  32% { opacity: 1; transform: translateY(-4px); }
}

.teacher-ai-composer {
  display: grid;
  gap: 7px;
  padding: 10px;
  min-width: 0;
  overflow: hidden;
  border-top: 1px solid #e1e7f0;
  background: #fff;
}

.teacher-ai-composer textarea {
  width: 100%;
  min-height: 50px;
  max-height: 108px;
  padding: 9px 10px;
  border: 1px solid #ced9e9;
  border-radius: 8px;
  color: #17233a;
  background: #f9fbfe;
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.teacher-ai-composer textarea:focus { outline: 2px solid rgba(47, 99, 223, .15); border-color: #6e91e8; }
.teacher-ai-composer-actions { display: flex; align-items: center; gap: 8px; }
.teacher-ai-composer-actions > small { min-width: 0; margin-right: auto; color: #8290a5; font-size: 9px; }
.teacher-ai-attach { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 6px 8px; border: 1px solid #d7e0ed; border-radius: 8px; color: #4f6382; background: #fff; font-size: 10px; font-weight: 750; cursor: pointer; }
.teacher-ai-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.teacher-ai-attach > span:first-of-type { color: #2f63df; font-size: 17px; line-height: 1; }
.teacher-ai-send { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 9px; color: #fff; background: #2f63df; cursor: pointer; }
.teacher-ai-send span { font-size: 20px; transform: translateY(-1px); }
.teacher-ai-send:disabled { opacity: .5; cursor: wait; }
.teacher-ai-file-preview { padding: 7px 9px; overflow: hidden; border-radius: 7px; color: #4d6080; background: #f1f5fb; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.math-input-preview {
  display: grid;
  gap: 4px;
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid #dbe4f1;
  border-radius: 8px;
  color: #20304b;
  background: #f7f9fd;
}

.math-input-preview > span {
  color: #738199;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.math-input-preview p,
.math-rich-output p {
  margin: 0;
}

.math-input-preview > div,
.math-rich-output {
  min-width: 0;
  font-family: Manrope, "Cambria Math", "STIX Two Math", Inter, sans-serif;
  overflow-wrap: anywhere;
}

.teacher-ai-composer .math-input-preview {
  max-height: 82px;
  margin-top: 0;
  overflow: auto;
}

@media (max-width: 720px) {
  .teacher-ai-shell { top: 68px; right: 10px; }
  .teacher-ai-launcher { grid-template-columns: 34px; width: 46px; min-height: 46px; padding: 5px; border-radius: 11px; }
  .teacher-ai-launcher-copy { display: none; }
  .teacher-ai-launcher-orbit { top: 1px; left: 1px; }
  .teacher-ai-panel { width: calc(100vw - 20px); height: calc(100dvh - 126px); min-height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  .teacher-ai-launcher-orbit,
  .teacher-ai-thinking i,
  .teacher-ai-panel,
  .teacher-ai-message { animation: none; }
}

/* Teacher tests: compact editor, focused question work and scalable assignment. */
body[data-page="teacher"] .test-editor-card {
  padding: 0 !important;
  overflow: clip;
  border-color: #dce5f1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 48, 83, .05);
}

body[data-page="teacher"] .test-editor-card > summary {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  margin: 0 !important;
  padding: 14px 16px !important;
  list-style: none;
  cursor: pointer;
  transition: background 160ms ease;
}

body[data-page="teacher"] .test-editor-card > summary::-webkit-details-marker,
.test-question-fold > summary::-webkit-details-marker,
.test-attachments-panel > summary::-webkit-details-marker,
.test-attempts-panel > summary::-webkit-details-marker,
.assign-more > summary::-webkit-details-marker { display: none; }

body[data-page="teacher"] .test-editor-card > summary:hover { background: #f8faff; }
body[data-page="teacher"] .test-editor-card[open] > summary { border-bottom: 1px solid #e1e8f2; background: #fbfcff; }

.test-card-summary-copy {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.test-card-question-count {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  color: #2f5bd7;
  background: #edf3ff;
  font-size: 12px;
  font-weight: 850;
}

.test-card-summary-copy > span:last-child { display: grid; min-width: 0; gap: 3px; }
.test-card-summary-copy strong { overflow: hidden; color: #1f2e45; font-size: .89rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.test-card-summary-copy small { overflow: hidden; color: #748299; font-size: .7rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }

.test-card-summary-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.test-card-assigned { padding: 5px 8px; border-radius: 7px; color: #66758b; background: #f1f4f8; font-size: .67rem; font-weight: 750; white-space: nowrap; }
.test-card-summary-meta .pill { min-width: auto; margin: 0; padding: 5px 8px; border-radius: 7px; font-size: .68rem; white-space: nowrap; }

.test-editor-shell { display: grid; min-width: 0; background: #fff; }

body[data-page="teacher"] .test-editor-card .test-card-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #e5ebf3;
  background: #f7f9fc;
}

body[data-page="teacher"] .test-editor-card .test-card-overview > span {
  min-width: 0;
  padding: 12px 16px;
  border-right: 1px solid #e5ebf3;
}

body[data-page="teacher"] .test-editor-card .test-card-overview > span:last-child { border-right: 0; }
body[data-page="teacher"] .test-editor-card .test-card-overview strong { color: #1e2e46; font-size: .86rem; }
body[data-page="teacher"] .test-editor-card .test-card-overview small { color: #7b889b; font-size: .66rem; font-weight: 650; }

body[data-page="teacher"] .test-editor-card[open] .test-edit-form {
  display: grid;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0 !important;
  background: #fff;
}

body[data-page="teacher"] .test-editor-card[open] .test-edit-form .test-edit-meta-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(130px, .8fr) minmax(110px, .55fr) minmax(100px, .5fr);
  gap: 10px;
  margin: 0;
}

.test-edit-questions-section { background: #f6f8fc; }
.test-question-list { gap: 10px; }

body[data-page="teacher"] .test-editor-card .test-question-builder {
  padding: 0;
  overflow: hidden;
  border-color: #dce5f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.test-question-fold { margin: 0; }
.test-question-fold > summary { list-style: none; cursor: pointer; }

body[data-page="teacher"] .test-editor-card .test-question-head {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  min-height: 58px;
  gap: 10px;
  margin: 0;
  padding: 11px 13px;
  border-bottom: 1px solid #e5eaf2;
  background: #fbfcfe;
}

body[data-page="teacher"] .test-editor-card .test-question-fold:not([open]) .test-question-head { border-bottom: 0; background: #fff; }
.test-question-head-meta { display: flex; align-items: center; gap: 8px; }
.test-question-type { padding: 4px 7px; border-radius: 6px; color: #49658b; background: #eff3f9; font-size: .63rem; font-weight: 800; white-space: nowrap; }
body[data-page="teacher"] .test-editor-card .question-remove { flex: 0 0 30px; width: 30px; height: 30px; }

body[data-page="teacher"] .test-editor-card .test-question-body {
  gap: 13px;
  padding: 14px;
  background: #fff;
}

.test-edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px 16px; border-bottom: 1px solid #e4eaf2; background: #fff; }
.test-edit-actions .dark-button,
.test-edit-actions .danger-button { min-height: 38px; margin: 0; }

.test-save-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: #64748b;
  background: #f1f5f9;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
}

.test-save-status:empty { display: none; }
.test-save-status[data-status="dirty"] { color: #52627a; background: #f3f6fb; }
.test-save-status[data-status="saving"] { color: #2755c7; background: #edf3ff; }
.test-save-status[data-status="saved"] { color: #0f7b55; background: #e7f7ef; }
.test-save-status[data-status="error"] { color: #b4233a; background: #fff0f2; }

.test-builder-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.test-save-error {
  flex-basis: 100%;
  margin: 0;
  color: #b4233a;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.4;
}

.has-save-error :where(textarea, input, select):focus {
  border-color: #d45b70;
  box-shadow: 0 0 0 3px rgba(180, 35, 58, 0.1);
}

.test-attachments-panel,
.test-attempts-panel {
  margin: 0;
  border-bottom: 1px solid #e4eaf2;
  background: #fff;
}

.test-attachments-panel > summary,
.test-attempts-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  list-style: none;
  color: #2b4263;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 800;
}

.test-attachments-panel > summary > span,
.test-attempts-panel > summary > span { padding: 4px 7px; border-radius: 6px; color: #62738a; background: #f0f3f8; font-size: .65rem; }
.test-attachments-panel[open] > summary,
.test-attempts-panel[open] > summary { border-bottom: 1px solid #e4eaf2; background: #f8faff; }
.test-attachments-panel > div { display: grid; gap: 8px; padding: 12px 16px 14px; }
.test-attempts-panel .test-attempt-review { margin: 0; padding: 12px 16px 14px; background: #f7f9fc; }

.assign-more { margin: 0; padding: 0; border-top: 0; background: #fff; }
.assign-more > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid #e4eaf2;
  color: #2458cf;
  cursor: pointer;
}

.assign-more[open] > summary { background: #f8faff; }
.assign-more-summary { display: flex; align-items: center; gap: 9px; min-width: 0; }
.assign-more-summary > span:last-child { display: grid; gap: 2px; min-width: 0; }
.assign-more-summary strong { color: #244b98; font-size: .76rem; }
.assign-more-summary small { overflow: hidden; color: #77869b; font-size: .65rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.assign-more-icon { display: grid; flex: 0 0 24px; width: 24px; height: 24px; place-items: center; border-radius: 7px; color: #2f61df; background: #e9f0ff; font-size: 18px; line-height: 1; }
.assign-more-count { display: grid; min-width: 24px; height: 24px; place-items: center; border-radius: 50%; color: #2458cf; background: #edf3ff; font-size: .68rem; font-weight: 850; }

.assign-more-form { display: grid; gap: 11px; margin: 0; padding: 13px 16px 16px; }
.assign-more-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.assign-more-actions small { color: #77879b; font-size: .66rem; font-weight: 600; }
.assign-more-actions .accent-button { min-height: 36px; margin: 0; white-space: nowrap; }
.assignment-complete { display: flex; align-items: center; gap: 7px; margin: 0; padding: 16px; border-top: 1px solid #e4eaf2; color: #61728b; background: #fbfcfe; font-size: .7rem; }
.assignment-complete strong { color: #355673; }

.student-picker { border-color: #dce5f0; background: #f8faff; }
.student-picker.is-compact { padding: 11px; }
.student-picker-toolbar { margin-bottom: 8px; }
.student-picker-search { width: 100%; min-height: 36px; margin: 0 0 9px; padding: 7px 10px; border: 1px solid #d9e3f0; border-radius: 7px; color: #27384f; background: #fff; font-size: .73rem; outline: none; }
.student-picker-search:focus { border-color: #7f9bea; box-shadow: 0 0 0 3px rgba(47, 91, 255, .09); }
.student-picker-options { max-height: 244px; padding-right: 3px; }
.student-picker-options > label { min-height: 48px; }
.student-picker-no-results { grid-column: 1 / -1; margin: 2px 0; padding: 11px; border: 1px dashed #d7e1ef; border-radius: 7px; color: #77879b; background: #fff; font-size: .71rem; text-align: center; }

@media (max-width: 980px) {
  body[data-page="teacher"] .test-editor-card[open] .test-edit-form .test-edit-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  body[data-page="teacher"] .test-editor-card > summary { grid-template-columns: 1fr; gap: 10px; padding: 13px 14px !important; }
  .test-card-summary-meta { justify-content: flex-start; }
  body[data-page="teacher"] .test-editor-card .test-card-overview > span { padding: 10px 12px; }
  .test-edit-section,
  .test-edit-actions,
  .assign-more-form,
  .test-attachments-panel > div,
  .test-attempts-panel .test-attempt-review { padding-right: 12px; padding-left: 12px; }
  .test-edit-section > header { align-items: flex-start; flex-direction: column; }
  body[data-page="teacher"] .test-editor-card[open] .test-edit-form .test-edit-meta-grid,
  body[data-page="teacher"] .test-editor-card[open] .test-question-prompt,
  body[data-page="teacher"] .test-editor-card[open] .test-question-config,
  body[data-page="teacher"] .test-editor-card .test-option-editor { grid-template-columns: 1fr; }
  .test-question-head-meta { gap: 6px; }
  .test-question-type { max-width: 94px; overflow: hidden; text-overflow: ellipsis; }
  .test-edit-actions,
  .assign-more-actions { align-items: stretch; flex-direction: column; }
  .test-edit-actions button,
  .assign-more-actions .accent-button { width: 100%; }
  .student-picker-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .student-picker-toolbar span { flex-basis: 100%; }
}

@media (max-width: 620px) {
  .brand {
    min-width: 0;
    max-width: calc(100% - 58px);
    font-size: 0.9rem;
  }

  .hero-actions,
  .dashboard-actions,
  .button-row,
  .portal-tabs {
    align-items: stretch;
    flex-direction: column;
  }

  .feature-grid,
  .about-stats,
  .format-grid,
  .review-grid,
  .stats-grid,
  .lesson-grid,
  .homework-grid,
  .material-grid,
  .payment-grid,
  .dashboard-nav {
    grid-template-columns: 1fr;
  }

  .calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-metrics div {
    width: 100%;
  }

  .platform-showcase {
    grid-template-columns: 1fr;
  }

  .showcase-sidebar {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Dashboard controls: the whole useful surface is interactive. */
:is(body[data-page="student"], .student-preview) .student-kpi-card:is(button) {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border-style: solid;
  color: #18243a;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
}

:is(body[data-page="student"], .student-preview) .student-kpi-card:is(button):hover {
  border-color: #b7c8e5;
  box-shadow: 0 10px 24px rgba(33, 55, 92, .08);
}

:is(body[data-page="student"], .student-preview) .student-kpi-card:is(button):focus-visible {
  outline: 3px solid rgba(47, 95, 232, .18);
  outline-offset: 2px;
}

.student-kpi-arrow {
  position: absolute;
  top: 14px;
  right: 15px;
  color: #7d8ca5;
  font-size: 15px;
  font-style: normal;
  line-height: 1;
}

:is(body[data-page="student"], .student-preview) .student-goals-card {
  min-width: 0;
  border-color: #d7e1ef;
  background: #fff;
}

:is(body[data-page="student"], .student-preview) .student-goals-card .student-panel-head span {
  color: #718099;
}

body[data-page="teacher"] [data-record-actions],
body[data-page="teacher"] [data-record-menu],
body[data-page="teacher"] [data-record-menu] button {
  pointer-events: auto;
}

@media (max-width: 720px) {
  body[data-page="teacher"] .teacher-ai-shell {
    top: auto;
    right: 12px;
    bottom: 12px;
    align-content: end;
  }

  body[data-page="teacher"] .teacher-ai-panel {
    grid-row: 1;
    height: min(620px, calc(100dvh - 86px));
  }

  body[data-page="teacher"] .teacher-ai-launcher {
    grid-row: 2;
  }
}

/* Compact forms, test states and notification details. */
body[data-page="teacher"] #dashboardContent :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select),
:is(body[data-page="student"], .student-preview) #dashboardContent :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select),
.record-dialog-content :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select) {
  box-sizing: border-box;
  min-height: 38px !important;
  padding: 7px 10px !important;
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  line-height: 1.25;
}

body[data-page="teacher"] #dashboardContent textarea,
:is(body[data-page="student"], .student-preview) #dashboardContent textarea,
.record-dialog-content textarea {
  box-sizing: border-box;
  min-height: 68px !important;
  padding: 9px 10px !important;
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  line-height: 1.42;
  resize: vertical;
}

body[data-page="teacher"] #dashboardContent label,
:is(body[data-page="student"], .student-preview) #dashboardContent label,
.record-dialog-content label {
  gap: 5px;
  font-size: 0.72rem;
}

.test-meta-grid,
.test-edit-meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: start;
  gap: 10px !important;
  width: 100%;
  min-width: 0;
}

.test-meta-grid > .full,
.test-edit-meta-grid > .full { grid-column: 1 / -1 !important; }

.test-editor-card.is-draft {
  border-color: #cec3ec !important;
  box-shadow: inset 3px 0 #7557d5, 0 8px 24px rgba(42, 55, 86, 0.04) !important;
}

.test-editor-card.is-draft > summary { background: #faf8ff !important; }
.pill.draft { color: #5f43b4 !important; background: #eee9ff !important; }

.test-list-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-bottom: 10px;
}

.test-list-controls > * { min-width: 0; }

.test-progress-filters {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #dce4ef;
  border-radius: 9px;
  background: #eef2f7;
}

.test-progress-filters button {
  min-height: 30px;
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  color: #64738a;
  background: transparent;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.test-progress-filters button:hover { color: #244fb8; background: rgba(255, 255, 255, .7); }
.test-progress-filters button.active { color: #244fb8; background: #fff; box-shadow: 0 1px 5px rgba(34, 54, 88, .1); }

.test-progress-filters .has-unreviewed-results {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.test-unreviewed-indicator {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2d63e6;
  box-shadow: 0 0 0 3px #eaf1ff;
}

.test-question-type { display: none !important; }
.test-question-head-meta { display: flex; align-items: center; justify-content: flex-end; min-width: 30px; }

.test-answers-button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #cbd8ed;
  border-radius: 7px;
  color: #2856c7;
  background: #fff;
  font-size: 0.69rem;
  font-weight: 800;
  cursor: pointer;
}

.test-answers-button:hover { border-color: #8ba8eb; background: #f5f8ff; }

body[data-page="teacher"] .test-editor-card.modal-detail-source {
  position: relative;
  overflow: visible !important;
}

body[data-page="teacher"] .test-editor-card.modal-detail-source:has(.record-action-menu:not([hidden])) {
  z-index: 80;
}

body[data-page="teacher"] .test-editor-card.modal-detail-source > summary {
  overflow: visible;
  border-radius: 11px;
}

body[data-page="teacher"] .test-editor-card.modal-detail-source .record-action-menu {
  z-index: 90;
}

.notification-popover .notification-item time {
  display: block;
  margin-top: 5px;
  color: #8a96a8;
  font-size: 0.66rem;
  font-weight: 650;
  line-height: 1.2;
}

body[data-page="teacher"] .notification-button,
:is(body[data-page="student"], .student-preview) .notification-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
}

body[data-page="teacher"] .notification-icon,
:is(body[data-page="student"], .student-preview) .notification-icon {
  width: 24px;
  height: 24px;
}

:is(body[data-page="student"], .student-preview) .student-mini-item:is(button) {
  position: relative;
  border-radius: 7px;
  transition: color 140ms ease-out, background-color 140ms ease-out, box-shadow 140ms ease-out;
}

:is(body[data-page="student"], .student-preview) .student-mini-item:is(button):hover {
  color: #214fae;
  background: #edf3ff;
}

:is(body[data-page="student"], .student-preview) .student-mini-item:is(button):focus-visible,
:is(body[data-page="student"], .student-preview) .student-panel-head .text-button:focus-visible {
  outline: 3px solid rgba(47, 99, 223, .2);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .test-meta-grid,
  .test-edit-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .test-list-controls { align-items: stretch; flex-direction: column; }
  .test-progress-filters { align-self: flex-start; max-width: 100%; overflow-x: auto; }
}

@media (max-width: 620px) {
  .test-meta-grid,
  .test-edit-meta-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .test-meta-grid > .full,
  .test-edit-meta-grid > .full { grid-column: auto !important; }
  .test-progress-filters { width: 100%; }
  .test-progress-filters button { flex: 1 1 auto; }
  .test-attempt-answer { grid-template-columns: 22px minmax(0, 1fr); }
  .attempt-grade-status { grid-column: 2; white-space: normal; }
  body[data-page="teacher"] #dashboardContent :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select),
  :is(body[data-page="student"], .student-preview) #dashboardContent :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select),
  .record-dialog-content :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select) { min-height: 42px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* AI tutor and detailed test results */
.test-ai-settings {
  border: 1px solid #d9e2f2;
  border-radius: 8px;
  background: #f7f9fd;
  padding: 0;
}

.test-ai-settings > summary {
  cursor: pointer;
  color: #22314d;
  font-weight: 700;
  padding: 14px 16px;
}

.test-ai-settings[open] > summary {
  border-bottom: 1px solid #d9e2f2;
}

.test-ai-settings > .form-grid,
.test-ai-settings > .field-hint {
  margin: 14px 16px;
}

.toggle-field {
  align-items: center;
  display: flex !important;
  flex-direction: row !important;
  gap: 10px;
}

.toggle-field input {
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.student-test-history {
  background: transparent;
  border: 0;
  display: grid;
  gap: 12px;
  padding: 0;
}

.student-test-history-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.student-test-history-title > span {
  align-items: center;
  background: #eaf0ff;
  border-radius: 50%;
  color: #2f5ee8;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.student-attempt-result {
  background: #fff;
  border: 1px solid #dbe3f0;
  border-radius: 8px;
  overflow: hidden;
}

.student-attempt-result > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
  min-height: 64px;
  padding: 12px 16px;
}

.student-attempt-result > summary::-webkit-details-marker { display: none; }
.student-attempt-result > summary span { display: grid; gap: 3px; }
.student-attempt-result > summary small { color: #748198; font-weight: 500; }
.student-attempt-result > summary > strong { color: #2f5ee8; }
.student-attempt-result[open] > summary { border-bottom: 1px solid #e2e8f2; }

.student-attempt-question-list { display: grid; }

.student-attempt-question {
  border-bottom: 1px solid #e7ebf3;
  padding: 16px;
}

.student-attempt-question:last-child { border-bottom: 0; }
.student-attempt-question.is-correct { border-left: 3px solid #28a873; }
.student-attempt-question.is-wrong { border-left: 3px solid #e25261; }
.student-attempt-question.is-manual { border-left: 3px solid #8a97aa; }

.student-attempt-question-head {
  align-items: flex-start;
  display: grid;
  gap: 12px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
}

.student-attempt-question-head > span:first-child {
  align-items: center;
  background: #edf2ff;
  border-radius: 50%;
  color: #2f5ee8;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  height: 30px;
  justify-content: center;
}

.student-attempt-question-head > div { display: grid; gap: 5px; min-width: 0; }
.student-attempt-question-head small { color: #67758d; overflow-wrap: anywhere; }

.attempt-grade-status {
  background: #eef2f8;
  border-radius: 6px;
  color: #526078;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 6px 9px;
  white-space: nowrap;
}

.is-correct .attempt-grade-status { background: #e7f6ef; color: #207b58; }
.is-wrong .attempt-grade-status { background: #fdecef; color: #ad3345; }

.ai-help-row {
  align-items: center;
  background: #f4f7ff;
  border: 1px solid #d9e3ff;
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-top: 14px;
  padding: 12px;
}

.ai-help-row > div { display: grid; gap: 3px; }
.ai-help-row small { color: #67758d; }
.ai-help-row .outline-button { flex: 0 0 auto; }

.ai-explanation-slot:empty { display: none; }
.ai-explanation-slot { margin-top: 12px; }

.ai-explanation-card {
  background: #fff;
  border: 1px solid #cddafd;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(32, 57, 107, .08);
  display: grid;
  gap: 14px;
  padding: 16px;
}

.ai-explanation-card.is-fallback { border-color: #d8dfeb; }
.ai-explanation-card header { align-items: center; display: flex; gap: 10px; }
.ai-explanation-card header > span { align-items: center; background: #2f5ee8; border-radius: 7px; color: #fff; display: flex; font-size: 18px; height: 36px; justify-content: center; width: 36px; }
.ai-explanation-card header div { display: grid; gap: 2px; }
.ai-explanation-card h5, .ai-explanation-card p { margin: 0; }
.ai-explanation-card header small { color: #2f5ee8; font-weight: 800; }
.ai-explanation-card > div:not(header) { display: grid; gap: 5px; }
.ai-explanation-card p { color: #4f5e76; line-height: 1.55; }
.ai-explanation-hint { background: #eef3ff; border-radius: 7px; padding: 12px; }
.ai-encouragement { border-top: 1px solid #e4e9f2; font-weight: 650; padding-top: 12px; }

.ai-unavailable-card { display: flex; align-items: center; gap: 12px; max-width: 560px; padding: 15px 16px; border: 1px solid #dbe3ee; border-radius: 8px; background: #f7f9fc; color: #1d2a3f; }
.ai-unavailable-card > span { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; border-radius: 8px; background: #e8eef8; color: #3766d9; font-size: 20px; font-weight: 800; }
.ai-unavailable-card div { display: grid; gap: 3px; }
.ai-unavailable-card strong { font-size: 15px; }
.ai-unavailable-card small { color: #728098; font-size: 13px; }

.student-attempt-task { display: grid; gap: 12px; margin: 14px 0; padding: 16px; border: 1px solid #dce4ef; border-radius: 8px; background: #fff; }
.student-attempt-task-label { color: #60708a; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.student-attempt-task-text { margin: 0; color: #1b2940; font-size: 16px; font-weight: 650; line-height: 1.55; white-space: pre-wrap; }
.student-attempt-task-file { display: grid; gap: 8px; }
.student-attempt-task-file > span { color: #60708a; font-size: 12px; font-weight: 700; }
.student-attempt-task-file .inline-image-attachment { width: min(100%, 720px); }
.student-attempt-task-file .inline-image-attachment img { width: 100%; max-height: 480px; object-fit: contain; }
.student-attempt-task-options { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.student-attempt-task-options > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 48px; padding: 9px 11px; border: 1px solid #dce4ef; border-radius: 8px; background: #f9fbfe; }
.student-attempt-task-options p { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.student-attempt-task-options small { color: #2f61d5; font-weight: 750; white-space: nowrap; }
.student-attempt-task-options > div.is-selected { border-color: #9eb8ff; background: #f0f5ff; }

.ai-followup-button {
  background: transparent;
  border: 0;
  color: #2f5ee8;
  cursor: pointer;
  font-weight: 800;
  margin-top: 10px;
  padding: 6px 0;
}

.ai-explanation-loading,
.ai-explanation-error {
  align-items: center;
  background: #f4f7fc;
  border: 1px solid #dce4f0;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  padding: 14px;
}

.ai-explanation-loading .math-ai-avatar { flex: 0 0 auto; }
.ai-explanation-loading > div { display: grid; gap: 2px; }
.ai-explanation-loading small { color: #67758d; }
.ai-explanation-error { color: #a42f43; }

.ai-thinking-dots {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
  padding: 6px 2px;
}

.ai-thinking-dots i {
  animation: ai-thinking-dot 1.15s ease-in-out infinite;
  background: #2f63df;
  border-radius: 50%;
  display: block;
  height: 6px;
  opacity: .28;
  width: 6px;
}

.ai-thinking-dots i:nth-child(2) { animation-delay: 140ms; }
.ai-thinking-dots i:nth-child(3) { animation-delay: 280ms; }

@keyframes ai-thinking-dot {
  0%, 65%, 100% { opacity: .28; transform: translateY(0); }
  32% { opacity: 1; transform: translateY(-5px); }
}

@media (max-width: 720px) {
  .student-attempt-question-head { grid-template-columns: 30px minmax(0, 1fr); }
  .student-attempt-question-head .attempt-grade-status { grid-column: 2; justify-self: start; }
  .ai-help-row { align-items: stretch; flex-direction: column; }
  .ai-help-row .outline-button { width: fit-content; }
  .student-attempt-task-options { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-thinking-dots i { animation: none; opacity: .65; }
}

/* Separate pages and auth flow */
.hero-content-centered {
  margin-inline: auto;
  text-align: center;
}

.hero-content-centered .hero-copy {
  margin-inline: auto;
}

.hero-content-centered .hero-actions,
.hero-content-centered .hero-metrics {
  justify-content: center;
}

.hero-content-left {
  margin-left: 0;
  text-align: left;
}

.hero-content-left .hero-actions,
.hero-content-left .hero-metrics {
  justify-content: flex-start;
}

.auth-page {
  min-height: calc(100vh - 75px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(20px, 5vw, 64px);
  align-items: center;
  padding: clamp(32px, 7vw, 90px) clamp(18px, 6vw, 86px);
  background: linear-gradient(135deg, #f5f8fd 0%, #eef3fb 100%);
}

.auth-panel,
.auth-help {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(28, 48, 82, 0.08);
  padding: clamp(22px, 4vw, 40px);
}

.auth-panel h1 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.auth-help {
  display: grid;
  gap: 14px;
}

.auth-help h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.credential-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.credential-card span {
  color: var(--muted);
  font-weight: 600;
}

.cabinet-page {
  min-height: calc(100vh - 75px);
  padding-top: 28px;
  background: #f5f7fb;
}

.app-shell.standalone {
  padding-top: 0;
}

.app-shell.standalone .sidebar {
  padding: 10px;
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 42px rgba(28, 48, 82, 0.08);
  backdrop-filter: blur(16px);
}

.app-shell.standalone .profile-box {
  background: #111111;
  color: var(--paper);
  box-shadow: none;
}

.app-shell.standalone .profile-box span:last-child {
  color: #b9c5d8;
}

.app-shell.standalone .profile-box .avatar {
  background: var(--paper);
  color: var(--ink);
}

.app-shell.standalone .dashboard {
  border-color: #dfe6f0;
  background: rgba(255, 255, 255, 0.94);
}

.app-shell.standalone #dashboardContent {
  animation: contentLift 260ms ease both;
}

.cabinet-topbar,
.auth-topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: #e3e9f2;
}

.cabinet-page {
  background:
    linear-gradient(180deg, #f5f7fb 0%, #edf2f8 100%);
}

.app-shell.standalone {
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
}

.app-shell.standalone .sidebar {
  padding: 8px;
  border-color: #dfe6f0;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 36px rgba(28, 48, 82, 0.06);
}

.app-shell.standalone .profile-box {
  border-color: #1b1b1b;
  background: #1b1b1b;
}

.dashboard-nav {
  gap: 4px;
}

.nav-button {
  min-height: 42px;
  border-color: transparent;
  background: transparent;
  color: #5b5147;
  box-shadow: none;
}

.nav-button:hover {
  background: #edf2f8;
  box-shadow: none;
  transform: none;
}

.nav-button.active {
  background: #e8eef7;
  color: #171717;
  border-color: #c9d6e8;
}

.nav-button.active::before {
  background: var(--accent);
  box-shadow: none;
}

.app-shell.standalone .dashboard {
  border-color: #dfe6f0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 45px rgba(28, 48, 82, 0.07);
}

.dashboard-head {
  align-items: center;
  border-bottom-color: #dbe4ef;
}

.dashboard-head h2 {
  font-family: Manrope, Inter, Roboto, Arial, sans-serif;
  font-size: clamp(1.55rem, 2.4vw, 2.35rem);
  letter-spacing: 0;
}

.dashboard-actions {
  justify-content: flex-end;
}

.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #dce5f1;
  border-radius: 999px;
  background: #fff;
  color: #315bca;
  cursor: pointer;
  box-shadow: none;
}

.icon-button:hover,
.icon-button.active {
  border-color: #aac1f5;
  background: #eef4ff;
  transform: none;
}

.bell-shape {
  position: relative;
  width: 15px;
  height: 17px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 9px 9px 5px 5px;
}

.bell-shape::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  width: 5px;
  height: 5px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  transform: translateX(-50%);
}

.bell-shape::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.metric-card,
.data-card,
.lesson-card,
.homework-card,
.material-card,
.payment-card,
.test-card,
.lead-item,
.email-item,
.form-panel {
  border-color: #dfe6f0;
  background: #fff;
  box-shadow: 0 10px 26px rgba(28, 48, 82, 0.05);
}

.metric-card::after {
  background: #d8e4fb;
  opacity: 1;
}

.data-card:hover,
.lesson-card:hover,
.homework-card:hover,
.material-card:hover,
.payment-card:hover,
.test-card:hover,
.lead-item:hover,
.email-item:hover {
  border-color: #c7d8f2;
  box-shadow: 0 14px 32px rgba(28, 48, 82, 0.08);
}

.notification-item {
  border-color: #dfe6f0;
  border-left-width: 3px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(28, 48, 82, 0.05);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.settings-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.settings-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.muted-note {
  color: var(--muted);
  font-size: 0.94rem;
}

.auth-page {
  min-height: calc(100vh - 73px);
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
  background:
    linear-gradient(180deg, #f5f7fb 0%, #e8eef7 100%);
}

.auth-panel {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 45px rgba(28, 48, 82, 0.08);
}

.auth-panel h1 {
  font-family: Manrope, Inter, Roboto, Arial, sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

input[type="file"] {
  padding: 9px 10px;
  background: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-weight: 800;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e3ecfb;
  color: #33281f;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.file-chip::before {
  content: "↓";
  flex: 0 0 auto;
  font-weight: 900;
}

@media (max-width: 820px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
}
.trial-price-block {
  max-width: 520px;
  margin-top: 24px;
}

.price-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.student-card-head,
.student-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.student-card {
  padding: 0;
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.student-card:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 45, 59, 0.24);
  box-shadow: 0 22px 54px rgba(28, 48, 82, 0.14);
}

.student-card-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 14px;
  align-items: center;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}

.student-card-summary::-webkit-details-marker {
  display: none;
}

.student-summary-main {
  display: grid;
  min-width: 0;
}

.student-summary-main strong,
.student-summary-main small {
  overflow-wrap: anywhere;
}

.student-summary-main small {
  color: var(--muted);
  font-weight: 700;
}

.student-summary-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-cue {
  justify-self: start;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
}

.student-card[open] .summary-cue {
  color: var(--muted);
}

.student-card[open] .summary-cue::after {
  content: " детали";
}

.student-card-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.student-profile-card {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.student-avatar {
  overflow: hidden;
  flex: 0 0 auto;
}

.student-avatar.large {
  width: 72px;
  height: 72px;
  font-size: 1.5rem;
}

.student-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inline-edit {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.compact-grid {
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
}

.inline-edit .form-grid,
.submit-homework,
.test-attempt {
  min-width: 0;
}

.submit-homework,
.test-attempt {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.test-options {
  min-width: 0;
}

.test-options label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.student-schedule-list {
  display: grid;
  gap: 12px;
}

.student-schedule-item {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(201, 214, 232, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(28, 48, 82, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.student-schedule-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(28, 48, 82, 0.12);
}

.student-schedule-item time {
  color: var(--muted);
  font-weight: 800;
}

.student-schedule-item h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.student-schedule-item p {
  margin: 0;
  color: var(--muted);
}

.student-schedule-item > div {
  min-width: 0;
}

.dashboard-section {
  margin-top: 18px;
}

.dashboard-section .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-section .section-heading h3 {
  margin: 0;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #ffffff;
}

.notification-item strong {
  display: block;
  margin-bottom: 4px;
}

.notification-item p {
  margin: 0;
  color: var(--muted);
}

.notification-item.red {
  border-left-color: var(--accent);
}

.notification-item.amber {
  border-left-color: var(--amber);
}

.notification-item.blue {
  border-left-color: var(--blue);
}

.file-chip.downloadable {
  border: 1px solid #9fb1ca;
  background: #ffffff;
  color: var(--blue);
}

@media (max-width: 760px) {
  .student-schedule-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .compact-grid {
    grid-template-columns: 1fr;
  }
}

/* Polished product-style theme */
:root {
  --paper: #f5f7fb;
  --paper-strong: #edf2f8;
  --sand: #d7e1f0;
  --sand-deep: #9fb1ca;
  --ink: #172033;
  --muted: #657086;
  --line: #dbe4ef;
  --soft: #ffffff;
  --accent: #2857ce;
  --accent-strong: #1f46b5;
  --green: #25815b;
  --amber: #785dcc;
  --blue: #2857ce;
  --shadow: 0 12px 32px rgba(30, 47, 80, 0.07);
  --shadow-strong: 0 24px 70px rgba(20, 33, 59, 0.2);
}

body {
  background: #f5f7fb;
}

.topbar {
  background: rgba(255, 255, 255, 0.88);
  border-bottom-color: #e3e9f2;
  box-shadow: 0 10px 30px rgba(41, 31, 22, 0.04);
}

.brand-mark,
.avatar {
  background: #171717;
  color: #ffffff;
}

.accent-button,
.dark-button {
  background: #171717;
  border-color: #171717;
  color: #ffffff;
  box-shadow: none;
}

.accent-button:hover,
.dark-button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

body[data-page="landing"] .light-button,
body[data-page="landing"] .ghost-button,
body[data-page="landing"] .outline-button {
  background: rgba(255, 255, 255, 0.78);
  border-color: #dbe4ef;
  color: #171717;
  box-shadow: none;
}

.hero {
  min-height: 84vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #111111 0%, #211b16 62%, #141414 100%);
  background-size: 44px 44px, 44px 44px, auto;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.94), rgba(28, 23, 18, 0.72) 52%, rgba(17, 17, 17, 0.32)),
    linear-gradient(180deg, rgba(17, 17, 17, 0.04), rgba(17, 17, 17, 0.8));
}

.hero h1 {
  color: #f8fafc;
}

.hero-copy {
  color: #dbe4ef;
}

.lesson-preview,
.platform-showcase {
  border-color: rgba(255, 255, 255, 0.2);
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.22);
}

.mini-badge {
  background: #edf2f8;
  color: #171717;
}

.section {
  background: #f8fafc;
}

.program-section,
.formats-section,
.prices-section {
  background: #f8fafc;
}

.about-section,
.journey-section,
.reviews-section,
.lead-section {
  background: #edf2f8;
}

.platform-section {
  background: #171717;
}

.feature-card,
.format-card,
.review-card,
.price-card,
.journey-card,
.about-stats article,
.lead-form,
.trial-price-block .price-card {
  border-color: #dbe4ef;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(41, 31, 22, 0.06);
}

.feature-card:hover,
.price-card:hover,
.format-card:hover,
.review-card:hover,
.journey-card:hover {
  transform: translateY(-2px);
  border-color: #c9d6e8;
  box-shadow: 0 18px 42px rgba(41, 31, 22, 0.09);
}

.format-badges span,
.pill {
  background: #f1f5f9;
  color: #4f463d;
}

.pill.green {
  background: #e5eee8;
  color: #3d6651;
}

.pill.blue {
  background: #e7ecf4;
  color: #425f8f;
}

.pill.amber {
  background: #edf3ff;
  color: #8a5d23;
}

.pill.red {
  background: #f2e2e5;
  color: #7f2636;
}

.cabinet-page {
  background:
    linear-gradient(180deg, #f8fafc 0%, #f5f7fb 100%);
}

.app-shell.standalone {
  grid-template-columns: 244px minmax(0, 1fr);
  padding-inline: clamp(14px, 4vw, 54px);
}

.app-shell.standalone .sidebar,
.app-shell.standalone .dashboard,
.auth-panel {
  border-color: #e3e9f2;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(41, 31, 22, 0.06);
}

.app-shell.standalone .profile-box {
  background: #171717;
  border-color: #171717;
  box-shadow: none;
}

.nav-button {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #665d54;
}

.nav-button.active {
  background: #edf2f8;
  border-color: #c9d6e8;
  color: #171717;
}

.dashboard-head {
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.dashboard-head .eyebrow {
  margin-bottom: 6px;
  color: #657086;
}

.metric-card,
.data-card,
.lesson-card,
.homework-card,
.material-card,
.payment-card,
.test-card,
.lead-item,
.email-item,
.form-panel,
.student-schedule-item,
.notification-item {
  border-color: #e3e9f2;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(41, 31, 22, 0.045);
}

.metric-card strong {
  font-size: 1.75rem;
}

.metric-card::after {
  height: 2px;
  background: #c9d6e8;
}

.form-panel {
  padding: 16px;
}

input,
textarea,
select {
  border-color: #dbe4ef;
  background: #ffffff;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #7f8da3;
  box-shadow: 0 0 0 3px rgba(183, 154, 114, 0.16);
}

.notification-item {
  border-left-width: 3px;
}

.auth-page {
  background:
    linear-gradient(180deg, #f8fafc 0%, #edf2f8 100%);
}

@media (max-width: 1080px) {
  .app-shell.standalone {
    grid-template-columns: 1fr;
  }
}

/* Bugfixes and final readability pass */
.avatar {
  position: relative;
  overflow: hidden;
}

.avatar img,
.profile-box .avatar img,
.student-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.profile-box {
  overflow: hidden;
}

.profile-box > div {
  min-width: 0;
}

.profile-box strong,
.profile-box span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.reviews-section {
  background: #edf2f8;
  color: var(--ink);
}

.reviews-section .section-heading h2 {
  color: var(--ink);
}

.reviews-section .section-heading .eyebrow {
  color: var(--accent);
}

.review-card {
  background: #ffffff;
  border-color: #dbe4ef;
  color: var(--ink);
}

.review-card p {
  color: #51483f;
}

.review-card strong,
.review-stars {
  color: #657086;
}

.notification-button {
  overflow: visible;
}

.notification-shell {
  position: relative;
  display: inline-flex;
}

.notification-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-button.has-count {
  border-color: rgba(127, 38, 54, 0.28);
  background: #f8fafc;
  color: var(--accent);
}

.notification-count {
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  border-color: #ffffff;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
}

.bell-shape {
  display: none;
}

.notification-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(360px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 120px));
  display: none;
  overflow: hidden;
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(41, 31, 22, 0.18);
}

.notification-popover.open {
  display: grid;
}

.notification-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.notification-popover-head div {
  display: grid;
  gap: 2px;
}

.notification-popover-head strong {
  font-size: 0.98rem;
}

.notification-popover-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.notification-popover-body {
  max-height: 430px;
  overflow-y: auto;
  padding: 10px;
}

.notification-popover .data-card {
  padding: 14px;
  box-shadow: none;
}

.notification-popover .notification-list {
  gap: 8px;
}

.notification-popover .notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 11px 12px;
  border-left-width: 4px;
  box-shadow: none;
}

.notification-popover .notification-item strong {
  font-size: 0.9rem;
}

.notification-popover .notification-item p {
  font-size: 0.84rem;
  line-height: 1.35;
}

.notification-item.is-read {
  opacity: 0.58;
  background: #ffffff;
}

.notification-popover .text-button {
  white-space: nowrap;
  font-size: 0.78rem;
}

/* Compact cabinet workflows */
.compact-form {
  padding: 0;
}

.compact-form > summary,
.compact-list > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 14px 16px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
  list-style: none;
}

.compact-form > summary::-webkit-details-marker,
.compact-list > summary::-webkit-details-marker {
  display: none;
}

.compact-form > summary::after,
.compact-list > summary::after {
  content: "";
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #dce4ef;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 8px #fff;
  transform: rotate(45deg);
  transition: transform 180ms ease, border-color 180ms ease;
}

.compact-form > summary::after,
.compact-list > summary::after {
  border-top-color: transparent;
  border-left-color: transparent;
  border-radius: 3px;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  box-shadow: none;
}

.compact-form[open] > summary::after,
.compact-list[open] > summary::after {
  transform: rotate(225deg);
}

.compact-form form {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.compact-list {
  margin-top: 14px;
  border: 1px solid #e3e9f2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(41, 31, 22, 0.045);
}

.compact-list .lesson-grid {
  padding: 0 16px 16px;
}

.week-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.week-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e3e9f2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(41, 31, 22, 0.045);
}

.week-toolbar h3,
.week-toolbar .eyebrow {
  margin: 0;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.week-day {
  min-height: 220px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e3e9f2;
  border-radius: 8px;
  background: #ffffff;
}

.week-day.today {
  border-color: rgba(127, 38, 54, 0.3);
  background: #f8fafc;
}

.week-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: capitalize;
}

.week-day header strong {
  color: var(--ink);
}

.week-lessons {
  display: grid;
  gap: 8px;
}

.week-lesson {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 8px;
  background: #edf2f8;
  color: var(--ink);
}

.week-lesson time {
  color: var(--accent);
  font-weight: 900;
}

.week-lesson strong {
  font-size: 0.92rem;
  line-height: 1.25;
}

.week-lesson span {
  color: var(--muted);
  font-size: 0.84rem;
}

.empty-day {
  margin: 0;
  color: #9a9086;
  font-size: 0.9rem;
}

.text-button {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
}

.dashboard .stats-grid {
  gap: 10px;
}

.dashboard .metric-card,
.dashboard .data-card,
.dashboard .lesson-card,
.dashboard .homework-card,
.dashboard .material-card,
.dashboard .payment-card,
.dashboard .test-card,
.dashboard .lead-item,
.dashboard .email-item {
  padding: 16px;
}

.dashboard .lesson-grid,
.dashboard .homework-grid,
.dashboard .material-grid,
.dashboard .payment-grid {
  gap: 10px;
}

.dashboard .lesson-grid,
.dashboard .homework-grid,
.dashboard .material-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
  justify-content: start;
}

.dashboard .payment-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 420px));
  justify-content: start;
}

.dashboard .homework-grid.compact-cards,
.dashboard .lesson-grid.compact-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 340px));
}

.dashboard .homework-card,
.dashboard .test-card,
.dashboard .material-card,
.dashboard .lesson-card {
  width: 100%;
  max-width: 360px;
}

.dashboard .payment-card {
  width: 100%;
  max-width: 420px;
}

.dashboard .homework-grid > .data-card:only-child,
.dashboard .lesson-grid > .data-card:only-child,
.dashboard .material-grid > .data-card:only-child,
.dashboard .payment-grid > .data-card:only-child {
  width: min(100%, 420px);
}

.dashboard .inline-edit {
  margin-top: 10px;
  padding-top: 10px;
}

.payment-card .price {
  margin: 8px 0;
  font-size: 1.45rem;
}

@media (max-width: 900px) {
  .week-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .week-grid {
    grid-template-columns: repeat(7, minmax(180px, 1fr));
  }
}

/* Compact learning cards */
.about-section {
  grid-template-columns: minmax(0, 0.95fr) minmax(260px, 0.62fr) minmax(280px, 0.9fr);
  align-items: stretch;
}

.about-photo {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid rgba(219, 228, 239, 0.9);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(41, 31, 22, 0.1);
}

.about-photo img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  display: block;
  object-fit: cover;
  object-position: 42% 50%;
}

.dense-form {
  gap: 10px;
}

.dense-form label {
  gap: 5px;
}

.dense-form input,
.dense-form select,
.dense-form textarea {
  min-height: 42px;
}

.compact-cards {
  align-items: start;
}

.collapsible-card {
  padding: 0 !important;
  overflow: hidden;
}

.collapsible-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.collapsible-card summary::-webkit-details-marker {
  display: none;
}

.collapsible-card summary > span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.collapsible-card summary strong,
.collapsible-card summary small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.collapsible-card summary strong {
  font-size: 0.98rem;
  line-height: 1.25;
}

.collapsible-card summary small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.collapsible-card > :not(summary) {
  margin-left: 16px;
  margin-right: 16px;
}

.collapsible-card > :last-child {
  margin-bottom: 16px;
}

.collapsible-card[open] summary {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(219, 228, 239, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.file-row > span:first-child {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.file-chip {
  max-width: min(100%, 280px);
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #edf3fb;
  font-size: 0.84rem;
  box-shadow: none;
}

.file-chip::before {
  content: "";
}

.file-chip .file-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: #171717;
  color: #ffffff;
  font-size: 0.85rem;
  line-height: 1;
}

.file-chip .file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip.downloadable {
  text-decoration: none;
}

.file-chip.downloadable:hover {
  border-color: rgba(127, 38, 54, 0.36);
  background: #f8fafc;
}

.muted-file {
  color: var(--muted);
  font-weight: 700;
}

.pill.muted {
  background: #edf2f8;
  color: var(--muted);
}

.student-schedule-item.collapsible-card {
  display: block;
  padding: 0;
}

.student-schedule-item.collapsible-card summary {
  grid-template-columns: minmax(130px, 190px) minmax(0, 1fr);
}

.student-schedule-item.collapsible-card .accent-button {
  margin-top: 10px;
}

.submit-homework,
.test-attempt {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1080px) {
  .about-section {
    grid-template-columns: 1fr;
  }

  .about-photo img {
    max-height: 560px;
  }
}

@media (max-width: 760px) {
  .collapsible-card summary,
  .student-schedule-item.collapsible-card summary {
    grid-template-columns: 1fr;
  }

  .file-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-chip {
    max-width: 100%;
  }
}

/* Minimal school dashboard refresh */
.cabinet-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(224, 199, 160, 0.18), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #f5f7fb 100%);
}

.cabinet-topbar {
  min-height: 64px;
  padding-block: 10px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.app-shell.standalone {
  align-items: start;
  gap: 18px;
  padding-block: 22px 42px;
}

.app-shell.standalone .sidebar,
.app-shell.standalone .dashboard {
  border: 1px solid rgba(219, 228, 239, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 42px rgba(41, 31, 22, 0.055);
}

.app-shell.standalone .sidebar {
  position: sticky;
  top: 82px;
  padding: 14px;
}

.app-shell.standalone .dashboard {
  padding: 18px;
}

.app-shell.standalone #dashboardContent {
  padding-top: 16px;
}

.profile-box {
  min-height: 74px;
  padding: 12px;
  border-radius: 14px;
}

.app-shell.standalone .profile-box {
  background: #171717;
}

.dashboard-nav {
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(219, 228, 239, 0.72);
}

.dashboard-nav .nav-button {
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #6d645b;
  font-size: 0.92rem;
  font-weight: 750;
}

.dashboard-nav .nav-button.active {
  background: #171717;
  color: #ffffff;
  box-shadow: none;
}

.dashboard-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(219, 228, 239, 0.86);
}

.dashboard-head h2 {
  font-size: clamp(1.9rem, 3vw, 2.65rem);
  letter-spacing: 0;
}

.dashboard-actions {
  gap: 8px;
}

.dashboard .metric-card,
.dashboard .data-card,
.dashboard .lesson-card,
.dashboard .homework-card,
.dashboard .material-card,
.dashboard .payment-card,
.dashboard .test-card,
.dashboard .lead-item,
.dashboard .email-item,
.dashboard .form-panel,
.week-toolbar,
.week-day,
.compact-list {
  border-color: rgba(219, 228, 239, 0.82);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(41, 31, 22, 0.045);
}

.dashboard .metric-card {
  min-height: 96px;
}

.dashboard .metric-card::after {
  height: 2px;
  opacity: 0.55;
}

.form-panel input,
.form-panel select,
.form-panel textarea,
.inline-edit input,
.inline-edit select,
.inline-edit textarea {
  border-radius: 10px;
  background: #ffffff;
}

/* Restored landing request form */
.lead-section {
  position: relative;
  grid-template-columns: minmax(280px, 0.86fr) minmax(320px, 1fr);
  overflow: hidden;
  border-top: 1px solid rgba(219, 228, 239, 0.75);
  border-bottom: 1px solid rgba(219, 228, 239, 0.75);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(237, 242, 248, 0.96)),
    #edf2f8;
}

.lead-section > div:first-child {
  max-width: 560px;
}

.lead-section h2 {
  margin-bottom: 12px;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
}

.lead-section p:not(.eyebrow) {
  color: #5f564d;
  font-size: 1.04rem;
  line-height: 1.7;
}

.lead-form {
  gap: 12px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 58px rgba(41, 31, 22, 0.1);
}

.lead-form label {
  display: grid;
  gap: 7px;
  color: #6d645b;
  font-size: 0.86rem;
  font-weight: 800;
}

.lead-form input,
.lead-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border: 1px solid #dbe4ef;
  border-radius: 11px;
  background: #ffffff;
  color: #171717;
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.lead-form textarea {
  min-height: 112px;
  resize: vertical;
}

.lead-form input:focus,
.lead-form textarea:focus {
  border-color: rgba(127, 38, 54, 0.48);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(127, 38, 54, 0.08);
}

.lead-form button {
  min-height: 48px;
  justify-content: center;
  border-radius: 11px;
}

@media (max-width: 960px) {
  .app-shell.standalone {
    grid-template-columns: 1fr;
  }

  .app-shell.standalone .sidebar {
    position: static;
  }

  .lead-section {
    grid-template-columns: 1fr;
  }
}

/* Cleaner student schedule and payments */
.next-lesson-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(219, 228, 239, 0.88);
  border-radius: 14px;
  background: linear-gradient(135deg, #171717, #2b2520);
  color: #ffffff;
  box-shadow: 0 16px 42px rgba(41, 31, 22, 0.12);
}

.next-lesson-banner span {
  color: #c9d6e8;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.next-lesson-banner strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.next-lesson-banner p {
  margin: 5px 0 0;
  color: #edf2f8;
}

.next-lesson-banner .dark-button {
  border-color: #ffffff;
  background: #ffffff;
  color: #171717;
}

.student-schedule-list {
  gap: 8px;
}

.student-schedule-item.collapsible-card {
  border-radius: 12px;
}

.student-schedule-item.collapsible-card summary {
  grid-template-columns: 128px minmax(0, 1fr) auto;
  min-height: 66px;
  padding: 12px 14px;
}

.student-schedule-item time {
  display: grid;
  gap: 3px;
  color: #6d645b;
}

.student-schedule-item time strong {
  color: #171717;
  font-size: 0.94rem;
}

.student-schedule-item time span {
  font-size: 1.05rem;
  font-weight: 850;
}

.student-schedule-item summary strong {
  white-space: normal;
}

.student-schedule-item summary small {
  display: block;
}

.payment-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.payment-summary article {
  padding: 14px 16px;
  border: 1px solid rgba(219, 228, 239, 0.86);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(41, 31, 22, 0.045);
}

.payment-summary span {
  color: #6d645b;
  font-size: 0.82rem;
  font-weight: 850;
}

.payment-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 1.45rem;
}

.payment-grid-clean {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.payment-card-modern {
  display: grid;
  gap: 12px;
}

.payment-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.payment-card-head h3 {
  margin-bottom: 8px;
}

.payment-card-modern .price {
  flex: 0 0 auto;
  margin: 0;
  font-size: 1.7rem;
  white-space: nowrap;
}

.payment-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5f7fb;
}

.payment-link-row span {
  min-width: 0;
  overflow: hidden;
  color: #6d645b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-link-row a {
  color: inherit;
  text-decoration: none;
}

.payment-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-actions .dark-button,
.payment-actions .outline-button,
.payment-primary {
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.payment-edit-details {
  flex-basis: 100%;
  margin-top: 2px;
}

.payment-edit-details summary {
  display: inline-flex;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 850;
  list-style: none;
}

.payment-edit-details summary::-webkit-details-marker {
  display: none;
}

.payment-edit-details .inline-edit {
  margin-top: 10px;
}

.payment-done {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #e5eee8;
  color: #3d6651;
  font-weight: 850;
}

@media (max-width: 760px) {
  .next-lesson-banner,
  .payment-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .student-schedule-item.collapsible-card summary {
    grid-template-columns: 1fr;
  }

  .payment-summary {
    grid-template-columns: 1fr;
  }
}

/* Neat compact forms */
.form-panel,
.lead-form,
.auth-form,
.inline-edit,
.submit-homework,
.test-attempt {
  --form-control-height: 42px;
}

.dashboard .form-panel {
  padding: 14px;
}

.form-panel h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.form-grid,
.dense-form {
  gap: 10px;
}

.form-grid label,
.lead-form label,
.auth-form label,
.inline-edit label,
.submit-homework label {
  gap: 6px;
  color: #6d645b;
  font-size: 0.84rem;
  font-weight: 800;
}

.form-panel input,
.form-panel select,
.form-panel textarea,
.inline-edit input,
.inline-edit select,
.inline-edit textarea,
.lead-form input,
.lead-form textarea,
.auth-form input,
.auth-form select,
.submit-homework textarea,
.submit-homework input,
.test-attempt input {
  min-height: var(--form-control-height);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
}

.form-panel textarea,
.inline-edit textarea,
.lead-form textarea,
.submit-homework textarea {
  min-height: 86px;
}

.compact-form {
  max-width: 860px;
}

.compact-form summary {
  min-height: 44px;
  padding: 12px 14px;
}

.compact-form form {
  gap: 12px;
  padding: 0 14px 14px;
}

.button-row {
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.form-panel > button,
.form-panel form > button,
.lead-form button,
.auth-form button,
.inline-edit > button,
.inline-edit .button-row button,
.submit-homework button,
.test-attempt button,
.teacher-settings-form button,
.avatar-form button,
.payment-edit-form button {
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  justify-self: start;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.15;
}

.lead-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 720px;
  justify-self: end;
  padding: clamp(16px, 2.4vw, 22px);
}

.lead-form button {
  justify-self: start;
}

.auth-form button {
  justify-self: stretch;
  width: 100%;
}

.inline-edit {
  gap: 10px;
}

.inline-edit .button-row {
  margin-top: 2px;
}

.payment-edit-details .button-row,
.student-edit-form .button-row,
.lesson-grade-form .button-row,
.homework-grade-form .button-row,
.material-edit-form .button-row,
.test-edit-form .button-row {
  display: flex;
}

@media (max-width: 760px) {
  .lead-form {
    grid-template-columns: 1fr;
    justify-self: stretch;
  }

  .form-panel > button,
  .form-panel form > button,
  .lead-form button,
  .inline-edit > button,
  .submit-homework button,
  .test-attempt button {
    width: fit-content;
  }

  .button-row {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Fixed-height weekly schedule */
.week-grid {
  align-items: start;
}

.week-day {
  height: 340px;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  overflow: hidden;
}

.week-lessons {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 38, 54, 0.35) transparent;
}

.week-lessons::-webkit-scrollbar {
  width: 6px;
}

.week-lessons::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(127, 38, 54, 0.3);
}

.week-lessons::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 900px) {
  .week-day {
    height: 320px;
  }
}

/* Dashboard visual hierarchy */
.app-shell.standalone #dashboardContent > * {
  animation: dashboardRise 280ms ease both;
}

.app-shell.standalone #dashboardContent > *:nth-child(2) {
  animation-delay: 45ms;
}

.app-shell.standalone #dashboardContent > *:nth-child(3) {
  animation-delay: 90ms;
}

.dashboard .data-card,
.dashboard .metric-card,
.dashboard .form-panel,
.dashboard .collapsible-card,
.week-panel,
.compact-list,
.schedule-block {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dashboard .data-card:hover,
.dashboard .metric-card:hover,
.dashboard .collapsible-card:hover,
.week-panel:hover,
.schedule-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(41, 31, 22, 0.08);
}

.schedule-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(210px, 0.65fr);
  gap: 12px;
  margin-bottom: 14px;
}

.schedule-showcase .next-lesson-banner {
  min-height: 150px;
  margin-bottom: 0;
  overflow: hidden;
  position: relative;
}

.schedule-showcase .next-lesson-banner::after {
  content: "∑";
  position: absolute;
  right: 26px;
  bottom: -34px;
  color: rgba(255, 255, 255, 0.07);
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.empty-banner {
  background: linear-gradient(135deg, #2d2924, #171717);
}

.schedule-mini-stats {
  display: grid;
  gap: 10px;
}

.schedule-mini-stats article {
  display: grid;
  align-content: space-between;
  min-height: 70px;
  padding: 14px;
  border: 1px solid rgba(219, 228, 239, 0.88);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
}

.schedule-mini-stats span,
.schedule-section-title span {
  color: #657086;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.schedule-mini-stats strong {
  color: #171717;
  font-size: 1.35rem;
}

.schedule-block {
  padding: 14px;
  border: 1px solid rgba(219, 228, 239, 0.88);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.schedule-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.schedule-section-title strong {
  color: #657086;
  font-size: 0.86rem;
}

.timeline-list {
  position: relative;
  padding-left: 18px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(127, 38, 54, 0.55), rgba(224, 199, 160, 0.35));
}

.student-schedule-item.collapsible-card {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
}

.timeline-list .student-schedule-item.collapsible-card::before {
  content: "";
  position: absolute;
  top: 25px;
  left: -19px;
  width: 11px;
  height: 11px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: #7f2636;
  box-shadow: 0 0 0 1px rgba(127, 38, 54, 0.24);
}

.student-schedule-item.collapsible-card summary {
  grid-template-columns: 42px 128px minmax(0, 1fr) auto;
}

.lesson-index {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #edf3ff;
  color: #7f2636;
  font-size: 0.8rem;
  font-weight: 900;
}

.soft-empty-card {
  padding: 18px;
  border: 1px dashed rgba(153, 132, 100, 0.45);
  border-radius: 14px;
  background: rgba(238, 243, 251, 0.48);
}

.soft-empty-card h3,
.soft-empty-card p {
  margin: 0;
}

.soft-empty-card p {
  margin-top: 6px;
  color: #6d645b;
}

.week-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88));
}

.week-toolbar {
  padding: 10px;
  border-radius: 14px;
  background: rgba(238, 243, 251, 0.58);
}

.week-day {
  background: rgba(255, 255, 255, 0.92);
}

.week-day.today {
  border-color: rgba(127, 38, 54, 0.38);
  box-shadow: inset 0 0 0 1px rgba(127, 38, 54, 0.1);
}

@keyframes dashboardRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

@media (max-width: 900px) {
  .schedule-showcase {
    grid-template-columns: 1fr;
  }

  .schedule-mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .student-schedule-item.collapsible-card summary {
    grid-template-columns: 38px 1fr;
  }

  .student-schedule-item time,
  .student-schedule-item.collapsible-card summary > span:not(.lesson-index):not(.pill),
  .student-schedule-item summary .pill {
    grid-column: 2;
  }

  .schedule-mini-stats {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell.standalone #dashboardContent > *,
  .dashboard .data-card,
  .dashboard .metric-card,
  .dashboard .form-panel,
  .dashboard .collapsible-card,
  .week-panel,
  .compact-list,
  .schedule-block {
    animation: none;
    transition: none;
  }
}

/* Professional polish pass */
.lead-section {
  grid-template-columns: minmax(280px, 500px) minmax(340px, 520px);
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: auto;
  padding-top: clamp(56px, 7vw, 84px);
  padding-bottom: clamp(56px, 7vw, 84px);
}

.lead-section > div:first-child {
  max-width: 500px;
}

.lead-section h2 {
  max-width: 440px;
  line-height: 0.98;
}

.lead-section p:not(.eyebrow) {
  max-width: 470px;
}

.lead-form {
  width: min(100%, 520px);
  justify-self: start;
}

.price-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.price-card p:not(.price) {
  flex: 1;
}

.price-card .dark-button,
.price-card .accent-button {
  width: 100%;
  min-height: 44px;
  justify-content: center;
  border-radius: 9px;
}

.price-card.highlighted {
  background: linear-gradient(180deg, #f8fafc, #edf2f8);
  box-shadow: 0 18px 48px rgba(127, 38, 54, 0.1);
}

.dashboard .file-row {
  align-items: flex-start;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.dashboard .file-row > span:first-child {
  line-height: 1;
}

.dashboard .file-chip {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-content: flex-start;
  border-radius: 10px;
  background: #edf2f8;
  color: #263f63;
}

.dashboard .file-chip .file-name {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.dashboard .file-chip.downloadable {
  border-color: rgba(127, 38, 54, 0.22);
}

.dashboard input[type="file"] {
  width: 100%;
  min-width: 0;
  border-style: dashed;
  background: #ffffff;
  color: #6d645b;
  font-size: 0.9rem;
}

.dashboard input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 1px solid rgba(23, 23, 23, 0.1);
  background: #171717;
  color: #ffffff;
}

.dashboard .dark-button,
.dashboard .accent-button,
.dashboard .outline-button,
.dashboard .danger-button {
  min-height: 38px;
  border-radius: 10px;
  box-shadow: none;
}

.dashboard .submit-homework {
  gap: 10px;
}

.dashboard .submit-homework button {
  min-width: 132px;
}

.dashboard .homework-card.collapsible-card[open],
.dashboard .test-card.collapsible-card[open],
.dashboard .material-card.collapsible-card[open],
.dashboard .lesson-card.collapsible-card[open] {
  border-color: rgba(127, 38, 54, 0.2);
  box-shadow: 0 18px 46px rgba(41, 31, 22, 0.08);
}

@media (max-width: 1100px) {
  .lead-section {
    grid-template-columns: minmax(0, 500px) minmax(0, 520px);
  }
}

@media (max-width: 860px) {
  .lead-section {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .lead-form {
    justify-self: stretch;
  }
}

/* Informative landing footer */
.footer {
  display: grid;
  gap: 26px;
  padding: clamp(38px, 6vw, 64px) clamp(18px, 6vw, 86px) 24px;
  background:
    radial-gradient(circle at 12% 12%, rgba(224, 199, 160, 0.16), transparent 34%),
    #141312;
  color: #ffffff;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.5fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: 16px;
  max-width: 390px;
}

.footer-logo {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(238, 243, 251, 0.18);
  border-radius: 14px;
  background: #eef3fb;
  color: #171717;
  font-size: 1.65rem;
  font-weight: 900;
  text-decoration: none;
}

.footer-brand strong {
  display: block;
  font-size: clamp(1.3rem, 2vw, 1.85rem);
  line-height: 1.1;
}

.footer-brand p {
  max-width: 340px;
  margin: 10px 0 0;
  color: #c9d6e8;
  line-height: 1.65;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) minmax(220px, 0.9fr);
  gap: 24px;
}

.footer-column {
  display: grid;
  align-content: start;
  gap: 9px;
}

.footer-column h3 {
  margin: 0 0 4px;
  color: #c9d6e8;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.footer-column a,
.footer-bottom {
  color: rgba(255, 255, 255, 0.78);
}

.footer-column a {
  width: fit-content;
  text-decoration: none;
  font-weight: 750;
  transition: color 160ms ease, transform 160ms ease;
}

.footer-column a:hover {
  color: #ffffff;
  transform: translateX(2px);
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.footer-socials a {
  padding: 7px 10px;
  border: 1px solid rgba(238, 243, 251, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.footer-cta {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(238, 243, 251, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.footer-cta span {
  color: #c9d6e8;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.footer-cta strong {
  line-height: 1.35;
}

.footer-cta .light-button {
  width: fit-content;
  min-height: 40px;
  padding: 10px 14px;
  color: #171717;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid rgba(238, 243, 251, 0.12);
  font-size: 0.9rem;
}

@media (max-width: 1050px) {
  .footer-main,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    gap: 22px;
  }

  .footer-cta {
    max-width: 420px;
  }
}

@media (max-width: 680px) {
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Student dashboard inspired by online-school layouts */
.dashboard.student-overview-mode {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.62);
}

.dashboard.student-overview-mode .dashboard-head {
  display: none;
}

.dashboard.student-overview-mode #dashboardContent {
  padding-top: 0;
}

.student-home {
  display: grid;
  gap: 16px;
}

.student-home-top {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 430px) auto;
  align-items: center;
  gap: 16px;
}

.student-home-kicker {
  margin: 0 0 4px;
  color: #657086;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.student-home-top h3 {
  margin: 0;
  font-size: clamp(1.6rem, 2.7vw, 2.25rem);
  line-height: 1.08;
}

.student-home-top span {
  color: #6d645b;
  font-weight: 700;
}

.student-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(41, 31, 22, 0.04);
}

.student-search span {
  color: #657086;
  font-size: 1.25rem;
}

.student-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #171717;
  font: inherit;
  outline: 0;
}

.student-top-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
}

.student-top-profile .avatar {
  width: 48px;
  height: 48px;
}

.student-top-profile strong,
.student-top-profile small {
  display: block;
  white-space: nowrap;
}

.student-top-profile small {
  color: #657086;
  font-weight: 700;
}

.student-lesson-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
  gap: clamp(18px, 4vw, 44px);
  min-height: 260px;
  overflow: hidden;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid rgba(23, 23, 23, 0.08);
  border-radius: 20px;
  background:
    radial-gradient(circle at 88% 24%, rgba(224, 199, 160, 0.2), transparent 28%),
    linear-gradient(135deg, #171717 0%, #2b211d 56%, #6f2030 130%);
  color: #ffffff;
  box-shadow: 0 26px 70px rgba(41, 31, 22, 0.16);
}

.student-lesson-hero.is-empty {
  background: linear-gradient(135deg, #28231f, #171717);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.hero-tags span,
.hero-live {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #edf3ff;
  font-size: 0.82rem;
  font-weight: 850;
}

.hero-live::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: #d43c4f;
  box-shadow: 0 0 0 4px rgba(212, 60, 79, 0.16);
}

.student-lesson-hero h3 {
  max-width: 620px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.9rem, 3.3vw, 3rem);
  line-height: 1.04;
}

.student-lesson-hero p {
  margin: 12px 0 0;
  color: #dbe4ef;
  font-size: 1.08rem;
}

.hero-teacher {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
}

.hero-teacher .avatar {
  width: 42px;
  height: 42px;
  background: #eef3fb;
  color: #171717;
}

.hero-teacher strong,
.hero-teacher small {
  display: block;
}

.hero-teacher small {
  color: #c9d6e8;
}

.student-lesson-hero .light-button {
  min-height: 48px;
  width: fit-content;
  padding: 13px 18px;
  border-radius: 12px;
  color: #171717;
}

.student-formula-board {
  position: relative;
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 210px;
  color: rgba(255, 255, 255, 0.8);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.5vw, 2.35rem);
  font-style: italic;
}

.student-formula-board span {
  width: fit-content;
}

.student-formula-board span:nth-child(2) {
  margin-left: 46px;
}

.student-formula-board span:nth-child(3) {
  margin-left: 18px;
}

.parabola-graphic {
  position: absolute;
  right: 4%;
  top: 14%;
  width: min(34%, 190px);
  aspect-ratio: 1;
  border-right: 2px solid rgba(255, 255, 255, 0.62);
  border-bottom: 2px solid rgba(255, 255, 255, 0.62);
  opacity: 0.7;
}

.parabola-graphic::before {
  content: "";
  position: absolute;
  inset: 20% 18% 16% 18%;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-top: 0;
  border-radius: 0 0 999px 999px;
  transform: rotate(180deg);
}

.student-kpi-grid,
.student-widget-grid,
.student-bottom-grid {
  display: grid;
  gap: 14px;
}

.student-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-kpi-card,
.student-widget,
.student-activity-card {
  border: 1px solid rgba(219, 228, 239, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(41, 31, 22, 0.07);
}

.student-kpi-card {
  position: relative;
  min-height: 112px;
  padding: 20px 20px 18px 84px;
}

.student-kpi-card::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 24px;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: #edf3ff;
  box-shadow: inset 0 0 0 1px rgba(127, 38, 54, 0.08);
}

.student-kpi-card.grade::before {
  background: linear-gradient(135deg, #edf3ff, #a9bde8);
}

.student-kpi-card.homework::before {
  background: linear-gradient(135deg, #e7f2ed, #afd8c1);
}

.student-kpi-card.tests::before {
  background: linear-gradient(135deg, #f0e8ff, #ceb8ff);
}

.student-kpi-card span,
.student-kpi-card small {
  display: block;
  color: #6d645b;
  font-weight: 750;
}

.student-kpi-card strong {
  display: block;
  margin: 8px 0 3px;
  font-size: 1.55rem;
  line-height: 1;
}

.student-widget-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-bottom-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
}

.student-widget,
.student-activity-card {
  padding: 18px;
}

.student-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.student-panel-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.student-panel-head span,
.student-panel-head .text-button {
  color: #7f2636;
  font-size: 0.84rem;
  font-weight: 850;
}

.student-panel-head .text-button {
  padding: 0;
  border: 0;
  background: transparent;
}

.student-mini-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.student-mini-item {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 58px;
  margin: 0;
  padding: 9px 10px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: #f8fafc;
  font: inherit;
  text-align: left;
}

.student-mini-item:is(button) {
  appearance: none;
  width: 100%;
  cursor: pointer;
}

.student-mini-item > div {
  min-width: 0;
  max-width: 100%;
}

.student-mini-item strong,
.student-mini-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-mini-item small {
  margin-top: 3px;
  color: #657086;
  font-size: 0.84rem;
  font-weight: 700;
}

.student-mini-item time {
  display: grid;
  place-items: center;
  width: 44px;
  height: 46px;
  border-radius: 7px;
  background: #edf3ff;
}

.student-mini-item time strong {
  color: #2857ce;
  font-size: 1.05rem;
}

.student-mini-item time span {
  color: #657086;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d43c4f;
  box-shadow: 0 0 0 4px rgba(212, 60, 79, 0.12);
}

.mini-status {
  width: max-content;
  max-width: 92px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #dbe4ef;
  color: #44372b;
  font-size: 0.76rem;
  font-weight: 900;
}

.mini-status.green {
  background: #dff2e8;
  color: #2d6b4d;
}

.mini-status.blue {
  background: #e7edf8;
  color: #315b8d;
}

.mini-status.red {
  background: #f8e2e7;
  color: #8a2d3b;
}

.test-progress {
  width: 72px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe4ef;
}

.test-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #7f2636;
}

.student-empty-line {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(153, 132, 100, 0.4);
  border-radius: 14px;
  color: #657086;
  background: rgba(238, 243, 251, 0.45);
  font-weight: 750;
}

.activity-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(22px, 1fr));
  align-items: end;
  gap: 12px;
  height: 150px;
  padding: 20px;
  border-radius: 16px;
  background:
    linear-gradient(rgba(127, 38, 54, 0.08) 1px, transparent 1px) 0 0 / 100% 33.33%,
    rgba(255, 255, 255, 0.72);
}

.activity-chart i {
  display: block;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, #7f2636, #c7d8f5);
}

.student-mini-item.message {
  grid-template-columns: minmax(0, 1fr);
  border-left: 4px solid #c9d6e8;
}

.student-mini-item.message.red {
  border-left-color: #8a2d3b;
}

.student-mini-item.message.blue {
  border-left-color: #315b8d;
}

@media (max-width: 1180px) {
  .student-home-top {
    grid-template-columns: 1fr;
  }

  .student-top-profile {
    justify-self: start;
  }

  .student-widget-grid,
  .student-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .student-lesson-hero,
  .student-kpi-grid {
    grid-template-columns: 1fr;
  }

  .student-formula-board {
    min-height: 150px;
  }
}

@media (max-width: 560px) {
  .student-lesson-hero {
    padding: 22px;
  }

  .student-kpi-card {
    padding-left: 76px;
  }
}

/* Student dashboard adjustments and homework workspace */
.dashboard.student-overview-mode .dashboard-head {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 10px;
  border-bottom: 0;
}

.dashboard.student-overview-mode .dashboard-head > div:first-child {
  display: none;
}

.dashboard.student-overview-mode .dashboard-actions {
  margin-left: auto;
}

.student-home-top {
  grid-template-columns: minmax(240px, 1fr) auto;
}

.student-achievements-card {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px solid rgba(219, 228, 239, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(41, 31, 22, 0.07);
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.achievement-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(219, 228, 239, 0.78);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
}

.achievement-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #edf3ff;
  color: #7f2636;
  font-weight: 950;
}

.achievement-card.done .achievement-icon {
  background: #dff2e8;
  color: #2d6b4d;
}

.achievement-card strong,
.achievement-card small {
  display: block;
  min-width: 0;
}

.achievement-card strong {
  overflow-wrap: anywhere;
}

.achievement-card small {
  margin-top: 3px;
  color: #657086;
  font-weight: 750;
}

.achievement-progress {
  display: block;
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe4ef;
}

.achievement-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7f2636, #c7d8f5);
}

.student-homework-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: start;
}

.homework-board,
.homework-side-card {
  border: 1px solid rgba(219, 228, 239, 0.86);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(41, 31, 22, 0.07);
}

.homework-board {
  padding: clamp(18px, 3vw, 28px);
}

.homework-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.homework-board-head h3 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.homework-board-head select {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: 12px;
  background: #ffffff;
  color: #51483f;
  font: inherit;
  font-weight: 800;
}

.homework-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(219, 228, 239, 0.75);
}

.homework-tab {
  position: relative;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 42px;
  padding: 0 10px 12px;
  border: 0;
  background: transparent;
  color: #657086;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.homework-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
}

.homework-tab.active {
  color: #7f2636;
}

.homework-tab.active::after {
  background: #7f2636;
}

.homework-tab span {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding: 0 7px;
  border-radius: 999px;
  background: #edf3ff;
  color: inherit;
  font-size: 0.78rem;
}

.homework-row-list {
  display: grid;
  gap: 12px;
}

.student-homework-row {
  overflow: hidden;
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.86);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.student-homework-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(41, 31, 22, 0.07);
}

.student-homework-row.is-late {
  border-color: rgba(138, 45, 59, 0.28);
}

.student-homework-row summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.student-homework-row summary::-webkit-details-marker {
  display: none;
}

.homework-row-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.homework-row-main strong {
  display: block;
  font-size: 1.05rem;
}

.homework-row-main p {
  margin: 5px 0 9px;
  color: #6d645b;
}

.homework-row-main small {
  color: #657086;
  font-weight: 750;
}

.homework-status {
  width: max-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f8e2e7;
  color: #8a2d3b;
  font-size: 0.78rem;
  font-weight: 900;
}

.homework-status.green {
  background: #dff2e8;
  color: #2d6b4d;
}

.homework-status.blue {
  background: #e7edf8;
  color: #315b8d;
}

.homework-status.red {
  background: #edf3ff;
  color: #7f2636;
}

.student-homework-row.is-late .homework-status {
  background: #f8e2e7;
  color: #8a2d3b;
}

.homework-row-side {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: 116px;
}

.homework-row-side span {
  color: #7f2636;
  font-weight: 900;
}

.homework-row-side b {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: #171717;
  color: #ffffff;
  font-size: 0.9rem;
}

.student-homework-row[open] .homework-row-side b {
  background: #edf3ff;
  color: #171717;
}

.homework-row-body {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.teacher-note {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(238, 243, 251, 0.54);
  color: #51483f;
}

.homework-aside {
  display: grid;
  gap: 16px;
}

.homework-side-card {
  padding: 18px;
}

.calendar-month {
  margin-bottom: 14px;
  color: #51483f;
  font-weight: 900;
  text-transform: capitalize;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
}

.calendar-weekdays {
  margin-bottom: 9px;
  color: #657086;
  font-size: 0.78rem;
  font-weight: 900;
}

.calendar-grid span {
  display: inline-grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 999px;
  color: #51483f;
  font-weight: 800;
}

.calendar-grid .has-due {
  background: #edf3ff;
  color: #7f2636;
}

.calendar-grid .is-done {
  background: #dff2e8;
  color: #2d6b4d;
}

.calendar-grid .is-late {
  background: #f8e2e7;
  color: #8a2d3b;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 12px;
  margin-top: 16px;
  color: #657086;
  font-size: 0.82rem;
  font-weight: 750;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #7f2636;
}

.calendar-legend span:nth-child(2) i {
  background: #2d6b4d;
}

.calendar-legend span:nth-child(3) i {
  background: #8a2d3b;
}

.progress-ring {
  --progress: 0;
  display: grid;
  place-items: center;
  align-content: center;
  width: 168px;
  height: 168px;
  margin: 12px auto 18px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #ffffff 58%, transparent 59%),
    conic-gradient(#7f2636 calc(var(--progress) * 1%), #e8edf5 0);
}

.progress-ring strong {
  font-size: 2rem;
  line-height: 1;
}

.progress-ring small {
  color: #657086;
  font-weight: 750;
}

.progress-list {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(219, 228, 239, 0.86);
  border-radius: 14px;
}

.progress-list span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: #6d645b;
  font-weight: 800;
}

.progress-list span + span {
  border-top: 1px solid rgba(219, 228, 239, 0.86);
}

.progress-list b {
  color: #171717;
}

@media (max-width: 1120px) {
  .achievement-grid,
  .student-homework-page {
    grid-template-columns: 1fr;
  }

  .homework-aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .student-homework-row summary,
  .homework-row-main,
  .homework-board-head,
  .homework-aside {
    grid-template-columns: 1fr;
  }

  .homework-board-head {
    display: grid;
  }

  .homework-row-side {
    justify-items: start;
  }

  .achievement-grid {
    grid-template-columns: 1fr;
  }
}

/* Student cabinet refinements */
.dashboard.student-overview-mode .dashboard-head {
  display: none;
}

.student-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.student-top-actions .notification-shell {
  flex: 0 0 auto;
}

.hero-teacher .avatar img,
.student-top-profile .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.achievement-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.student-achievements-page .student-achievements-card {
  grid-column: auto;
}

.student-workspace-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: start;
}

.workspace-board {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(219, 228, 239, 0.86);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(41, 31, 22, 0.07);
}

.workspace-row-list {
  display: grid;
  gap: 12px;
}

.lesson-row .lesson-index {
  flex: 0 0 auto;
}

.side-next-lesson {
  display: grid;
  gap: 10px;
}

.side-next-lesson strong,
.side-next-lesson small {
  display: block;
}

.side-next-lesson small {
  color: #657086;
  font-weight: 750;
}

.side-next-lesson .dark-button {
  width: fit-content;
}

.test-row .test-options {
  padding: 12px;
  border: 1px solid rgba(219, 228, 239, 0.82);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.test-row .test-options + .test-options {
  margin-top: 10px;
}

.test-row .test-options label {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.material-row .homework-row-side span {
  color: #315b8d;
}

.student-settings-page {
  display: grid;
  gap: 18px;
}

.settings-panel {
  padding: 18px;
  border: 1px solid rgba(219, 228, 239, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(41, 31, 22, 0.07);
}

.settings-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.settings-info-grid span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(219, 228, 239, 0.78);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.settings-info-grid small {
  color: #657086;
  font-weight: 800;
}

.settings-info-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-panel .student-payment-summary,
.settings-panel .payment-grid-clean {
  margin-top: 12px;
}

.settings-panel .payment-card {
  max-width: none;
}

@media (max-width: 1120px) {
  .student-workspace-page,
  .settings-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .student-top-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Student analytics */
.test-builder-actions,
.analytics-toolbar,
.analytics-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.test-builder-actions {
  justify-content: flex-start;
  margin-top: 14px;
}

.analytics-page {
  display: grid;
  gap: 16px;
}

.analytics-toolbar,
.analytics-table-wrap {
  padding: 18px;
  border: 1px solid rgba(219, 228, 239, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(41, 31, 22, 0.055);
}

.analytics-toolbar h3 {
  margin: 2px 0 5px;
  font-size: 1.45rem;
}

.analytics-toolbar > div > span {
  color: #74695f;
}

.analytics-toolbar label {
  display: grid;
  gap: 6px;
  min-width: min(280px, 100%);
  color: #6d645b;
  font-size: 0.82rem;
  font-weight: 850;
}

.analytics-toolbar select {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #ffffff;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-table-wrap {
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(219, 228, 239, 0.78);
  text-align: left;
  vertical-align: top;
}

.analytics-table th {
  color: #6d645b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.analytics-table td:first-child,
.analytics-table td:nth-child(2),
.analytics-table td:nth-child(3) {
  white-space: nowrap;
}

.analytics-note-form {
  display: grid;
  gap: 7px;
  min-width: 210px;
}

.analytics-note-form textarea {
  width: 100%;
  min-height: 76px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid #dbe4ef;
  border-radius: 9px;
  background: #ffffff;
}

.analytics-note-form .text-button {
  justify-self: start;
}

/* Compact mobile navigation for all cabinets */
.cabinet-menu-button {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 9px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #ffffff;
}

.cabinet-menu-button span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: #171717;
}

@media (max-width: 900px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-page="teacher"],
  :is(body[data-page="student"], .student-preview) {
    background: #f5f7fb;
  }

  .cabinet-topbar {
    flex-wrap: nowrap;
    min-height: 62px;
    padding: 9px 12px;
  }

  .cabinet-topbar .brand {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .cabinet-topbar .brand > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cabinet-topbar .topbar-actions {
    display: flex;
    flex: 0 0 auto;
    width: auto;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .cabinet-menu-button {
    display: flex;
  }

  .cabinet-topbar .ghost-button {
    min-height: 40px;
    padding: 8px 12px;
  }

  .app-shell.standalone {
    display: block;
    width: 100%;
    padding: 12px;
  }

  .app-shell.standalone .sidebar {
    position: fixed;
    z-index: 80;
    top: 72px;
    left: 12px;
    width: min(320px, calc(100vw - 24px));
    max-height: calc(100dvh - 84px);
    overflow-y: auto;
    padding: 12px;
    transform: translateX(calc(-100% - 28px));
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  body.cabinet-menu-open .app-shell.standalone .sidebar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell.standalone .dashboard {
    width: 100%;
    min-width: 0;
    padding: 14px;
    border-radius: 14px;
  }

  .app-shell.standalone #dashboardContent,
  .app-shell.standalone #dashboardContent > *,
  .dashboard-head,
  .student-home,
  .student-homework-page,
  .student-workspace-page,
  .homework-board,
  .workspace-board {
    min-width: 0;
    max-width: 100%;
  }

  .dashboard-head {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .dashboard-head h2 {
    font-size: clamp(1.65rem, 7vw, 2rem);
  }

  .dashboard-actions {
    margin-left: auto;
    flex-direction: row;
  }

  .stats-grid,
  .lesson-grid,
  .homework-grid,
  .material-grid,
  .student-grid,
  .analytics-summary,
  .settings-info-grid,
  .student-kpi-grid,
  .student-widget-grid,
  .student-bottom-grid {
    grid-template-columns: 1fr;
  }

  .week-grid {
    grid-template-columns: 1fr;
    max-height: 520px;
    overflow-y: auto;
  }

  .week-toolbar,
  .analytics-toolbar,
  .test-question-head,
  .test-builder-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .week-toolbar .button-row,
  .test-builder-actions,
  .button-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .button-row > *,
  .test-builder-actions > * {
    width: auto;
    flex: 0 1 auto;
  }

  .form-panel,
  .compact-form,
  .inline-edit,
  .test-question-builder {
    max-width: 100%;
  }

  .analytics-table {
    min-width: 0;
  }

  .analytics-table thead {
    display: none;
  }

  .analytics-table,
  .analytics-table tbody,
  .analytics-table tr,
  .analytics-table td {
    display: block;
    width: 100%;
  }

  .analytics-table tr {
    display: grid;
    gap: 10px;
    padding: 14px 0;
  }

  .analytics-table td {
    display: grid;
    grid-template-columns: minmax(92px, 0.35fr) minmax(0, 1fr);
    gap: 10px;
    padding: 0;
    border: 0;
    white-space: normal !important;
  }

  .analytics-table td::before {
    content: attr(data-label);
    color: #657086;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .analytics-note-form {
    min-width: 0;
  }
}

@media (max-width: 820px) {
  .topbar:not(.cabinet-topbar) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 14px;
  }

  .topbar:not(.cabinet-topbar) .brand {
    min-width: 0;
    max-width: none;
  }

  .topbar:not(.cabinet-topbar) .brand > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar:not(.cabinet-topbar) .menu-button {
    display: block;
  }

  .topbar:not(.cabinet-topbar) .main-nav,
  .topbar:not(.cabinet-topbar) .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .topbar:not(.cabinet-topbar).open .main-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(219, 228, 239, 0.8);
  }

  .topbar:not(.cabinet-topbar).open .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .topbar:not(.cabinet-topbar) .contact-icons {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .topbar:not(.cabinet-topbar) .topbar-actions > .ghost-button,
  .topbar:not(.cabinet-topbar) .topbar-actions > .dark-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .cabinet-topbar .brand-mark,
  .cabinet-topbar .avatar {
    width: 38px;
    height: 38px;
  }

  .cabinet-topbar .brand > span:last-child {
    font-size: 0.84rem;
  }

  .dashboard-head {
    align-items: flex-start;
  }

  .notification-popup {
    position: fixed;
    top: 68px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100dvh - 88px);
  }

  .student-homework-row summary,
  .homework-row-main,
  .homework-board-head,
  .homework-aside,
  .student-workspace-page,
  .student-homework-page {
    grid-template-columns: 1fr;
  }

  .homework-board,
  .workspace-board,
  .analytics-toolbar,
  .analytics-table-wrap {
    padding: 14px;
    border-radius: 14px;
  }

  .topbar:not(.cabinet-topbar).open .main-nav,
  .topbar:not(.cabinet-topbar).open .topbar-actions {
    grid-template-columns: 1fr;
  }

  .topbar:not(.cabinet-topbar) .contact-icons {
    grid-column: auto;
  }
}

/* Cabinet visual system: spacious, neutral and task-focused */
body[data-page="teacher"],
:is(body[data-page="student"], .student-preview) {
  --cabinet-bg: #f4f5f7;
  --cabinet-surface: #ffffff;
  --cabinet-surface-soft: #f8f9fa;
  --cabinet-border: #e4e6ea;
  --cabinet-text: #20232a;
  --cabinet-muted: #737984;
  --cabinet-accent: #8a2d3f;
  --cabinet-accent-soft: #f8ecef;
  --cabinet-green: #2f7b59;
  --cabinet-green-soft: #eaf5ef;
  --cabinet-blue: #42658f;
  --cabinet-blue-soft: #edf2f8;
  color: var(--cabinet-text);
  background: var(--cabinet-bg);
  font-family: Manrope, Inter, Arial, sans-serif;
}

body[data-page="teacher"] *,
:is(body[data-page="student"], .student-preview) * {
  letter-spacing: 0;
}

body[data-page="teacher"] .cabinet-page,
:is(body[data-page="student"], .student-preview) .cabinet-page {
  min-height: calc(100vh - 65px);
  background: var(--cabinet-bg);
}

.cabinet-topbar {
  min-height: 65px;
  padding: 10px clamp(24px, 3.5vw, 56px);
  border-bottom: 1px solid var(--cabinet-border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

.cabinet-topbar .brand {
  min-width: 0;
  color: var(--cabinet-text);
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
}

.cabinet-topbar .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--cabinet-text);
  color: #fff;
}

.cabinet-topbar .ghost-button {
  min-height: 40px;
  padding: 9px 14px;
  border-color: var(--cabinet-border);
  border-radius: 8px;
  background: #fff;
  color: var(--cabinet-text);
  box-shadow: none;
}

.app-shell.standalone {
  width: min(100%, 1640px);
  margin: 0 auto;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: clamp(24px, 2.8vw, 42px);
  padding: 28px clamp(24px, 3.5vw, 56px) 56px;
}

.app-shell.standalone .sidebar {
  top: 91px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 119px);
  padding: 18px 14px;
  overflow-y: auto;
  border: 1px solid var(--cabinet-border);
  border-radius: 8px;
  background: var(--cabinet-surface);
  box-shadow: 0 8px 28px rgba(24, 29, 38, 0.04);
}

.app-shell.standalone .profile-box {
  min-height: 0;
  gap: 11px;
  padding: 2px 4px 18px;
  border: 0;
  border-bottom: 1px solid var(--cabinet-border);
  border-radius: 0;
  background: transparent;
  color: var(--cabinet-text);
}

.app-shell.standalone .profile-box .avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--cabinet-text);
  color: #fff;
  font-family: Manrope, Inter, sans-serif;
  font-size: 1rem;
}

.app-shell.standalone .profile-box strong {
  font-size: 0.92rem;
}

.app-shell.standalone .profile-box span:last-child {
  margin-top: 2px;
  color: var(--cabinet-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.dashboard-nav {
  gap: 3px;
  margin-top: 12px;
  padding-top: 0;
  border: 0;
}

.dashboard-nav .nav-button {
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #626873;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: none;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dashboard-nav .nav-button:hover {
  transform: translateX(2px);
  background: var(--cabinet-surface-soft);
  color: var(--cabinet-text);
}

.dashboard-nav .nav-button.active {
  background: var(--cabinet-accent-soft);
  color: var(--cabinet-accent);
  box-shadow: inset 3px 0 0 var(--cabinet-accent);
}

.dashboard-nav .nav-button.active::before {
  display: none;
}

.app-shell.standalone .dashboard {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell.standalone #dashboardContent {
  padding-top: 0;
}

.dashboard-head {
  min-height: 76px;
  margin-bottom: 22px;
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--cabinet-border);
}

.dashboard-head .eyebrow,
.student-home-kicker {
  margin-bottom: 5px;
  color: var(--cabinet-accent);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-head h2 {
  color: var(--cabinet-text);
  font-size: clamp(1.85rem, 2.5vw, 2.35rem);
  line-height: 1.1;
}

.dashboard-actions .accent-button,
.dashboard-actions .dark-button,
.dashboard-actions .outline-button,
.dashboard .accent-button,
.dashboard .dark-button,
.dashboard .outline-button,
.dashboard .danger-button,
.dashboard .ghost-button,
.dashboard .light-button {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 8px;
  box-shadow: none;
}

.dashboard .accent-button {
  background: var(--cabinet-accent);
  border-color: var(--cabinet-accent);
}

.dashboard .dark-button {
  background: var(--cabinet-text);
  border-color: var(--cabinet-text);
}

.notification-button {
  width: 42px;
  height: 42px;
  border-color: var(--cabinet-border);
  background: #fff;
  color: var(--cabinet-accent);
  box-shadow: none;
}

.notification-count {
  background: var(--cabinet-accent);
}

/* Teacher overview */
.teacher-overview {
  display: grid;
  gap: 18px;
}

.teacher-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 126px;
  padding: 24px 26px;
  border: 1px solid var(--cabinet-border);
  border-radius: 8px;
  background: var(--cabinet-surface);
  box-shadow: 0 8px 28px rgba(24, 29, 38, 0.035);
}

.teacher-welcome p,
.teacher-welcome h3,
.teacher-welcome span {
  margin: 0;
}

.teacher-welcome p {
  margin-bottom: 5px;
  color: var(--cabinet-accent);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: capitalize;
}

.teacher-welcome h3 {
  font-size: clamp(1.5rem, 2.3vw, 2rem);
}

.teacher-welcome span {
  display: block;
  margin-top: 7px;
  color: var(--cabinet-muted);
  font-size: 0.9rem;
}

.teacher-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.teacher-metric-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--cabinet-border);
  border-radius: 8px;
  background: var(--cabinet-surface);
  color: var(--cabinet-text);
  text-align: left;
  box-shadow: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.teacher-metric-card:hover {
  transform: translateY(-2px);
  border-color: #cfd3da;
  box-shadow: 0 10px 24px rgba(24, 29, 38, 0.055);
}

.teacher-metric-card span {
  color: var(--cabinet-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.teacher-metric-card strong {
  align-self: end;
  font-size: 1.85rem;
  line-height: 1;
}

.teacher-metric-card i {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #a6abb4;
  font-style: normal;
}

.teacher-overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.teacher-overview-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--cabinet-border);
  border-radius: 8px;
  background: var(--cabinet-surface);
}

.overview-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.overview-panel-head p,
.overview-panel-head h3 {
  margin: 0;
}

.overview-panel-head p {
  margin-bottom: 3px;
  color: var(--cabinet-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.overview-panel-head h3 {
  font-size: 1.08rem;
}

.overview-panel-head .text-button {
  color: var(--cabinet-accent);
}

.teacher-overview-lessons,
.teacher-focus-list {
  display: grid;
}

.teacher-overview-lesson,
.teacher-focus-item {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--cabinet-border);
  border-radius: 0;
  background: transparent;
  color: var(--cabinet-text);
  text-align: left;
  box-shadow: none;
}

.teacher-overview-lesson:first-child,
.teacher-focus-item:first-child {
  border-top: 0;
}

.teacher-overview-lesson {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 68px;
  padding: 9px 4px;
}

.teacher-overview-lesson:hover,
.teacher-focus-item:hover {
  background: var(--cabinet-surface-soft);
}

.teacher-overview-lesson time {
  display: grid;
  place-items: center;
  width: 44px;
  height: 48px;
  border-radius: 7px;
  background: var(--cabinet-accent-soft);
  color: var(--cabinet-accent);
}

.teacher-overview-lesson time strong,
.teacher-overview-lesson time span,
.overview-lesson-main strong,
.overview-lesson-main small {
  display: block;
}

.teacher-overview-lesson time span {
  font-size: 0.65rem;
  font-weight: 850;
  text-transform: uppercase;
}

.overview-lesson-main {
  min-width: 0;
}

.overview-lesson-main strong,
.overview-lesson-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-lesson-main strong {
  font-size: 0.9rem;
}

.overview-lesson-main small,
.overview-lesson-time {
  margin-top: 4px;
  color: var(--cabinet-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.teacher-focus-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 11px 4px;
}

.teacher-focus-item strong,
.teacher-focus-item small {
  display: block;
}

.teacher-focus-item strong {
  font-size: 0.88rem;
}

.teacher-focus-item small {
  margin-top: 4px;
  color: var(--cabinet-muted);
  font-size: 0.75rem;
}

.teacher-focus-item b {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--cabinet-surface-soft);
  color: var(--cabinet-accent);
}

.overview-empty {
  display: grid;
  justify-items: start;
  gap: 5px;
  padding: 24px 4px;
  color: var(--cabinet-muted);
}

.overview-empty strong {
  color: var(--cabinet-text);
  font-size: 0.88rem;
}

.overview-empty span {
  font-size: 0.76rem;
}

.overview-empty .text-button {
  margin-top: 4px;
}

/* Student home */
.dashboard.student-overview-mode .dashboard-head {
  display: none;
}

.student-home {
  display: grid;
  gap: 16px;
}

.student-home-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 76px;
  padding: 0 2px 14px;
  border-bottom: 1px solid var(--cabinet-border);
}

.student-home-top h3 {
  margin: 0;
  color: var(--cabinet-text);
  font-size: clamp(1.65rem, 2.6vw, 2.3rem);
  line-height: 1.15;
}

.student-home-top > div:first-child > span {
  display: block;
  max-width: 760px;
  margin-top: 6px;
  color: var(--cabinet-muted);
  font-size: 0.9rem;
}

.student-top-actions {
  gap: 10px;
}

.student-top-profile {
  padding: 4px 0 4px 10px;
  border-left: 1px solid var(--cabinet-border);
}

.student-top-profile .avatar {
  border-radius: 8px;
  background: var(--cabinet-text);
}

.student-top-profile strong {
  font-size: 0.86rem;
}

.student-top-profile small {
  color: var(--cabinet-muted);
}

.student-lesson-hero {
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.75fr);
  gap: 28px;
  min-height: 250px;
  padding: 30px 34px;
  border: 0;
  border-radius: 12px;
  background: #202126;
  color: #fff;
  box-shadow: 0 12px 32px rgba(20, 22, 27, 0.12);
}

.student-lesson-hero::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 7px;
  background: var(--cabinet-accent);
}

.student-lesson-hero h3 {
  max-width: 680px;
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
  line-height: 1.08;
}

.student-lesson-hero p {
  margin-top: 9px;
  color: #cfd2d8;
  font-size: 0.95rem;
}

.hero-tags {
  margin-bottom: 13px;
}

.hero-tags span,
.hero-live {
  min-height: 26px;
  border-radius: 7px;
  color: #e7e9ed;
  font-size: 0.72rem;
}

.hero-teacher {
  margin: 16px 0;
}

.hero-teacher .avatar {
  font-family: Manrope, Inter, sans-serif;
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
}

.hero-teacher small {
  color: #adb2bb;
}

.student-lesson-hero .light-button {
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 8px;
  background: #fff;
}

.student-formula-board {
  min-height: 170px;
  gap: 14px;
  color: rgba(255, 255, 255, 0.62);
  font-size: clamp(1.15rem, 2vw, 1.85rem);
}

.parabola-graphic {
  opacity: 0.34;
}

.student-kpi-grid,
.student-widget-grid,
.student-bottom-grid {
  gap: 14px;
}

.student-kpi-card,
.student-widget,
.student-activity-card,
.student-achievements-card {
  border: 1px solid var(--cabinet-border);
  border-radius: 8px;
  background: var(--cabinet-surface);
  box-shadow: none;
}

.student-kpi-card {
  min-height: 106px;
  padding: 18px 26px 18px 22px;
  border-top: 3px solid #d7dbe1;
}

.student-kpi-card::before {
  display: none;
}

.student-kpi-card.grade {
  border-top-color: #7f9ff1;
}

.student-kpi-card.homework {
  border-top-color: #76b596;
}

.student-kpi-card.tests {
  border-top-color: #9d87d5;
}

.student-kpi-card span,
.student-kpi-card small {
  color: var(--cabinet-muted);
}

.student-kpi-card span {
  font-size: 0.8rem;
}

.student-kpi-card strong {
  margin: 9px 0 5px;
  font-size: 1.5rem;
}

.student-widget,
.student-achievements-card {
  padding: 18px;
}

.student-panel-head {
  margin-bottom: 12px;
}

.student-panel-head h3 {
  font-size: 0.96rem;
}

.student-panel-head span,
.student-panel-head .text-button {
  color: var(--cabinet-accent);
  font-size: 0.76rem;
}

.student-empty-line {
  border-color: var(--cabinet-border);
  border-radius: 8px;
  background: var(--cabinet-surface-soft);
  color: var(--cabinet-muted);
}

.achievement-grid {
  gap: 10px;
}

.achievement-card {
  min-height: 88px;
  padding: 13px;
  border: 1px solid var(--cabinet-border);
  border-radius: 8px;
  background: var(--cabinet-surface-soft);
}

.achievement-icon {
  border-radius: 8px;
  background: var(--cabinet-accent-soft);
  color: var(--cabinet-accent);
}

.achievement-progress,
.test-progress {
  background: #e8eaee;
}

.achievement-progress i,
.test-progress i {
  background: var(--cabinet-accent);
}

/* Workspaces, forms and data views */
.dashboard .form-panel,
.dashboard .data-card,
.dashboard .lesson-card,
.dashboard .homework-card,
.dashboard .test-card,
.dashboard .material-card,
.dashboard .lead-item,
.dashboard .email-item,
.week-panel,
.week-toolbar,
.week-day,
.homework-board,
.homework-side-card,
.workspace-board,
.settings-panel,
.analytics-toolbar,
.analytics-table-wrap {
  border-color: var(--cabinet-border);
  border-radius: 8px;
  background: var(--cabinet-surface);
  box-shadow: none;
}

.dashboard .form-panel,
.dashboard details.form-panel {
  width: 100%;
  max-width: none;
  margin-bottom: 18px;
  padding: 18px;
}

.dashboard details.form-panel > summary {
  min-height: 28px;
  color: var(--cabinet-text);
  font-size: 0.95rem;
}

.dashboard .form-panel form,
.dashboard .inline-edit {
  padding-top: 16px;
}

.dashboard .form-panel input,
.dashboard .form-panel select,
.dashboard .form-panel textarea,
.dashboard .inline-edit input,
.dashboard .inline-edit select,
.dashboard .inline-edit textarea,
.analytics-note-form textarea {
  min-height: 42px;
  border-color: #dfe2e7;
  border-radius: 7px;
  background: #fff;
}

.dashboard .form-panel textarea,
.dashboard .inline-edit textarea,
.analytics-note-form textarea {
  min-height: 76px;
}

.dashboard .form-panel input:focus,
.dashboard .form-panel select:focus,
.dashboard .form-panel textarea:focus,
.dashboard .inline-edit input:focus,
.dashboard .inline-edit select:focus,
.dashboard .inline-edit textarea:focus {
  border-color: rgba(138, 45, 63, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 45, 63, 0.08);
}

.homework-board,
.workspace-board {
  padding: clamp(18px, 2.4vw, 26px);
}

.homework-board-head h3 {
  font-size: clamp(1.6rem, 2.5vw, 2.15rem);
}

.homework-board-head select {
  border-color: var(--cabinet-border);
  border-radius: 7px;
  background: #fff;
}

.student-homework-row {
  border-color: var(--cabinet-border);
  border-radius: 8px;
  background: #fff;
}

.student-homework-row:hover {
  transform: none;
  border-color: #cfd3da;
  box-shadow: 0 8px 20px rgba(24, 29, 38, 0.045);
}

.homework-status,
.mini-status,
.pill {
  border-radius: 6px;
}

.file-row {
  border-color: var(--cabinet-border);
  border-radius: 7px;
  background: var(--cabinet-surface-soft);
}

.file-chip {
  border-radius: 6px;
}

.analytics-page {
  gap: 14px;
}

.analytics-toolbar,
.analytics-table-wrap {
  padding: 20px;
}

.analytics-summary .metric-card,
.dashboard .metric-card {
  min-height: 94px;
  padding: 17px;
  border-color: var(--cabinet-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.dashboard .metric-card::after {
  display: none;
}

.analytics-table th {
  color: var(--cabinet-muted);
}

.analytics-table th,
.analytics-table td {
  border-color: var(--cabinet-border);
}

.notification-popup {
  border-color: var(--cabinet-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(24, 29, 38, 0.14);
}

.notification-item {
  border-color: var(--cabinet-border);
  border-radius: 7px;
  background: var(--cabinet-surface-soft);
}

.app-shell.standalone #dashboardContent > * {
  animation: cabinet-content-in 240ms ease both;
}

@keyframes cabinet-content-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) and (min-width: 901px) {
  .app-shell.standalone {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    padding-inline: 24px;
  }

  .teacher-overview-columns,
  .student-widget-grid {
    grid-template-columns: 1fr 1fr;
  }

  .teacher-focus-panel,
  .student-widget:last-child {
    grid-column: 1 / -1;
  }

  .teacher-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .cabinet-topbar {
    padding-inline: 12px;
  }

  .app-shell.standalone {
    padding: 14px 12px 36px;
  }

  .app-shell.standalone .sidebar {
    top: 74px;
    max-height: calc(100dvh - 88px);
    border-radius: 8px;
    box-shadow: 0 20px 55px rgba(24, 29, 38, 0.18);
  }

  .app-shell.standalone .dashboard {
    padding: 0;
  }

  .dashboard-head {
    min-height: 66px;
    margin-bottom: 16px;
    padding-top: 2px;
  }

  .teacher-overview-columns,
  .student-widget-grid,
  .student-bottom-grid {
    grid-template-columns: 1fr;
  }

  .teacher-welcome {
    align-items: flex-start;
    flex-direction: column;
  }

  .teacher-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-home-top {
    grid-template-columns: 1fr;
  }

  .student-top-actions {
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
  }

  .student-lesson-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 26px;
  }

  .student-formula-board {
    display: none;
  }

  .student-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .cabinet-topbar .ghost-button {
    padding-inline: 10px;
  }

  .dashboard-head h2 {
    font-size: 1.72rem;
  }

  .teacher-welcome,
  .teacher-overview-panel,
  .homework-board,
  .workspace-board,
  .analytics-toolbar,
  .analytics-table-wrap,
  .settings-panel {
    padding: 16px;
  }

  .teacher-metric-card {
    min-height: 98px;
    padding: 14px;
  }

  .teacher-metric-card strong {
    font-size: 1.55rem;
  }

  .student-home-top h3 {
    font-size: 1.65rem;
  }

  .student-top-profile {
    max-width: calc(100% - 54px);
  }

  .student-lesson-hero {
    padding: 22px;
    border-radius: 10px;
  }

  .student-lesson-hero h3 {
    font-size: 1.75rem;
  }

  .student-kpi-grid {
    grid-template-columns: 1fr;
  }

  .student-kpi-card {
    min-height: 92px;
  }

  .student-widget,
  .student-achievements-card {
    padding: 15px;
  }

  .achievement-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .teacher-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-overview-lesson {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .overview-lesson-time {
    display: none;
  }

  .student-top-actions {
    align-items: flex-start;
  }

  .student-top-profile {
    min-width: 0;
  }

  .student-top-profile strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell.standalone #dashboardContent > * {
    animation: none;
  }
}

/* Final cabinet polish: one restrained system for forms, files and management views. */
body[data-page="teacher"],
:is(body[data-page="student"], .student-preview) {
  --cabinet-bg: #f5f6f8;
  --cabinet-surface: #ffffff;
  --cabinet-surface-soft: #fafbfc;
  --cabinet-border: #e1e5ea;
  --cabinet-text: #1c1f25;
  --cabinet-muted: #68707c;
  --cabinet-accent: #8a2d3f;
  --cabinet-accent-soft: #f9eef1;
}

body[data-page="teacher"] .student-lesson-hero p,
:is(body[data-page="student"], .student-preview) .student-lesson-hero p { color: #cfd3da; }
body[data-page="teacher"] .hero-teacher .avatar,
:is(body[data-page="student"], .student-preview) .hero-teacher .avatar { background: #fff; color: #24272e; }
body[data-page="teacher"] .hero-teacher small,
:is(body[data-page="student"], .student-preview) .hero-teacher small { color: #b7bdc7; }
body[data-page="teacher"] .activity-chart i,
:is(body[data-page="student"], .student-preview) .activity-chart i { background: linear-gradient(180deg, #8a2d3f, #a9bfd5); }

.mobile-header-notification {
  display: block;
}

.cabinet-topbar .topbar-actions {
  gap: 10px;
}

.cabinet-topbar .notification-shell {
  position: relative;
}

.cabinet-topbar .notification-popover {
  right: 0;
  top: calc(100% + 11px);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  margin-top: auto;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--cabinet-border);
  border-radius: 0;
  background: transparent;
  color: #a33d51;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: left;
  box-shadow: none;
}

.sidebar-logout:hover {
  background: #fff7f8;
}

.dashboard .password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  width: 100%;
  border: 1px solid #dfe3e8;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.auth-form .password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid #d9dce2;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.dashboard .password-control input,
.auth-form .password-control input {
  min-width: 0;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.password-control:focus-within {
  border-color: rgba(138, 45, 63, 0.68);
  box-shadow: 0 0 0 3px rgba(138, 45, 63, 0.08);
}

.password-toggle {
  min-width: 74px;
  padding: 0 11px;
  border: 0;
  border-left: 1px solid #e5e7eb;
  border-radius: 0;
  background: #fff;
  color: var(--cabinet-accent);
  font: inherit;
  font-size: 0.73rem;
  font-weight: 800;
  box-shadow: none;
}

.password-toggle:hover {
  background: var(--cabinet-accent-soft);
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--cabinet-muted);
  font-size: 0.69rem;
  font-weight: 600;
  line-height: 1.35;
}

body[data-page="teacher"] input[type="file"],
:is(body[data-page="student"], .student-preview) input[type="file"] {
  min-width: 0;
  padding: 5px 7px;
  border: 1px dashed #cfd6df;
  border-radius: 7px;
  background: #fbfcfd;
  color: var(--cabinet-muted);
  font-size: 0.76rem;
}

body[data-page="teacher"] input[type="file"]::file-selector-button,
:is(body[data-page="student"], .student-preview) input[type="file"]::file-selector-button {
  margin-right: 9px;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: var(--cabinet-text);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.dashboard .form-panel,
.dashboard details.form-panel,
.settings-student-create {
  background: #fff;
}

.dashboard .form-panel form > .accent-button,
.dashboard .form-panel form > .dark-button,
.dashboard .form-panel form > .outline-button,
.dashboard .inline-edit > .accent-button,
.dashboard .inline-edit > .dark-button,
.dashboard .inline-edit > .outline-button {
  width: auto;
  margin-top: 14px;
  align-self: flex-start;
}

.dashboard .button-row {
  align-items: center;
  gap: 8px;
}

.dashboard .button-row > button,
.dashboard .button-row > a {
  flex: 0 0 auto;
}

.dashboard .accent-button,
.dashboard .dark-button,
.dashboard .outline-button,
.dashboard .danger-button,
.dashboard .light-button {
  font-size: 0.78rem;
  font-weight: 800;
}

.student-management-page {
  display: grid;
  gap: 20px;
}

.student-management-head,
.student-management-subhead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.student-management-head {
  min-height: 102px;
  padding: 24px 26px;
  border: 1px solid var(--cabinet-border);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f7f8fa);
}

.student-management-head h3,
.student-management-subhead h3 {
  margin: 0;
  color: var(--cabinet-text);
  font-size: 1.32rem;
}

.student-management-head .eyebrow,
.student-management-subhead .eyebrow {
  margin: 0 0 5px;
}

.student-management-head > span {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--cabinet-text);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 850;
}

.student-directory-grid {
  grid-template-columns: repeat(auto-fit, minmax(305px, 1fr));
  gap: 12px;
}

.student-card {
  min-width: 0;
  border: 1px solid var(--cabinet-border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.student-card-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  min-height: 78px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.student-card-summary::-webkit-details-marker { display: none; }

.student-card-summary .student-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #2c3038;
}

.student-summary-main,
.student-summary-main strong,
.student-summary-main small { min-width: 0; }
.student-summary-main strong,
.student-summary-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-summary-main strong { font-size: 0.88rem; }
.student-summary-main small { margin-top: 3px; color: var(--cabinet-muted); font-size: 0.74rem; }

.student-summary-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.student-summary-meta .pill { font-size: 0.64rem; white-space: nowrap; }
.summary-cue { color: var(--cabinet-muted); font-size: 0.7rem; font-weight: 800; }
.student-card[open] .summary-cue { color: var(--cabinet-accent); }

.student-card-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 16px;
  border-top: 1px solid var(--cabinet-border);
}

.student-card-body > p { margin: 0; color: #4f5662; font-size: 0.78rem; line-height: 1.55; }
.student-analytics-block { padding-top: 4px; }
.student-management-subhead { margin-bottom: 12px; }

.empty-state-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 680px;
  padding: 22px;
  border: 1px solid var(--cabinet-border);
  border-radius: 8px;
  background: #fff;
}

.empty-state-panel h3,
.empty-state-panel p { margin: 0; }
.empty-state-panel p { margin-top: 5px; color: var(--cabinet-muted); font-size: 0.83rem; line-height: 1.5; }
.empty-state-mark { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 8px; background: #eaf5ef; color: #2f7b59; font-weight: 850; }

.student-progress-page { display: grid; gap: 16px; max-width: 1080px; }
.student-progress-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px; border: 1px solid var(--cabinet-border); border-radius: 8px; background: #fff; }
.student-progress-head h3, .student-progress-head p { margin: 0; }
.student-progress-head > div:first-child > span { display: block; margin-top: 5px; color: var(--cabinet-muted); font-size: 0.86rem; }
.student-progress-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.student-progress-summary article { min-height: 90px; padding: 16px; border: 1px solid var(--cabinet-border); border-radius: 8px; background: #fff; }
.student-progress-summary span { color: var(--cabinet-muted); font-size: 0.74rem; font-weight: 750; }
.student-progress-summary strong { display: block; margin-top: 8px; font-size: 1.45rem; }
.student-progress-list { display: grid; gap: 10px; }
.student-progress-lesson { padding: 18px; border: 1px solid var(--cabinet-border); border-radius: 8px; background: #fff; }
.student-progress-lesson-head h4 { margin: 5px 0 3px; font-size: 0.95rem; }
.student-progress-lesson-head span, .student-progress-lesson-head small { color: var(--cabinet-muted); font-size: 0.75rem; }
.student-feedback-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.student-feedback-grid > div { padding: 11px 12px; border-radius: 7px; background: #f8f9fb; }
.student-feedback-grid strong { display: block; color: var(--cabinet-muted); font-size: 0.68rem; text-transform: uppercase; }
.student-feedback-grid p { margin: 5px 0 0; font-size: 0.79rem; line-height: 1.45; }
.student-feedback-grid .math-rich-output > p,
.student-lesson-feedback .math-rich-output > p { margin: 5px 0 0; font-size: 0.79rem; line-height: 1.45; }

.test-choice-fields[hidden] { display: none; }
.test-attempt-review { display: grid; gap: 8px; margin-top: 12px; }
.test-attempt-review article { padding: 11px 12px; border: 1px solid var(--cabinet-border); border-radius: 7px; background: #fafbfc; }
.test-attempt-review article p { margin: 7px 0 0; font-size: 0.78rem; }

/* Landing: crisper surfaces and a more intentional conversion form. */
body[data-page="landing"] { background: #f7f8fa; color: #1b1e24; }
body[data-page="landing"] .section,
body[data-page="landing"] .program-section,
body[data-page="landing"] .formats-section,
body[data-page="landing"] .prices-section { background: #ffffff; border-color: #e4e7eb; }
body[data-page="landing"] .about-section,
body[data-page="landing"] .journey-section,
body[data-page="landing"] .reviews-section,
body[data-page="landing"] .lead-section { background: #f5f6f8; color: #1b1e24; }
body[data-page="landing"] .reviews-section .section-heading h2 { color: #1b1e24; }
body[data-page="landing"] .reviews-section .section-heading .eyebrow,
body[data-page="landing"] .review-stars { color: #8a2d3f; }
body[data-page="landing"] .review-card { background: #fff; color: #1b1e24; }
body[data-page="landing"] .review-card p { color: #4f5662; }
body[data-page="landing"] .review-card strong { color: #30343c; }
body[data-page="landing"] .journey-card,
body[data-page="landing"] .feature-card,
body[data-page="landing"] .format-card,
body[data-page="landing"] .review-card,
body[data-page="landing"] .price-card { border-color: #e1e4e8; box-shadow: 0 10px 30px rgba(28, 31, 37, 0.045); }
body[data-page="landing"] .lead-section { gap: clamp(36px, 7vw, 116px); align-items: start; }
body[data-page="landing"] .lead-section > div { max-width: 540px; padding-top: 18px; }
body[data-page="landing"] .lead-form { max-width: 510px; padding: 22px; border: 1px solid #e0e4e8; border-radius: 10px; background: #fff; box-shadow: 0 20px 48px rgba(28, 31, 37, 0.07); }
body[data-page="landing"] .lead-form .accent-button { width: auto; min-width: 168px; justify-self: start; }
body[data-page="landing"] .referral-banner { border-color: #d7dce2; background: #202126; color: #fff; box-shadow: 0 12px 28px rgba(28, 31, 37, 0.12); }

@media (max-width: 900px) {
  .cabinet-topbar .topbar-logout { display: none; }
  .app-shell.standalone .sidebar { padding-bottom: 0; }
  .cabinet-topbar .notification-popover { position: fixed; top: 68px; right: 12px; left: 12px; width: auto; max-width: none; }
  .student-card-summary { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .student-summary-meta { grid-column: 2 / -1; justify-content: flex-start; }
  .summary-cue { display: none; }
}

@media (max-width: 620px) {
  .app-shell.standalone { padding-inline: 12px; }
  .dashboard .form-panel, .dashboard details.form-panel { padding: 14px; }
  .dashboard .button-row > button, .dashboard .button-row > a { width: auto; }
  .student-management-head { min-height: 86px; padding: 18px; }
  .student-management-head h3 { font-size: 1.12rem; }
  .student-progress-summary, .student-feedback-grid { grid-template-columns: 1fr; }
  .student-progress-head { align-items: flex-start; flex-direction: column; }
  .student-card-summary { padding: 13px; }
  .student-summary-meta .pill:nth-child(2) { display: none; }
  body[data-page="landing"] .lead-section { gap: 22px; }
  body[data-page="landing"] .lead-form { width: 100%; padding: 16px; }
}

/* 2026 visual reset: one clear system for the landing and workspaces. */
body[data-page="landing"] {
  --landing-bg: #f4f7fb;
  --landing-surface: #ffffff;
  --landing-ink: #172033;
  --landing-muted: #657086;
  --landing-line: #e1e7f0;
  --landing-accent: #2c5bea;
  --landing-accent-soft: #edf2ff;
  background: var(--landing-bg);
  color: var(--landing-ink);
  font-family: Manrope, Inter, Arial, sans-serif;
}

body[data-page="landing"] .topbar {
  min-height: 74px;
  padding-inline: clamp(18px, 4vw, 72px);
  border-color: var(--landing-line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.025);
}

body[data-page="landing"] .brand,
body[data-page="landing"] .main-nav a,
body[data-page="landing"] .phone-link {
  color: var(--landing-ink);
}

body[data-page="landing"] .brand-mark {
  border-radius: 10px;
  background: var(--landing-accent);
  color: #fff;
}

body[data-page="landing"] .main-nav a:hover,
body[data-page="landing"] .phone-link:hover {
  color: var(--landing-accent);
}

body[data-page="landing"] .dark-button,
body[data-page="landing"] .accent-button {
  border-color: var(--landing-accent);
  background: var(--landing-accent);
  color: #fff;
  box-shadow: none;
}

body[data-page="landing"] .dark-button:hover,
body[data-page="landing"] .accent-button:hover {
  border-color: #2149c4;
  background: #2149c4;
  box-shadow: 0 12px 28px rgba(44, 91, 234, 0.2);
}

body[data-page="landing"] .light-button,
body[data-page="landing"] .ghost-button,
body[data-page="landing"] .outline-button {
  border-color: #d8e0ec;
  background: #fff;
  color: var(--landing-ink);
  box-shadow: none;
}

body[data-page="landing"] .hero {
  min-height: min(760px, 88svh);
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.78fr);
  gap: clamp(30px, 6vw, 96px);
  padding: 122px clamp(22px, 5.5vw, 96px) 92px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 76% 30%, rgba(67, 111, 255, 0.18), transparent 28%),
    #101827;
  background-size: 42px 42px, 42px 42px, auto, auto;
}

body[data-page="landing"] .hero-overlay {
  background:
    linear-gradient(90deg, rgba(16, 24, 39, 0.98) 0%, rgba(16, 24, 39, 0.88) 48%, rgba(16, 24, 39, 0.48) 100%),
    linear-gradient(180deg, rgba(16, 24, 39, 0) 30%, rgba(16, 24, 39, 0.58) 100%);
}

body[data-page="landing"] .hero-content {
  max-width: 760px;
}

body[data-page="landing"] .hero .eyebrow {
  margin-bottom: 16px;
  color: #9fb1ff;
}

body[data-page="landing"] .hero h1 {
  max-width: 780px;
  margin-bottom: 20px;
  color: #f8fafc;
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: clamp(3.2rem, 6.1vw, 6.6rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

body[data-page="landing"] .hero-city {
  margin-bottom: 16px;
  color: #c1ceff;
  font-size: clamp(0.95rem, 1.55vw, 1.12rem);
  font-weight: 750;
}

body[data-page="landing"] .hero-copy {
  max-width: 650px;
  color: #c9d2e1;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.62;
}

body[data-page="landing"] .hero-actions {
  gap: 10px;
}

body[data-page="landing"] .hero-actions a {
  min-height: 46px;
  padding: 12px 17px;
  border-radius: 9px;
}

body[data-page="landing"] .lesson-preview {
  width: min(100%, 390px);
  padding: 24px;
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: #fff;
  color: var(--landing-ink);
  box-shadow: 0 28px 70px rgba(5, 12, 26, 0.35);
  transform: rotate(-1.5deg);
}

body[data-page="landing"] .lesson-preview::before {
  border-color: #e7edf5;
  border-radius: 10px;
}

body[data-page="landing"] .lesson-preview-top,
body[data-page="landing"] .lesson-preview-main p,
body[data-page="landing"] .lesson-preview-row {
  color: var(--landing-muted);
}

body[data-page="landing"] .lesson-preview-top strong,
body[data-page="landing"] .lesson-preview-row strong {
  color: var(--landing-accent);
}

body[data-page="landing"] .mini-badge {
  background: var(--landing-accent-soft);
  color: #2849b3;
}

body[data-page="landing"] .preview-progress {
  background: #e8edf6;
}

body[data-page="landing"] .preview-progress span {
  background: var(--landing-accent);
}

body[data-page="landing"] .formula-ticket {
  border-color: rgba(255, 255, 255, 0.19);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.74);
  color: #f8fafc;
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: 1.05rem;
}

body[data-page="landing"] .formula-ticket.second {
  color: #c9d6ff;
}

body[data-page="landing"] .section {
  border: 0;
  background: transparent;
  color: var(--landing-ink);
}

body[data-page="landing"] .journey-section,
body[data-page="landing"] .about-section,
body[data-page="landing"] .reviews-section,
body[data-page="landing"] .lead-section {
  background: var(--landing-bg);
}

body[data-page="landing"] .program-section,
body[data-page="landing"] .formats-section,
body[data-page="landing"] .prices-section {
  background: var(--landing-surface);
}

body[data-page="landing"] .section-heading {
  max-width: 710px;
}

body[data-page="landing"] .section-heading .eyebrow,
body[data-page="landing"] .about-copy .eyebrow,
body[data-page="landing"] .lead-section .eyebrow {
  color: var(--landing-accent);
}

body[data-page="landing"] h2 {
  color: var(--landing-ink);
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: clamp(2rem, 3.8vw, 4rem);
  letter-spacing: 0;
}

body[data-page="landing"] .journey-card,
body[data-page="landing"] .feature-card,
body[data-page="landing"] .format-card,
body[data-page="landing"] .review-card,
body[data-page="landing"] .price-card {
  border-color: var(--landing-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(32, 48, 80, 0.055);
}

body[data-page="landing"] .journey-card,
body[data-page="landing"] .feature-card,
body[data-page="landing"] .format-card,
body[data-page="landing"] .review-card {
  min-height: 0;
}

body[data-page="landing"] .journey-card::after {
  height: 3px;
  background: var(--landing-accent);
}

body[data-page="landing"] .journey-card span,
body[data-page="landing"] .feature-number {
  color: var(--landing-accent);
  font-family: Manrope, Inter, Arial, sans-serif;
}

body[data-page="landing"] .journey-card p,
body[data-page="landing"] .feature-card p,
body[data-page="landing"] .format-card p,
body[data-page="landing"] .review-card p,
body[data-page="landing"] .about-copy > p:not(.eyebrow),
body[data-page="landing"] .lead-section > div > p:not(.eyebrow) {
  color: var(--landing-muted);
}

body[data-page="landing"] .feature-card:hover,
body[data-page="landing"] .format-card:hover,
body[data-page="landing"] .review-card:hover,
body[data-page="landing"] .price-card:hover,
body[data-page="landing"] .journey-card:hover {
  border-color: #b7c9ff;
  box-shadow: 0 18px 42px rgba(37, 76, 170, 0.1);
}

body[data-page="landing"] .platform-section {
  background: #101827 !important;
  color: #f8fafc;
}

body[data-page="landing"] .platform-section .eyebrow {
  color: #9fb1ff;
}

body[data-page="landing"] .platform-section h2 {
  color: #f8fafc;
}

body[data-page="landing"] .platform-copy p {
  color: #b8c4d8;
}

body[data-page="landing"] .platform-showcase {
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.24);
}

body[data-page="landing"] .showcase-sidebar {
  background: #18243b;
}

body[data-page="landing"] .showcase-sidebar span {
  background: rgba(255, 255, 255, 0.13);
}

body[data-page="landing"] .showcase-sidebar span:first-child {
  background: var(--landing-accent);
}

body[data-page="landing"] .showcase-main {
  color: var(--landing-ink);
}

body[data-page="landing"] .showcase-header span {
  color: var(--landing-accent);
}

body[data-page="landing"] .showcase-lesson,
body[data-page="landing"] .showcase-grid span {
  border: 1px solid #e6ebf3;
  background: #f7f9fc;
  box-shadow: none;
}

body[data-page="landing"] .showcase-lesson strong {
  color: var(--landing-ink);
}

body[data-page="landing"] .about-photo {
  border-radius: 14px;
  overflow: hidden;
}

body[data-page="landing"] .about-stats article {
  border-color: var(--landing-line);
  background: #fff;
}

body[data-page="landing"] .about-stats strong {
  color: var(--landing-accent);
}

body[data-page="landing"] .review-stars {
  color: var(--landing-accent);
}

body[data-page="landing"] .trial-price-block {
  max-width: 360px;
}

body[data-page="landing"] .price-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body[data-page="landing"] .price-card {
  min-height: 278px;
  padding: 22px;
}

body[data-page="landing"] .price-card.highlighted {
  border-color: #b6c9ff;
  background: #f4f7ff;
  box-shadow: 0 18px 42px rgba(44, 91, 234, 0.11);
}

body[data-page="landing"] .price-card .price span {
  color: var(--landing-ink);
}

body[data-page="landing"] .price-card del {
  color: #8a94a6;
}

body[data-page="landing"] .price-card p:not(.price) {
  color: var(--landing-muted);
}

body[data-page="landing"] .referral-banner {
  max-width: 860px;
  border-color: #243f9b;
  border-radius: 12px;
  background: #18347d;
  color: #fff;
  box-shadow: none;
}

body[data-page="landing"] .lead-section {
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.8fr);
  align-items: center;
  gap: clamp(32px, 7vw, 108px);
}

body[data-page="landing"] .lead-section > div {
  padding-top: 0;
}

body[data-page="landing"] .lead-section h2 {
  max-width: 520px;
}

body[data-page="landing"] .lead-form {
  width: min(100%, 470px);
  padding: 22px;
  border-color: var(--landing-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(32, 48, 80, 0.07);
}

body[data-page="landing"] .lead-form label {
  color: #4d5b72;
}

body[data-page="landing"] .lead-form input,
body[data-page="landing"] .lead-form textarea {
  border-color: #dce4f0;
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--landing-ink);
}

body[data-page="landing"] .lead-form input:focus,
body[data-page="landing"] .lead-form textarea:focus {
  border-color: var(--landing-accent);
  box-shadow: 0 0 0 3px rgba(44, 91, 234, 0.12);
}

body[data-page="landing"] .footer {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: row;
  gap: 30px;
  overflow: hidden;
  padding: clamp(44px, 6vw, 76px) clamp(20px, 5.5vw, 88px) 24px;
  background: #101827;
  color: #f8fafc;
}

body[data-page="landing"] .footer-main {
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 2.18fr);
  gap: clamp(30px, 5vw, 74px);
  grid-column: 1;
  width: 100%;
}

body[data-page="landing"] .footer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(210px, 0.95fr);
  gap: clamp(20px, 3vw, 42px);
}

body[data-page="landing"] .footer-brand,
body[data-page="landing"] .footer-column,
body[data-page="landing"] .footer-cta {
  min-width: 0;
}

body[data-page="landing"] .footer-logo {
  border: 0;
  border-radius: 10px;
  background: var(--landing-accent);
  color: #fff;
}

body[data-page="landing"] .footer-brand p,
body[data-page="landing"] .footer-column h3,
body[data-page="landing"] .footer-cta span {
  color: #9eafcb;
}

body[data-page="landing"] .footer-column a,
body[data-page="landing"] .footer-bottom {
  color: #d8e0ed;
}

body[data-page="landing"] .footer-socials a,
body[data-page="landing"] .footer-cta {
  border-color: rgba(201, 215, 240, 0.17);
  background: rgba(255, 255, 255, 0.045);
}

body[data-page="landing"] .footer-cta {
  border-radius: 12px;
}

body[data-page="landing"] .footer-cta .light-button {
  background: #fff;
  color: #18243b;
}

body[data-page="landing"] .footer-bottom {
  position: static;
  grid-column: 1;
  width: auto;
  border-color: rgba(201, 215, 240, 0.16);
}

body[data-page="teacher"],
:is(body[data-page="student"], .student-preview) {
  --cabinet-bg: #f5f7fb;
  --cabinet-surface: #ffffff;
  --cabinet-surface-soft: #f8fafd;
  --cabinet-border: #e1e7ef;
  --cabinet-text: #182235;
  --cabinet-muted: #6a778a;
  --cabinet-accent: #2c5bea;
  --cabinet-accent-soft: #edf2ff;
  --cabinet-green: #16856a;
  --cabinet-green-soft: #e9f8f3;
  --cabinet-blue: #2c5bea;
  --cabinet-blue-soft: #edf2ff;
  background: var(--cabinet-bg);
}

body[data-page="teacher"] .cabinet-page,
:is(body[data-page="student"], .student-preview) .cabinet-page {
  background: var(--cabinet-bg);
}

body[data-page="teacher"] .cabinet-topbar,
:is(body[data-page="student"], .student-preview) .cabinet-topbar {
  min-height: 70px;
  border-color: var(--cabinet-border);
  background: rgba(255, 255, 255, 0.96);
}

body[data-page="teacher"] .cabinet-topbar .brand-mark,
:is(body[data-page="student"], .student-preview) .cabinet-topbar .brand-mark {
  border-radius: 10px;
  background: var(--cabinet-accent);
}

body[data-page="teacher"] .app-shell.standalone,
:is(body[data-page="student"], .student-preview) .app-shell.standalone {
  width: min(100%, 1540px);
  gap: clamp(22px, 2.8vw, 42px);
}

body[data-page="teacher"] .app-shell.standalone .sidebar,
:is(body[data-page="student"], .student-preview) .app-shell.standalone .sidebar {
  border-color: var(--cabinet-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(30, 47, 80, 0.045);
}

body[data-page="teacher"] .app-shell.standalone .profile-box .avatar,
:is(body[data-page="student"], .student-preview) .app-shell.standalone .profile-box .avatar {
  border-radius: 10px;
  background: var(--cabinet-accent);
}

body[data-page="teacher"] .dashboard-nav .nav-button,
:is(body[data-page="student"], .student-preview) .dashboard-nav .nav-button {
  border-radius: 8px;
  color: #59677a;
}

body[data-page="teacher"] .dashboard-nav .nav-button:hover,
:is(body[data-page="student"], .student-preview) .dashboard-nav .nav-button:hover {
  background: #f4f7fc;
  color: var(--cabinet-text);
}

body[data-page="teacher"] .dashboard-nav .nav-button.active,
:is(body[data-page="student"], .student-preview) .dashboard-nav .nav-button.active {
  background: var(--cabinet-accent-soft);
  color: #2548b7;
  box-shadow: inset 3px 0 0 var(--cabinet-accent);
}

body[data-page="teacher"] .dashboard-head,
:is(body[data-page="student"], .student-preview) .dashboard-head {
  border-color: var(--cabinet-border);
}

body[data-page="teacher"] .dashboard-head .eyebrow,
:is(body[data-page="student"], .student-preview) .dashboard-head .eyebrow,
body[data-page="teacher"] .student-home-kicker,
:is(body[data-page="student"], .student-preview) .student-home-kicker {
  color: var(--cabinet-accent);
}

body[data-page="teacher"] .dashboard .accent-button,
:is(body[data-page="student"], .student-preview) .dashboard .accent-button {
  border-color: var(--cabinet-accent);
  background: var(--cabinet-accent);
}

body[data-page="teacher"] .dashboard .accent-button:hover,
:is(body[data-page="student"], .student-preview) .dashboard .accent-button:hover {
  border-color: #2149c4;
  background: #2149c4;
}

body[data-page="teacher"] .dashboard .dark-button,
:is(body[data-page="student"], .student-preview) .dashboard .dark-button {
  border-color: #1b2739;
  background: #1b2739;
}

body[data-page="teacher"] .dashboard .outline-button,
:is(body[data-page="student"], .student-preview) .dashboard .outline-button,
body[data-page="teacher"] .cabinet-topbar .ghost-button,
:is(body[data-page="student"], .student-preview) .cabinet-topbar .ghost-button {
  border-color: #dbe3ef;
  background: #fff;
  color: #34435a;
}

body[data-page="teacher"] .dashboard .danger-button,
:is(body[data-page="student"], .student-preview) .dashboard .danger-button {
  border-color: #f1cbd3;
  background: #fff;
  color: #b42344;
}

body[data-page="teacher"] .dashboard .form-panel,
body[data-page="teacher"] .dashboard details.form-panel,
body[data-page="teacher"] .dashboard .data-card,
body[data-page="teacher"] .dashboard .homework-card,
body[data-page="teacher"] .dashboard .test-card,
body[data-page="teacher"] .dashboard .material-card,
body[data-page="teacher"] .dashboard .lead-item,
:is(body[data-page="student"], .student-preview) .dashboard .data-card,
:is(body[data-page="student"], .student-preview) .dashboard .homework-card,
:is(body[data-page="student"], .student-preview) .dashboard .test-card,
:is(body[data-page="student"], .student-preview) .dashboard .material-card,
:is(body[data-page="student"], .student-preview) .dashboard .student-homework-row,
:is(body[data-page="student"], .student-preview) .dashboard .student-widget,
:is(body[data-page="student"], .student-preview) .dashboard .student-achievements-card {
  border-color: var(--cabinet-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(30, 47, 80, 0.04);
}

body[data-page="teacher"] .dashboard details.form-panel,
body[data-page="teacher"] .settings-student-create {
  align-self: start;
  min-height: 0 !important;
  height: auto !important;
  margin: 0;
  padding: 0 !important;
  overflow: hidden;
}

body[data-page="teacher"] .dashboard details.form-panel > summary,
body[data-page="teacher"] .settings-student-create > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 0 20px;
  color: var(--cabinet-text);
  font-size: 0.92rem;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

body[data-page="teacher"] .dashboard details.form-panel > summary::-webkit-details-marker,
body[data-page="teacher"] .settings-student-create > summary::-webkit-details-marker {
  display: none;
}

body[data-page="teacher"] .dashboard details.form-panel > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #d8e1ee;
  border-radius: 50%;
  color: var(--cabinet-accent);
  font-size: 1.05rem;
  font-weight: 500;
}

body[data-page="teacher"] .dashboard details.form-panel[open] > summary,
body[data-page="teacher"] .settings-student-create[open] > summary {
  border-bottom: 1px solid var(--cabinet-border);
}

body[data-page="teacher"] .dashboard details.form-panel[open] > summary::after {
  content: "-";
}

body[data-page="teacher"] .dashboard details.form-panel > form,
body[data-page="teacher"] .settings-student-create > form {
  padding: 18px 20px 20px;
}

body[data-page="teacher"] .settings-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(310px, 0.86fr);
  align-items: start;
  gap: 18px;
}

body[data-page="teacher"] .settings-grid > * {
  align-self: start;
}

body[data-page="teacher"] .settings-card {
  min-height: 0;
}

body[data-page="teacher"] .settings-student-create:not([open]) {
  max-height: 68px;
}

body[data-page="teacher"] .student-management-page {
  gap: 18px;
}

body[data-page="teacher"] .student-management-head {
  min-height: 90px;
  padding: 20px 22px;
  border-color: var(--cabinet-border);
  border-radius: 12px;
  background: #fff;
}

body[data-page="teacher"] .student-management-head > span {
  border-radius: 9px;
  background: var(--cabinet-accent-soft);
  color: var(--cabinet-accent);
}

body[data-page="teacher"] .student-directory-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

body[data-page="teacher"] .student-card {
  border-color: var(--cabinet-border);
  border-radius: 12px;
  background: #fff;
}

body[data-page="teacher"] .student-card-summary {
  min-height: 72px;
  padding: 14px 16px;
}

body[data-page="teacher"] .student-card-summary .student-avatar {
  border-radius: 9px;
  background: var(--cabinet-accent);
}

body[data-page="teacher"] .student-card[open] {
  border-color: #bdceff;
  box-shadow: 0 16px 34px rgba(44, 91, 234, 0.09);
}

body[data-page="teacher"] .student-card[open] .summary-cue {
  color: var(--cabinet-accent);
}

body[data-page="teacher"] .dashboard input,
body[data-page="teacher"] .dashboard select,
body[data-page="teacher"] .dashboard textarea,
:is(body[data-page="student"], .student-preview) .dashboard input,
:is(body[data-page="student"], .student-preview) .dashboard select,
:is(body[data-page="student"], .student-preview) .dashboard textarea {
  border-color: #dce4ef;
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--cabinet-text);
}

body[data-page="teacher"] .dashboard input:focus,
body[data-page="teacher"] .dashboard select:focus,
body[data-page="teacher"] .dashboard textarea:focus,
:is(body[data-page="student"], .student-preview) .dashboard input:focus,
:is(body[data-page="student"], .student-preview) .dashboard select:focus,
:is(body[data-page="student"], .student-preview) .dashboard textarea:focus,
body[data-page="teacher"] .password-control:focus-within,
:is(body[data-page="student"], .student-preview) .password-control:focus-within {
  border-color: var(--cabinet-accent);
  box-shadow: 0 0 0 3px rgba(44, 91, 234, 0.12);
}

body[data-page="teacher"] .password-toggle,
:is(body[data-page="student"], .student-preview) .password-toggle {
  color: var(--cabinet-accent);
}

body[data-page="teacher"] .dashboard input[type="file"],
:is(body[data-page="student"], .student-preview) .dashboard input[type="file"] {
  border-color: #cfd9e8;
  background: #f8faff;
}

body[data-page="teacher"] .dashboard .file-chip,
:is(body[data-page="student"], .student-preview) .dashboard .file-chip,
body[data-page="teacher"] .dashboard .file-row,
:is(body[data-page="student"], .student-preview) .dashboard .file-row {
  border-color: #dbe4f1;
  border-radius: 8px;
  background: #f7f9fc;
  color: #36507a;
}

body[data-page="teacher"] .notification-popover,
:is(body[data-page="student"], .student-preview) .notification-popover,
body[data-page="teacher"] .notification-popup,
:is(body[data-page="student"], .student-preview) .notification-popup {
  border-color: #dbe4ef;
  border-radius: 12px;
  background: #fff;
  color: var(--cabinet-text);
  box-shadow: 0 20px 52px rgba(23, 40, 71, 0.16);
}

body[data-page="teacher"] .notification-popover-head,
:is(body[data-page="student"], .student-preview) .notification-popover-head {
  border-color: var(--cabinet-border);
  background: #fff;
}

body[data-page="teacher"] .notification-popover-head span,
:is(body[data-page="student"], .student-preview) .notification-popover-head span,
body[data-page="teacher"] .notification-popover .text-button,
:is(body[data-page="student"], .student-preview) .notification-popover .text-button {
  color: var(--cabinet-accent);
}

body[data-page="teacher"] .notification-item,
:is(body[data-page="student"], .student-preview) .notification-item,
body[data-page="teacher"] .notification-popover .notification-item,
:is(body[data-page="student"], .student-preview) .notification-popover .notification-item {
  border-color: #e3e9f2;
  border-left: 3px solid #8aa9ff;
  border-radius: 8px;
  background: #f9fbfe;
}

body[data-page="teacher"] .notification-item.amber,
:is(body[data-page="student"], .student-preview) .notification-item.amber {
  border-left-color: #6c63d8;
}

body[data-page="teacher"] .notification-item.red,
:is(body[data-page="student"], .student-preview) .notification-item.red {
  border-left-color: #d34b67;
}

body[data-page="teacher"] .notification-item.blue,
:is(body[data-page="student"], .student-preview) .notification-item.blue {
  border-left-color: var(--cabinet-accent);
}

body[data-page="teacher"] .notification-item strong,
:is(body[data-page="student"], .student-preview) .notification-item strong {
  color: #25354c;
}

body[data-page="teacher"] .notification-item p,
:is(body[data-page="student"], .student-preview) .notification-item p {
  color: #778397;
}

body[data-page="teacher"] .notification-button,
:is(body[data-page="student"], .student-preview) .notification-button {
  border-color: #d8e2f0;
  border-radius: 10px;
  background: #fff;
  color: var(--cabinet-accent);
}

body[data-page="teacher"] .notification-count,
:is(body[data-page="student"], .student-preview) .notification-count {
  background: #d83f61;
}

body[data-page="teacher"] .week-panel {
  overflow: hidden;
  border-color: var(--cabinet-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(30, 47, 80, 0.04);
}

body[data-page="teacher"] .week-toolbar {
  min-height: 84px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--cabinet-border);
  border-radius: 0;
  background: #fff;
}

body[data-page="teacher"] .week-toolbar .eyebrow {
  color: var(--cabinet-accent);
}

body[data-page="teacher"] .week-toolbar h3 {
  margin: 2px 0 0;
  color: var(--cabinet-text);
  font-size: 1.02rem;
}

body[data-page="teacher"] .week-toolbar .outline-button {
  min-height: 36px;
  padding: 8px 12px;
  border-color: #dce4ef;
  border-radius: 8px;
  background: #fff;
}

body[data-page="teacher"] .week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(144px, 1fr));
  gap: 0;
  overflow-x: auto;
  background: #fff;
}

/* Quick audit fixes: credentials, compact tests and mobile cabinet header. */
body[data-page="teacher"] .student-directory-grid > .student-card[open] {
  grid-column: 1 / -1;
}

body[data-page="teacher"] .student-credentials {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(150px, 0.7fr) auto;
  align-items: center;
  gap: 10px;
  width: min(100%, 680px);
  padding: 11px 12px;
  border: 1px solid #dce4ef;
  border-radius: 9px;
  background: #f7f9fc;
}

body[data-page="teacher"] .student-credentials > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

body[data-page="teacher"] .student-credentials small {
  color: #728097;
  font-size: 0.68rem;
  font-weight: 650;
}

body[data-page="teacher"] .student-credentials strong {
  overflow: hidden;
  color: #1d2a3e;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="teacher"] .student-credentials .text-button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #d3def0;
  border-radius: 7px;
  background: #fff;
  white-space: nowrap;
}

.field-label {
  color: #627087;
  font-size: 0.75rem;
  font-weight: 750;
}

.credential-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  padding-left: 13px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #fbfcfe;
}

.credential-control > span {
  overflow: hidden;
  color: #34435a;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-control .outline-button {
  height: 44px;
  min-height: 44px;
  border-width: 0 0 0 1px;
  border-radius: 0 7px 7px 0;
}

.password-dialog-backdrop {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 29, 48, 0.48);
  backdrop-filter: blur(5px);
}

.password-dialog {
  width: min(100%, 470px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  border: 1px solid #dbe3ef;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(18, 29, 48, 0.22);
}

.password-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #e3e9f1;
}

.password-dialog-head span {
  color: #2f5bff;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.password-dialog-head h3 {
  margin: 4px 0 0;
  color: #172238;
  font-size: 1.1rem;
}

.password-change-form {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.password-change-form label {
  display: grid;
  gap: 6px;
  color: #5d6a7e;
  font-size: 0.74rem;
  font-weight: 750;
}

.password-change-form .password-control {
  min-height: 44px;
  border-color: #dce4ef;
  background: #fbfcfe;
}

.password-dialog-note {
  margin: 0;
  color: #6d7a8e;
  font-size: 0.72rem;
  line-height: 1.5;
}

.password-change-form .button-row {
  margin-top: 2px;
}

:is(body[data-page="student"], .student-preview) .student-mini-item.test {
  grid-template-columns: minmax(0, 1fr) auto;
}

:is(body[data-page="student"], .student-preview) .mini-test-status,
:is(body[data-page="student"], .student-preview) .mini-test-result {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf2ff;
  color: #2c5bea;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

:is(body[data-page="student"], .student-preview) .mini-test-result {
  background: #e9f8f3;
  color: #16856a;
}

body[data-page="teacher"] .dashboard input,
body[data-page="teacher"] .dashboard select,
body[data-page="teacher"] .dashboard textarea,
:is(body[data-page="student"], .student-preview) .dashboard input,
:is(body[data-page="student"], .student-preview) .dashboard select,
:is(body[data-page="student"], .student-preview) .dashboard textarea,
body[data-page="teacher"] .test-question-builder,
:is(body[data-page="student"], .student-preview) .test-row .test-options {
  border-color: #dce4ef;
  background: #fbfcfe;
}

body[data-page="teacher"] .pill.amber,
:is(body[data-page="student"], .student-preview) .pill.amber {
  background: #eef2f8;
  color: #526178;
}

@media (max-width: 900px) {
  body[data-page="teacher"] .cabinet-topbar,
  :is(body[data-page="student"], .student-preview) .cabinet-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 8px 12px;
  }

  body[data-page="teacher"] .cabinet-topbar .brand,
  :is(body[data-page="student"], .student-preview) .cabinet-topbar .brand {
    align-items: center;
    width: auto;
    min-width: 0;
    margin: 0;
  }

  body[data-page="teacher"] .cabinet-topbar .topbar-actions,
  :is(body[data-page="student"], .student-preview) .cabinet-topbar .topbar-actions {
    display: flex;
    align-items: center;
    align-self: center;
    gap: 8px;
    width: auto;
    margin: 0;
  }

  body[data-page="teacher"] .cabinet-menu-button,
  :is(body[data-page="student"], .student-preview) .cabinet-menu-button {
    display: flex;
    align-self: center;
    margin: 0;
    border-color: #dce4ef;
    background: #fff;
  }
}

@media (max-width: 700px) {
  body[data-page="teacher"] .student-credentials {
    grid-template-columns: 1fr 1fr;
  }

  body[data-page="teacher"] .student-credentials .text-button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 420px) {
  body[data-page="teacher"] .cabinet-topbar .brand > span:last-child,
  :is(body[data-page="student"], .student-preview) .cabinet-topbar .brand > span:last-child {
    font-size: 0.78rem;
  }

  body[data-page="teacher"] .cabinet-topbar .brand-mark,
  :is(body[data-page="student"], .student-preview) .cabinet-topbar .brand-mark {
    width: 36px;
    height: 36px;
  }

  .password-change-form .button-row {
    align-items: stretch;
    flex-direction: column;
  }
}

body[data-page="teacher"] .week-day {
  min-width: 144px;
  height: 410px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--cabinet-border);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

body[data-page="teacher"] .week-day:first-child {
  border-left: 0;
}

body[data-page="teacher"] .week-day.today {
  border-color: #c7d5ff;
  background: #f7f9ff;
  box-shadow: inset 0 3px 0 var(--cabinet-accent);
}

body[data-page="teacher"] .week-day header {
  min-height: 54px;
  padding: 13px 13px 11px;
  border-bottom: 1px solid var(--cabinet-border);
  color: #6a778a;
}

body[data-page="teacher"] .week-day header strong {
  color: var(--cabinet-text);
}

body[data-page="teacher"] .week-lessons {
  display: grid;
  align-content: start;
  gap: 8px;
  height: calc(100% - 54px);
  padding: 10px;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-color: #c5d1e7 transparent;
  scrollbar-width: thin;
}

body[data-page="teacher"] .empty-day {
  margin: 2px 0;
  color: #9aa5b4;
  font-size: 0.78rem;
}

body[data-page="teacher"] .week-lesson {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 108px;
  padding: 10px;
  border: 1px solid #dfe6f1;
  border-left: 3px solid var(--cabinet-accent);
  border-radius: 9px;
  background: #fff;
  color: var(--cabinet-text);
  box-shadow: none;
}

body[data-page="teacher"] .week-lesson.lesson-tone-geometry { border-left-color: #16856a; }
body[data-page="teacher"] .week-lesson.lesson-tone-exam { border-left-color: #6c63d8; }
body[data-page="teacher"] .week-lesson.lesson-tone-review { border-left-color: #9b6a16; }

body[data-page="teacher"] .week-lesson-head,
body[data-page="teacher"] .week-lesson-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

body[data-page="teacher"] .week-lesson-head time {
  color: var(--cabinet-accent);
  font-size: 0.8rem;
  font-weight: 850;
}

body[data-page="teacher"] .week-lesson-head span {
  overflow: hidden;
  color: #8090a7;
  font-size: 0.63rem;
  font-weight: 750;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="teacher"] .week-lesson > strong {
  display: -webkit-box;
  overflow: hidden;
  color: #263650;
  font-size: 0.8rem;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body[data-page="teacher"] .week-lesson-foot {
  margin-top: auto;
}

body[data-page="teacher"] .week-lesson-foot small {
  overflow: hidden;
  color: #718097;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="teacher"] .week-lesson-link {
  display: inline-grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 24px;
  border-radius: 6px;
  background: var(--cabinet-accent-soft);
  color: var(--cabinet-accent);
  font-size: 0.64rem;
  font-weight: 850;
  text-decoration: none;
}

body[data-page="teacher"] .compact-list {
  padding: 0;
  overflow: hidden;
  border-color: var(--cabinet-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(30, 47, 80, 0.035);
}

body[data-page="teacher"] .compact-list > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 20px;
  color: var(--cabinet-text);
  font-size: 0.92rem;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

body[data-page="teacher"] .compact-list > summary::-webkit-details-marker { display: none; }

body[data-page="teacher"] .compact-list > summary::after {
  content: "+";
  color: var(--cabinet-accent);
  font-size: 1.2rem;
  font-weight: 500;
}

body[data-page="teacher"] .compact-list[open] > summary {
  border-bottom: 1px solid var(--cabinet-border);
}

body[data-page="teacher"] .compact-list[open] > summary::after { content: "-"; }

body[data-page="teacher"] .compact-list .lesson-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 12px;
  padding: 14px;
}

body[data-page="teacher"] .lesson-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-color: var(--cabinet-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

body[data-page="teacher"] .lesson-card > summary {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  list-style: none;
  cursor: pointer;
}

body[data-page="teacher"] .lesson-card > summary::-webkit-details-marker { display: none; }

body[data-page="teacher"] .lesson-card-time {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 46px;
  padding: 6px;
  border-radius: 7px;
  background: var(--cabinet-accent-soft);
}

body[data-page="teacher"] .lesson-card-time strong {
  color: var(--cabinet-accent);
  font-size: 0.78rem;
}

body[data-page="teacher"] .lesson-card-time small,
body[data-page="teacher"] .lesson-card-title small {
  color: #7a879a;
  font-size: 0.65rem;
  line-height: 1.25;
}

body[data-page="teacher"] .lesson-card-title {
  min-width: 0;
}

body[data-page="teacher"] .lesson-card-title strong,
body[data-page="teacher"] .lesson-card-title small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="teacher"] .lesson-card-title strong {
  color: #263650;
  font-size: 0.84rem;
}

body[data-page="teacher"] .lesson-card-label {
  max-width: 96px;
  overflow: hidden;
  padding: 5px 7px;
  border-radius: 999px;
  background: #f1f4f9;
  color: #64748b;
  font-size: 0.64rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="teacher"] .lesson-card-cue {
  color: #8d9aab;
  font-size: 1rem;
  transition: transform 160ms ease;
}

body[data-page="teacher"] .lesson-card[open] {
  border-color: #bdceff;
  box-shadow: 0 14px 30px rgba(44, 91, 234, 0.09);
}

body[data-page="teacher"] .lesson-card[open] .lesson-card-cue {
  transform: rotate(180deg);
}

body[data-page="teacher"] .lesson-card:not([open]) .lesson-card-details {
  display: none !important;
}

body[data-page="teacher"] .lesson-card-details {
  display: grid;
  gap: 12px;
  padding: 0 14px 16px;
  border-top: 1px solid var(--cabinet-border);
}

body[data-page="teacher"] .lesson-card-details > p {
  margin: 0;
  color: #5e6e84;
  font-size: 0.78rem;
  line-height: 1.5;
}

body[data-page="teacher"] .lesson-card-details .inline-edit {
  padding-top: 2px;
}

body[data-page="teacher"] .homework-card[open],
body[data-page="teacher"] .test-card[open],
body[data-page="teacher"] .material-card[open] {
  border-color: #bdceff;
  box-shadow: 0 14px 30px rgba(44, 91, 234, 0.08);
}

body[data-page="teacher"] .analytics-toolbar,
body[data-page="teacher"] .analytics-table-wrap {
  border-color: var(--cabinet-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(30, 47, 80, 0.04);
}

body[data-page="teacher"] .analytics-toolbar select,
body[data-page="teacher"] .analytics-note-form textarea {
  border-color: #dce4ef;
  background: #fbfcfe;
}

body[data-page="teacher"] .analytics-table th {
  border-color: #dfe6f0;
  background: #f4f7fb;
  color: #6b7890;
}

body[data-page="teacher"] .analytics-table td {
  border-color: #e4eaf2;
  color: #3f4d63;
}

body[data-page="teacher"] .analytics-table tbody tr:hover {
  background: #f9fbfe;
}

body[data-page="teacher"] .analytics-note-form .text-button {
  color: var(--cabinet-accent);
}

:is(body[data-page="student"], .student-preview) .student-lesson-hero {
  border: 0;
  border-radius: 14px;
  background: #14213b;
  box-shadow: 0 16px 42px rgba(20, 33, 59, 0.18);
}

:is(body[data-page="student"], .student-preview) .student-lesson-hero p,
:is(body[data-page="student"], .student-preview) .hero-teacher small {
  color: #bdc9dd;
}

:is(body[data-page="student"], .student-preview) .hero-teacher .avatar {
  background: #fff;
  color: var(--cabinet-accent);
}

:is(body[data-page="student"], .student-preview) .student-kpi-card,
:is(body[data-page="student"], .student-preview) .student-widget,
:is(body[data-page="student"], .student-preview) .student-activity-card {
  border-color: var(--cabinet-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(30, 47, 80, 0.04);
}

:is(body[data-page="student"], .student-preview) .student-kpi-card::before,
:is(body[data-page="student"], .student-preview) .student-kpi-card.grade::before {
  border-radius: 9px;
  background: var(--cabinet-accent-soft);
  box-shadow: none;
}

:is(body[data-page="student"], .student-preview) .student-kpi-card.homework::before {
  background: var(--cabinet-green-soft);
}

:is(body[data-page="student"], .student-preview) .student-kpi-card.tests::before {
  background: #f1efff;
}

:is(body[data-page="student"], .student-preview) .student-kpi-card span,
:is(body[data-page="student"], .student-preview) .student-kpi-card small {
  color: var(--cabinet-muted);
}

:is(body[data-page="student"], .student-preview) .student-empty-line {
  border-color: var(--cabinet-border);
  border-radius: 8px;
  background: #f9fbfe;
}

:is(body[data-page="student"], .student-preview) .student-panel-head span,
:is(body[data-page="student"], .student-preview) .student-panel-head .text-button {
  color: var(--cabinet-accent);
}

:is(body[data-page="student"], .student-preview) .student-homework-row {
  overflow: hidden;
}

:is(body[data-page="student"], .student-preview) .homework-board,
:is(body[data-page="student"], .student-preview) .workspace-board,
:is(body[data-page="student"], .student-preview) .homework-side-card {
  border-color: var(--cabinet-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(30, 47, 80, 0.04);
}

:is(body[data-page="student"], .student-preview) .homework-tabs .tab-button.active,
:is(body[data-page="student"], .student-preview) .student-homework-row[open] summary {
  color: var(--cabinet-accent);
}

:is(body[data-page="student"], .student-preview) .homework-status,
:is(body[data-page="student"], .student-preview) .mini-status,
:is(body[data-page="student"], .student-preview) .pill {
  border-radius: 999px;
}

@media (max-width: 1080px) {
  body[data-page="landing"] .footer-main,
  body[data-page="landing"] .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="landing"] .footer-brand {
    grid-column: 1 / -1;
  }

  body[data-page="landing"] .footer-cta {
    max-width: none;
  }

  body[data-page="teacher"] .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body[data-page="landing"] .hero,
  body[data-page="landing"] .lead-section {
    grid-template-columns: 1fr;
  }

  body[data-page="landing"] .hero {
    min-height: auto;
    padding-top: 112px;
  }

  body[data-page="landing"] .hero-learning-scene {
    min-height: 320px;
  }

  body[data-page="landing"] .lesson-preview {
    justify-self: start;
  }

  body[data-page="teacher"] .week-day {
    height: 380px;
  }
}

@media (max-width: 680px) {
  body[data-page="landing"] .hero {
    padding: 104px 20px 64px;
  }

  body[data-page="landing"] .hero h1 {
    font-size: clamp(2.7rem, 14vw, 4rem);
  }

  body[data-page="landing"] .hero-copy {
    font-size: 0.98rem;
  }

  body[data-page="landing"] .formula-ticket {
    display: none;
  }

  body[data-page="landing"] .section {
    padding: 58px 20px;
  }

  body[data-page="landing"] .footer-main,
  body[data-page="landing"] .footer-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="landing"] .footer-brand {
    grid-column: auto;
  }

  body[data-page="teacher"] .week-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-page="teacher"] .week-toolbar .button-row {
    width: 100%;
  }

  body[data-page="teacher"] .week-toolbar .outline-button {
    flex: 1 1 0;
    padding-inline: 8px;
  }

  body[data-page="teacher"] .compact-list .lesson-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="teacher"] .lesson-card > summary {
    grid-template-columns: 52px minmax(0, 1fr) 18px;
  }

  body[data-page="teacher"] .lesson-card-label {
    display: none;
  }

  body[data-page="teacher"] .student-directory-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="teacher"] .student-card-summary {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  body[data-page="teacher"] .student-summary-meta {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }
}

/* Landing header stays a compact row between desktop and mobile breakpoints. */
body[data-page="landing"] .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

body[data-page="landing"] .main-nav,
body[data-page="landing"] .topbar-actions,
body[data-page="landing"] .contact-icons {
  display: flex;
  align-items: center;
}

body[data-page="landing"] .main-nav {
  flex: 1 1 auto;
  justify-content: center;
  gap: clamp(12px, 1.35vw, 22px);
  min-width: 0;
}

body[data-page="landing"] .main-nav a {
  white-space: nowrap;
}

body[data-page="landing"] .topbar-actions {
  flex: 0 0 auto;
  gap: 8px;
}

body[data-page="landing"] .contact-icons {
  flex: 0 0 auto;
  gap: 6px;
}

@media (max-width: 1380px) and (min-width: 901px) {
  body[data-page="landing"] .contact-icons .phone-link {
    display: none;
  }
}

@media (max-width: 900px) {
  body[data-page="landing"] .topbar {
    gap: 12px;
  }

  body[data-page="landing"] .main-nav,
  body[data-page="landing"] .topbar-actions {
    display: none;
  }

  body[data-page="landing"] .menu-button {
    display: inline-flex;
    flex: 0 0 auto;
    border-color: #d8e0ec;
    background: #fff;
  }

  body[data-page="landing"] .topbar.open .main-nav,
  body[data-page="landing"] .topbar.open .topbar-actions {
    display: grid;
  }

  body[data-page="landing"] .topbar.open .main-nav {
    grid-column: 1 / -1;
    justify-items: start;
    gap: 12px;
    width: 100%;
    padding: 16px 0 4px;
  }

  body[data-page="landing"] .topbar.open .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
    padding: 4px 0 16px;
  }
}

body[data-page="landing"] .brand {
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
}

body[data-page="landing"] .footer-column a[href^="tel:"] {
  font-size: 0.82rem;
  white-space: nowrap;
}

:is(body[data-page="student"], .student-preview) .student-workspace-page {
  gap: 18px;
}

:is(body[data-page="student"], .student-preview) .workspace-row-list,
:is(body[data-page="student"], .student-preview) .homework-row-list {
  display: grid;
  gap: 10px;
}

:is(body[data-page="student"], .student-preview) .student-homework-row {
  border-color: var(--cabinet-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

:is(body[data-page="student"], .student-preview) .student-homework-row > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px 16px;
  list-style: none;
  cursor: pointer;
}

:is(body[data-page="student"], .student-preview) .student-homework-row > summary::-webkit-details-marker { display: none; }

:is(body[data-page="student"], .student-preview) .student-homework-row[open] {
  border-color: #bdceff;
  box-shadow: 0 14px 30px rgba(44, 91, 234, 0.08);
}

:is(body[data-page="student"], .student-preview) .student-homework-row:not([open]) .homework-row-body {
  display: none !important;
}

:is(body[data-page="student"], .student-preview) .homework-row-main {
  min-width: 0;
}

:is(body[data-page="student"], .student-preview) .homework-row-main > div {
  min-width: 0;
}

:is(body[data-page="student"], .student-preview) .homework-row-main strong,
:is(body[data-page="student"], .student-preview) .homework-row-main p,
:is(body[data-page="student"], .student-preview) .homework-row-main small {
  color: var(--cabinet-text);
}

:is(body[data-page="student"], .student-preview) .homework-row-main p,
:is(body[data-page="student"], .student-preview) .homework-row-main small {
  margin-top: 3px;
  color: var(--cabinet-muted);
}

:is(body[data-page="student"], .student-preview) .homework-row-side {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--cabinet-accent);
  font-size: 0.74rem;
}

:is(body[data-page="student"], .student-preview) .homework-row-side b {
  color: #8491a4;
  font-size: 0.66rem;
  font-weight: 750;
}

:is(body[data-page="student"], .student-preview) .homework-row-body {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--cabinet-border);
  background: #fafcff;
}

:is(body[data-page="student"], .student-preview) .lesson-index {
  border-radius: 8px;
  background: var(--cabinet-accent-soft);
  color: var(--cabinet-accent);
}

:is(body[data-page="student"], .student-preview) .homework-status.blue {
  background: var(--cabinet-accent-soft);
  color: var(--cabinet-accent);
}

:is(body[data-page="student"], .student-preview) .homework-status.green {
  background: var(--cabinet-green-soft);
  color: var(--cabinet-green);
}

:is(body[data-page="student"], .student-preview) .homework-status.red {
  background: #fff0f3;
  color: #c53d5b;
}

:is(body[data-page="student"], .student-preview) .homework-side-card,
:is(body[data-page="student"], .student-preview) .settings-panel,
:is(body[data-page="student"], .student-preview) .student-progress-head,
:is(body[data-page="student"], .student-preview) .student-progress-lesson {
  border-color: var(--cabinet-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(30, 47, 80, 0.04);
}

:is(body[data-page="student"], .student-preview) .calendar-month,
:is(body[data-page="student"], .student-preview) .calendar-weekdays,
:is(body[data-page="student"], .student-preview) .calendar-grid,
:is(body[data-page="student"], .student-preview) .calendar-legend,
:is(body[data-page="student"], .student-preview) .progress-list {
  color: var(--cabinet-muted);
}

:is(body[data-page="student"], .student-preview) .calendar-grid .has-due {
  background: var(--cabinet-accent-soft);
  color: var(--cabinet-accent);
}

:is(body[data-page="student"], .student-preview) .calendar-grid .is-done {
  background: var(--cabinet-green-soft);
  color: var(--cabinet-green);
}

:is(body[data-page="student"], .student-preview) .calendar-grid .is-late {
  background: #fff0f3;
  color: #c53d5b;
}

:is(body[data-page="student"], .student-preview) .progress-ring {
  background: conic-gradient(var(--cabinet-accent) calc(var(--progress) * 1%), #e8edf5 0);
}

:is(body[data-page="student"], .student-preview) .student-feedback-grid > div,
:is(body[data-page="student"], .student-preview) .test-attempt-review article {
  background: #f7f9fc;
}

:is(body[data-page="student"], .student-preview) .teacher-note {
  border-color: #dbe5f4;
  background: #f5f8ff;
  color: #4e617d;
}

@media (max-width: 620px) {
  :is(body[data-page="student"], .student-preview) .student-homework-row > summary {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(body[data-page="student"], .student-preview) .homework-row-side {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

/* Final interaction pass: clear hierarchy, high contrast, no legacy cream surfaces. */
body[data-page="teacher"] .dashboard .dark-button,
:is(body[data-page="student"], .student-preview) .dashboard .dark-button,
body[data-page="teacher"] .dashboard .accent-button,
:is(body[data-page="student"], .student-preview) .dashboard .accent-button {
  color: #fff !important;
  font-weight: 800;
  letter-spacing: 0;
}

body[data-page="teacher"] .cabinet-page,
:is(body[data-page="student"], .student-preview) .cabinet-page {
  background: #f5f7fb !important;
}

body[data-page="teacher"] .cabinet-topbar,
:is(body[data-page="student"], .student-preview) .cabinet-topbar {
  border-color: #dfe7f1;
  background: rgba(255, 255, 255, 0.96);
}

body[data-page="teacher"] .dashboard .outline-button,
:is(body[data-page="student"], .student-preview) .dashboard .outline-button,
body[data-page="teacher"] .dashboard .text-button,
:is(body[data-page="student"], .student-preview) .dashboard .text-button {
  color: #2857ce;
  font-weight: 750;
}

body[data-page="teacher"] .dashboard .outline-button:hover,
:is(body[data-page="student"], .student-preview) .dashboard .outline-button:hover {
  border-color: #9db8ff;
  background: #f1f5ff;
  color: #1e48b9;
}

body[data-page="teacher"] .dashboard input[type="file"]::file-selector-button,
:is(body[data-page="student"], .student-preview) .dashboard input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 11px;
  border: 0;
  border-radius: 7px;
  background: #2857ce;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

body[data-page="teacher"] .dashboard .lesson-card,
body[data-page="teacher"] .dashboard .lesson-card > summary,
body[data-page="teacher"] .dashboard .lesson-card-details,
body[data-page="teacher"] .dashboard .week-day,
body[data-page="teacher"] .dashboard .week-lesson,
body[data-page="teacher"] .dashboard .homework-card,
body[data-page="teacher"] .dashboard .homework-card > summary,
:is(body[data-page="student"], .student-preview) .dashboard .student-homework-row,
:is(body[data-page="student"], .student-preview) .dashboard .student-homework-row > summary {
  background: #fff !important;
}

body[data-page="teacher"] .dashboard .lesson-card-details,
:is(body[data-page="student"], .student-preview) .dashboard .homework-row-body {
  background: #f8fbff !important;
}

body[data-page="teacher"] .dashboard .lesson-card-label {
  border: 1px solid #dbe6ff;
  border-radius: 999px;
  background: #eff4ff !important;
  color: #3860c9;
}

body[data-page="teacher"] .dashboard .week-lesson {
  border-left-color: #5780ef;
  box-shadow: none;
}

body[data-page="teacher"] .dashboard .week-lesson.is-complete {
  border-left-color: #2ca06c;
  background: #f3fbf7 !important;
}

body[data-page="teacher"] .dashboard .week-lesson.is-complete .week-lesson-head span {
  color: #238459;
}

body[data-page="teacher"] .dashboard .lesson-card[open],
body[data-page="teacher"] .dashboard .homework-card[open],
:is(body[data-page="student"], .student-preview) .dashboard .student-homework-row[open] {
  border-color: #a9c0ff;
  box-shadow: 0 18px 40px rgba(43, 87, 206, 0.1);
}

body[data-page="teacher"] .notification-popover,
:is(body[data-page="student"], .student-preview) .notification-popover,
body[data-page="teacher"] .notification-popover-head,
:is(body[data-page="student"], .student-preview) .notification-popover-head,
body[data-page="teacher"] .notification-popover-body,
:is(body[data-page="student"], .student-preview) .notification-popover-body,
body[data-page="teacher"] .notification-item,
:is(body[data-page="student"], .student-preview) .notification-item {
  background: #fff !important;
  color: #1f2b3d;
}

body[data-page="teacher"] .notification-item,
:is(body[data-page="student"], .student-preview) .notification-item {
  border-color: #e1e8f3;
  border-left-color: #7ea1ff;
}

body[data-page="teacher"] .notification-item.amber,
:is(body[data-page="student"], .student-preview) .notification-item.amber {
  border-left-color: #8d74e7;
}

body[data-page="teacher"] .notification-item.red,
:is(body[data-page="student"], .student-preview) .notification-item.red {
  border-left-color: #e3617d;
}

body[data-page="teacher"] .notification-item.is-read,
:is(body[data-page="student"], .student-preview) .notification-item.is-read {
  background: #f8fafc !important;
  opacity: 0.72;
}

body[data-page="teacher"] .notification-button,
:is(body[data-page="student"], .student-preview) .notification-button {
  color: #2857ce;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

.form-actions .accent-button {
  flex: 0 0 auto;
}

.form-note,
.homework-linkage,
.analytics-linked-homework,
.analytics-wait {
  color: #728097;
  font-size: 0.78rem;
  line-height: 1.45;
}

.form-note {
  max-width: 470px;
  margin: 0;
}

.homework-linkage {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
  background: #f8fbff;
}

.homework-linkage strong {
  color: #42536d;
}

.analytics-wait {
  display: inline-flex;
  padding: 7px 9px;
  border: 1px solid #e2e8f2;
  border-radius: 7px;
  background: #f8fafc;
  white-space: nowrap;
}

.analytics-linked-homework {
  display: block;
  margin: 0 0 6px;
  color: #516783;
}

body[data-page="teacher"] .analytics-grade-form {
  display: grid;
  grid-template-columns: minmax(68px, 90px) auto;
  align-items: center;
  gap: 7px;
}

body[data-page="teacher"] .analytics-grade-form input {
  min-width: 0;
}

:is(body[data-page="student"], .student-preview) .homework-row-side b {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #2857ce !important;
  font-size: 0.72rem;
  font-weight: 800;
}

:is(body[data-page="student"], .student-preview) .homework-row-side span {
  color: #435a7d;
  font-weight: 750;
}

:is(body[data-page="student"], .student-preview) .student-top-profile {
  margin-left: auto;
}

@keyframes workspace-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes achievement-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

body[data-page="teacher"] #dashboardContent > *,
:is(body[data-page="student"], .student-preview) #dashboardContent > * {
  animation: workspace-enter 0.34s ease both;
}

body[data-page="teacher"] .dashboard .collapsible-card,
:is(body[data-page="student"], .student-preview) .dashboard .student-homework-row,
:is(body[data-page="student"], .student-preview) .dashboard .achievement-card {
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

:is(body[data-page="student"], .student-preview) .achievement-card:hover {
  transform: translateY(-2px);
}

:is(body[data-page="student"], .student-preview) .achievement-progress i {
  transform-origin: left center;
  animation: achievement-fill 720ms cubic-bezier(.2,.8,.2,1) both;
}

body[data-page="teacher"] .lesson-card[open] .lesson-card-details,
:is(body[data-page="student"], .student-preview) .student-homework-row[open] .homework-row-body {
  animation: workspace-enter 180ms ease both;
}

body[data-page="landing"] .hero h1 {
  font-size: clamp(2.8rem, 4.9vw, 5.35rem);
}

body[data-page="landing"] .price-card,
body[data-page="landing"] .price-card.featured,
body[data-page="landing"] .trial-card {
  border-color: var(--landing-line) !important;
  background: #fff !important;
}

body[data-page="landing"] .lead-section {
  grid-template-columns: minmax(0, 0.9fr) minmax(350px, 0.72fr);
  align-items: start;
  gap: clamp(30px, 4.5vw, 72px);
  padding-top: clamp(64px, 7vw, 96px);
  padding-bottom: clamp(64px, 7vw, 96px);
}

body[data-page="landing"] .lead-section > div {
  max-width: 560px;
  padding-top: 20px;
}

body[data-page="landing"] .lead-form {
  justify-self: end;
}

body[data-page="landing"] .lead-form-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

body[data-page="landing"] .lead-form-actions .accent-button {
  width: auto;
  min-height: 42px;
  padding-inline: 16px;
}

body[data-page="landing"] .lead-form-actions p {
  margin: 0;
  color: #6b7890;
  font-size: 0.73rem;
  line-height: 1.45;
}

body[data-page="landing"] .lead-form-actions a {
  color: #2857ce;
  font-weight: 750;
}

@media (max-width: 900px) {
  body[data-page="landing"] .lead-section {
    align-items: stretch;
  }

  body[data-page="landing"] .lead-section > div {
    padding-top: 0;
  }

  body[data-page="landing"] .lead-form {
    justify-self: stretch;
  }
}

@media (max-width: 620px) {
  .form-actions,
  body[data-page="landing"] .lead-form-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .accent-button,
  body[data-page="landing"] .lead-form-actions .accent-button {
    width: 100%;
  }

  body[data-page="teacher"] .analytics-grade-form {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* July 2026 consistency pass: identity, authentication and learning workflows. */
.brand-mark,
.footer-logo {
  padding: 0 !important;
  overflow: hidden;
  border: 0 !important;
  background: transparent !important;
}

.brand-mark img,
.footer-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body[data-page="login"] {
  min-height: 100vh;
  background: #f3f6fb;
  color: #172033;
  font-family: Manrope, Inter, Arial, sans-serif;
}

body[data-page="login"] .auth-topbar {
  position: relative;
  min-height: 68px;
  border-bottom: 1px solid #e1e7f0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

body[data-page="login"] .auth-topbar .brand {
  color: #172033;
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
}

body[data-page="login"] .auth-topbar .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
}

body[data-page="login"] .auth-page {
  display: grid;
  grid-template-columns: minmax(0, 470px);
  justify-content: center;
  min-height: calc(100vh - 68px);
  padding: clamp(30px, 6vw, 72px) 18px;
  background: #f3f6fb;
}

body[data-page="login"] .auth-panel {
  align-self: center;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid #dfe6f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(37, 58, 98, 0.1);
}

body[data-page="login"] .auth-panel > div {
  padding-bottom: 22px;
  border-bottom: 1px solid #e5eaf2;
}

body[data-page="login"] .auth-panel .eyebrow {
  color: #2f5bff;
}

body[data-page="login"] .auth-panel h1 {
  max-width: 390px;
  margin: 8px 0 12px;
  color: #172033;
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.06;
  letter-spacing: 0;
}

body[data-page="login"] .auth-panel p:not(.eyebrow) {
  margin: 0;
  color: #66748b;
  font-size: 0.92rem;
  line-height: 1.65;
}

body[data-page="login"] .auth-form {
  gap: 14px;
  margin-top: 22px;
}

body[data-page="login"] .auth-form label {
  color: #526079;
}

body[data-page="login"] .auth-form input,
body[data-page="login"] .auth-form select,
body[data-page="login"] .auth-form .password-control {
  border-color: #d8e0ec;
  background: #fbfcfe;
}

body[data-page="login"] .auth-form input:focus,
body[data-page="login"] .auth-form select:focus,
body[data-page="login"] .auth-form .password-control:focus-within {
  border-color: #7d9cff;
  box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.11);
}

body[data-page="login"] .auth-form .accent-button {
  min-height: 46px;
  border-color: #2f5bff;
  border-radius: 9px;
  background: #2f5bff;
  color: #fff;
  box-shadow: 0 9px 22px rgba(47, 91, 255, 0.2);
}

body[data-page="login"] .password-toggle {
  color: #2f5bff;
}

body[data-page="teacher"] .settings-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100%;
  max-width: none;
  gap: 18px;
}

body[data-page="teacher"] .settings-card,
body[data-page="teacher"] .settings-student-create {
  width: 100%;
  border-color: #dfe6f0 !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 12px 32px rgba(35, 55, 90, 0.05) !important;
}

body[data-page="teacher"] .settings-card {
  padding: 20px !important;
}

body[data-page="teacher"] .settings-card .form-grid,
body[data-page="teacher"] .settings-student-create .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body[data-page="teacher"] .settings-profile {
  padding-bottom: 18px;
  border-bottom: 1px solid #e4eaf2;
}

body[data-page="teacher"] .settings-profile p,
body[data-page="teacher"] .settings-card label,
body[data-page="teacher"] .settings-student-create label {
  color: #657188;
}

body[data-page="teacher"] .settings-card input,
body[data-page="teacher"] .settings-card select,
body[data-page="teacher"] .settings-card textarea,
body[data-page="teacher"] .settings-student-create input,
body[data-page="teacher"] .settings-student-create select,
body[data-page="teacher"] .settings-student-create textarea {
  border-color: #dbe3ef !important;
  background: #fbfcfe !important;
}

body[data-page="teacher"] .settings-student-create:not([open]) {
  max-height: 64px;
}

body[data-page="teacher"] .settings-student-create > summary {
  min-height: 64px;
}

body[data-page="teacher"] .settings-student-create > form {
  padding: 20px !important;
}

body[data-page="teacher"] .settings-card input[type="file"],
body[data-page="teacher"] .settings-student-create input[type="file"] {
  min-width: 0;
  max-width: 100%;
}

body[data-page="teacher"] .notification-popover,
:is(body[data-page="student"], .student-preview) .notification-popover {
  overflow: hidden;
  border: 1px solid #dce4ef !important;
  background: #fff !important;
}

body[data-page="teacher"] .notification-popover-body,
:is(body[data-page="student"], .student-preview) .notification-popover-body {
  padding: 10px !important;
  background: #f6f8fc !important;
}

body[data-page="teacher"] .notification-list,
:is(body[data-page="student"], .student-preview) .notification-list {
  gap: 8px;
}

body[data-page="teacher"] .notification-item,
:is(body[data-page="student"], .student-preview) .notification-item {
  border-color: #dfe6f1 !important;
  background: #fff !important;
  box-shadow: 0 4px 12px rgba(42, 62, 100, 0.035);
}

body[data-page="teacher"] .notification-empty,
:is(body[data-page="student"], .student-preview) .notification-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 24px 18px;
  border: 1px dashed #cfdaea;
  border-radius: 10px;
  background: #fff;
  color: #6d7a90;
  text-align: center;
}

body[data-page="teacher"] .notification-empty > span,
:is(body[data-page="student"], .student-preview) .notification-empty > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #edf3ff;
  color: #2f5bff;
  font-weight: 900;
}

body[data-page="teacher"] .notification-empty strong,
:is(body[data-page="student"], .student-preview) .notification-empty strong {
  color: #243149;
}

body[data-page="teacher"] .notification-empty p,
:is(body[data-page="student"], .student-preview) .notification-empty p {
  max-width: 240px;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
}

:is(body[data-page="student"], .student-preview) .student-schedule-page {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

:is(body[data-page="student"], .student-preview) .schedule-count {
  color: #76839a;
  font-size: 0.78rem;
  font-weight: 750;
}

:is(body[data-page="student"], .student-preview) .lesson-row {
  position: relative;
  overflow: hidden;
}

:is(body[data-page="student"], .student-preview) .lesson-row::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #7e9dff;
  content: "";
}

:is(body[data-page="student"], .student-preview) .lesson-row.is-complete::before {
  background: #35a776;
}

:is(body[data-page="student"], .student-preview) .lesson-row.is-complete {
  border-color: #d7e8df;
  background: #fcfffd;
}

:is(body[data-page="student"], .student-preview) .lesson-row-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

:is(body[data-page="student"], .student-preview) .lesson-state,
:is(body[data-page="student"], .student-preview) .lesson-grade,
:is(body[data-page="student"], .student-preview) .lesson-homework-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 800;
  white-space: nowrap;
}

:is(body[data-page="student"], .student-preview) .lesson-state.complete {
  background: #e7f7ef;
  color: #247b55;
}

:is(body[data-page="student"], .student-preview) .lesson-state.planned {
  background: #edf3ff;
  color: #365fca;
}

:is(body[data-page="student"], .student-preview) .lesson-grade {
  background: #fff4d9;
  color: #8b6212;
}

:is(body[data-page="student"], .student-preview) .lesson-homework-badge {
  background: #f0edff;
  color: #6753c4;
}

:is(body[data-page="student"], .student-preview) .row-chevron {
  color: #8190a7;
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 160ms ease;
}

:is(body[data-page="student"], .student-preview) details[open] .row-chevron {
  transform: rotate(90deg);
}

:is(body[data-page="student"], .student-preview) .lesson-result-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

:is(body[data-page="student"], .student-preview) .lesson-result-grid > div {
  display: grid;
  gap: 2px;
  min-width: 130px;
  padding: 10px 12px;
  border: 1px solid #dfe7f2;
  border-radius: 9px;
  background: #fff;
}

:is(body[data-page="student"], .student-preview) .lesson-result-grid > div span {
  color: #7a879b;
  font-size: 0.68rem;
}

:is(body[data-page="student"], .student-preview) .lesson-result-grid > div strong {
  color: #25334b;
  font-size: 0.82rem;
}

:is(body[data-page="student"], .student-preview) .lesson-result-grid > p {
  flex-basis: 100%;
  margin: 0;
  color: #5f6f86;
  font-size: 0.8rem;
  line-height: 1.55;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-toolbar {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  text-align: center;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-toolbar strong {
  color: #27354d;
  font-size: 0.86rem;
  text-transform: capitalize;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-toolbar .icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-color: #dce4ef;
  border-radius: 8px;
  color: #3f5f9e;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #56647b;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 750;
  box-shadow: none;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button:hover {
  background: #f0f4fb;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.has-lesson {
  border-color: #9bb3ff;
  background: #eef3ff;
  color: #2857ce;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-today {
  box-shadow: inset 0 0 0 1px #2f5bff;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-selected {
  border-color: #2f5bff;
  background: #2f5bff;
  color: #fff;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button i {
  position: absolute;
  right: -2px;
  bottom: -1px;
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #52a77d;
  color: #fff;
  font-size: 0.48rem;
  font-style: normal;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-spacer {
  aspect-ratio: 1;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-legend {
  align-items: center;
  justify-content: space-between;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-legend .lesson-dot {
  background: #52a77d;
}

:is(body[data-page="student"], .student-preview) .student-progress-list {
  gap: 14px;
}

:is(body[data-page="student"], .student-preview) .student-progress-lesson {
  position: relative;
  overflow: hidden;
  padding: 0;
}

:is(body[data-page="student"], .student-preview) .student-progress-lesson::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #35a776;
  content: "";
}

:is(body[data-page="student"], .student-preview) .student-progress-lesson-head {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #e5ebf3;
}

:is(body[data-page="student"], .student-preview) .student-progress-lesson-head time {
  display: grid;
  place-items: center;
  min-height: 50px;
  border-radius: 9px;
  background: #edf3ff;
  color: #2f5bff;
}

:is(body[data-page="student"], .student-preview) .student-progress-lesson-head time strong {
  font-size: 1rem;
}

:is(body[data-page="student"], .student-preview) .student-progress-lesson-head time span {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
}

:is(body[data-page="student"], .student-preview) .student-progress-status {
  display: grid;
  justify-items: end;
  gap: 5px;
}

:is(body[data-page="student"], .student-preview) .student-progress-status span {
  color: #28815a;
  font-size: 0.7rem;
  font-weight: 800;
}

:is(body[data-page="student"], .student-preview) .student-progress-status strong {
  color: #263650;
  font-size: 0.8rem;
}

:is(body[data-page="student"], .student-preview) .student-feedback-grid {
  margin: 0;
  padding: 14px 18px 18px;
}

:is(body[data-page="student"], .student-preview) .student-feedback-grid > div {
  border: 1px solid #e2e8f1;
  background: #f8fafc;
}

body[data-page="teacher"] .analytics-table-wrap {
  padding: 12px 14px 18px;
  background: #f5f7fb;
}

body[data-page="teacher"] .analytics-table {
  border-collapse: separate;
  border-spacing: 0 10px;
}

body[data-page="teacher"] .analytics-table thead th {
  border: 0;
  background: transparent;
}

body[data-page="teacher"] .analytics-table tbody td {
  border-top: 1px solid #dfe6f0;
  border-bottom: 1px solid #dfe6f0;
  background: #fff;
}

body[data-page="teacher"] .analytics-table tbody td:first-child {
  border-left: 4px solid #49a87b;
  border-radius: 10px 0 0 10px;
}

body[data-page="teacher"] .analytics-table tbody td:last-child {
  border-right: 1px solid #dfe6f0;
  border-radius: 0 10px 10px 0;
}

body[data-page="teacher"] .analytics-table tbody tr.is-upcoming td {
  background: #fafbfc;
  color: #7e899a;
}

body[data-page="teacher"] .analytics-table tbody tr.is-upcoming td:first-child {
  border-left-color: #9aa8bc;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  color: #2f5bff !important;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.resource-link > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: #edf3ff;
}

body[data-page="landing"] .hero h1 {
  font-size: clamp(2.7rem, 4.45vw, 4.85rem);
}

body[data-page="landing"] .lead-section {
  grid-template-columns: minmax(300px, 480px) minmax(360px, 500px);
  justify-content: center;
  gap: clamp(24px, 3.2vw, 50px);
}

body[data-page="landing"] .lead-section > div {
  max-width: 480px;
  padding-top: 0;
}

body[data-page="landing"] .lead-form {
  justify-self: start;
}

@media (max-width: 900px) {
  body[data-page="landing"] .lead-section,
  :is(body[data-page="student"], .student-preview) .student-schedule-page {
    grid-template-columns: 1fr;
  }

  body[data-page="landing"] .lead-section {
    gap: 22px;
  }

  body[data-page="landing"] .lead-section > div,
  body[data-page="landing"] .lead-form {
    width: 100%;
    max-width: 620px;
    justify-self: center;
  }

  body[data-page="teacher"] .analytics-table tbody tr {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid #dfe6f0;
    border-left: 4px solid #49a87b;
    border-radius: 10px;
    background: #fff;
  }

  body[data-page="teacher"] .analytics-table tbody tr.is-upcoming {
    border-left-color: #9aa8bc;
    background: #fafbfc;
  }

  body[data-page="teacher"] .analytics-table tbody td,
  body[data-page="teacher"] .analytics-table tbody td:first-child,
  body[data-page="teacher"] .analytics-table tbody td:last-child {
    border: 0;
    border-radius: 0;
    background: transparent;
  }
}

@media (max-width: 620px) {
  body[data-page="login"] .auth-topbar {
    padding-inline: 14px;
  }

  body[data-page="login"] .auth-topbar .brand > span:last-child {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="login"] .auth-page {
    align-items: start;
    padding: 20px 12px;
  }

  body[data-page="login"] .auth-panel {
    padding: 22px 18px;
  }

  body[data-page="teacher"] .settings-card .form-grid,
  body[data-page="teacher"] .settings-student-create .form-grid,
  :is(body[data-page="student"], .student-preview) .student-feedback-grid {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="student"], .student-preview) .student-progress-lesson-head {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 11px;
    padding: 14px;
  }

  :is(body[data-page="student"], .student-preview) .student-progress-status {
    grid-column: 2;
    justify-items: start;
  }

  :is(body[data-page="student"], .student-preview) .student-feedback-grid {
    padding: 12px 14px 14px;
  }

  :is(body[data-page="student"], .student-preview) .lesson-row-badges {
    justify-content: flex-start;
  }

  :is(body[data-page="student"], .student-preview) .homework-row-side {
    align-items: center;
  }
}

body[data-page="teacher"] details.form-panel > summary:focus,
body[data-page="teacher"] .settings-student-create > summary:focus {
  outline: 0;
}

body[data-page="teacher"] details.form-panel > summary:focus-visible,
body[data-page="teacher"] .settings-student-create > summary:focus-visible {
  box-shadow: inset 0 0 0 2px #7c9bff;
}

body[data-page="teacher"] .analytics-lesson-list {
  display: grid;
  gap: 14px;
}

body[data-page="teacher"] .analytics-lesson-card {
  overflow: hidden;
  border: 1px solid #dfe6f0;
  border-left: 4px solid #49a87b;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(35, 55, 90, 0.045);
}

body[data-page="teacher"] .analytics-lesson-card.is-upcoming {
  border-left-color: #98a6ba;
  background: #fafbfc;
}

body[data-page="teacher"] .analytics-lesson-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #e4eaf2;
}

body[data-page="teacher"] .analytics-lesson-head time {
  display: grid;
  place-items: center;
  min-height: 52px;
  border-radius: 9px;
  background: #edf3ff;
  color: #2f5bff;
}

body[data-page="teacher"] .analytics-lesson-head time strong {
  font-size: 1rem;
}

body[data-page="teacher"] .analytics-lesson-head time span {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
}

body[data-page="teacher"] .analytics-lesson-head > div > span,
body[data-page="teacher"] .analytics-lesson-head > div > p {
  color: #758299;
  font-size: 0.7rem;
  font-weight: 700;
}

body[data-page="teacher"] .analytics-lesson-head h4 {
  margin: 4px 0;
  color: #22304a;
  font-size: 0.98rem;
}

body[data-page="teacher"] .analytics-lesson-state {
  padding: 6px 9px;
  border-radius: 999px;
  background: #e7f7ef;
  color: #247b55;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

body[data-page="teacher"] .analytics-lesson-card.is-upcoming .analytics-lesson-state {
  background: #edf1f6;
  color: #6f7d91;
}

body[data-page="teacher"] .analytics-lesson-fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.56fr) repeat(2, minmax(220px, 1fr));
  gap: 12px;
  padding: 14px 18px 18px;
}

body[data-page="teacher"] .analytics-field {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e1e8f1;
  border-radius: 9px;
  background: #f8fafc;
}

body[data-page="teacher"] .analytics-field > strong {
  display: block;
  margin-bottom: 9px;
  color: #647189;
  font-size: 0.68rem;
  text-transform: uppercase;
}

body[data-page="teacher"] .analytics-field .analytics-note-form {
  min-width: 0;
}

body[data-page="teacher"] .analytics-field textarea,
body[data-page="teacher"] .analytics-field input {
  border-color: #dbe4ef;
  background: #fff;
}

body[data-page="teacher"] .analytics-rich-field {
  display: grid;
  padding: 10px;
}

body[data-page="teacher"] .analytics-rich-field .rich-editor-field {
  min-width: 0;
}

body[data-page="teacher"] .analytics-rich-field .rich-text-editor {
  min-height: 92px;
  background: #fff;
}

body[data-page="teacher"] .analytics-rich-field .field-label {
  color: #647189;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

body[data-page="teacher"] .analytics-field .analytics-wait {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 7px;
  background: #eef1f5;
  color: #7a8799;
  font-size: 0.72rem;
  font-weight: 750;
}

body[data-page="login"] .auth-panel {
  padding: clamp(22px, 3vw, 30px);
}

body[data-page="login"] .auth-panel > div {
  padding-bottom: 18px;
}

body[data-page="login"] .auth-panel h1 {
  font-size: clamp(2rem, 4vw, 2.55rem);
}

body[data-page="login"] .auth-form {
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 900px) {
  body[data-page="teacher"] .analytics-lesson-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body[data-page="teacher"] .analytics-lesson-head {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 11px;
    padding: 14px;
  }

  body[data-page="teacher"] .analytics-lesson-state {
    grid-column: 2;
    justify-self: start;
  }

  body[data-page="teacher"] .analytics-lesson-fields {
    padding: 12px 14px 14px;
  }
}

body[data-page="teacher"] .analytics-lesson-form {
  display: grid;
}

body[data-page="teacher"] .analytics-field {
  display: block;
  color: #22304a;
}

body[data-page="teacher"] .analytics-field textarea,
body[data-page="teacher"] .analytics-field input {
  width: 100%;
}

body[data-page="teacher"] .analytics-grade-field input {
  max-width: 120px;
}

body[data-page="teacher"] .analytics-linked-homework {
  display: block;
  margin: -2px 0 8px;
  color: #6b7890;
  font-size: 0.68rem;
  line-height: 1.4;
}

body[data-page="teacher"] .analytics-feedback-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 18px 18px;
}

body[data-page="teacher"] .analytics-feedback-actions .accent-button {
  width: auto;
  min-height: 40px;
  padding-inline: 16px;
}

@media (max-width: 620px) {
  body[data-page="teacher"] .analytics-feedback-actions {
    justify-content: stretch;
    padding: 0 14px 14px;
  }

  body[data-page="teacher"] .analytics-feedback-actions .accent-button {
    width: 100%;
  }
}

/* Bounded collections and resilient dashboard states */
.collection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  margin: 16px 0;
  padding: 10px 12px;
  border: 1px solid #dde5ef;
  border-radius: 8px;
  background: #fff;
}

.collection-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 340px;
  max-width: 520px;
  min-width: 0;
  color: #77859a;
}

.collection-search > span {
  position: absolute;
  left: 13px;
  z-index: 1;
  font-size: 1.25rem;
  line-height: 1;
  pointer-events: none;
}

.collection-search input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 38px;
  border-color: #d8e1ec;
  border-radius: 7px;
  background: #f8fafc;
}

.collection-search input:focus {
  border-color: #2f5bff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.1);
  outline: none;
}

.collection-count {
  flex: 0 0 auto;
  color: #718096;
  font-size: 0.78rem;
  white-space: nowrap;
}

.collection-count strong {
  color: #1c2940;
}

.collection-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e3e9f1;
  color: #748197;
  font-size: 0.78rem;
}

.collection-pagination {
  display: flex;
  align-items: center;
  gap: 9px;
}

.collection-pagination button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #d8e1ec;
  border-radius: 7px;
  background: #fff;
  color: #1d2a40;
  font-size: 1rem;
  cursor: pointer;
}

.collection-pagination button:hover:not(:disabled) {
  border-color: #2f5bff;
  color: #2f5bff;
}

.collection-pagination button:disabled {
  opacity: 0.38;
  cursor: default;
}

.collection-pagination strong {
  min-width: 58px;
  color: #26344b;
  text-align: center;
}

.collection-panel-body {
  padding: 0 18px 18px;
}

.compact-list > summary > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 24px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf3ff;
  color: #2f5bff;
  font-size: 0.72rem;
}

.connection-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 14px;
  border: 1px solid #c9d8ff;
  border-radius: 8px;
  background: #f4f7ff;
  color: #24334d;
}

.connection-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e14761;
  box-shadow: 0 0 0 4px rgba(225, 71, 97, 0.12);
}

.connection-banner p,
.connection-banner small {
  display: block;
  min-width: 0;
  margin: 0;
}

.connection-banner small {
  margin-top: 2px;
  color: #66758d;
  line-height: 1.4;
}

.connection-banner .outline-button {
  width: auto;
  min-height: 36px;
  padding: 7px 12px;
}

body[data-page="teacher"] .week-lessons {
  height: 330px;
  max-height: 330px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body[data-page="teacher"] .week-day {
  min-width: 0;
  overflow: hidden;
}

.student-card-summary strong,
.lesson-card-title strong,
.homework-row-main strong,
.workspace-row-list strong,
.analytics-lesson-card h4,
.week-lesson > strong,
.file-row a,
.file-row span {
  overflow-wrap: anywhere;
}

.student-grid,
.lesson-grid,
.homework-grid,
.material-grid,
.analytics-lesson-list,
.workspace-row-list,
.student-progress-list {
  min-width: 0;
}

@media (max-width: 700px) {
  .collection-toolbar,
  .collection-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .collection-search {
    flex-basis: auto;
    width: 100%;
    max-width: none;
  }

  .collection-footer {
    gap: 10px;
  }

  .collection-pagination {
    justify-content: space-between;
  }

  .connection-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .connection-banner .outline-button {
    grid-column: 2;
    justify-self: start;
  }

  .collection-panel-body {
    padding: 0 12px 14px;
  }

  body[data-page="teacher"] .week-lessons {
    height: 280px;
    max-height: 280px;
  }
}

/* Static error pages */
body[data-page="error"] {
  min-height: 100vh;
  margin: 0;
  background: #f4f7fb;
  color: #172238;
  font-family: Inter, Arial, sans-serif;
}

.error-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 32px;
}

.error-page::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(#dfe6f0 1px, transparent 1px), linear-gradient(90deg, #dfe6f0 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  opacity: 0.38;
  mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent);
}

.error-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  padding: clamp(28px, 6vw, 52px);
  border: 1px solid #dce4ee;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(28, 45, 76, 0.12);
}

.error-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1d2a42;
  font-weight: 750;
  text-decoration: none;
}

.error-brand img {
  width: 38px;
  height: 38px;
}

.error-code {
  display: block;
  margin-top: clamp(42px, 8vw, 72px);
  color: #2f5bff;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.error-shell h1 {
  max-width: 560px;
  margin: 12px 0 14px;
  color: #172238;
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.error-shell > p {
  max-width: 520px;
  margin: 0;
  color: #66758d;
  font-size: 1rem;
  line-height: 1.65;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.error-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #d6e0ec;
  border-radius: 7px;
  background: #fff;
  color: #1d2a42;
  font-weight: 750;
  text-decoration: none;
}

.error-actions a:first-child {
  border-color: #2f5bff;
  background: #2f5bff;
  color: #fff;
}

@media (max-width: 540px) {
  .error-page { padding: 16px; }
  .error-actions { flex-direction: column; }
  .error-actions a { width: 100%; }
}

/* Student lesson outcomes and interactive calendars */
:is(body[data-page="student"], .student-preview) .student-kpi-card.grade-good {
  border-color: #cfe9dc;
  background: #f5fcf8;
}

:is(body[data-page="student"], .student-preview) .student-kpi-card.grade-good::before {
  background: #dff5e9;
}

:is(body[data-page="student"], .student-preview) .student-kpi-card.grade-warning {
  border-color: #f0d78f;
  background: #fffbeb;
}

:is(body[data-page="student"], .student-preview) .student-kpi-card.grade-warning::before {
  background: #ffedb5;
}

:is(body[data-page="student"], .student-preview) .student-kpi-card.grade-danger {
  border-color: #f2c7cf;
  background: #fff6f7;
}

:is(body[data-page="student"], .student-preview) .student-kpi-card.grade-danger::before {
  background: #ffe0e6;
}

:is(body[data-page="student"], .student-preview) .student-kpi-card.grade-neutral {
  border-color: var(--cabinet-border);
  background: #fff;
}

:is(body[data-page="student"], .student-preview) .lesson-row.is-current::before {
  background: #2f5bff;
}

:is(body[data-page="student"], .student-preview) .lesson-row.is-current {
  border-color: #cfdcff;
  background: #fbfcff;
}

:is(body[data-page="student"], .student-preview) .lesson-state.current {
  background: #edf3ff;
  color: #2f5bff;
}

:is(body[data-page="student"], .student-preview) .lesson-grade,
:is(body[data-page="student"], .student-preview) .lesson-homework-badge {
  background: #f1f4f9;
  color: #718096;
}

:is(body[data-page="student"], .student-preview) .lesson-grade.has-value {
  background: #e8f0ff;
  color: #2857ce;
}

:is(body[data-page="student"], .student-preview) .lesson-homework-badge.has-value {
  background: #eeebff;
  color: #624bc4;
}

:is(body[data-page="student"], .student-preview) .lesson-score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 170px));
  gap: 10px;
}

:is(body[data-page="student"], .student-preview) .lesson-score-grid > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #fff;
}

:is(body[data-page="student"], .student-preview) .lesson-score-grid span {
  color: #738198;
  font-size: 0.7rem;
  font-weight: 750;
}

:is(body[data-page="student"], .student-preview) .lesson-score-grid strong {
  color: #25334b;
  font-size: 1rem;
}

:is(body[data-page="student"], .student-preview) .lesson-score-grid .has-grade strong {
  color: #2f5bff;
}

:is(body[data-page="student"], .student-preview) .lesson-score-grid .is-empty {
  background: #f8fafc;
}

:is(body[data-page="student"], .student-preview) .lesson-feedback-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

:is(body[data-page="student"], .student-preview) .lesson-feedback-compact section {
  min-width: 0;
  padding: 11px 12px;
  border-left: 3px solid #8ca8ff;
  border-radius: 0 8px 8px 0;
  background: #f5f8ff;
}

:is(body[data-page="student"], .student-preview) .lesson-feedback-compact span {
  display: block;
  margin-bottom: 4px;
  color: #2f5bff;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

:is(body[data-page="student"], .student-preview) .lesson-feedback-compact p {
  margin: 0;
  color: #53647d;
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-past {
  border-color: #a7dbc2;
  background: #e8f7ef;
  color: #247b55;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-future {
  border-color: #9bb3ff;
  background: #eef3ff;
  color: #2857ce;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-past i {
  background: #35a776;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-future i {
  background: #2f5bff;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-selected,
:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-past.is-selected,
:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-future.is-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px currentColor;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-legend {
  justify-content: flex-start;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-legend .lesson-dot.past {
  background: #35a776;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-legend .lesson-dot.future {
  background: #2f5bff;
}

:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-toolbar {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  text-align: center;
}

:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-toolbar strong {
  color: #27354d;
  font-size: 0.86rem;
  text-transform: capitalize;
}

:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-toolbar .icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-color: #dce4ef;
  border-radius: 8px;
  color: #3f5f9e;
}

:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #56647b;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 750;
  box-shadow: none;
}

:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button:disabled {
  opacity: 0.62;
  cursor: default;
}

:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button.has-due {
  border-color: #9bb3ff;
  background: #eef3ff;
  color: #2857ce;
  cursor: pointer;
}

:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button.is-done {
  border-color: #a7dbc2;
  background: #e8f7ef;
  color: #247b55;
}

:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button.is-late {
  border-color: #f1bec9;
  background: #fff0f3;
  color: #c53d5b;
}

:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button.is-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px currentColor;
}

:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button i {
  position: absolute;
  right: -2px;
  bottom: -1px;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
  font-size: 0.48rem;
  font-style: normal;
}

:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-spacer {
  aspect-ratio: 1;
}

:is(body[data-page="student"], .student-preview) .calendar-legend i.due { background: #2f5bff; }
:is(body[data-page="student"], .student-preview) .calendar-legend i.done { background: #35a776; }
:is(body[data-page="student"], .student-preview) .calendar-legend i.late { background: #d64562; }

:is(body[data-page="student"], .student-preview) .calendar-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: -4px 0 12px;
  padding: 6px 8px 6px 11px;
  border: 1px solid #cfdcff;
  border-radius: 999px;
  background: #f3f6ff;
  color: #315bca;
  font-size: 0.75rem;
  font-weight: 750;
}

:is(body[data-page="student"], .student-preview) .calendar-filter-chip button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #dfe8ff;
  color: #315bca;
  cursor: pointer;
}

:is(body[data-page="student"], .student-preview) .homework-tabs {
  border-color: #e1e7f0;
}

:is(body[data-page="student"], .student-preview) .homework-tab {
  color: #6f7d91;
}

:is(body[data-page="student"], .student-preview) .homework-tab.active {
  color: #2f5bff;
}

:is(body[data-page="student"], .student-preview) .homework-tab.active::after {
  background: #2f5bff;
}

:is(body[data-page="student"], .student-preview) .homework-tab span {
  background: #edf1f6;
  color: #65738a;
}

:is(body[data-page="student"], .student-preview) .homework-tab.active span {
  background: #e5edff;
  color: #2f5bff;
}

:is(body[data-page="student"], .student-preview) .homework-board-head select {
  border-color: #dce4ef;
  background: #fff;
  color: #35445c;
}

:is(body[data-page="student"], .student-preview) .progress-ring {
  background:
    radial-gradient(circle at center, #fff 58%, transparent 59%),
    conic-gradient(var(--cabinet-accent) calc(var(--progress) * 1%), #e8edf5 0);
}

:is(body[data-page="student"], .student-preview) .progress-list,
:is(body[data-page="student"], .student-preview) .progress-list span + span {
  border-color: #e1e7f0;
}

:is(body[data-page="student"], .student-preview) .test-row .test-options {
  border-color: #dce5f2;
  background: #f7f9fd;
}

:is(body[data-page="student"], .student-preview) .test-row .test-options legend {
  color: #25334b;
  font-weight: 800;
}

:is(body[data-page="student"], .student-preview) .test-row .test-options label {
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #dce5f2;
  border-radius: 8px;
  background: #fff;
  color: #34445d;
}

:is(body[data-page="student"], .student-preview) .test-row .test-options input[type="radio"] {
  accent-color: #2f5bff;
}

@media (max-width: 620px) {
  :is(body[data-page="student"], .student-preview) .lesson-score-grid,
  :is(body[data-page="student"], .student-preview) .lesson-feedback-compact {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="student"], .student-preview) .lesson-score-grid > div {
    max-width: none;
  }
}

/* Quiet motion: enough feedback to feel responsive without distracting from study. */
@keyframes cabinet-section-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cabinet-card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes notification-badge-in {
  0% { transform: scale(0.7); }
  65% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

body[data-page="teacher"] #dashboardContent > section,
body[data-page="teacher"] #dashboardContent > details,
:is(body[data-page="student"], .student-preview) #dashboardContent > section,
:is(body[data-page="student"], .student-preview) #dashboardContent > details {
  animation: cabinet-section-in 220ms ease both;
}

body[data-page="teacher"] .student-grid > *,
body[data-page="teacher"] .lesson-grid > *,
body[data-page="teacher"] .homework-grid > *,
body[data-page="teacher"] .material-grid > *,
body[data-page="teacher"] .analytics-lesson-list > *,
:is(body[data-page="student"], .student-preview) .workspace-row-list > *,
:is(body[data-page="student"], .student-preview) .homework-row-list > *,
:is(body[data-page="student"], .student-preview) .student-widget-grid > *,
:is(body[data-page="student"], .student-preview) .student-progress-list > * {
  animation: cabinet-card-in 240ms ease both;
}

body[data-page="teacher"] .student-grid > *:nth-child(2),
body[data-page="teacher"] .lesson-grid > *:nth-child(2),
body[data-page="teacher"] .homework-grid > *:nth-child(2),
:is(body[data-page="student"], .student-preview) .workspace-row-list > *:nth-child(2),
:is(body[data-page="student"], .student-preview) .homework-row-list > *:nth-child(2),
:is(body[data-page="student"], .student-preview) .student-widget-grid > *:nth-child(2) { animation-delay: 35ms; }

body[data-page="teacher"] .student-grid > *:nth-child(3),
body[data-page="teacher"] .lesson-grid > *:nth-child(3),
body[data-page="teacher"] .homework-grid > *:nth-child(3),
:is(body[data-page="student"], .student-preview) .workspace-row-list > *:nth-child(3),
:is(body[data-page="student"], .student-preview) .homework-row-list > *:nth-child(3),
:is(body[data-page="student"], .student-preview) .student-widget-grid > *:nth-child(3) { animation-delay: 70ms; }

:is(body[data-page="student"], .student-preview) .student-kpi-card,
:is(body[data-page="student"], .student-preview) .student-widget,
body[data-page="teacher"] .teacher-metric-card {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

:is(body[data-page="student"], .student-preview) .student-kpi-card:hover,
:is(body[data-page="student"], .student-preview) .student-widget:hover,
body[data-page="teacher"] .teacher-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(30, 47, 80, 0.08);
}

.notification-count {
  animation: notification-badge-in 220ms ease both;
}

:is(body[data-page="student"], .student-preview) .student-home-top {
  grid-template-columns: minmax(0, 1fr);
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button,
:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button {
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button:hover:not(:disabled),
:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button:hover:not(:disabled) {
  transform: translateY(-1px);
}

:is(body[data-page="student"], .student-preview) .student-homework-row > summary:focus {
  outline: none;
}

:is(body[data-page="student"], .student-preview) .student-homework-row > summary:focus-visible {
  box-shadow: inset 0 0 0 2px #9bb3ff;
}

:is(body[data-page="student"], .student-preview) .lesson-row.is-current[open] {
  border-color: #9bb3ff;
  box-shadow: 0 14px 30px rgba(47, 91, 255, 0.1);
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="teacher"] #dashboardContent *,
  :is(body[data-page="student"], .student-preview) #dashboardContent *,
  .notification-count {
    animation: none !important;
    transition: none !important;
  }
}

/* Teacher settings: identical field rhythm for text, password and file controls. */
body[data-page="teacher"] .teacher-settings-form {
  display: grid;
  gap: 18px;
}

body[data-page="teacher"] .teacher-settings-form .form-grid {
  align-items: start;
  column-gap: 14px;
  row-gap: 16px;
}

body[data-page="teacher"] .teacher-settings-form .settings-field {
  display: grid;
  grid-template-rows: auto 46px;
  align-content: start;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

body[data-page="teacher"] .teacher-settings-form .settings-password-field,
body[data-page="teacher"] .teacher-settings-form .settings-avatar-field {
  grid-template-rows: auto 46px minmax(18px, auto);
}

body[data-page="teacher"] .teacher-settings-form .settings-field > input:not([type="file"]),
body[data-page="teacher"] .teacher-settings-form .password-control,
body[data-page="teacher"] .teacher-settings-form input[type="file"] {
  width: 100%;
  height: 46px;
  min-height: 46px;
  margin: 0;
}

body[data-page="teacher"] .teacher-settings-form input[type="file"] {
  padding: 5px 7px;
  line-height: 34px;
}

body[data-page="teacher"] .teacher-settings-form input[type="file"]::file-selector-button {
  height: 34px;
  margin-block: 0;
  padding-block: 0;
}

body[data-page="teacher"] .teacher-settings-form .field-hint {
  min-height: 18px;
  margin: 0;
}

body[data-page="teacher"] .teacher-settings-form > .dark-button {
  justify-self: start;
  width: auto;
  margin: 0 !important;
}

@media (max-width: 620px) {
  body[data-page="teacher"] .teacher-settings-form {
    gap: 16px;
  }

  body[data-page="teacher"] .teacher-settings-form .form-grid {
    row-gap: 14px;
  }
}

/* Laptop polish, inline media, achievements and student preview. */
body[data-page="landing"] .main-nav,
body[data-page="landing"] .topbar-actions {
  flex-wrap: nowrap;
}

body[data-page="landing"] .brand {
  flex: 0 1 330px;
  min-width: 240px;
}

@media (max-width: 900px) {
  body[data-page="landing"] .topbar {
    position: sticky;
    flex-wrap: nowrap;
    gap: 14px;
    padding-inline: clamp(22px, 3vw, 44px);
  }

  body[data-page="landing"] .main-nav {
    display: none !important;
  }

  body[data-page="landing"] .menu-button {
    display: inline-flex;
    flex: 0 0 42px;
    order: 4;
  }

  body[data-page="landing"] .topbar.open .main-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: clamp(22px, 3vw, 44px);
    display: grid !important;
    width: min(360px, calc(100vw - 44px));
    padding: 14px;
    border: 1px solid #dce4ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(24, 38, 66, 0.14);
  }

  body[data-page="landing"] .topbar.open .main-nav a {
    width: 100%;
    padding: 9px 10px;
    border-radius: 7px;
  }

  body[data-page="landing"] .topbar.open .main-nav a:hover {
    background: #f2f5fb;
  }

  body[data-page="landing"] .contact-icons .phone-link {
    display: none;
  }
}

@media (max-width: 1180px) and (min-width: 901px) {
  body[data-page="landing"] .contact-icons {
    display: none;
  }

  body[data-page="landing"] .topbar-actions .ghost-button,
  body[data-page="landing"] .topbar-actions .dark-button {
    min-height: 40px;
    padding: 9px 12px;
    font-size: 0.76rem;
  }
}

body[data-page="teacher"] .student-edit-form {
  width: min(100%, 1180px);
}

body[data-page="teacher"] .student-edit-form > .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body[data-page="teacher"] .student-edit-form label {
  min-width: 0;
}

body[data-page="teacher"] .student-edit-form input,
body[data-page="teacher"] .student-edit-form select,
body[data-page="teacher"] .student-edit-form .password-control {
  min-height: 46px;
}

body[data-page="teacher"] .student-edit-form textarea {
  min-height: 76px;
}

body[data-page="teacher"] .student-edit-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body[data-page="teacher"] .student-edit-form .button-row {
  gap: 8px;
  margin-top: 12px;
}

body[data-page="teacher"] .student-edit-form .button-row button {
  min-height: 38px;
  padding: 8px 12px;
}

.vk-link-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
}

.vk-link-control .outline-button {
  min-height: 42px;
  white-space: nowrap;
}

.lesson-link-pending {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #f6f8fb;
  color: #6f7d93;
  font-size: 0.74rem;
  font-weight: 700;
}

@media (max-width: 1240px) {
  body[data-page="teacher"] .student-edit-form > .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  body[data-page="teacher"] .student-edit-form > .form-grid,
  body[data-page="teacher"] .student-edit-notes {
    grid-template-columns: 1fr;
  }

  .vk-link-control {
    grid-template-columns: 1fr;
  }
}

body[data-page="teacher"] .week-panel {
  overflow: hidden;
}

body[data-page="teacher"] .week-grid {
  grid-template-columns: repeat(7, minmax(190px, 1fr));
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: #b8c6dc #f1f4f8;
  scrollbar-width: thin;
}

body[data-page="teacher"] .week-day {
  min-width: 190px !important;
  overflow: hidden;
}

body[data-page="teacher"] .week-lesson {
  min-width: 0;
}

body[data-page="teacher"] .week-lesson > strong {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}

body[data-page="teacher"] .week-lesson-foot small {
  min-width: 0;
}

.test-text-fields[hidden] {
  display: none;
}

.inline-image-attachment {
  display: inline-block;
  width: min(100%, 220px);
  margin: 0;
  vertical-align: top;
}

.inline-image-attachment a {
  display: grid;
  gap: 6px;
  color: #42536d;
}

.inline-image-attachment img {
  display: block;
  width: 100%;
  height: 132px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #f4f7fb;
  object-fit: cover;
  transition: border-color 160ms ease, transform 160ms ease;
}

.inline-image-attachment a:hover img {
  border-color: #8ca8ff;
  transform: translateY(-1px);
}

.inline-image-attachment figcaption {
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row:has(.inline-image-attachment) {
  align-items: start;
}

.achievement-manager {
  overflow: hidden;
  border: 1px solid var(--cabinet-border);
  border-radius: 10px;
  background: #fff;
}

.achievement-manager > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 12px 16px;
  list-style: none;
  cursor: pointer;
}

.achievement-manager > summary::-webkit-details-marker { display: none; }
.achievement-manager > summary span,
.achievement-manager > summary strong,
.achievement-manager > summary small { display: block; }
.achievement-manager > summary small { margin-top: 2px; color: #728097; font-size: 0.72rem; font-weight: 600; }
.achievement-manager > summary b { display: grid; place-items: center; min-width: 28px; min-height: 28px; border-radius: 999px; background: #edf3ff; color: #2f5bff; font-size: 0.74rem; }
.achievement-manager.is-standalone > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 64px; padding: 12px 16px; border-bottom: 1px solid var(--cabinet-border); }
.achievement-manager.is-standalone > header > span { display: grid; min-width: 0; gap: 3px; }
.achievement-manager.is-standalone > header strong { color: #1d2a40; font-size: 15px; }
.achievement-manager.is-standalone > header small { overflow: hidden; color: #728097; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.achievement-manager.is-standalone > header > b { display: grid; flex: 0 0 auto; min-width: 28px; min-height: 28px; place-items: center; border-radius: 999px; color: #2f5bff; background: #edf3ff; font-size: 12px; }

.achievement-manager-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--cabinet-border);
}

.achievement-form {
  display: grid;
  align-content: start;
  gap: 12px;
}

.achievement-form-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 10px;
}

.achievement-form-fields .full { grid-column: 1 / -1; }
.achievement-form .accent-button { justify-self: start; width: auto; }

.teacher-achievement-list,
.awarded-achievement-list {
  display: grid;
  gap: 8px;
}

.teacher-achievement-list article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  background: #f9fbfe;
}

.teacher-achievement-list strong,
.teacher-achievement-list small { display: block; }
.teacher-achievement-list small { margin-top: 2px; color: #738198; font-size: 0.7rem; }
.teacher-achievement-list .achievement-icon { width: 34px; height: 34px; }
.teacher-achievement-list .icon-button { width: 30px; height: 30px; min-height: 30px; padding: 0; }

.awarded-achievement-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 14px;
}

.achievement-card.awarded {
  grid-template-columns: 42px minmax(0, 1fr);
  border-color: #c8d8ff;
  background: #f5f8ff;
}

.achievement-card.awarded small {
  margin-top: 4px;
  line-height: 1.4;
}

body.student-preview-open {
  overflow: hidden;
}

body[data-page="teacher"] .app-shell.standalone #dashboardContent,
:is(body[data-page="student"], .student-preview) .app-shell.standalone #dashboardContent {
  animation: none !important;
  transform: none !important;
}

.student-preview {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  box-sizing: border-box;
  padding: clamp(16px, 2.5vw, 34px);
  place-items: center;
  background: rgba(20, 31, 50, 0.55);
  backdrop-filter: blur(5px);
  animation: none !important;
  transform: none !important;
}

.student-preview-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1560px, calc(100vw - clamp(32px, 5vw, 68px)));
  height: min(940px, calc(100dvh - clamp(32px, 5vw, 68px)));
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  overflow: hidden;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #f4f7fb;
  box-shadow: 0 34px 90px rgba(15, 29, 54, 0.28);
}

.student-preview-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px 18px;
  border-bottom: 1px solid #dce4ef;
  background: #fff;
}

.student-preview-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.student-preview-identity small,
.student-preview-identity strong,
.student-preview-title span,
.student-preview-title small { display: block; }
.student-preview-identity small,
.student-preview-title small { color: #718097; font-size: 0.7rem; }
.student-preview-title { text-align: center; }
.student-preview-title span { color: #20304a; font-weight: 800; }
.student-preview-close { justify-self: end; width: 38px; height: 38px; padding: 0; font-size: 1.3rem; }

.student-preview-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 0;
}

.student-preview-nav {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 16px 12px;
  overflow-y: auto;
  border-right: 1px solid #dce4ef;
  background: #fff;
}

.student-preview-nav button {
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #52617a;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.student-preview-nav button:hover { background: #f2f5fa; }
.student-preview-nav button.active { background: #eaf0ff; color: #2857ce; }

.student-preview-content {
  min-width: 0;
  padding: 22px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.student-preview-content form button[type="submit"] {
  opacity: 0.55;
}

@media (max-width: 880px) {
  .achievement-manager-body { grid-template-columns: 1fr; }
  .student-preview { padding: 0; }
  .student-preview-shell { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .student-preview-toolbar { grid-template-columns: minmax(0, 1fr) auto; min-height: 64px; }
  .student-preview-title { display: none; }
  .student-preview-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .student-preview-nav { display: flex; padding: 8px 10px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid #dce4ef; }
  .student-preview-nav button { flex: 0 0 auto; }
  .student-preview-content { padding: 14px; }
}

@media (max-width: 560px) {
  .achievement-form-fields { grid-template-columns: 1fr; }
  .achievement-form-fields .full { grid-column: auto; }
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button,
:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  margin: auto;
  aspect-ratio: 1;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-today:not(.is-selected),
:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1px #2f5bff;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-selected,
:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-past.is-selected,
:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-future.is-selected,
:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button.is-selected {
  border-color: #2f5bff;
  background: #2f5bff;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.16);
}

:is(body[data-page="student"], .student-preview) .schedule-calendar .calendar-grid button.is-selected i,
:is(body[data-page="student"], .student-preview) .homework-calendar .calendar-grid button.is-selected i {
  display: none;
}

/* Unified content editors */
.student-picker {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #f8faff;
}

.student-picker legend {
  padding: 0 6px;
  color: #17243a;
  font-size: 0.78rem;
  font-weight: 800;
}

.student-picker-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: #718098;
  font-size: 0.72rem;
}

.student-picker-toolbar span { margin-right: auto; }
.student-picker-toolbar .text-button { padding: 2px 0; font-size: 0.72rem; }

.student-picker-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 7px;
  max-height: 190px;
  overflow-y: auto;
}

.student-picker-options > label {
  display: grid;
  grid-template-columns: 18px 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 50px;
  padding: 7px 9px;
  border: 1px solid #e2e8f1;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.student-picker-options > label:has(input:checked) {
  border-color: #7fa0ff;
  background: #eef3ff;
  box-shadow: inset 3px 0 #2f5bff;
}

.student-picker-options input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: #2f5bff; }
.student-picker-options .student-avatar { width: 32px; height: 32px; font-size: 0.72rem; }
.student-picker-options strong,
.student-picker-options small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-picker-options strong { color: #1b2940; font-size: 0.76rem; }
.student-picker-options small { margin-top: 2px; color: #76849a; font-size: 0.66rem; }

.assign-more {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f1;
}

.assign-more > summary { width: fit-content; color: #2b5bd7; font-size: 0.76rem; font-weight: 800; cursor: pointer; }
.assign-more-form { display: grid; gap: 10px; margin-top: 10px; }
.assign-more-form > button { justify-self: start; }
.assignment-complete { margin: 12px 0 0; color: #77859a; font-size: 0.72rem; }

.test-create-panel {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  overflow: clip;
}

.test-create-panel > summary {
  min-height: 68px !important;
  padding: 14px 20px !important;
}

.test-create-panel > summary > span,
.test-builder-section > header > div,
.test-question-head > div,
.test-answer-section-head > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.test-create-panel > summary strong,
.test-builder-section > header strong,
.test-question-head strong,
.test-answer-section-head strong {
  color: #1c2a40;
  font-size: 0.86rem;
}

.test-create-panel > summary small,
.test-builder-section > header small,
.test-question-head small,
.test-answer-section-head small {
  color: #76849a;
  font-size: 0.68rem;
  font-weight: 600;
}

.test-builder-form {
  display: grid;
  gap: 0;
  padding: 0 !important;
  border-top: 1px solid #e2e8f1;
}

.test-builder-section {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px 20px;
  border-bottom: 1px solid #e5eaf1;
  background: #fff;
}

.test-builder-section > header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.test-builder-section > header > span,
.test-question-number {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #2d5bd4;
  background: #edf2ff;
  font-size: 0.76rem;
  font-weight: 850;
}

.test-builder-questions { background: #f6f8fc; }
.test-meta-grid { grid-template-columns: minmax(0, 1fr) 120px; margin: 0; }
.test-question-list { display: grid; gap: 12px; min-width: 0; }

.test-question-builder {
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: clip;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(31, 49, 78, 0.035);
}

.test-question-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #e5eaf1;
  background: #fbfcfe;
}

.test-question-head .question-remove {
  width: 32px;
  height: 32px;
  border-color: #e4e9f1;
  border-radius: 8px;
  background: #fff;
  color: #9c2f46;
  font-size: 1.15rem;
}

.test-question-body {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 15px;
}

.test-question-prompt {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  align-items: start;
  gap: 12px;
}

.test-question-prompt > label,
.test-question-config > label,
.test-text-fields > label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.test-question-prompt textarea,
.rich-text-editor { min-height: 94px; }
.rich-editor-field { display: grid; gap: 6px; }
.rich-text-editor {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  border: 1px solid #d7e0ed;
  border-radius: 8px;
  color: var(--cabinet-text);
  background: #fbfcfe;
  font: inherit;
  line-height: 1.45;
  white-space: pre-wrap;
}
.rich-text-editor:empty::before {
  content: attr(data-placeholder);
  color: #8a97aa;
}
.rich-text-editor:focus {
  outline: none;
  border-color: #7f9feb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 99, 223, .09);
}
.test-question-file input[type="file"] { min-height: 46px; }
.test-question-file > small { color: #7b879a; font-size: 0.64rem; font-weight: 550; }

.test-question-config {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 12px;
  max-width: 620px;
}

.test-choice-fields,
.test-text-fields,
.test-ai-settings {
  min-width: 0;
  padding: 13px;
  border: 1px solid #e0e6ef;
  border-radius: 9px;
  background: #f8fafd;
}

.test-choice-fields[hidden],
.test-text-fields[hidden] { display: none; }

.test-answer-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.test-answer-section-head .text-button { flex: 0 0 auto; padding: 4px 0; }
.test-option-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.test-option-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  background: #fff;
}
.test-option-row:has(.test-correct-checkbox:checked) { border-color: #79aa91; background: #f1faf5; box-shadow: inset 3px 0 #2d9365; }
.test-option-row > span { display: none; }
.test-option-row .test-correct-checkbox { width: 17px; height: 17px; min-height: 0; accent-color: #25825a; }
.test-option-row input:last-child { min-width: 0; min-height: 38px; padding: 7px 9px; }
.test-text-fields { max-width: 620px; }

.test-ai-settings > summary {
  color: #38577f;
  font-size: 0.74rem;
  font-weight: 750;
  cursor: pointer;
}

.test-ai-settings[open] > summary { margin-bottom: 12px; }
.test-ai-settings > .field-hint { display: block; margin-top: 10px; }
.test-answer-hint { margin: 0 0 8px; color: #5f6f87; font-size: 0.74rem; font-weight: 700; }

.test-card-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px 16px;
  border-bottom: 1px solid #e5eaf1;
  background: #f8fafd;
}

.test-card-overview > span { display: grid; gap: 2px; min-width: 74px; }
.test-card-overview strong { color: #223149; font-size: 0.82rem; }
.test-card-overview small { color: #778499; font-size: 0.64rem; }

@media (max-width: 720px) {
  .test-create-panel > summary,
  .test-builder-section,
  .test-builder-actions { padding-right: 14px !important; padding-left: 14px !important; }
  .test-meta-grid,
  .test-question-prompt,
  .test-question-config,
  .test-option-editor { grid-template-columns: 1fr; }
  .test-question-config { max-width: none; }
  .test-answer-section-head { align-items: flex-start; flex-direction: column; }
  .test-card-overview { gap: 12px; }
}

body[data-page="teacher"] .compact-cards,
body[data-page="teacher"] .compact-card-grid,
body[data-page="teacher"] .lesson-grid,
body[data-page="teacher"] .homework-grid,
body[data-page="teacher"] .material-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start;
  gap: 10px;
}

body[data-page="teacher"] .compact-cards > .collapsible-card[open],
body[data-page="teacher"] .compact-card-grid > .collapsible-card[open],
body[data-page="teacher"] .lesson-grid > .collapsible-card[open],
body[data-page="teacher"] .homework-grid > .collapsible-card[open],
body[data-page="teacher"] .material-grid > .collapsible-card[open] {
  grid-column: auto !important;
  animation: editor-expand 180ms ease-out both;
}

body[data-page="teacher"] .test-card[open] .test-edit-form,
body[data-page="teacher"] .homework-card[open] .homework-grade-form {
  width: 100%;
  max-width: none;
}

@keyframes editor-expand {
  from { opacity: 0.78; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

body[data-page="teacher"] details,
:is(body[data-page="student"], .student-preview) details {
  scroll-margin-top: 92px;
  overflow-anchor: none;
}

body[data-page="teacher"] details[open] > :not(summary),
:is(body[data-page="student"], .student-preview) details[open] > :not(summary) {
  animation: details-content-in 190ms ease-out both;
}

@keyframes details-content-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@supports (interpolate-size: allow-keywords) and selector(details::details-content) {
  :root { interpolate-size: allow-keywords; }

  body[data-page="teacher"] details::details-content,
  :is(body[data-page="student"], .student-preview) details::details-content {
    block-size: 0;
    overflow: clip;
    opacity: 0;
    transition: block-size 220ms ease, opacity 160ms ease;
  }

  body[data-page="teacher"] details[open]::details-content,
  :is(body[data-page="student"], .student-preview) details[open]::details-content {
    block-size: auto;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="teacher"] details[open] > :not(summary),
  :is(body[data-page="student"], .student-preview) details[open] > :not(summary),
  body[data-page="teacher"] details::details-content,
  :is(body[data-page="student"], .student-preview) details::details-content {
    animation: none;
    transition: none;
  }
}

.inline-image-attachment { width: min(100%, 340px); }
.inline-image-attachment button {
  position: relative;
  display: grid;
  width: 100%;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #42536d;
  text-align: left;
  cursor: zoom-in;
}
.inline-image-attachment img { height: 200px; }
.inline-image-attachment button > span {
  position: absolute;
  right: 8px;
  bottom: 30px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(17, 29, 49, 0.84);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 750;
  opacity: 0;
  transition: opacity 150ms ease;
}
.inline-image-attachment button:hover > span { opacity: 1; }

.image-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  padding: 24px;
  background: rgba(12, 21, 37, 0.7);
  backdrop-filter: blur(7px);
}
.image-preview-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(92vw, 960px);
  max-height: 88vh;
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0,0,0,0.35);
}
.image-preview-dialog header { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 9px 12px 9px 18px; border-bottom: 1px solid #e2e8f1; }
.image-preview-dialog header strong { min-width: 0; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-preview-dialog img { display: block; width: 100%; height: 100%; max-height: calc(88vh - 54px); object-fit: contain; background: #eef2f7; }

.student-password-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 6px 8px 6px 12px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #f8faff;
}
.student-password-summary small,
.student-password-summary strong { display: block; }
.student-password-summary small { color: #748198; font-size: 0.65rem; }
.student-password-summary strong { margin-top: 1px; color: #1b2940; }
.student-password-summary .outline-button { min-height: 32px; padding: 6px 9px; }

.achievement-edit-form {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  background: #f9fbfe;
}
.achievement-edit-fields { display: grid; gap: 6px; min-width: 0; }
.achievement-edit-fields input { min-height: 34px; padding: 6px 8px; }
.goal-inline { display: grid; grid-template-columns: 70px auto 70px; align-items: center; gap: 6px; color: #748198; font-size: 0.7rem; }
.achievement-edit-actions { display: flex; align-items: center; gap: 6px; }
.personal-goal { border-color: #cedcff; background: #f7f9ff; }

/* Cabinet surfaces are deliberately neutral; old beige rules must not leak here. */
body[data-page="teacher"] .student-card-body,
body[data-page="teacher"] .student-edit-form,
body[data-page="teacher"] .test-card,
body[data-page="teacher"] .homework-card,
body[data-page="teacher"] .material-card,
:is(body[data-page="student"], .student-preview) .test-options,
:is(body[data-page="student"], .student-preview) .notification-item,
body[data-page="teacher"] .notification-item {
  background: #fff !important;
}
body[data-page="teacher"] input,
body[data-page="teacher"] textarea,
body[data-page="teacher"] select,
:is(body[data-page="student"], .student-preview) input,
:is(body[data-page="student"], .student-preview) textarea,
:is(body[data-page="student"], .student-preview) select {
  border-color: #d7e0ed;
  background-color: #fbfcfe;
}

/* Cabinet search and dense-data polish. */
body[data-page="teacher"] .cabinet-topbar,
:is(body[data-page="student"], .student-preview) .cabinet-topbar {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(280px, 560px) minmax(160px, 1fr);
  align-items: center;
  gap: 18px;
}

.cabinet-global-search {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  color: #718097;
}

.cabinet-global-search[hidden] { display: none; }
.cabinet-global-search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.cabinet-global-search-field svg {
  position: absolute;
  left: 14px;
  z-index: 1;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  pointer-events: none;
}

.cabinet-global-search input {
  width: 100%;
  min-height: 42px;
  padding: 9px 38px 9px 42px;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  outline: 0;
  background: #f7f9fc;
  color: #17243a;
  font: 650 0.8rem Inter, Arial, sans-serif;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.cabinet-global-search input:focus {
  border-color: #86a4ff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.1);
}

.cabinet-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  width: 100%;
  max-height: min(520px, 70vh);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(24, 39, 68, 0.16);
}

.cabinet-search-results[hidden] { display: none; }
.cabinet-search-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px 9px;
  color: #718097;
  font-size: 0.7rem;
  font-weight: 750;
}
.cabinet-search-results-head b {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #edf2ff;
  color: #2f5bdb;
}
.cabinet-search-result {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1a273b;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}
.cabinet-search-result:hover,
.cabinet-search-result:focus-visible { background: #f3f6fc; transform: translateX(2px); outline: 0; }
.cabinet-search-result-type {
  width: fit-content;
  padding: 5px 7px;
  border-radius: 6px;
  background: #edf2ff;
  color: #315fda;
  font-size: 0.62rem;
  font-weight: 800;
}
.cabinet-search-result > span:nth-child(2) { min-width: 0; }
.cabinet-search-result strong,
.cabinet-search-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cabinet-search-result strong { font-size: 0.78rem; }
.cabinet-search-result small { margin-top: 3px; color: #758198; font-size: 0.67rem; }
.cabinet-search-result i { color: #8090a8; font-style: normal; }
.cabinet-search-empty { display: grid; gap: 4px; padding: 22px 14px; text-align: center; }
.cabinet-search-empty strong { color: #26344a; }
.cabinet-search-empty span { color: #7a879b; font-size: 0.75rem; }

.collection-toolbar-compact {
  min-height: 24px;
  justify-content: flex-end;
  padding: 0;
  border: 0;
  background: transparent;
}

#dashboardContent.is-search-updating *,
#dashboardContent.is-search-updating > * {
  animation: none !important;
  transition: none !important;
}

body[data-page="teacher"] .student-directory-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

body[data-page="teacher"] .student-directory-grid > .student-card[open] {
  grid-column: 1 / -1;
}

body[data-page="teacher"] .student-card-summary {
  grid-template-columns: 42px minmax(0, 1fr) minmax(0, auto) 78px;
}

body[data-page="teacher"] .student-card-body {
  padding-top: 14px;
}

body[data-page="teacher"] .student-card-body > .achievement-manager {
  margin-top: 4px;
}

.student-password-field {
  display: grid;
  grid-template-rows: 18px 46px;
  align-content: start;
  min-width: 0;
  gap: 6px;
}

.student-password-field > .field-label {
  color: #657187;
  font-size: 0.75rem;
  font-weight: 750;
}

.student-password-summary {
  height: 46px;
  min-height: 46px;
  padding: 4px 5px 4px 12px;
  background: #fbfcfe;
}

body[data-page="teacher"] .student-edit-form > .form-grid > label {
  display: grid;
  grid-template-rows: 18px 46px;
  align-content: start;
  gap: 6px;
}

body[data-page="teacher"] .student-edit-form > .form-grid > label > input,
body[data-page="teacher"] .student-edit-form > .form-grid > label > select {
  height: 46px;
}

.student-password-summary > strong {
  overflow: hidden;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-picker-options {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  max-height: 236px;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.student-picker-options > label {
  min-height: 48px;
}

.student-picker-options input[type="checkbox"],
.test-option-row input[type="checkbox"],
:is(body[data-page="student"], .student-preview) .test-options input[type="radio"],
:is(body[data-page="student"], .student-preview) .test-options input[type="checkbox"] {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 17px !important;
  min-width: 17px;
  height: 17px !important;
  min-height: 17px !important;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50%;
  outline-offset: 3px;
  background: transparent !important;
  box-shadow: none !important;
  accent-color: #2f5bff;
}

.student-picker-options input[type="checkbox"],
.test-option-row input[type="checkbox"],
:is(body[data-page="student"], .student-preview) .test-options input[type="checkbox"] { border-radius: 4px; }

body[data-page="teacher"] .compact-cards,
body[data-page="teacher"] .compact-card-grid,
body[data-page="teacher"] .material-grid {
  align-items: stretch;
}

body[data-page="teacher"] .test-card:not([open]),
body[data-page="teacher"] .homework-card:not([open]),
body[data-page="teacher"] .material-card:not([open]) {
  min-height: 92px;
}

body[data-page="teacher"] .test-card:not([open]) > summary,
body[data-page="teacher"] .homework-card:not([open]) > summary,
body[data-page="teacher"] .material-card:not([open]) > summary {
  height: 100%;
  min-height: 92px;
}

body[data-page="teacher"] .test-card:not([open]) > summary strong,
body[data-page="teacher"] .homework-card:not([open]) > summary strong,
body[data-page="teacher"] .material-card:not([open]) > summary strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-page="teacher"] .compact-card-grid > .lesson-card[open],
body[data-page="teacher"] .lesson-grid > .lesson-card[open] {
  grid-column: auto;
  width: 100%;
  max-width: none;
}

body[data-page="teacher"] .homework-grid > .homework-card[open],
body[data-page="teacher"] .test-grid > .test-card[open],
body[data-page="teacher"] .material-grid > .material-card[open],
body[data-page="teacher"] .compact-cards > .homework-card[open],
body[data-page="teacher"] .compact-cards > .test-card[open],
body[data-page="teacher"] .compact-cards > .material-card[open] {
  grid-column: auto;
  width: 100%;
  max-width: none;
}

body[data-page="teacher"] .lesson-card-details,
body[data-page="teacher"] .lesson-edit-form,
body[data-page="teacher"] .lesson-edit-form .form-grid {
  width: 100%;
  min-width: 0;
  max-width: none;
}

body[data-page="teacher"] .lesson-card-details {
  box-sizing: border-box;
  margin-inline: 0;
  padding: 16px;
}

body[data-page="teacher"] .lesson-edit-form input,
body[data-page="teacher"] .lesson-edit-form select,
body[data-page="teacher"] .lesson-edit-form textarea {
  width: 100%;
  min-width: 0;
}

body[data-page="teacher"] .lesson-card-cue {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #d9e2ef;
  border-radius: 50%;
  background: #fff;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

body[data-page="teacher"] .lesson-card-cue i {
  position: absolute;
  display: block;
  width: 8px;
  height: 1.5px;
  border-radius: 2px;
  background: #66768d;
  transition: transform 180ms ease;
}

body[data-page="teacher"] .lesson-card-cue i:first-child { transform: translateX(-2.5px) rotate(45deg); }
body[data-page="teacher"] .lesson-card-cue i:last-child { transform: translateX(2.5px) rotate(-45deg); }
body[data-page="teacher"] .lesson-card[open] .lesson-card-cue {
  border-color: #b8c9ff;
  background: #eef3ff;
  transform: none;
}
body[data-page="teacher"] .lesson-card[open] .lesson-card-cue i:first-child { transform: translateX(-2.5px) rotate(-45deg); }
body[data-page="teacher"] .lesson-card[open] .lesson-card-cue i:last-child { transform: translateX(2.5px) rotate(45deg); }

.inline-image-attachment {
  display: block;
  width: min(100%, 580px);
}

.inline-image-attachment img {
  height: clamp(260px, 34vw, 380px);
  object-fit: contain;
  background: #f1f4f8;
}

.file-row:has(.inline-image-attachment) {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr);
  align-items: start;
}

.file-row:has(.inline-image-attachment) .inline-image-attachment {
  justify-self: start;
}

.achievement-edit-form {
  overflow: hidden;
}

.achievement-edit-fields input,
.goal-inline input {
  width: 100%;
  min-width: 0;
}

.analytics-toolbar-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.analytics-toolbar-actions label { min-width: min(280px, 52vw); }
.analytics-toolbar-actions .icon-button { flex: 0 0 auto; margin-bottom: 1px; }

@media (max-width: 1100px) {
  body[data-page="teacher"] .cabinet-topbar,
  :is(body[data-page="student"], .student-preview) .cabinet-topbar {
    grid-template-columns: minmax(190px, 0.8fr) minmax(240px, 1.2fr) auto;
    gap: 12px;
  }

  body[data-page="teacher"] .student-card-summary {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  body[data-page="teacher"] .student-card-summary .student-summary-meta {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }

  body[data-page="teacher"] .student-card-summary .summary-cue { grid-column: 3; grid-row: 1; }
}

@media (max-width: 900px) {
  body[data-page="teacher"] .cabinet-topbar,
  :is(body[data-page="student"], .student-preview) .cabinet-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cabinet-global-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .cabinet-global-search input { min-height: 40px; }
  body[data-page="teacher"] .student-directory-grid { grid-template-columns: 1fr; }
  body[data-page="teacher"] .student-directory-grid > .student-card[open] { grid-column: auto; }
}

@media (max-width: 700px) {
  .file-row:has(.inline-image-attachment) { grid-template-columns: 1fr; }
  .inline-image-attachment img { height: min(72vw, 320px); }
  .achievement-edit-form { grid-template-columns: 30px minmax(0, 1fr); }
  .achievement-edit-actions { grid-column: 2; justify-content: flex-start; }
  body[data-page="teacher"] .lesson-card > summary { grid-template-columns: 54px minmax(0, 1fr) 24px; }
  body[data-page="teacher"] .lesson-card-label { display: none; }
}

@media (max-width: 900px) {
  body[data-page="landing"] .topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
  }

  body[data-page="landing"] .topbar .brand {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
  }

  body[data-page="landing"] .topbar .brand > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="landing"] .topbar .menu-button {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    width: 42px;
    min-width: 42px;
    margin: 0;
  }

  body[data-page="landing"] .topbar .main-nav,
  body[data-page="landing"] .topbar .topbar-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .student-picker-options { grid-template-columns: 1fr; max-height: 230px; }
  .student-picker-toolbar { flex-wrap: wrap; }
  .student-picker-toolbar span { flex-basis: 100%; }
  .test-option-row { grid-template-columns: 20px minmax(0, 1fr); }
  .test-option-row > span { display: none; }
  .inline-image-attachment { width: 100%; }
  .inline-image-attachment img { height: min(72vw, 320px); }
  .image-preview-backdrop { padding: 10px; }
  .image-preview-dialog { width: 100%; max-height: 92vh; }
  .student-password-summary { grid-column: 1 / -1; }
}

/* Keep expandable schedule groups consistent with lesson cards. */
body[data-page="teacher"] .compact-list > summary::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: 14px;
  border-right: 1.5px solid #66768d;
  border-bottom: 1.5px solid #66768d;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 180ms ease, border-color 180ms ease;
}

body[data-page="teacher"] .compact-list[open] > summary::after {
  content: "";
  border-color: var(--cabinet-accent);
  transform: rotate(225deg) translate(-2px, -2px);
}

/* A single master-detail workspace keeps student management predictable. */
.student-management-head small {
  display: block;
  margin-top: 5px;
  color: #7a879a;
  font-size: 0.74rem;
  font-weight: 550;
}

.student-workspace {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.student-directory-panel,
.student-workspace-card,
.student-workspace-empty {
  overflow: hidden;
  border: 1px solid #dce4ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(25, 42, 74, 0.045);
}

.student-directory-panel {
  position: sticky;
  top: 88px;
}

.student-directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid #e4e9f1;
  color: #243249;
  font-size: 0.78rem;
}
.student-directory-head span {
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  border-radius: 7px;
  background: #eef3ff;
  color: #315ed4;
  font-weight: 800;
}
.student-directory-list {
  display: grid;
  gap: 4px;
  max-height: min(590px, calc(100vh - 245px));
  overflow-y: auto;
  padding: 8px;
}
.student-directory-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 58px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #26344a;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.student-directory-item:hover { background: #f6f8fc; }
.student-directory-item.active { border-color: #bfd0ff; background: #eef3ff; }
.student-directory-item .avatar { width: 38px; height: 38px; border-radius: 9px; }
.student-directory-item > span:nth-child(2) { min-width: 0; }
.student-directory-item strong,
.student-directory-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-directory-item strong { font-size: 0.75rem; }
.student-directory-item small { margin-top: 3px; color: #78859a; font-size: 0.63rem; }
.student-directory-item > b { font-size: 0.72rem; }
.student-directory-item > b.grade-good { color: #198754; }
.student-directory-item > b.grade-warning { color: #b77909; }
.student-directory-item > b.grade-danger { color: #c33f59; }
.student-directory-item > b.grade-neutral { color: #7d899b; }
.student-directory-panel .collection-footer { padding: 9px 10px; border-top: 1px solid #e4e9f1; }

.student-workspace-main { min-width: 0; }
.student-workspace-header {
  display: grid;
  grid-template-columns: 54px minmax(150px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f1;
}
.student-workspace-header .avatar { width: 54px; height: 54px; border-radius: 11px; }
.student-workspace-header h3 { margin: 0; color: #1d2a40; font-size: 1.08rem; }
.student-workspace-header p { margin: 4px 0 0; color: #758198; font-size: 0.72rem; }
.student-workspace-stats { display: flex; align-items: center; gap: 4px; }
.student-workspace-stats span { min-width: 78px; padding: 7px 9px; border-radius: 8px; background: #f4f7fb; text-align: center; }
.student-workspace-stats strong,
.student-workspace-stats small { display: block; }
.student-workspace-stats strong { color: #22324a; font-size: 0.88rem; }
.student-workspace-stats small { margin-top: 2px; color: #7b889c; font-size: 0.58rem; }
.student-workspace-stats .grade-good { background: #edf9f2; }
.student-workspace-stats .grade-good strong { color: #198754; }
.student-workspace-stats .grade-warning { background: #fff7df; }
.student-workspace-stats .grade-warning strong { color: #a66a09; }
.student-workspace-stats .grade-danger { background: #fff0f2; }
.student-workspace-stats .grade-danger strong { color: #be3552; }

.student-workspace-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 14px 0;
  border-bottom: 1px solid #e2e8f1;
  overflow-x: auto;
}
.student-workspace-tabs button {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #748198;
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}
.student-workspace-tabs button.active { border-bottom-color: #315fdf; color: #244fc1; }
.student-workspace-content { min-width: 0; padding: 16px 18px 20px; }
.student-profile-form { padding: 0 !important; border: 0 !important; background: #fff !important; box-shadow: none !important; }
.student-profile-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.student-workspace-content > .achievement-manager { margin: 0; border-color: #dce4ef; }
.student-workspace-content > .achievement-manager > summary { display: none; }
.student-workspace-content > .achievement-manager > .achievement-manager-body { border-top: 0; }
.analytics-page-embedded { gap: 14px; }
.analytics-page-embedded .analytics-summary { margin: 0; }
.analytics-inline-head { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; color: #26344a; }
.analytics-inline-head span { color: #315fda; font-size: 0.75rem; font-weight: 800; }
.student-workspace-empty { display: grid; justify-items: start; gap: 8px; padding: 28px; }
.student-workspace-empty p { margin: 0 0 8px; color: #748198; }

@media (max-width: 1120px) {
  .student-workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .student-workspace-header { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .student-workspace-header .avatar { width: 48px; height: 48px; }
  .student-workspace-stats { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .cabinet-search-result { grid-template-columns: 86px minmax(0, 1fr) 14px; }
  .student-workspace { grid-template-columns: 1fr; }
  .student-directory-panel { position: static; }
  .student-directory-list { max-height: 250px; }
  .student-workspace-header { grid-template-columns: 46px minmax(0, 1fr); padding: 14px; }
  .student-workspace-header > .outline-button { grid-column: 1 / -1; width: 100%; }
  .student-workspace-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .student-workspace-stats span { min-width: 0; }
  .student-workspace-content { padding: 14px; }
  .student-profile-actions { align-items: stretch; flex-direction: column; }
}

/* Dedicated student test workspace */
:is(body[data-page="student"], .student-preview) .student-test-workspace { width: min(100%, 1180px); margin: 0 auto; animation: cabinet-section-in 260ms ease both; }
.student-test-hero { position: relative; min-height: 210px; overflow: hidden; padding: 28px 32px; border: 1px solid #d9e2f2; border-radius: 8px; color: #f8fbff; background: #142340; box-shadow: 0 18px 50px rgba(23, 42, 76, .12); }
.test-back-button { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; color: #cdd8eb; background: transparent; font: inherit; font-weight: 700; cursor: pointer; }
.test-back-button:hover { color: #fff; }
.student-test-hero-copy { position: relative; z-index: 1; max-width: 720px; margin-top: 34px; }
.student-test-hero-copy h2 { max-width: 760px; margin: 7px 0 18px; color: #fff; font-family: Manrope, Inter, Arial, sans-serif; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: 0; }
.student-test-hero .student-home-kicker { color: #8fb0ff; }
.student-test-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.student-test-meta span { padding: 7px 11px; border: 1px solid rgba(255,255,255,.14); border-radius: 6px; color: #dce5f4; background: rgba(255,255,255,.06); font-size: 13px; font-weight: 700; }
.student-test-hero-mark { position: absolute; inset: 0 0 0 auto; width: 38%; opacity: .7; pointer-events: none; }
.student-test-hero-mark span { position: absolute; color: rgba(255,255,255,.22); font: 600 56px Georgia, serif; }
.student-test-hero-mark span:nth-child(1) { top: 28px; right: 22%; }
.student-test-hero-mark span:nth-child(2) { top: 102px; right: 49%; font-size: 42px; }
.student-test-hero-mark span:nth-child(3) { right: 10%; bottom: 18px; font-size: 76px; }
.student-test-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; margin-top: 20px; }
.student-test-main, .student-test-form { display: grid; gap: 16px; min-width: 0; }
.student-test-question-card { min-width: 0; margin: 0; padding: 24px; border: 1px solid #dbe3ef; border-left: 4px solid #3263e8; border-radius: 8px; background: #fff; box-shadow: 0 10px 28px rgba(28,48,82,.055); transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.student-test-question-card:focus-within { border-color: #9db7ff; border-left-color: #3263e8; box-shadow: 0 14px 34px rgba(50,99,232,.11); transform: translateY(-1px); }
.student-test-question-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; align-items: start; margin-bottom: 20px; }
.student-test-question-head > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: #fff; background: #3263e8; font-weight: 800; }
.student-test-question-head small { color: #70809a; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.student-test-question-head h3 { margin: 4px 0 0; color: #17233a; font-size: 19px; line-height: 1.35; }
.student-test-question-head > b { padding: 6px 9px; border-radius: 6px; color: #2755c7; background: #edf3ff; white-space: nowrap; font-size: 12px; }
.student-test-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.student-test-choice-grid label { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 58px; padding: 10px 14px; overflow: hidden; border: 1px solid #dbe3ef; border-radius: 7px; color: #24324a; background: #fbfcff; cursor: pointer; transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.student-test-choice-grid label:hover { border-color: #9ab4f8; background: #f5f8ff; }
.student-test-choice-grid label:has(input:checked) { border-color: #3263e8; background: #eef3ff; box-shadow: inset 0 0 0 1px #3263e8; }
.student-test-choice-grid input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.student-test-choice-control { display: grid; width: 18px; height: 18px; place-items: center; border: 1.5px solid #b7c4d8; border-radius: 50%; background: #fff; }
.student-test-question-card.is-multiple .student-test-choice-control { border-radius: 5px; }
.student-test-choice-grid label:has(input:checked) .student-test-choice-control { border: 5px solid #3263e8; }
.student-test-question-card.is-multiple .student-test-choice-grid label:has(input:checked) .student-test-choice-control { border-width: 1.5px; background: #3263e8; }
.student-test-question-card.is-multiple .student-test-choice-grid label:has(input:checked) .student-test-choice-control::after { content: ""; width: 7px; height: 4px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.student-test-choice-grid label > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.student-test-question-card .test-answer-hint { margin: -8px 0 12px 52px; color: #70809a; font-size: 13px; }
.student-test-text-answer, .student-test-file-answer { display: grid; gap: 7px; color: #52627a; font-weight: 700; }
.student-test-text-answer textarea { min-height: 118px; resize: vertical; }
.student-test-file-answer { padding: 16px; border: 1px dashed #b9c8de; border-radius: 7px; background: #f8faff; }
.student-test-file-answer small { color: #7a879b; font-weight: 500; }
.student-test-attachment { display: grid; gap: 8px; margin: 0 0 18px 52px; color: #65758d; font-size: 13px; font-weight: 700; }
.student-test-attachment .inline-image-attachment { width: min(100%, 620px); }
.student-test-attachment .inline-image-attachment img { height: clamp(240px, 38vw, 430px); object-fit: contain; background: #f4f7fb; }
.student-test-aside { position: sticky; top: 86px; display: grid; gap: 14px; }
.student-test-progress-card, .student-test-info-card, .student-test-tip, .student-test-history, .student-test-state { border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; box-shadow: 0 10px 28px rgba(28,48,82,.05); }
.student-test-progress-card, .student-test-info-card, .student-test-tip { padding: 20px; }
.student-test-progress-card h3, .student-test-info-card h3 { margin: 0 0 16px; color: #17233a; font-size: 16px; }
.student-test-progress-ring { display: grid; width: 126px; height: 126px; margin: 4px auto 14px; place-content: center; border-radius: 50%; text-align: center; background: radial-gradient(circle at center, #fff 62%, transparent 64%), conic-gradient(#3263e8 calc(var(--test-progress) * 1%), #e8edf5 0); }
.student-test-progress-ring strong { color: #17233a; font-size: 26px; }
.student-test-progress-ring span { color: #78869a; font-size: 12px; }
.student-test-progress-card > p { margin: 0; color: #65758d; text-align: center; font-size: 13px; }
.student-test-progress-track { height: 5px; margin-top: 12px; overflow: hidden; border-radius: 5px; background: #e8edf5; }
.student-test-progress-track i { display: block; width: 0; height: 100%; background: #3263e8; transition: width 180ms ease; }
.student-test-info-card dl { display: grid; gap: 0; margin: 0; }
.student-test-info-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #edf1f6; }
.student-test-info-card dt { color: #718098; }
.student-test-info-card dd { margin: 0; color: #17233a; font-weight: 800; text-align: right; }
.student-test-tip { border-color: #cddcff; background: #f3f7ff; }
.student-test-tip strong { color: #2855c5; }
.student-test-tip p { margin: 7px 0 0; color: #5f6f87; font-size: 13px; line-height: 1.5; }
.student-test-history { display: flex; justify-content: space-between; gap: 16px; padding: 15px 18px; }
.student-test-history div { display: flex; flex-wrap: wrap; gap: 7px; }
.student-test-history span { padding: 4px 8px; border-radius: 5px; color: #51617a; background: #eef2f8; font-size: 12px; font-weight: 700; }
.student-test-submit { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px 22px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; }
.student-test-submit div { display: grid; gap: 4px; }
.student-test-submit span { color: #718098; font-size: 13px; }
.student-test-state { display: flex; gap: 18px; align-items: center; padding: 28px; }
.student-test-state > span { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 50%; color: #2855c5; background: #edf3ff; font-size: 22px; }
.student-test-state h3 { margin: 0 0 5px; }
.student-test-state p { margin: 0; color: #718098; }
.student-test-list-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) 130px auto; gap: 14px; align-items: center; padding: 17px 18px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.student-test-list-card:hover { border-color: #b9cae7; box-shadow: 0 10px 26px rgba(35,57,92,.07); transform: translateY(-1px); }
.student-test-list-status { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 8px; color: #2b5ad0; background: #edf3ff; font-weight: 800; }
.student-test-list-status.complete { color: #167454; background: #eaf7f0; }
.student-test-list-status.review { color: #a05d13; background: #fff5e8; }
.student-test-list-main { min-width: 0; }
.student-test-list-main h4 { margin: 7px 0 3px; overflow: hidden; color: #17233a; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.student-test-list-main p { margin: 0; color: #718098; font-size: 13px; }
.student-test-list-result { display: grid; gap: 2px; text-align: right; }
.student-test-list-result strong { color: #17233a; }
.student-test-list-result small { color: #8793a6; }

/* Pricing editor */
.pricing-settings { width: 100%; margin-top: 14px; padding: 0; overflow: hidden; }
.pricing-settings-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 22px 24px; }
.pricing-settings > summary { list-style: none; cursor: pointer; }
.pricing-settings > summary::-webkit-details-marker { display: none; }
.pricing-settings > summary::marker { content: ""; }
.pricing-settings-head h3 { margin: 4px 0; color: #18243a; }
.pricing-settings-head span { color: #718098; font-size: 14px; }
.pricing-settings-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pricing-settings-stats span { display: inline-flex; align-items: baseline; gap: 5px; min-height: 30px; padding: 5px 8px; border: 1px solid #dce4ef; border-radius: 7px; background: #f7f9fc; color: #65738a; white-space: nowrap; }
.pricing-settings-stats strong { color: #1d2a3f; font-size: 15px; }
.pricing-settings-stats i { width: 10px; height: 10px; margin-left: 2px; border-right: 2px solid #70819a; border-bottom: 2px solid #70819a; transform: rotate(45deg) translateY(-2px); transition: transform .18s ease; }
.pricing-settings[open] .pricing-settings-stats i { transform: rotate(225deg) translate(-1px, -1px); }
.pricing-editor { display: grid; gap: 18px; padding: 22px 24px 26px; border-top: 1px solid #e0e6ef; background: #f8faff; }
.pricing-editor[hidden] { display: none; }
.pricing-category-list { display: grid; gap: 12px; }
.pricing-category-editor { overflow: hidden; border: 1px solid #dce4ef; border-radius: 8px; background: #fff; }
.pricing-compact-form { display: flex; gap: 10px; align-items: end; padding: 14px; }
.pricing-compact-form label { flex: 1; min-width: 180px; }
.pricing-category-edit { border-bottom: 1px solid #e7ecf3; }
.pricing-plan-editor-list { display: grid; gap: 1px; background: #e7ecf3; }
.pricing-plan-row { display: grid; grid-template-columns: 1.1fr 120px 130px minmax(180px, 1.5fr) auto auto; gap: 10px; align-items: end; padding: 14px; background: #fff; }
.pricing-plan-row label, .pricing-plan-form label { min-width: 0; color: #65738a; font-size: 12px; font-weight: 700; }
.pricing-plan-row input, .pricing-plan-form input, .pricing-plan-form select, .pricing-plan-form textarea { margin-top: 6px; }
.pricing-featured-field { display: flex; gap: 7px; align-items: center; min-height: 44px; white-space: nowrap; }
.pricing-featured-field input { width: 18px; height: 18px; margin: 0; }
.pricing-row-actions { display: flex; gap: 7px; }
.pricing-empty { margin: 0; padding: 18px; color: #7a8799; background: #fff; }
.pricing-plan-create { padding: 20px; border: 1px solid #dce4ef; border-radius: 8px; background: #fff; }
.pricing-form-heading { margin-bottom: 16px; }
.pricing-form-heading h4 { margin: 0 0 4px; color: #18243a; }
.pricing-form-heading span { color: #718098; font-size: 13px; }
.pricing-plan-fields { display: grid; grid-template-columns: 1fr 1.2fr 130px 140px; gap: 12px; align-items: end; }
.pricing-plan-fields .pricing-description-field { grid-column: span 3; }
.pricing-plan-create > .dark-button { margin-top: 14px; }
body[data-page="landing"] .landing-pricing { display: grid; gap: 28px; }
body[data-page="landing"] .landing-pricing .trial-price-block { max-width: 520px; }
body[data-page="landing"] .landing-pricing .trial-price-block .price-grid { grid-template-columns: 1fr; }
.pricing-public-empty { padding: 22px; border: 1px solid #dde3eb; border-radius: 8px; color: #65738a; background: #fff; }

@media (max-width: 1050px) {
  .student-test-layout { grid-template-columns: minmax(0, 1fr) 230px; }
  .pricing-plan-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pricing-plan-row .pricing-description-field { grid-column: span 2; }
  .pricing-plan-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pricing-plan-fields .pricing-description-field { grid-column: span 2; }
}
@media (max-width: 780px) {
  .pricing-settings-head { align-items: flex-start; flex-direction: column; }
  .pricing-settings-stats { justify-content: flex-start; }
  .student-test-hero { min-height: 190px; padding: 22px 20px; }
  .student-test-hero-copy { margin-top: 26px; }
  .student-test-hero-copy h2 { font-size: 30px; }
  .student-test-hero-mark { display: none; }
  .student-test-layout { grid-template-columns: 1fr; }
  .student-test-aside { position: static; grid-row: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-test-tip { display: none; }
  .student-test-progress-ring { width: 98px; height: 98px; }
  .student-test-question-card { padding: 18px 16px; }
  .student-test-question-head { grid-template-columns: 34px minmax(0, 1fr); }
  .student-test-question-head > span { width: 34px; height: 34px; }
  .student-test-question-head > b { grid-column: 2; justify-self: start; }
  .student-test-choice-grid { grid-template-columns: 1fr; }
  .student-test-attachment { margin-left: 0; }
  .student-test-submit { align-items: stretch; flex-direction: column; }
  .student-test-submit button { width: 100%; }
  .student-test-list-card { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .student-test-list-result { display: none; }
  .pricing-settings-head { align-items: flex-start; padding: 18px; }
  .pricing-editor { padding: 16px; }
  .pricing-compact-form { align-items: stretch; flex-direction: column; }
  .pricing-compact-form label { min-width: 0; }
  .pricing-plan-row, .pricing-plan-fields { grid-template-columns: 1fr 1fr; }
  .pricing-plan-row .pricing-description-field, .pricing-plan-fields .pricing-description-field { grid-column: 1 / -1; }
  .pricing-row-actions { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .student-test-aside { grid-template-columns: 1fr; }
  .student-test-info-card { display: none; }
  .student-test-list-card { grid-template-columns: 36px minmax(0, 1fr); }
  .student-test-list-card > button { grid-column: 1 / -1; width: 100%; }
  .student-test-list-status { width: 36px; height: 36px; }
  .student-test-meta span { font-size: 12px; }
  .student-test-question-head h3 { font-size: 17px; }
  .pricing-settings-head { flex-direction: column; }
  .pricing-plan-row, .pricing-plan-fields { grid-template-columns: 1fr; }
  .pricing-plan-row .pricing-description-field, .pricing-plan-fields .pricing-description-field { grid-column: auto; }
  .pricing-featured-field, .pricing-row-actions { grid-column: auto; }
}

/* Keep detailed attempt cards isolated from the legacy compact history row. */
.student-test-main .student-test-history {
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  gap: 12px;
  padding: 0;
}

.student-test-main .student-test-history span {
  background: transparent;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  padding: 0;
}

.student-test-main .student-test-history .student-test-history-title {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.student-test-main .student-test-history .student-test-history-title > span {
  align-items: center;
  background: #eaf0ff;
  border-radius: 50%;
  color: #2f5ee8;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.student-test-main .student-attempt-result > summary span,
.student-test-main .student-attempt-question-head > div,
.student-test-main .ai-explanation-card header > div,
.student-test-main .ai-explanation-card > div:not(header),
.student-test-main .ai-explanation-loading > div {
  display: grid;
}

.student-test-main .student-attempt-question-list { display: grid; }
.student-test-main .student-attempt-question-head { display: grid; }
.student-test-main .ai-help-row { display: flex; }
.student-test-main .ai-explanation-card { display: grid; }

.student-test-main .student-attempt-question-head > span:first-child {
  align-items: center;
  background: #edf2ff;
  border-radius: 50%;
  color: #2f5ee8;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  padding: 0;
}

.student-test-main .student-attempt-question .attempt-grade-status {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 9px;
}

.student-test-main .student-attempt-question.is-correct .attempt-grade-status { background: #e7f6ef; color: #207b58; }
.student-test-main .student-attempt-question.is-wrong .attempt-grade-status { background: #fdecef; color: #ad3345; }
.student-test-main .ai-explanation-card header > span { background: #2f5ee8; border-radius: 7px; color: #fff; padding: 0; }

/* Compact student tests and conversational Math AI */
:is(body[data-page="student"], .student-preview) .student-test-workspace { width: min(100%, 940px); }
.student-test-compact-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 12px 28px;
  min-height: 0;
  padding: 20px 22px;
  overflow: visible;
  border-color: #dce4ef;
  color: #17243a;
  background: #fff;
  box-shadow: 0 10px 30px rgba(25, 45, 78, .055);
}
.student-test-compact-head .test-back-button { grid-column: 1 / -1; color: #45617f; font-size: 13px; }
.student-test-compact-head .test-back-button:hover { color: #2459d8; }
.student-test-compact-head .student-test-hero-copy { max-width: none; margin: 0; }
.student-test-compact-head .student-home-kicker { margin: 0 0 4px; color: #2f61df; }
.student-test-compact-head .student-test-hero-copy h2 { margin: 0 0 12px; color: #17243a; font-size: clamp(23px, 3vw, 31px); line-height: 1.18; }
.student-test-compact-head .student-test-meta span { padding: 0; border: 0; color: #708097; background: transparent; font-size: 12px; }
.student-test-compact-head .student-test-meta span + span::before { content: "·"; margin-right: 8px; color: #b0bac8; }
.student-test-inline-progress { align-self: end; display: grid; gap: 8px; }
.student-test-inline-progress > div:first-child { display: flex; justify-content: space-between; gap: 12px; color: #718097; font-size: 12px; }
.student-test-inline-progress strong { color: #214fc1; font-size: 13px; }
.student-test-inline-progress [data-test-progress-ring] { display: none; }
.student-test-inline-progress .student-test-progress-track { height: 6px; margin: 0; }
.student-test-main { margin-top: 14px; }
.student-test-form { gap: 10px; }

.student-test-question-card {
  padding: 17px 18px;
  border-left-width: 1px;
  border-radius: 8px;
  box-shadow: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.student-test-question-card:focus-within { border-color: #9cb4eb; border-left-color: #9cb4eb; box-shadow: 0 0 0 3px rgba(47, 97, 223, .08); transform: none; }
.student-test-question-head { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 11px; margin-bottom: 13px; }
.student-test-question-head > span { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }
.student-test-question-head small { font-size: 10px; letter-spacing: 0; }
.student-test-question-head h3 { margin-top: 2px; font-size: 16px; line-height: 1.42; }
.student-test-question-head > b { padding: 4px 7px; font-size: 11px; }
.student-test-choice-grid { gap: 7px; }
.student-test-choice-grid label { min-height: 46px; padding: 7px 10px; border-radius: 7px; background: #fff; }
.student-test-choice-control { width: 18px; height: 18px; }
.student-test-question-card .test-answer-hint { margin: -4px 0 9px 41px; font-size: 12px; }
.student-test-text-answer textarea { min-height: 82px; }
.student-test-file-answer { padding: 12px; }
.student-test-attachment { margin: 0 0 12px 41px; }
.student-test-attachment .inline-image-attachment img { height: clamp(190px, 32vw, 340px); }
.student-test-submit { padding: 12px 14px; border-radius: 8px; }
.student-test-submit .accent-button { min-height: 40px; padding: 9px 16px; }

.student-test-main .student-test-history { gap: 8px; margin-bottom: 4px; }
.student-test-main .student-test-history .student-test-history-title { margin-bottom: 2px; }
.student-test-history-title > div { display: grid; gap: 2px; }
.student-test-history-title > div > strong { color: #1c2a40; font-size: 15px; }
.student-test-history-title > div > small { color: #7b8799; font-size: 12px; font-weight: 500; }
.student-attempt-result { border-color: #dfe6ef; box-shadow: none; }
.student-attempt-result > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; gap: 14px; min-height: 58px; padding: 10px 13px; }
.attempt-summary-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.student-test-main .student-test-history .attempt-summary-main > span { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 8px; color: #315fce; background: #edf3ff; font-size: 12px; font-weight: 800; }
.attempt-summary-main > div, .attempt-summary-score { display: grid; gap: 1px; }
.attempt-summary-main strong { color: #25334a; font-size: 14px; }
.attempt-summary-main small, .attempt-summary-score small { color: #8490a2; font-size: 11px; font-weight: 500; }
.attempt-summary-score { text-align: right; }
.attempt-summary-score strong { color: #244fb8; font-size: 14px; }
.student-attempt-result > summary > i { width: 8px; height: 8px; align-self: center; border-right: 2px solid #8794a8; border-bottom: 2px solid #8794a8; transform: rotate(45deg); transition: transform 160ms ease; }
.student-attempt-result[open] > summary > i { transform: rotate(225deg); }
.student-attempt-result[open] > summary { border-bottom-color: #e8edf4; background: #fbfcfe; }
.student-attempt-question { padding: 14px 15px; border-left: 0 !important; }
.student-attempt-question-head { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 9px; }
.student-test-main .student-attempt-question-head > span:first-child { width: 26px; height: 26px; border-radius: 7px; }
.student-attempt-task { gap: 9px; margin: 10px 0; padding: 11px 12px; border: 0; background: #f7f9fc; }
.student-test-main .student-attempt-task,
.student-test-main .student-attempt-task-options,
.student-test-main .student-attempt-task-options > div { display: grid; }
.student-attempt-task-text { font-size: 14px; line-height: 1.45; }
.student-attempt-task-options { gap: 5px; }
.student-attempt-task-options > div { min-height: 40px; padding: 6px 8px; }

.ai-help-row { gap: 10px; margin-top: 10px; padding: 10px 11px; border-color: #dce6fb; background: #f7f9fe; }
.ai-help-row::before { content: "∑"; display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 8px; color: #fff; background: #2f63df; font-weight: 850; }
.ai-help-row > div { margin-right: auto; }
.ai-help-row > div strong { font-size: 13px; }
.ai-help-row > div small { font-size: 11px; }
.ai-help-row .outline-button { min-height: 34px; padding: 7px 10px; font-size: 12px; }

.ai-explanation-card.math-ai-message { gap: 12px; padding: 14px; border-color: #dce4f1; box-shadow: 0 8px 24px rgba(30, 52, 91, .065); }
.math-ai-message header { align-items: center; }
.math-ai-message header > div { gap: 1px; }
.math-ai-message header strong { color: #1d2d46; font-size: 15px; }
.math-ai-message header small { color: #718198; font-size: 11px; font-weight: 600; }
.math-ai-content { display: grid; gap: 9px; padding-left: 54px; }
.math-ai-sections { display: grid; gap: 8px; }
.math-ai-section { display: grid; gap: 7px; padding: 10px 12px; border: 1px solid #e0e8f4; border-radius: 8px; background: #fbfcff; }
.math-ai-section.is-main { border-left: 3px solid #2f63df; background: #f5f8ff; }
.math-ai-section.is-mistake { border-left: 3px solid #d95867; background: #fff8f9; }
.math-ai-section.is-steps { border-left: 3px solid #6d86c6; }
.math-ai-section.is-answer { border-left: 3px solid #7759d6; background: #faf9ff; }
.math-ai-section.is-check { border-left: 3px solid #25a06d; background: #f7fcfa; }
.math-ai-section h4 { margin: 0; color: #1d2d46; font-size: 12px; font-weight: 800; letter-spacing: .01em; }
.math-ai-section > div { display: grid; gap: 5px; }
.math-ai-section p { margin: 0; color: #34445d; font-size: 14px; line-height: 1.55; white-space: normal; }
.math-ai-section .math-ai-step { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-items: start; }
.math-ai-section .math-ai-step b { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #2f63df; background: #eaf0ff; font-size: 11px; }
.ai-unavailable-card { max-width: 520px; padding: 13px 14px; background: #f8fafd; }
.ai-unavailable-card > .math-ai-avatar { flex-basis: 38px; width: 38px !important; height: 38px !important; }

@media (max-width: 720px) {
  .student-test-compact-head { grid-template-columns: 1fr; padding: 16px; }
  .student-test-compact-head .student-test-hero-copy h2 { font-size: 23px; }
  .student-test-question-card { padding: 14px 12px; }
  .student-test-question-head { grid-template-columns: 28px minmax(0, 1fr); }
  .student-test-question-head > span { width: 28px; height: 28px; }
  .student-test-question-head > b { grid-column: 2; justify-self: start; }
  .student-test-choice-grid { grid-template-columns: 1fr; }
  .student-test-submit { align-items: stretch; flex-direction: column; }
  .student-test-submit button { width: 100%; }
  .student-attempt-result > summary { grid-template-columns: minmax(0, 1fr) auto 14px; gap: 8px; }
  .student-attempt-question-head { grid-template-columns: 26px minmax(0, 1fr); }
  .student-attempt-question-head .attempt-grade-status { grid-column: 2; }
  .math-ai-content { padding-left: 0; }
  .ai-help-row::before { display: none; }
}

/* Focused test workspace: compact questions and a recognizable Math AI assistant */
:is(body[data-page="student"], .student-preview) .student-test-main {
  padding: 0;
  background: transparent;
}

:is(body[data-page="student"], .student-preview) .student-test-form {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid #e0e7f0;
  border-radius: 10px;
  background: #f4f7fb;
}

:is(body[data-page="student"], .student-preview) .student-test-question-card {
  position: relative;
  margin: 0;
  padding: 16px 17px 17px;
  overflow: hidden;
  border: 1px solid #d7e1ed;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(31, 49, 78, .045);
}

:is(body[data-page="student"], .student-preview) .student-test-question-card:focus-within {
  border-color: #93afe9;
  box-shadow: 0 0 0 3px rgba(47, 97, 223, .08), 0 8px 22px rgba(31, 49, 78, .06);
}

:is(body[data-page="student"], .student-preview) .student-test-question-head {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0 0 12px;
  align-items: start;
}

:is(body[data-page="student"], .student-preview) .student-test-question-head > span {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 11px;
}

:is(body[data-page="student"], .student-preview) .student-test-question-head small {
  color: #7b8799;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}

:is(body[data-page="student"], .student-preview) .student-test-question-head h3 {
  margin: 2px 0 0;
  color: #1d2b40;
  font-size: 15px;
  line-height: 1.42;
}

:is(body[data-page="student"], .student-preview) .student-test-question-head > b {
  align-self: start;
  padding: 4px 7px;
  border-radius: 6px;
  color: #466388;
  background: #f0f4f9;
  font-size: 10px;
}

:is(body[data-page="student"], .student-preview) .student-test-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

:is(body[data-page="student"], .student-preview) .student-test-choice-grid label {
  min-height: 42px;
  padding: 7px 9px;
  border-color: #dde5ef;
  border-radius: 7px;
  color: #28384f;
  background: #fbfcfe;
  font-size: 13px;
}

:is(body[data-page="student"], .student-preview) .student-test-choice-grid label:hover {
  border-color: #a9bee9;
  background: #f7f9ff;
}

:is(body[data-page="student"], .student-preview) .student-test-choice-grid label:has(input:checked) {
  border-color: #6f93ed;
  background: #f0f4ff;
  box-shadow: inset 0 0 0 1px #6f93ed;
}

:is(body[data-page="student"], .student-preview) .student-test-question-card .test-answer-hint {
  margin: -3px 0 9px 38px;
  color: #718098;
  font-size: 11px;
}

:is(body[data-page="student"], .student-preview) .student-test-attachment {
  margin: 0 0 12px 38px;
}

:is(body[data-page="student"], .student-preview) .student-test-attachment > span,
:is(body[data-page="student"], .student-preview) .student-attempt-task-file > span {
  display: block;
  margin-bottom: 6px;
  color: #7a8799;
  font-size: 10px;
  font-weight: 750;
  text-transform: none;
}

:is(body[data-page="student"], .student-preview) .student-test-attachment .inline-image-attachment,
:is(body[data-page="student"], .student-preview) .student-attempt-task-file .inline-image-attachment {
  max-width: 680px;
}

:is(body[data-page="student"], .student-preview) .student-test-attachment .inline-image-attachment img,
:is(body[data-page="student"], .student-preview) .student-attempt-task-file .inline-image-attachment img {
  width: 100%;
  height: clamp(190px, 28vw, 310px);
  object-fit: contain;
  background: #f4f7fb;
}

:is(body[data-page="student"], .student-preview) .student-test-history {
  margin-bottom: 14px;
}

:is(body[data-page="student"], .student-preview) .student-attempt-result {
  overflow: hidden;
  border: 1px solid #dbe4ef;
  border-radius: 9px;
  background: #fff;
}

:is(body[data-page="student"], .student-preview) .student-attempt-result[open] > summary {
  border-bottom: 1px solid #e2e8f1;
  background: #f8fafe;
}

:is(body[data-page="student"], .student-preview) .student-attempt-question-list {
  gap: 12px;
  padding: 12px;
  background: #f3f6fa;
}

:is(body[data-page="student"], .student-preview) .student-attempt-question {
  padding: 13px 14px;
  overflow: hidden;
  border: 1px solid #dde5ef;
  border-radius: 8px;
  background: #fff;
}

:is(body[data-page="student"], .student-preview) .student-attempt-question.is-correct {
  box-shadow: inset 3px 0 #32a36f;
}

:is(body[data-page="student"], .student-preview) .student-attempt-question.is-wrong {
  box-shadow: inset 3px 0 #e05a69;
}

:is(body[data-page="student"], .student-preview) .student-attempt-question.is-manual {
  box-shadow: inset 3px 0 #8b98ab;
}

:is(body[data-page="student"], .student-preview) .student-attempt-question-head {
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
}

:is(body[data-page="student"], .student-preview) .student-attempt-question-head strong {
  color: #26354a;
  font-size: 13px;
  line-height: 1.4;
}

:is(body[data-page="student"], .student-preview) .student-attempt-question-head small {
  margin-top: 2px;
  color: #76849a;
  font-size: 11px;
}

:is(body[data-page="student"], .student-preview) .student-attempt-task {
  gap: 8px;
  margin: 10px 0 0 35px;
  padding: 0;
  border: 0;
  background: transparent;
}

:is(body[data-page="student"], .student-preview) .student-attempt-task-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

:is(body[data-page="student"], .student-preview) .student-attempt-task-options > div {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid #e0e6ef;
  border-radius: 7px;
  background: #fbfcfe;
}

:is(body[data-page="student"], .student-preview) .student-attempt-task-options > div.is-selected {
  border-color: #7c9aef;
  background: #f0f4ff;
}

:is(body[data-page="student"], .student-preview) .ai-help-row {
  align-items: center;
  gap: 9px;
  margin: 11px 0 0 35px;
  padding: 9px 10px;
  border: 1px solid #d9e4fb;
  border-radius: 8px;
  background: #f7f9ff;
}

:is(body[data-page="student"], .student-preview) .ai-help-row::before {
  display: none !important;
  content: none;
}

:is(body[data-page="student"], .student-preview) .ai-help-row > div {
  display: block;
  min-width: 0;
  margin-right: auto;
}

:is(body[data-page="student"], .student-preview) .ai-help-row > div strong {
  color: #22344e;
  font-size: 12px;
}

.math-ai-avatar {
  position: relative;
  display: grid !important;
  flex: 0 0 42px;
  width: 42px !important;
  height: 42px !important;
  place-items: center;
  overflow: visible;
  isolation: isolate;
  padding: 2px;
  border: 0 !important;
  border-radius: 13px 13px 13px 5px !important;
  color: #214fc7 !important;
  background: conic-gradient(from 218deg, #315fe8, #29a9e6, #20b99a, #f2ba45, #ef6a82, #735bd9, #315fe8) !important;
  box-shadow: 0 7px 18px rgba(47, 97, 223, .18);
}

.math-ai-avatar::before {
  position: absolute;
  z-index: 0;
  inset: 2px;
  border-radius: 11px 11px 11px 4px;
  background: #f9fbff;
  box-shadow: inset 0 -6px 12px rgba(65, 94, 170, .08);
  content: "";
}

.math-ai-avatar::after {
  position: absolute;
  z-index: -1;
  bottom: -3px;
  left: 5px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #315fe8;
  content: "";
  transform: rotate(32deg);
}

.math-ai-avatar b {
  position: relative;
  z-index: 1;
  transform: translateY(-1px);
  color: #214fc7;
  font: 800 25px/1 Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.math-ai-avatar em {
  position: absolute;
  z-index: 2;
  right: -6px;
  bottom: -5px;
  display: grid;
  min-width: 19px;
  height: 16px;
  padding: 0 3px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 7px;
  color: #fff;
  background: #172b5d;
  box-shadow: 0 3px 8px rgba(29, 56, 112, .14);
  font: 800 8px/1 Inter, Arial, sans-serif;
  font-style: normal;
  letter-spacing: .02em;
}

.math-ai-avatar i {
  position: absolute;
  z-index: 2;
  top: 7px;
  right: 7px;
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: #1db69a;
  box-shadow: -5px 5px 0 #f0b744, 0 10px 0 #ee6683;
}

.math-ai-avatar.is-compact {
  flex-basis: 30px;
  width: 30px !important;
  height: 30px !important;
  border-radius: 9px 9px 9px 4px !important;
  padding: 2px;
  box-shadow: 0 4px 11px rgba(47, 97, 223, .16);
}

.math-ai-avatar.is-compact b {
  font-size: 19px;
}

.math-ai-avatar.is-compact em {
  right: -6px;
  bottom: -5px;
  transform: scale(.82);
  transform-origin: bottom right;
}

.math-ai-avatar.is-compact i {
  top: 5px;
  right: 5px;
  transform: scale(.78);
  transform-origin: top right;
}

:is(body[data-page="student"], .student-preview) .ai-explanation-slot:not(:empty) {
  margin: 10px 0 0 35px;
}

@media (max-width: 720px) {
  :is(body[data-page="student"], .student-preview) .student-test-form {
    gap: 12px;
    padding: 10px;
  }

  :is(body[data-page="student"], .student-preview) .student-test-question-card {
    padding: 13px 12px 14px;
  }

  :is(body[data-page="student"], .student-preview) .student-test-question-head {
    grid-template-columns: 27px minmax(0, 1fr);
  }

  :is(body[data-page="student"], .student-preview) .student-test-question-head > b {
    grid-column: 2;
    justify-self: start;
  }

  :is(body[data-page="student"], .student-preview) .student-test-choice-grid,
  :is(body[data-page="student"], .student-preview) .student-attempt-task-options {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="student"], .student-preview) .student-test-attachment,
  :is(body[data-page="student"], .student-preview) .student-attempt-task,
  :is(body[data-page="student"], .student-preview) .ai-help-row,
  :is(body[data-page="student"], .student-preview) .ai-explanation-slot:not(:empty) {
    margin-left: 0;
  }

  :is(body[data-page="student"], .student-preview) .student-attempt-question-head {
    grid-template-columns: 25px minmax(0, 1fr);
  }

  :is(body[data-page="student"], .student-preview) .student-attempt-question-head .attempt-grade-status {
    grid-column: 2;
    justify-self: start;
  }

  :is(body[data-page="student"], .student-preview) .ai-help-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  :is(body[data-page="student"], .student-preview) .ai-help-row .outline-button {
    width: auto;
  }
}

/* Neutral student settings */
:is(body[data-page="student"], .student-preview) .student-settings-page {
  max-width: 860px;
}

:is(body[data-page="student"], .student-preview) .student-settings-page .settings-panel {
  padding: 22px;
  border: 1px solid #dce4ef;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(29, 48, 79, .05);
}

:is(body[data-page="student"], .student-preview) .settings-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

:is(body[data-page="student"], .student-preview) .settings-info-grid > span {
  padding: 12px 13px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #f7f9fc;
}

:is(body[data-page="student"], .student-preview) .settings-info-grid small {
  color: #758299;
}

:is(body[data-page="student"], .student-preview) .settings-info-grid strong {
  color: #1d2a3f;
}

/* Layered pricing editor: categories and plans stay compact until needed */
body[data-page="teacher"] .pricing-settings {
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #fff;
}

body[data-page="teacher"] .pricing-settings-head {
  min-height: 70px;
  padding: 13px 16px;
}

body[data-page="teacher"] .pricing-settings-head h3 {
  margin: 2px 0;
  font-size: 1rem;
}

body[data-page="teacher"] .pricing-settings-head > div:first-child > span {
  font-size: 0.75rem;
}

body[data-page="teacher"] .pricing-editor {
  gap: 10px;
  padding: 11px 12px 13px;
  background: #f7f9fc;
}

body[data-page="teacher"] .pricing-category-list {
  gap: 6px;
}

body[data-page="teacher"] .pricing-category-editor,
body[data-page="teacher"] .pricing-plan-editor,
body[data-page="teacher"] .pricing-create-section {
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
}

body[data-page="teacher"] .pricing-category-editor > summary,
body[data-page="teacher"] .pricing-plan-editor > summary,
body[data-page="teacher"] .pricing-create-section > summary {
  list-style: none;
  cursor: pointer;
}

body[data-page="teacher"] .pricing-category-editor > summary::-webkit-details-marker,
body[data-page="teacher"] .pricing-plan-editor > summary::-webkit-details-marker,
body[data-page="teacher"] .pricing-create-section > summary::-webkit-details-marker {
  display: none;
}

body[data-page="teacher"] .pricing-category-summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
}

body[data-page="teacher"] .pricing-category-summary > span,
body[data-page="teacher"] .pricing-plan-editor > summary > span:first-child,
body[data-page="teacher"] .pricing-create-section > summary > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

body[data-page="teacher"] .pricing-category-summary strong,
body[data-page="teacher"] .pricing-plan-editor > summary strong,
body[data-page="teacher"] .pricing-create-section > summary strong {
  color: #1b2940;
  font-size: 14px;
}

body[data-page="teacher"] .pricing-category-summary small,
body[data-page="teacher"] .pricing-plan-editor > summary small,
body[data-page="teacher"] .pricing-create-section > summary small {
  overflow: hidden;
  color: #7a8799;
  font-size: 11px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="teacher"] .pricing-category-summary > i,
body[data-page="teacher"] .pricing-plan-editor > summary > i,
body[data-page="teacher"] .pricing-create-section > summary > i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 2px solid #8390a3;
  border-bottom: 2px solid #8390a3;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

body[data-page="teacher"] details[open] > summary > i {
  transform: rotate(225deg);
}

body[data-page="teacher"] .pricing-category-editor[open] > .pricing-category-summary {
  border-bottom: 1px solid #e2e8f0;
  background: #fafbfd;
}

body[data-page="teacher"] .pricing-category-body {
  padding: 10px;
}

body[data-page="teacher"] .pricing-category-edit {
  margin-bottom: 10px;
  padding: 0 0 12px;
  border-bottom: 1px solid #e4e9f0;
}

body[data-page="teacher"] .pricing-plan-editor-list {
  gap: 5px;
  background: transparent;
}

body[data-page="teacher"] .pricing-plan-editor > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 10px;
  gap: 14px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
}

body[data-page="teacher"] .pricing-plan-editor[open] > summary {
  border-bottom: 1px solid #e2e8f0;
  background: #f9fbfe;
}

body[data-page="teacher"] .pricing-plan-price {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

body[data-page="teacher"] .pricing-plan-price b {
  color: #1c2a40;
  font-size: 14px;
}

body[data-page="teacher"] .pricing-plan-price del {
  color: #8b96a6;
  font-size: 11px;
}

body[data-page="teacher"] .pricing-plan-price em {
  padding: 3px 6px;
  border-radius: 5px;
  color: #2859c7;
  background: #eaf0ff;
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}

body[data-page="teacher"] .pricing-plan-row {
  grid-template-columns: minmax(150px, 1.1fr) 110px 120px minmax(180px, 1.5fr);
  gap: 8px;
  padding: 10px;
  background: #fff;
}

body[data-page="teacher"] .pricing-plan-row .pricing-description-field {
  grid-column: auto;
}

body[data-page="teacher"] .pricing-plan-row .pricing-featured-field {
  grid-column: 1 / 3;
}

body[data-page="teacher"] .pricing-plan-row .pricing-row-actions {
  grid-column: 3 / 5;
  justify-self: end;
}

body[data-page="teacher"] .pricing-create-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

body[data-page="teacher"] .pricing-create-section > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
}

body[data-page="teacher"] .pricing-create-section[open] > summary {
  border-bottom: 1px solid #e2e8f0;
  background: #f9fbfe;
}

body[data-page="teacher"] .pricing-create-section .pricing-compact-form,
body[data-page="teacher"] .pricing-create-section .pricing-plan-form {
  padding: 10px;
}

body[data-page="teacher"] .pricing-create-section .pricing-plan-create {
  border: 0;
  border-radius: 0;
}

body[data-page="teacher"] .pricing-create-section .pricing-plan-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page="teacher"] .pricing-create-section .pricing-description-field {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  body[data-page="teacher"] .pricing-plan-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="teacher"] .pricing-plan-row .pricing-featured-field,
  body[data-page="teacher"] .pricing-plan-row .pricing-row-actions {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  :is(body[data-page="student"], .student-preview) .settings-info-grid,
  body[data-page="teacher"] .pricing-create-tools,
  body[data-page="teacher"] .pricing-plan-row,
  body[data-page="teacher"] .pricing-create-section .pricing-plan-fields {
    grid-template-columns: 1fr;
  }

  body[data-page="teacher"] .pricing-settings-head,
  body[data-page="teacher"] .pricing-editor {
    padding-right: 14px;
    padding-left: 14px;
  }

  body[data-page="teacher"] .pricing-plan-editor > summary {
    grid-template-columns: minmax(0, 1fr) 10px;
  }

  body[data-page="teacher"] .pricing-plan-price {
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
  }

  body[data-page="teacher"] .pricing-plan-editor > summary > i {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  body[data-page="teacher"] .pricing-plan-row .pricing-featured-field,
  body[data-page="teacher"] .pricing-plan-row .pricing-row-actions,
  body[data-page="teacher"] .pricing-create-section .pricing-description-field {
    grid-column: auto;
  }
}

/* Form rails: large test editors must retain a breathing edge at every width. */
body[data-page="teacher"] .test-card,
body[data-page="teacher"] .test-card[open],
body[data-page="teacher"] .test-card[open] .test-edit-form,
body[data-page="teacher"] .test-card[open] .test-question-list,
body[data-page="teacher"] .test-card[open] .test-question-builder,
body[data-page="teacher"] .test-card[open] .test-question-body,
body[data-page="teacher"] .test-card[open] .test-question-prompt,
body[data-page="teacher"] .test-card[open] .test-question-config {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

body[data-page="teacher"] .test-card[open] .test-edit-form {
  width: auto;
  margin: 0;
  padding: 16px;
}

body[data-page="teacher"] .test-card[open] .test-edit-form .form-grid,
body[data-page="teacher"] .test-card[open] .test-question-config {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page="teacher"] .test-card[open] .test-question-prompt {
  grid-template-columns: minmax(0, 1fr);
}

body[data-page="teacher"] .test-card[open] .form-grid > *,
body[data-page="teacher"] .test-card[open] .test-question-prompt > *,
body[data-page="teacher"] .test-card[open] .test-question-config > *,
body[data-page="teacher"] .test-card[open] label,
body[data-page="teacher"] .test-card[open] input,
body[data-page="teacher"] .test-card[open] select,
body[data-page="teacher"] .test-card[open] textarea {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 820px) {
  body[data-page="teacher"] .test-card[open] .test-edit-form {
    padding: 14px;
  }

  body[data-page="teacher"] .test-card[open] .test-edit-form .form-grid,
  body[data-page="teacher"] .test-card[open] .test-question-prompt,
  body[data-page="teacher"] .test-card[open] .test-question-config {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Final cabinet integrity pass: no card or form may expand the page canvas. */
body[data-page="teacher"] #dashboardContent,
:is(body[data-page="student"], .student-preview) #dashboardContent,
body[data-page="teacher"] #dashboardContent > *,
:is(body[data-page="student"], .student-preview) #dashboardContent > * {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

body[data-page="teacher"] #dashboardContent :where(.data-card, .form-panel, .collapsible-card, .lesson-card, .homework-card, .test-card, .material-card, form, fieldset, details, .form-grid, .settings-grid, .button-row, .file-row),
:is(body[data-page="student"], .student-preview) #dashboardContent :where(.data-card, .form-panel, .collapsible-card, .lesson-card, .homework-card, .test-card, .material-card, form, fieldset, details, .form-grid, .settings-grid, .button-row, .file-row) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

body[data-page="teacher"] #dashboardContent :where(.form-grid, .settings-grid, .test-question-list, .test-question-builder, .test-question-body, .test-question-prompt, .test-question-config, .button-row) > *,
:is(body[data-page="student"], .student-preview) #dashboardContent :where(.form-grid, .settings-grid, .button-row) > * {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

body[data-page="teacher"] #dashboardContent :where(h2, h3, h4, p, li, label, strong, small, .file-name, .break-link),
:is(body[data-page="student"], .student-preview) #dashboardContent :where(h2, h3, h4, p, li, label, strong, small, .file-name, .break-link) {
  overflow-wrap: anywhere;
}

body[data-page="teacher"] #dashboardContent :where(input, select, textarea),
:is(body[data-page="student"], .student-preview) #dashboardContent :where(input, select, textarea) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

body[data-page="teacher"] .test-editor-card .test-question-fold > summary.test-question-head,
body[data-page="teacher"] .test-builder .test-question-fold > summary.test-question-head {
  box-sizing: border-box;
  grid-template-columns: 30px minmax(0, 1fr) minmax(0, auto);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

body[data-page="teacher"] .test-question-head > div,
body[data-page="teacher"] .test-question-head-meta {
  min-width: 0;
  max-width: 100%;
}

body[data-page="teacher"] .test-question-head-meta {
  justify-content: flex-end;
  overflow: hidden;
}

body[data-page="teacher"] .test-question-type {
  min-width: 0;
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page="teacher"] #dashboardContent :where(.button-row, .form-actions, .test-edit-actions, .test-question-add-row) {
  flex-wrap: wrap;
}

body[data-page="teacher"] #dashboardContent :where(.table-wrap, .analytics-table-wrap),
:is(body[data-page="student"], .student-preview) #dashboardContent :where(.table-wrap, .analytics-table-wrap) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

@media (max-width: 760px) {
  .file-drop-hint { font-size: 0.62rem; }
  body[data-page="teacher"] .test-question-head-meta { max-width: 94px; }
  body[data-page="teacher"] .test-question-type { max-width: 60px; }
}

/* Compact record interaction: lists stay scannable, editing lives in a focused dialog. */
body.record-dialog-open {
  overflow: hidden;
}

details.modal-detail-source {
  position: relative;
}

details.modal-detail-source > summary {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  cursor: pointer;
  list-style: none;
}

details.modal-detail-source > summary::-webkit-details-marker,
details.analytics-lesson-card > summary::-webkit-details-marker {
  display: none;
}

details.modal-detail-source > summary::marker,
details.analytics-lesson-card > summary::marker {
  content: "";
}

details.modal-detail-source > summary:focus-visible,
.week-lesson[role="button"]:focus-visible {
  outline: 3px solid rgba(49, 95, 234, 0.24);
  outline-offset: 3px;
}

.record-actions {
  position: relative;
  z-index: 4;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  margin-left: auto;
}

.record-more-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid #dce3ef;
  border-radius: 7px;
  color: #536178;
  background: #fff;
  font: 800 12px/1 Inter, sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.record-more-button:hover,
.record-more-button[aria-expanded="true"] {
  border-color: #aabcea;
  color: #2459d9;
  background: #f3f7ff;
}

.record-action-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 15;
  display: grid;
  width: max-content;
  min-width: 176px;
  max-width: min(250px, calc(100vw - 36px));
  padding: 6px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(24, 37, 61, 0.16);
}

.record-action-menu[hidden] {
  display: none;
}

.record-action-menu button {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  color: #27354b;
  background: transparent;
  font: 700 12px/1.3 Inter, sans-serif;
  text-align: left;
  cursor: pointer;
}

.record-action-menu button:hover {
  background: #f1f5fb;
}

.record-action-menu button.is-danger {
  color: #b0374d;
}

.record-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  box-sizing: border-box;
  padding: clamp(18px, 3vw, 42px);
  place-items: center;
  background: rgba(18, 29, 48, 0.44);
  backdrop-filter: blur(5px);
  animation: record-backdrop-in 170ms ease both;
}

.record-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(720px, 100%);
  max-height: min(88vh, 920px);
  overflow: hidden;
  border: 1px solid rgba(218, 226, 239, 0.96);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(15, 28, 51, 0.24);
  animation: record-dialog-in 190ms cubic-bezier(.2, .8, .2, 1) both;
}

.student-indicators-card { display: grid; gap: 14px; min-width: 0; padding: 16px; border: 1px solid #dce4ef; border-radius: 10px; background: #fff; box-shadow: 0 9px 24px rgba(31, 52, 84, .04); }
.student-indicators-card.is-compact { padding: 14px; }
.student-indicators-card .student-panel-head { margin: 0; }
.exam-score-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 8px; border-radius: 7px; color: #6a43b8; background: #f1ecff; font-size: 12px; font-weight: 800; white-space: nowrap; }
.grade-trend-chart { display: grid; grid-template-columns: 24px minmax(0, 1fr); grid-template-rows: 168px auto; column-gap: 9px; row-gap: 8px; min-width: 0; padding: 8px 2px 0; }
.grade-trend-axis { display: flex; grid-row: 1; flex-direction: column; justify-content: space-between; padding: 0 0 1px; color: #8290a4; font-size: 10px; font-weight: 700; text-align: right; }
.grade-trend-plot { position: relative; grid-column: 2; grid-row: 1; min-width: 0; border-bottom: 1px solid #dce4ef; background: repeating-linear-gradient(to bottom, #edf1f6 0 1px, transparent 1px 33.33%); }
.grade-trend-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grade-trend-area { fill: #eef3ff; }
.grade-trend-line { fill: none; stroke: #3563db; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.grade-trend-point { position: absolute; left: var(--trend-x); bottom: var(--trend-y); width: 14px; height: 14px; transform: translate(-50%, 50%); }
.grade-trend-point i { display: block; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: #3563db; box-shadow: 0 0 0 2px #3563db; }
.grade-trend-point b { position: absolute; left: 50%; bottom: calc(100% + 7px); padding: 2px 5px; border-radius: 5px; background: #fff; color: #23304a; box-shadow: 0 2px 8px rgba(35, 48, 74, .12); font-size: 11px; line-height: 1.25; transform: translateX(-50%); white-space: nowrap; }
.grade-trend-point.is-low i { background: #cf4059; box-shadow: 0 0 0 2px #cf4059; }
.grade-trend-point.is-mid i { background: #d69a1f; box-shadow: 0 0 0 2px #d69a1f; }
.grade-trend-point.is-high i { background: #278d66; box-shadow: 0 0 0 2px #278d66; }
.grade-trend-labels { display: grid; grid-column: 2; grid-row: 2; grid-template-columns: repeat(var(--trend-columns), minmax(0, 1fr)); min-width: 0; }
.grade-trend-labels small { overflow: hidden; padding: 0 4px; color: #77859a; font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.grade-trend-details { border-top: 1px solid #e5ebf3; }
.grade-trend-details > summary { padding-top: 11px; color: #2e5cd6; font-size: 12px; font-weight: 800; cursor: pointer; }
.grade-trend-details > div { display: grid; gap: 8px; margin-top: 10px; }
.grade-trend-detail { display: grid; gap: 4px; padding: 9px 10px; border: 1px solid #e3e9f2; border-radius: 8px; background: #fafcff; }
.grade-trend-detail header, .grade-trend-detail p { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 0; }
.grade-trend-detail header { grid-template-columns: minmax(0, 1fr) auto; }
.grade-trend-detail header strong { color: #26344b; font-size: 12px; }
.grade-trend-detail p { color: #65748b; font-size: 12px; }
.grade-trend-detail p span { color: #7b899c; }
.grade-trend-detail p strong { overflow: hidden; color: #34425a; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.grade-trend-detail p b { color: #2b5bd7; }
.exam-score-note { margin: -4px 0 0; color: #748198; font-size: 12px; }

body[data-page="teacher"] .analytics-page-embedded .analytics-lesson-list { gap: 10px; }
body[data-page="teacher"] .analytics-page-embedded .analytics-lesson-head { min-height: 76px; padding: 11px 14px; }
body[data-page="teacher"] .analytics-page-embedded .analytics-lesson-head time { min-height: 44px; }

@media (max-width: 640px) {
  .achievement-manager.is-standalone > header { padding: 12px; }
  .achievement-manager.is-standalone > header small { white-space: normal; }
  .grade-trend-chart { grid-template-rows: 142px auto; column-gap: 7px; }
  .grade-trend-labels small { font-size: 9px; }
  .grade-trend-point b { font-size: 10px; }
}

.record-dialog-backdrop.is-wide .record-dialog {
  width: min(1240px, 100%);
}

:is(body[data-page="student"], .student-preview) .lesson-row-badges {
  display: grid;
  justify-items: end;
  gap: 5px;
  max-width: 180px;
}

:is(body[data-page="student"], .student-preview) .lesson-grade {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 72px;
}

:is(body[data-page="student"], .student-preview) .lesson-grade em {
  font-style: normal;
  font-weight: 700;
}

:is(body[data-page="student"], .student-preview) .lesson-grade b {
  display: inline;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font-size: inherit !important;
}

.test-add-question-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #cbd9f6;
  border-radius: 50%;
  background: #f7faff;
  color: #315fea;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.test-add-question-button:hover,
.test-add-question-button:focus-visible {
  border-color: #315fea;
  background: #315fea;
  color: #fff;
}

.test-question-add-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 40px;
  margin: 4px 0 0 40px;
}

.test-question-add-row small {
  color: #72819a;
  font-size: 12px;
}

.test-edit-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #dfe7f3;
  border-radius: 10px;
  background: #fff;
}

.test-edit-section + .test-edit-section {
  margin-top: 12px;
}

.test-edit-section > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5ebf4;
}

.test-edit-section > header > div { display: grid; min-width: 0; gap: 3px; }
.test-edit-section > header strong { color: #203049; font-size: 13px; }
.test-edit-section > header > span { flex: 0 0 auto; padding: 4px 7px; border-radius: 6px; color: #566b89; background: #eef3fa; font-size: 11px; font-weight: 800; }

.test-edit-section > header small {
  display: block;
  margin-top: 3px;
  color: #71809a;
}

.publication-quick-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-left: 16px;
  border-left: 1px solid #e2e8f1;
  color: #64738b;
  font-size: 11px;
}

.publication-quick-control span { font-weight: 750; }
.publication-quick-control.is-draft span { color: #5e4b9d; }
.publication-quick-control select { min-width: 150px; min-height: 36px; border-color: #d5def0; color: #2856c7; background: #fff; }
.publication-quick-control.is-draft select { border-color: #c9c3e5; color: #5e4b9d; background: #fff; }

.test-deadline-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}
.test-deadline-badge.is-calm { background: #edf3ff; color: #355fc5; }
.test-deadline-badge.is-soon { background: #fff4dc; color: #9a6810; }
.test-deadline-badge.is-urgent { background: #ffe8df; color: #c4522e; }
.test-deadline-badge.is-late { background: #fde7ec; color: #b33755; }

.test-attempt-dialog-content,
.test-attempt-review { display: grid; gap: 12px; min-width: 0; }
.test-attempt-card { display: grid; gap: 0; overflow: hidden; border: 1px solid #dce4ef; border-radius: 10px; background: #fff; box-shadow: 0 8px 22px rgba(29, 49, 82, .05); }
.test-attempt-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #e6ebf3; background: #f8faff; }
.test-attempt-card > header > div { display: grid; gap: 2px; }
.test-attempt-card > header strong { color: #203049; font-size: 13px; }
.test-attempt-card > header small { color: #748299; font-size: 11px; }
.attempt-total { flex: 0 0 auto; padding: 5px 8px; border-radius: 7px; color: #18724f; background: #eaf7f1; font-size: 11px; font-weight: 800; }
.attempt-total.is-pending { color: #855ec2; background: #f2edfb; }
.test-attempt-question-review { display: grid; gap: 0; }
.test-attempt-answer { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 12px; min-width: 0; padding: 14px; border-top: 1px solid #e8edf4; border-left: 3px solid #9aa9bd; background: #fff; }
.test-attempt-answer:first-child { border-top: 0; }
.test-attempt-answer.is-correct { border-left-color: #39a36f; }
.test-attempt-answer.is-wrong { border-left-color: #d7586e; }
.test-attempt-answer.is-manual { border-left-color: #8066c9; }
.attempt-question-number { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 7px; color: #315dd2; background: #edf3ff; font-size: 11px; font-weight: 850; }
.test-attempt-answer-copy { display: grid; gap: 10px; min-width: 0; }
.test-attempt-task, .test-attempt-student-answer, .test-attempt-reference { display: grid; gap: 4px; min-width: 0; color: #26344b; line-height: 1.45; overflow-wrap: anywhere; }
.test-attempt-task > strong { font-size: 13px; font-weight: 700; }
.test-attempt-task small, .test-attempt-student-answer small, .test-attempt-reference small { color: #78869a; font-size: 10px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.test-attempt-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.test-attempt-student-answer, .test-attempt-reference { padding: 9px 10px; border: 1px solid #e1e7f0; border-radius: 7px; background: #f7f9fc; color: #16243b; }
.test-attempt-reference { background: #f4f8ff; }
.attempt-grade-status { display: grid; align-self: center; gap: 2px; padding: 6px 8px; border-radius: 7px; color: #51647e; background: #f1f4f8; font-size: 11px; font-style: normal; font-weight: 750; white-space: nowrap; }
.attempt-grade-status span { color: #7a879a; font-size: 10px; font-weight: 650; }
.manual-test-grade-form { display: flex; align-items: end; gap: 6px; padding: 8px; border: 1px solid #ddd6f0; border-radius: 8px; background: #faf9fd; }
.manual-test-grade-form label { display: grid; gap: 4px; color: #61708a; font-size: 11px; }
.manual-test-grade-form input { width: 68px; min-height: 32px; }
.manual-test-grade-form > span { align-self: center; color: #77859a; font-size: 11px; }
.manual-test-grade-form .outline-button { min-height: 32px; padding: 5px 9px; font-size: 11px; }

.test-builder-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; box-sizing: border-box; width: 100%; margin: 0; padding: 12px 16px; border-top: 1px solid #e2e8f1; background: #fff; }
.test-action-primary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.test-builder-actions .publication-quick-control { margin-left: auto; }

@media (max-width: 700px) {
  :is(body[data-page="student"], .student-preview) .lesson-row-badges { justify-items: start; max-width: none; }
  .publication-quick-control { width: 100%; margin: 8px 0 0; }
  .test-edit-actions { flex-wrap: wrap; }
  .manual-test-grade-form { grid-column: 1 / -1; }
  .test-attempt-comparison { grid-template-columns: 1fr; }
  .test-attempt-answer { grid-template-columns: 28px minmax(0, 1fr); }
  .test-attempt-answer > :last-child { grid-column: 2; justify-self: start; }
}

.record-dialog-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #e3e8f1;
  background: #fff;
}

.record-dialog-head > div {
  min-width: 0;
}

.record-dialog-head span {
  display: block;
  margin-bottom: 4px;
  color: #2f63df;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.record-dialog-head h3 {
  max-width: 100%;
  margin: 0;
  color: #18243a;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.record-dialog-head p {
  margin: 5px 0 0;
  color: #748096;
  font-size: 12px;
  line-height: 1.45;
}

.record-dialog-head .icon-button {
  flex: 0 0 auto;
  border-color: #dbe3ef;
  color: #526077;
  background: #f8faff;
}

.record-dialog-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.record-dialog-content {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 20px 28px 24px 22px;
  color: #1c2940;
  background: #fff;
}

.record-dialog-backdrop.is-wide .record-dialog-content {
  padding: 22px 44px 28px 28px;
}

.record-dialog-loading {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed #d7e2f1;
  border-radius: 8px;
  background: #f8fbff;
  color: #617088;
  font-weight: 800;
}

.record-dialog-content :where(form, fieldset, details, section, article, div, label, input, select, textarea, .form-grid, .file-row, .button-row) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.record-dialog-content :where(h2, h3, h4, p, strong, small, label, .file-name) {
  overflow-wrap: anywhere;
}

.record-dialog-content > :first-child {
  margin-top: 0;
}

.record-dialog-content > :last-child {
  margin-bottom: 0;
}

.record-dialog-content.lesson-card,
.record-dialog-content.homework-card,
.record-dialog-content.test-card,
.record-dialog-content.material-card,
.record-dialog-content.analytics-lesson-card,
.record-dialog-content.form-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.record-dialog-content .lesson-card-details,
.record-dialog-content .homework-row-body,
.record-dialog-content .test-editor-shell,
.record-dialog-content .analytics-feedback-dialog-body,
.record-dialog-content .lead-detail-body,
.record-dialog-content > form {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.lead-item.modal-detail-source {
  padding: 0;
  overflow: visible;
}

.lead-item.modal-detail-source > summary {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
}

.lead-item.modal-detail-source > summary strong,
.lead-item.modal-detail-source > summary small {
  display: block;
}

.lead-item.modal-detail-source > summary small {
  margin-top: 4px;
  color: #77849a;
}

.record-dialog-content .inline-edit,
.record-dialog-content.test-card .test-edit-form,
.record-dialog-content.form-panel > form {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.record-dialog-content.test-card .test-editor-shell,
.record-dialog-content.analytics-lesson-card .analytics-feedback-dialog-body {
  padding: 0;
}

.record-dialog-content .test-card-overview {
  margin-bottom: 16px;
}

.record-dialog-content .test-question-fold > summary {
  cursor: pointer;
}

.week-lesson[role="button"] {
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.week-lesson[role="button"]:hover {
  transform: translateY(-2px);
  border-color: #b8c8ef;
  box-shadow: 0 10px 24px rgba(31, 53, 91, 0.1);
}

.analytics-lesson-card > summary {
  list-style: none;
  cursor: pointer;
}

.record-math-copy,
.homework-row-description {
  min-width: 0;
  color: #495873;
  line-height: 1.58;
}

.record-math-copy p,
.homework-row-description p {
  margin: 0;
}

.math-rich-output {
  font-variant-numeric: lining-nums;
}

.test-ai-explanation-fields,
.test-teacher-explanation-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid #dce4f0;
  border-radius: 8px;
  background: #f8faff;
}

.test-ai-explanation-fields[hidden],
.test-teacher-explanation-fields[hidden] {
  display: none;
}

.teacher-test-explanation {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 15px;
  border: 1px solid #d8e2ef;
  border-left: 3px solid #2d63e6;
  border-radius: 8px;
  background: #f8faff;
}

.teacher-test-explanation header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.teacher-test-explanation header > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #2d63e6;
  font-weight: 800;
}

.teacher-test-explanation header strong,
.teacher-test-explanation header small {
  display: block;
}

.teacher-test-explanation header small {
  margin-top: 2px;
  color: #758199;
}

@keyframes record-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes record-dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .record-dialog-backdrop,
  .record-dialog,
  .week-lesson[role="button"] {
    animation: none;
    transition: none;
  }
}

@media (max-width: 720px) {
  .record-dialog-backdrop {
    align-items: end;
    padding: 0;
  }

  .record-dialog,
  .record-dialog-backdrop.is-wide .record-dialog {
    width: 100%;
    max-height: min(92dvh, 920px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 12px 12px 0 0;
  }

  .record-dialog-head {
    padding: 15px 16px;
  }

  .record-dialog-content {
    padding: 16px;
  }

  .record-action-menu {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    padding: 8px;
  }

  .record-action-menu button {
    min-height: 44px;
  }

  .test-ai-explanation-fields,
  .test-teacher-explanation-fields {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }
}

/* Unified cabinet design system: compact, neutral and predictable across every section. */
body[data-page="teacher"],
:is(body[data-page="student"], .student-preview) {
  --cabinet-bg: #f3f6fa;
  --cabinet-surface: #ffffff;
  --cabinet-surface-soft: #f8fafc;
  --cabinet-border: #dce4ef;
  --cabinet-border-strong: #cbd7e7;
  --cabinet-text: #17243a;
  --cabinet-muted: #6c7a90;
  --cabinet-accent: #315fea;
  --cabinet-accent-soft: #edf2ff;
  --cabinet-green: #16845f;
  --cabinet-green-soft: #ebf7f1;
  --cabinet-warning: #b96d12;
  --cabinet-danger: #c33f59;
  background: var(--cabinet-bg);
  color: var(--cabinet-text);
}

body[data-page="teacher"] .cabinet-topbar,
:is(body[data-page="student"], .student-preview) .cabinet-topbar {
  grid-template-columns: minmax(210px, auto) minmax(280px, 620px) auto;
  min-height: 64px;
  gap: 18px;
  padding-inline: clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--cabinet-border);
  background: rgba(255, 255, 255, .97);
  box-shadow: none;
}

body[data-page="teacher"] .cabinet-topbar .brand,
:is(body[data-page="student"], .student-preview) .cabinet-topbar .brand {
  min-width: 0;
  gap: 9px;
  color: var(--cabinet-text);
  font-size: 13px;
}

body[data-page="teacher"] .cabinet-topbar .brand-mark,
:is(body[data-page="student"], .student-preview) .cabinet-topbar .brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 8px;
}

body[data-page="teacher"] .app-shell.standalone,
:is(body[data-page="student"], .student-preview) .app-shell.standalone {
  grid-template-columns: 210px minmax(0, 1fr);
  width: min(100%, 1480px);
  gap: 24px;
  align-items: start;
  padding: 22px clamp(16px, 3vw, 40px) 42px;
}

body[data-page="teacher"] .app-shell.standalone .sidebar,
:is(body[data-page="student"], .student-preview) .app-shell.standalone .sidebar {
  top: 82px;
  padding: 12px;
  border: 1px solid var(--cabinet-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(28, 45, 75, .045);
}

body[data-page="teacher"] .app-shell.standalone .profile-box,
:is(body[data-page="student"], .student-preview) .app-shell.standalone .profile-box {
  gap: 10px;
  margin: 0 0 8px;
  padding: 7px 6px 13px;
  border-bottom: 1px solid var(--cabinet-border);
}

body[data-page="teacher"] .app-shell.standalone .profile-box .avatar,
:is(body[data-page="student"], .student-preview) .app-shell.standalone .profile-box .avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
}

body[data-page="teacher"] .dashboard-nav,
:is(body[data-page="student"], .student-preview) .dashboard-nav {
  gap: 2px;
}

body[data-page="teacher"] .dashboard-nav .nav-button,
:is(body[data-page="student"], .student-preview) .dashboard-nav .nav-button {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
}

body[data-page="teacher"] .dashboard-nav .nav-button.active,
:is(body[data-page="student"], .student-preview) .dashboard-nav .nav-button.active {
  box-shadow: inset 2px 0 0 var(--cabinet-accent);
}

body[data-page="teacher"] .sidebar-logout,
:is(body[data-page="student"], .student-preview) .sidebar-logout {
  min-height: 36px;
  margin-top: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--cabinet-border);
  color: #a9364c;
  font-size: 12px;
}

body[data-page="teacher"] .app-shell.standalone .dashboard,
:is(body[data-page="student"], .student-preview) .app-shell.standalone .dashboard {
  width: 100%;
  min-width: 0;
}

body[data-page="teacher"] .dashboard-head,
:is(body[data-page="student"], .student-preview) .dashboard-head {
  min-height: 58px;
  margin: 0 0 14px;
  padding: 0 2px 13px;
}

body[data-page="teacher"] .dashboard-head .eyebrow,
:is(body[data-page="student"], .student-preview) .dashboard-head .eyebrow,
body[data-page="teacher"] .student-home-kicker,
:is(body[data-page="student"], .student-preview) .student-home-kicker {
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: .02em;
}

body[data-page="teacher"] .dashboard-head h2,
:is(body[data-page="student"], .student-preview) .dashboard-head h2 {
  font-size: 30px;
  letter-spacing: 0;
}

body[data-page="teacher"] #dashboardContent,
:is(body[data-page="student"], .student-preview) #dashboardContent {
  display: grid;
  gap: 14px;
}

body[data-page="teacher"] #dashboardContent > *,
:is(body[data-page="student"], .student-preview) #dashboardContent > * {
  margin-top: 0;
  margin-bottom: 0;
}

body[data-page="teacher"] .dashboard :where(.data-card, .form-panel, .collapsible-card, .lesson-card, .homework-card, .test-card, .material-card, .lead-item, .student-card, .teacher-overview-panel, .teacher-welcome, .week-panel),
:is(body[data-page="student"], .student-preview) .dashboard :where(.data-card, .student-widget, .student-kpi-card, .student-achievements-card, .student-homework-row, .homework-side-card, .workspace-board, .student-test-list-card, .student-progress-lesson) {
  border-color: var(--cabinet-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(28, 45, 75, .035);
}

body[data-page="teacher"] .dashboard :where(input, select, textarea),
:is(body[data-page="student"], .student-preview) .dashboard :where(input, select, textarea) {
  min-height: 42px;
  padding: 9px 11px;
  border-color: var(--cabinet-border);
  border-radius: 7px;
  background: #fbfcfe;
  font-size: 13px;
  line-height: 1.4;
}

body[data-page="teacher"] .dashboard textarea,
:is(body[data-page="student"], .student-preview) .dashboard textarea {
  min-height: 76px;
}

body[data-page="teacher"] .dashboard :where(.form-grid, .settings-grid, .dense-form),
:is(body[data-page="student"], .student-preview) .dashboard :where(.form-grid, .settings-grid, .dense-form) {
  gap: 11px 13px;
}

body[data-page="teacher"] .dashboard :where(.form-grid > label, .settings-field),
:is(body[data-page="student"], .student-preview) .dashboard :where(.form-grid > label, .settings-field) {
  gap: 5px;
  color: #617088;
  font-size: 12px;
}

body[data-page="teacher"] .dashboard :where(.accent-button, .dark-button, .outline-button, .danger-button, .ghost-button, .light-button),
:is(body[data-page="student"], .student-preview) .dashboard :where(.accent-button, .dark-button, .outline-button, .danger-button, .ghost-button, .light-button) {
  min-height: 37px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12px;
}

body[data-page="teacher"] .dashboard details.form-panel > summary,
body[data-page="teacher"] .settings-student-create > summary {
  min-height: 56px;
  padding: 0 16px;
  font-size: 13px;
}

body[data-page="teacher"] .dashboard details.form-panel > summary::after {
  width: 26px;
  height: 26px;
}

body[data-page="teacher"] .dashboard details.form-panel > form,
body[data-page="teacher"] .settings-student-create > form {
  padding: 15px 16px 17px;
}

body[data-page="teacher"] .teacher-overview,
:is(body[data-page="student"], .student-preview) .student-home {
  gap: 14px;
}

body[data-page="teacher"] .teacher-welcome {
  min-height: 104px;
  padding: 18px 20px;
}

body[data-page="teacher"] .teacher-welcome h3 {
  font-size: 26px;
}

body[data-page="teacher"] .teacher-metric-grid {
  gap: 10px;
}

body[data-page="teacher"] .teacher-metric-card {
  min-height: 92px;
  gap: 7px;
  padding: 14px 15px;
  border-radius: 8px;
}

body[data-page="teacher"] .teacher-metric-card strong {
  font-size: 25px;
}

body[data-page="teacher"] .teacher-overview-columns {
  gap: 14px;
}

body[data-page="teacher"] .teacher-overview-panel {
  padding: 17px;
}

body[data-page="teacher"] .overview-panel-head {
  margin-bottom: 10px;
}

body[data-page="teacher"] .teacher-overview-lesson,
body[data-page="teacher"] .teacher-focus-item {
  min-height: 58px;
  padding-block: 7px;
}

body[data-page="teacher"] .teacher-overview-lesson time {
  width: 40px;
  height: 42px;
}

body[data-page="teacher"] .week-panel {
  border-radius: 8px;
}

body[data-page="teacher"] .week-toolbar {
  min-height: 68px;
  padding: 12px 15px;
}

body[data-page="teacher"] .week-grid {
  grid-template-columns: repeat(7, minmax(132px, 1fr));
}

body[data-page="teacher"] .week-lesson {
  min-height: 72px;
  padding: 9px;
  overflow: hidden;
}

body[data-page="teacher"] .collection-toolbar,
:is(body[data-page="student"], .student-preview) .collection-toolbar,
.collection-toolbar-compact {
  min-height: 50px;
  padding: 9px 11px;
  border-color: var(--cabinet-border);
  border-radius: 8px;
  background: #fff;
}

:is(body[data-page="student"], .student-preview) .student-home-top {
  min-height: 64px;
  padding: 0 2px 12px;
}

:is(body[data-page="student"], .student-preview) .student-home-top h3 {
  font-size: 29px;
}

:is(body[data-page="student"], .student-preview) .student-lesson-hero {
  grid-template-columns: minmax(0, 1.25fr) minmax(230px, .62fr);
  min-height: 210px;
  gap: 22px;
  padding: 24px 27px;
  border-radius: 8px;
  background: #17233a;
  box-shadow: 0 9px 28px rgba(20, 31, 52, .12);
}

:is(body[data-page="student"], .student-preview) .student-lesson-hero h3 {
  font-size: 32px;
}

:is(body[data-page="student"], .student-preview) .student-kpi-grid,
:is(body[data-page="student"], .student-preview) .student-widget-grid,
:is(body[data-page="student"], .student-preview) .student-bottom-grid {
  gap: 10px;
}

:is(body[data-page="student"], .student-preview) .student-kpi-card {
  min-height: 88px;
  padding: 13px 15px;
  border-top-width: 2px;
}

:is(body[data-page="student"], .student-preview) .student-kpi-card.grade { border-top-color: #4c78ec; }
:is(body[data-page="student"], .student-preview) .student-kpi-card.homework { border-top-color: #32a878; }
:is(body[data-page="student"], .student-preview) .student-kpi-card.tests { border-top-color: #7b68d8; }

:is(body[data-page="student"], .student-preview) .student-kpi-card strong {
  margin: 6px 0 3px;
  font-size: 21px;
}

.student-latest-feedback {
  display: grid;
  gap: 13px;
  padding: 15px 17px;
  border: 1px solid var(--cabinet-border);
  border-left: 3px solid #4c78ec;
  border-radius: 8px;
  background: #fff;
}

.student-latest-feedback > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.student-latest-feedback > header > div { display: grid; min-width: 0; gap: 2px; }
.student-latest-feedback > header p { margin: 0; color: #3863d4; font-size: 10px; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.student-latest-feedback > header h3 { margin: 0; color: #1e2d45; font-size: 15px; }
.student-latest-feedback > header small { color: #728198; font-size: 11px; font-weight: 650; }
.student-latest-feedback > header .text-button { flex: 0 0 auto; }

.student-latest-feedback-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 10px;
  padding-top: 11px;
  border-top: 1px solid #e5ebf3;
}

.student-latest-feedback-notes section { min-width: 0; padding-left: 10px; border-left: 2px solid #dce6fb; }
.student-latest-feedback-notes section > span { display: block; margin-bottom: 4px; color: #63728a; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.student-latest-feedback-notes .math-rich-output { color: #263650; font-size: 12px; line-height: 1.5; }
.student-latest-feedback-notes .math-rich-output > :last-child { margin-bottom: 0; }

@media (max-width: 620px) {
  .student-latest-feedback { padding: 13px; }
  .student-latest-feedback > header { align-items: flex-start; }
  .student-latest-feedback > header .text-button { padding-right: 0; }
}

:is(body[data-page="student"], .student-preview) .student-widget,
:is(body[data-page="student"], .student-preview) .student-achievements-card,
:is(body[data-page="student"], .student-preview) .workspace-board,
:is(body[data-page="student"], .student-preview) .homework-side-card {
  padding: 15px;
}

:is(body[data-page="student"], .student-preview) .student-test-question-card,
:is(body[data-page="student"], .student-preview) .student-attempt-question {
  padding: 13px 14px;
  border-color: var(--cabinet-border);
  border-radius: 8px;
  background: #fff;
}

:is(body[data-page="student"], .student-preview) .student-test-choice-grid label,
:is(body[data-page="student"], .student-preview) .student-attempt-task-options > div {
  min-height: 48px;
  padding: 9px 11px;
  border-color: var(--cabinet-border);
  border-radius: 7px;
  background: #fbfcfe;
}

:is(body[data-page="student"], .student-preview) .ai-help-row {
  gap: 8px;
  margin-top: 9px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #f7f9fe;
}

:is(body[data-page="student"], .student-preview) .ai-explanation-card.math-ai-message {
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 5px 18px rgba(30, 52, 91, .045);
}

:is(body[data-page="student"], .student-preview) .math-ai-content {
  padding-left: 44px;
}

:is(body[data-page="student"], .student-preview) .math-ai-sections {
  gap: 7px;
}

:is(body[data-page="student"], .student-preview) .math-ai-section {
  gap: 5px;
  padding: 9px 10px;
  border-radius: 7px;
}

:is(body[data-page="student"], .student-preview) .math-ai-section p {
  font-size: 13px;
  line-height: 1.48;
}

body[data-page="teacher"] .notification-popover,
:is(body[data-page="student"], .student-preview) .notification-popover {
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(23, 40, 71, .14);
}

body[data-page="teacher"] .notification-item,
:is(body[data-page="student"], .student-preview) .notification-item {
  border-radius: 7px;
  background: #f9fbfe !important;
}

.record-more-button {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

body[data-page="landing"] .topbar .menu-button {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  justify-content: center;
}

body[data-page="landing"] .topbar .menu-button span {
  width: 100%;
  height: 2px;
  margin: 0;
  border-radius: 2px;
}

@media (min-width: 901px) {
  body[data-page="landing"] .topbar .main-nav,
  body[data-page="landing"] .topbar .topbar-actions {
    display: flex !important;
  }

  body[data-page="landing"] .topbar .menu-button {
    display: none !important;
  }
}

/* Product notification center */
.notification-popover.product-notification-center {
  width: min(410px, calc(100vw - 28px));
  max-height: min(620px, calc(100dvh - 92px));
  border: 1px solid #dbe4f1 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 18px 48px rgba(24, 42, 72, .14) !important;
}

.product-notification-center .notification-popover-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 64px;
  padding: 13px 15px;
  border-bottom: 1px solid #e5ebf4;
  background: #ffffff;
}

.product-notification-center .notification-popover-head strong {
  color: #1e2b40;
  font-size: .95rem;
}

.product-notification-center .notification-popover-head span {
  color: #718099;
  font-size: .72rem;
  font-weight: 650;
}

.product-notification-center .notification-popover-head .text-button {
  min-height: 32px;
  padding: 5px 7px;
  color: #2d63e6;
  font-size: .72rem;
}

.product-notification-center .notification-popover-body {
  max-height: min(540px, calc(100dvh - 158px));
  padding: 0 !important;
  background: #ffffff !important;
}

.product-notification-feed,
.product-notification-group {
  display: grid;
}

.product-notification-group + .product-notification-group {
  border-top: 1px solid #e5ebf4;
}

.product-notification-group > h4 {
  margin: 0;
  padding: 10px 14px 6px;
  color: #718099;
  font-size: .68rem;
  font-weight: 750;
}

.product-notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  border-bottom: 1px solid #edf1f7;
  background: #ffffff;
  transition: background-color .16s ease, color .16s ease;
}

.product-notification-group .product-notification-item:last-child {
  border-bottom: 0;
}

.product-notification-item.is-unread {
  background: #ffffff;
}

.product-notification-item.is-read {
  background: #f2f4f7;
}

.product-notification-main {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) 14px;
  align-items: start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 78px;
  padding: 12px 10px 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1e2b40;
  text-align: left;
  cursor: pointer;
}

.product-notification-main:hover,
.product-notification-main:focus-visible {
  background: #f1f6ff;
}

.product-notification-main:focus-visible {
  outline: 0;
  box-shadow: inset 3px 0 0 #2d63e6;
}

.product-notification-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #2d63e6;
  box-shadow: 0 0 0 3px #e4edff;
}

.product-notification-item.red .product-notification-dot {
  background: #c93f59;
  box-shadow: 0 0 0 3px #fdecef;
}

.product-notification-item.amber .product-notification-dot {
  background: #a96916;
  box-shadow: 0 0 0 3px #fff2d8;
}

.product-notification-item.is-read .product-notification-dot {
  opacity: 0;
}

.product-notification-item.is-read .product-notification-copy > strong {
  color: #526074;
}

.product-notification-item.is-read .product-notification-copy > span:not(.product-notification-meta) {
  color: #667388;
}

.product-notification-item.is-read .product-notification-meta {
  color: #748094;
}

.product-notification-item.is-read .product-notification-meta em {
  background: #e5e9ef;
  color: #59677b;
}

.product-notification-item.is-read .product-notification-cue {
  color: #8490a1;
}

.product-notification-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.product-notification-copy > strong {
  overflow: hidden;
  color: #1e2b40;
  font-size: .82rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-notification-copy > span:not(.product-notification-meta) {
  overflow: hidden;
  color: #66758d;
  font-size: .75rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-notification-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  color: #8490a3;
  font-size: .66rem;
}

.product-notification-meta em {
  padding: 2px 5px;
  border-radius: 4px;
  background: #edf3ff;
  color: #2d63e6;
  font-style: normal;
  font-weight: 750;
}

.product-notification-meta time {
  color: inherit;
}

.product-notification-cue {
  align-self: center;
  color: #9aa8bc;
  font-size: 1.15rem;
  line-height: 1;
}

.product-notification-read {
  display: grid;
  width: 28px;
  height: 28px;
  margin-right: 10px;
  place-items: center;
  border: 1px solid #cfdbed;
  border-radius: 50%;
  background: #ffffff;
  color: #2d63e6;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}

.product-notification-read:hover,
.product-notification-read:focus-visible {
  border-color: #9eb8f4;
  background: #edf3ff;
  outline: 0;
}

.product-notification-center .notification-empty {
  min-height: 190px;
  padding: 34px 20px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.notification-button.active {
  border-color: #aac0f4 !important;
  background: #edf3ff !important;
  color: #2d63e6 !important;
}

@media (max-width: 620px) {
  .notification-popover.product-notification-center {
    top: 62px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100dvh - 74px);
  }

  .product-notification-center .notification-popover-body {
    max-height: calc(100dvh - 140px);
  }

  .product-notification-main {
    min-height: 74px;
  }
}

/* Delayed loading feedback: fast resources render without a flash. */
.dashboard-loading {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  opacity: 0;
  animation: dashboard-loading-show 1ms 160ms forwards;
}

.dashboard-loading span {
  min-height: 74px;
  border-radius: var(--cabinet-radius);
  background: linear-gradient(100deg, #dfe7f1 20%, #f8fafc 42%, #dfe7f1 64%);
  background-size: 220% 100%;
  animation: loading-surface-shimmer 1.35s ease-in-out infinite;
}

.dashboard-loading span:first-child {
  grid-column: 1 / -1;
  min-height: 106px;
}

img.is-image-loading {
  color: transparent;
  background: linear-gradient(100deg, #dbe4ef 20%, #f8fafc 42%, #dbe4ef 64%);
  background-size: 220% 100%;
  animation: loading-surface-shimmer 1.35s ease-in-out infinite;
}

img.is-image-loaded {
  animation: image-load-reveal 180ms ease-out both;
}

img.is-image-failed {
  opacity: .42;
  background: #edf2f8;
  filter: grayscale(1);
}

@keyframes dashboard-loading-show {
  to { opacity: 1; }
}

@keyframes loading-surface-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -120% 0; }
}

@keyframes image-load-reveal {
  from { opacity: .72; }
  to { opacity: 1; }
}

@media (max-width: 620px) {
  .dashboard-loading { grid-template-columns: 1fr; }
  .dashboard-loading span:first-child { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-loading {
    opacity: 1;
    animation: none;
  }

  .dashboard-loading span,
  img.is-image-loading,
  img.is-image-loaded {
    animation: none;
  }
}

body[data-page="landing"] :where(.program-card, .format-card, .testimonial-card, .price-card, .trial-card, .lead-form) {
  border-radius: 8px;
}

@media (max-width: 1100px) {
  body[data-page="teacher"] .cabinet-topbar,
  :is(body[data-page="student"], .student-preview) .cabinet-topbar {
    grid-template-columns: minmax(190px, .8fr) minmax(240px, 1.2fr) auto;
    gap: 12px;
  }

  body[data-page="teacher"] .teacher-overview-columns {
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr);
  }
}

@media (max-width: 900px) {
  body[data-page="teacher"] .cabinet-topbar,
  :is(body[data-page="student"], .student-preview) .cabinet-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-page="teacher"] .app-shell.standalone,
  :is(body[data-page="student"], .student-preview) .app-shell.standalone {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 14px;
  }

  body[data-page="teacher"] .teacher-overview-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="teacher"] .teacher-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body[data-page="landing"] .section {
    padding-block: 58px;
  }

  body[data-page="landing"] :where(.section-heading, .journey-heading, .formats-section .section-heading, .reviews-section .section-heading) {
    margin-bottom: 24px;
  }

  body[data-page="landing"] :where(.journey-card, .format-card, .testimonial-card, .program-card, .price-card) {
    padding: 20px;
  }

  body[data-page="landing"] .journey-card {
    min-height: 0;
  }

  body[data-page="landing"] :where(.journey-grid, .formats-grid, .reviews-grid, .program-grid, .price-grid) {
    gap: 12px;
  }

  body[data-page="landing"] .lead-section {
    padding-block: 58px;
  }

  body[data-page="teacher"] .cabinet-topbar,
  :is(body[data-page="student"], .student-preview) .cabinet-topbar {
    min-height: 58px;
    padding-inline: 12px;
  }

  body[data-page="teacher"] .cabinet-topbar .brand-mark,
  :is(body[data-page="student"], .student-preview) .cabinet-topbar .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  body[data-page="teacher"] .app-shell.standalone,
  :is(body[data-page="student"], .student-preview) .app-shell.standalone {
    padding: 12px 10px 30px;
  }

  body[data-page="teacher"] .dashboard-head,
  :is(body[data-page="student"], .student-preview) .dashboard-head {
    min-height: 50px;
    margin-bottom: 11px;
    padding-bottom: 10px;
  }

  body[data-page="teacher"] .dashboard-head h2,
  :is(body[data-page="student"], .student-preview) .dashboard-head h2 {
    font-size: 25px;
  }

  body[data-page="teacher"] .teacher-welcome {
    align-items: flex-start;
    min-height: 0;
    padding: 16px;
  }

  body[data-page="teacher"] .teacher-welcome h3,
  :is(body[data-page="student"], .student-preview) .student-home-top h3 {
    font-size: 24px;
  }

  body[data-page="teacher"] .teacher-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="teacher"] .teacher-metric-card {
    min-height: 82px;
    padding: 12px;
  }

  :is(body[data-page="student"], .student-preview) .student-lesson-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 20px 18px;
  }

  :is(body[data-page="student"], .student-preview) .student-lesson-hero h3 {
    font-size: 26px;
  }

  :is(body[data-page="student"], .student-preview) .student-formula-board {
    display: none;
  }

  :is(body[data-page="student"], .student-preview) .student-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(body[data-page="student"], .student-preview) .math-ai-content {
    padding-left: 0;
  }

  .record-dialog-head h3 {
    font-size: 19px;
  }
}

/* Final alignment pass: keep compact controls on one line and prevent narrow-column jumps. */
.collection-toolbar.collection-toolbar-compact {
  min-height: 22px;
  padding: 0 2px;
  justify-content: flex-end;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.collection-toolbar-compact .collection-count {
  color: var(--cabinet-muted, #6c7a90);
  font-size: 12px;
}

.homework-board-head > div {
  flex: 1 1 auto;
  min-width: 0;
}

.homework-board-head h3 {
  word-break: normal;
  overflow-wrap: normal;
}

.homework-board-head select {
  flex: 0 0 auto;
  width: min(280px, 100%);
  max-width: 100%;
}

body[data-page="teacher"] .test-editor-card > summary {
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  gap: 8px;
  min-height: 64px;
}

body[data-page="teacher"] .test-editor-card > summary .record-actions {
  grid-column: 3;
  grid-row: 1;
}

body[data-page="teacher"] .analytics-lesson-card > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

body[data-page="teacher"] .analytics-lesson-card > summary .analytics-lesson-head {
  min-width: 0;
}

body[data-page="teacher"] .analytics-lesson-card > summary .record-actions {
  grid-column: 2;
  grid-row: 1;
  margin-right: 12px;
}

body[data-page="teacher"] .record-dialog-content.lesson-card .lesson-card-details {
  display: grid !important;
}

body.record-dialog-open .teacher-ai-shell {
  opacity: 0;
  pointer-events: none;
}

.record-dialog-head .icon-button {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.record-dialog-head .icon-button:focus-visible {
  border-color: #8ba8fa;
  outline: 3px solid rgba(49, 95, 234, .2);
  outline-offset: 2px;
  box-shadow: none;
}

@media (max-width: 720px) {
  body[data-page="teacher"] .teacher-ai-shell {
    top: 116px;
  }

  body[data-page="teacher"] .teacher-ai-panel {
    height: calc(100dvh - 186px);
    min-height: 0;
  }

  body[data-page="teacher"] .test-editor-card > summary {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  body[data-page="teacher"] .test-editor-card > summary .test-card-summary-meta {
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
  }

  body[data-page="teacher"] .test-editor-card > summary .record-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .homework-board-head select {
    width: 100%;
  }
}

/* Current cabinet UI: compact, neutral and overflow-safe. */
.test-option-row .math-input-preview,
.student-test-choice-grid .math-input-preview {
  display: none !important;
}

.test-question-prompt .math-input-preview,
.test-teacher-explanation-fields .math-input-preview {
  box-sizing: border-box;
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 54px;
  max-height: 180px;
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  border-color: #d9e2f0;
  color: #1c2940;
  background: #f7f9fd;
}

/* Stable cabinet navigation and compact records. */
body[data-page="teacher"] #dashboardContent > *,
:is(body[data-page="student"], .student-preview) #dashboardContent > *,
body[data-page="teacher"] :where(.student-grid, .lesson-grid, .homework-grid, .material-grid, .analytics-lesson-list) > *,
:is(body[data-page="student"], .student-preview) :where(.workspace-row-list, .homework-row-list, .student-widget-grid, .student-progress-list) > * {
  animation: none !important;
}

body[data-page="teacher"] details[open] > :not(summary),
:is(body[data-page="student"], .student-preview) details[open] > :not(summary) {
  animation: none !important;
}

@supports (interpolate-size: allow-keywords) and selector(details::details-content) {
  body[data-page="teacher"] details::details-content,
  :is(body[data-page="student"], .student-preview) details::details-content {
    transition: none !important;
  }
}

body[data-page="teacher"] .dashboard :where(.student-kpi-card, .student-widget, .teacher-metric-card, .week-lesson),
:is(body[data-page="student"], .student-preview) .dashboard :where(.student-kpi-card, .student-widget, .teacher-metric-card, .student-mini-item) {
  transform: none !important;
}

body[data-page="teacher"] .dashboard-head,
:is(body[data-page="student"], .student-preview) .dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.dashboard-create-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid #2f63df;
  border-radius: 7px;
  color: #fff;
  background: #2f63df;
  box-shadow: 0 5px 14px rgba(47, 99, 223, .16);
  font: 750 12px/1.2 Inter, sans-serif;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.dashboard-create-button:hover {
  border-color: #244fc0;
  background: #244fc0;
  box-shadow: 0 7px 18px rgba(47, 99, 223, .2);
}

.dashboard-create-button > span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  font-size: 17px;
  line-height: 1;
}

details.dialog-form-source[hidden] {
  display: none !important;
}

.collection-toolbar.collection-toolbar-compact {
  min-height: 28px;
  padding: 0;
}

.collection-toolbar-compact .collection-count {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border: 1px solid #dfe6f1;
  border-radius: 7px;
  color: #607089;
  background: #f6f8fc;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.collection-toolbar-compact .collection-count strong {
  color: #24334b;
  font-size: 12px;
}

body[data-page="teacher"] .student-management-head {
  min-height: 58px;
  align-items: center;
  padding: 12px 15px;
}

body[data-page="teacher"] .student-management-head small {
  display: block;
  color: #708099;
  font-size: 12px;
}

body[data-page="teacher"] .student-management-head > span {
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid #dfe6f1;
  border-radius: 7px;
  color: #4f6079;
  background: #f7f9fc;
  font-size: 11px;
  white-space: nowrap;
}

body[data-page="teacher"] .week-panel {
  min-width: 0;
  overflow: hidden;
}

body[data-page="teacher"] .week-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

body[data-page="teacher"] .week-day,
body[data-page="teacher"] .week-lessons,
body[data-page="teacher"] .week-lesson {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

body[data-page="teacher"] .week-lesson {
  width: 100%;
  overflow: hidden;
  border-left-width: 3px;
  box-shadow: none;
}

body[data-page="teacher"] .week-lesson:hover {
  transform: none;
  border-color: #b9c8e6;
  box-shadow: 0 5px 14px rgba(31, 53, 91, .07);
}

body[data-page="teacher"] .week-lesson > strong {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
}

body[data-page="teacher"] .week-lesson-head,
body[data-page="teacher"] .week-lesson-foot {
  min-width: 0;
  overflow: hidden;
}

body[data-page="teacher"] .week-lesson-head span,
body[data-page="teacher"] .week-lesson-foot small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.all-lessons-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--cabinet-border, #dfe6f1);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(28, 45, 75, .035);
}

.all-lessons-head {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  border-bottom: 1px solid #e4e9f1;
}

.all-lessons-head h3,
.all-lessons-head p {
  margin: 0;
}

.all-lessons-head h3 {
  margin-top: 2px;
  color: #1d2a40;
  font-size: 16px;
}

.all-lessons-panel .collection-panel-body {
  padding: 6px 14px 12px;
}

.lesson-archive-list {
  display: grid;
}

.lesson-archive-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 24px;
  min-width: 0;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  padding: 9px 4px;
  border: 0;
  border-bottom: 1px solid #e7ebf2;
  color: #1f2d44;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.lesson-archive-item:last-child { border-bottom: 0; }
.lesson-archive-item:hover { background: #f7f9fd; }

.lesson-archive-item time {
  display: grid;
  width: 42px;
  height: 44px;
  place-content: center;
  border-radius: 7px;
  color: #2759d4;
  background: #eef3ff;
  text-align: center;
}

.lesson-archive-item time strong { font-size: 15px; line-height: 1; }
.lesson-archive-item time span { margin-top: 3px; font-size: 9px; text-transform: uppercase; }
.lesson-archive-copy,
.lesson-archive-meta { display: grid; min-width: 0; gap: 4px; }
.lesson-archive-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-archive-copy small,
.lesson-archive-meta small { color: #77859a; font-size: 11px; }
.lesson-archive-meta { min-width: 88px; text-align: right; }
.lesson-archive-arrow { color: #8693a8; font-size: 23px; }

.copy-link-button {
  border-color: #cbd8f2 !important;
  color: #2759d4 !important;
  background: #f5f8ff !important;
}

.copy-link-button:hover {
  border-color: #9fb6eb !important;
  background: #edf3ff !important;
}

body[data-page="teacher"] .test-builder-section > header {
  grid-template-columns: minmax(0, 1fr) !important;
}

body[data-page="teacher"] .test-builder-section > header > div {
  min-width: 0;
}

body[data-page="teacher"] .test-card-summary-copy {
  min-width: 0;
}

body[data-page="teacher"] .test-card-summary-copy > span {
  min-width: 0;
}

body[data-page="teacher"] .test-card-summary-copy strong,
body[data-page="teacher"] .test-card-summary-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(body[data-page="student"], .student-preview) .homework-board-head {
  min-height: 54px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5eaf2;
}

:is(body[data-page="student"], .student-preview) .homework-board-head small {
  display: block;
  margin-top: 4px;
  color: #75839a;
  font-size: 11px;
}

:is(body[data-page="student"], .student-preview) .student-test-list-card {
  grid-template-columns: 4px minmax(0, 1fr) minmax(92px, auto) auto;
  gap: 13px;
  overflow: hidden;
}

.student-test-list-accent {
  align-self: stretch;
  width: 4px;
  min-height: 46px;
  border-radius: 4px;
  background: #4d74e8;
}

.student-test-list-accent.tone-purple { background: #7458d6; }
.student-test-list-accent.tone-teal { background: #2b9b79; }
.student-test-list-accent.tone-rose { background: #ce5b78; }
.student-test-list-accent.review { background: #d0963d; }

:is(body[data-page="student"], .student-preview) .student-test-list-main,
:is(body[data-page="student"], .student-preview) .student-test-list-main h4,
:is(body[data-page="student"], .student-preview) .student-test-list-main p {
  min-width: 0;
  max-width: 100%;
}

:is(body[data-page="student"], .student-preview) .student-test-list-main h4 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(body[data-page="student"], .student-preview) .student-test-list-card > button {
  min-width: 110px;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  body[data-page="teacher"] .week-grid {
    grid-template-columns: repeat(7, minmax(126px, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-page="teacher"] .dashboard-head,
  :is(body[data-page="student"], .student-preview) .dashboard-head {
    align-items: center;
  }

  .dashboard-create-button {
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 0;
  }

  .dashboard-create-button > span {
    width: auto;
    height: auto;
    background: transparent;
    font-size: 21px;
  }

  .all-lessons-head {
    align-items: flex-start;
  }

  .lesson-archive-item {
    grid-template-columns: 40px minmax(0, 1fr) 20px;
    gap: 9px;
  }

  .lesson-archive-meta {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    text-align: left;
  }

  .lesson-archive-arrow {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  :is(body[data-page="student"], .student-preview) .student-test-list-card {
    grid-template-columns: 4px minmax(0, 1fr) auto;
  }

  :is(body[data-page="student"], .student-preview) .student-test-list-result {
    grid-column: 3;
    grid-row: 1;
  }

  :is(body[data-page="student"], .student-preview) .student-test-list-card > button {
    grid-column: 2 / -1;
    width: auto;
    min-width: 0;
    justify-self: start;
  }
}

@media (max-width: 520px) {
  body[data-page="teacher"] .dashboard-head h2,
  :is(body[data-page="student"], .student-preview) .dashboard-head h2 {
    font-size: 23px;
  }

  body[data-page="teacher"] .student-management-head {
    align-items: flex-start;
  }

  body[data-page="teacher"] .student-management-head > span {
    white-space: normal;
  }

  :is(body[data-page="student"], .student-preview) .homework-board-head {
    align-items: flex-start;
  }

  :is(body[data-page="student"], .student-preview) .homework-board-head select,
  :is(body[data-page="student"], .student-preview) .homework-board-head .outline-button {
    width: 100%;
  }

  :is(body[data-page="student"], .student-preview) .student-test-list-card {
    grid-template-columns: 4px minmax(0, 1fr);
  }

  :is(body[data-page="student"], .student-preview) .student-test-list-result,
  :is(body[data-page="student"], .student-preview) .student-test-list-card > button {
    grid-column: 2;
  }

  :is(body[data-page="student"], .student-preview) .student-test-list-result {
    grid-row: auto;
    text-align: left;
  }
}

.test-question-prompt .math-input-preview > div,
.test-teacher-explanation-fields .math-input-preview > div {
  width: 100%;
  min-width: 0;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.test-option-editor,
.student-test-choice-grid {
  min-width: 0;
  max-width: 100%;
}

.test-option-row {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.test-option-row input:last-child {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.teacher-ai-file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 7px;
  overflow: hidden;
  white-space: normal;
}

.teacher-ai-file-preview span {
  display: block;
  flex: 0 1 100%;
  min-width: 0;
  max-width: 100%;
  padding: 4px 7px;
  overflow: hidden;
  border: 1px solid #d9e3f2;
  border-radius: 6px;
  color: #435571;
  background: #fff;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assessment-badge,
.test-row-labels .homework-status {
  display: inline-flex;
  box-sizing: border-box;
  min-height: 28px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.assessment-badge.tone-blue { border-color: #d6e2ff; color: #2858c9; background: #eef4ff; }
.assessment-badge.tone-purple { border-color: #e2d8ff; color: #6942bd; background: #f5f1ff; }
.assessment-badge.tone-teal { border-color: #ccecdf; color: #21775a; background: #edf9f4; }
.assessment-badge.tone-rose { border-color: #f2d4dc; color: #a43a55; background: #fff1f4; }

.student-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
}

.student-leaderboard-card,
.student-goals-card {
  box-sizing: border-box;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 39, 66, 0.05);
}

.leaderboard-chart {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 24px minmax(72px, 0.65fr) minmax(90px, 1fr) 30px;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  color: #4d5c72;
  background: #f8fafd;
}

.leaderboard-row.is-current { color: #1f4fbd; background: #eef4ff; }
.leaderboard-position { color: #7d8aa0; font-size: 11px; font-weight: 800; text-align: center; }
.leaderboard-row strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-row > b { font-size: 12px; text-align: right; }
.leaderboard-track { height: 5px; overflow: hidden; border-radius: 999px; background: #e5eaf2; }
.leaderboard-track i { display: block; height: 100%; border-radius: inherit; background: #3263e8; }

.material-folder-manager,
.material-folder-tabs,
.attachment-list {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.material-folder-manager {
  display: grid;
  gap: 10px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.material-folder-manager-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #536178; font-size: 12px; font-weight: 750; }
.material-folder-manager-summary b { display: grid; min-width: 26px; height: 26px; place-items: center; border-radius: 7px; color: #315ed7; background: #edf3ff; font-size: 11px; }

.dashboard-create-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.dashboard-folder-button { min-height: 38px; padding: 0 12px; color: #2b5bd7; border-color: #ccd9f5; background: #fff; font-size: 13px; }
.dashboard-folder-button span { margin-right: 5px; font-size: 17px; line-height: 1; }
.material-folder-overview { display: grid; gap: 11px; padding: 14px; border: 1px solid #dfe6f0; border-radius: 10px; background: #fff; }
.material-folder-overview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.material-folder-overview-head > div { display: grid; gap: 2px; }
.material-folder-overview-head p { margin: 0; color: #718098; font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.material-folder-overview-head h3 { margin: 0; color: #1a2941; font-size: 16px; }
.material-folder-add-current { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.material-folder-overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.material-folder-overview-card {
  appearance: none;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 62px;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  color: inherit;
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.material-folder-overview-card:hover { border-color: #b6c6e2; background: #f8faff; transform: translateY(-1px); }
.material-folder-overview-card:focus-visible { outline: 3px solid rgba(49, 94, 215, .2); outline-offset: 2px; }
.material-folder-overview-card.is-active { border-color: #89a5ed; background: #f1f5ff; box-shadow: inset 3px 0 #315ed7; }
.material-folder-overview-card > div { display: grid; min-width: 0; gap: 2px; }
.material-folder-overview-card strong { overflow: hidden; color: #1a2941; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.material-folder-overview-card small { color: #74839a; font-size: 12px; }
.folder-all-icon { display: grid; width: 18px; height: 18px; flex: 0 0 18px; place-items: center; color: #315ed7; font-size: 18px; line-height: 1; }
.folder-open-cue { margin-left: auto; color: #8796ad; font-size: 20px; line-height: 1; transition: transform 160ms ease; }
.material-folder-overview-card:hover .folder-open-cue { transform: translateX(2px); }
.material-folder-empty { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; justify-content: space-between; gap: 18px; }
.material-folder-dialog-source[hidden] { display: none; }

.material-folder-manager-status {
  margin: 0;
  padding: 8px 10px;
  border-radius: 7px;
  color: #536178;
  background: #f3f6fb;
  font-size: 0.72rem;
  font-weight: 750;
}

.material-folder-manager-status[data-status="saved"] {
  color: #1f684a;
  background: #edf8f2;
}

.material-folder-manager-status[data-status="error"] {
  color: #9f1d34;
  background: #fff1f3;
}

.material-folder-manager-status[data-status="saving"] {
  color: #2857ce;
  background: #edf3ff;
}

.material-folder-manager-body,
.material-folder-editor-list { display: grid; gap: 8px; }
.material-folder-manager-body { padding: 0; }

.material-folder-edit {
  display: grid;
  grid-template-columns: 12px minmax(140px, 1fr) minmax(112px, .45fr) auto auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e4eaf3;
  border-radius: 8px;
  background: #f9fbfe;
}

.material-folder-edit .folder-delete-button {
  color: #b4233a;
}

.material-folder-edit .folder-delete-button:disabled {
  color: #a9b3c1;
  cursor: not-allowed;
}

.material-folder-create {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(112px, .42fr) auto;
  align-items: center;
  gap: 8px;
}
.material-folder-create-section { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid #e4eaf3; }
.material-folder-create-section > strong { color: #293850; font-size: 12px; }
.material-folder-create input,
.material-folder-create select { min-width: 0; }
.folder-color { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #3263e8; }
.folder-color.tone-purple { background: #7654d6; }
.folder-color.tone-teal { background: #2b936c; }
.folder-color.tone-rose { background: #c44d68; }
.folder-color.tone-amber { background: #d9942e; }

.material-folder-tabs {
  display: flex;
  gap: 7px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.material-folder-tabs button {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid #dce4ef;
  border-radius: 7px;
  color: #536178;
  background: #fff;
  font: 700 11px/1.2 Inter, sans-serif;
  cursor: pointer;
}

.material-folder-tabs button.active { border-color: #98b2f5; color: #2253ca; background: #eef4ff; }
.material-folder-tabs button b { color: #78869b; font-size: 10px; }

.attachment-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 8px; }
.attachment-list-item { position: relative; min-width: 0; }
.attachment-list-item .inline-image-attachment { width: 100%; max-width: 100%; margin: 0; }
.attachment-list-item .inline-image-attachment button { width: 100%; min-height: 200px; }
.attachment-list-item .inline-image-attachment img { width: 100%; height: clamp(200px, 26vw, 300px); object-fit: contain; }

.test-question-builder,
.test-editor-card,
.test-editor-shell,
.test-edit-form,
.test-edit-section,
.test-question-body,
.test-question-prompt,
.test-choice-fields,
.test-text-fields,
.test-ai-settings {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

details.test-card,
details.material-card,
details.student-homework-row,
details.form-panel:not(.analytics-lesson-card) {
  scroll-margin-top: 92px;
}

@media (max-width: 900px) {
  .student-bottom-grid { grid-template-columns: 1fr; }
  .material-folder-edit { grid-template-columns: 12px minmax(0, 1fr); }
  .material-folder-edit select { grid-column: 2; }
  .material-folder-edit .text-button { grid-column: 2; justify-self: start; }
  .material-folder-edit .folder-delete-button { justify-self: start; }
  .material-folder-create { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .test-question-prompt,
  .test-option-editor { grid-template-columns: minmax(0, 1fr) !important; }
  .leaderboard-row { grid-template-columns: 22px minmax(64px, .65fr) minmax(72px, 1fr) 28px; gap: 6px; }
  .attachment-list-item .inline-image-attachment button,
  .attachment-list-item .inline-image-attachment img { min-height: 170px; height: min(58vw, 240px); }
}

/* Cabinet stability audit: this final layer owns layout, motion and neutral colors. */
html:has(body[data-page="teacher"]),
html:has(body[data-page="student"]) {
  scroll-behavior: auto;
}

body[data-page="teacher"],
:is(body[data-page="student"], .student-preview) {
  --cabinet-page: #f4f7fb;
  --cabinet-surface: #ffffff;
  --cabinet-surface-soft: #f8fafd;
  --cabinet-border: #dce4ef;
  --cabinet-text: #19263b;
  --cabinet-muted: #718097;
  background: var(--cabinet-page) !important;
}

body[data-page="teacher"] #dashboardContent,
:is(body[data-page="student"], .student-preview) #dashboardContent {
  min-width: 0;
  min-height: calc(100vh - 190px);
  overflow: visible;
}

body[data-page="teacher"] #dashboardContent :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
:is(body[data-page="student"], .student-preview) #dashboardContent :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  border-color: var(--cabinet-border);
  color: var(--cabinet-text);
  background: #fbfcfe;
}

body[data-page="teacher"] #dashboardContent :where(input, select, textarea):focus,
:is(body[data-page="student"], .student-preview) #dashboardContent :where(input, select, textarea):focus {
  border-color: #7f9feb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 99, 223, .09);
}

body[data-page="teacher"] .dashboard-head,
:is(body[data-page="student"], .student-preview) .dashboard-head {
  box-sizing: border-box;
  min-height: 76px;
  margin: 0 0 18px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--cabinet-border);
}

body[data-page="teacher"] .dashboard-head h2,
:is(body[data-page="student"], .student-preview) .dashboard-head h2 {
  margin: 4px 0 0;
  color: var(--cabinet-text);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
}

body[data-page="teacher"] #dashboardContent > *,
:is(body[data-page="student"], .student-preview) #dashboardContent > *,
body[data-page="teacher"] details[open] > :not(summary),
:is(body[data-page="student"], .student-preview) details[open] > :not(summary) {
  animation: none !important;
}

@supports (interpolate-size: allow-keywords) and selector(details::details-content) {
  body[data-page="teacher"] details::details-content,
  :is(body[data-page="student"], .student-preview) details::details-content {
    transition: none !important;
  }
}

body[data-page="teacher"] details,
:is(body[data-page="student"], .student-preview) details {
  overflow-anchor: none;
}

.dashboard-create-button {
  min-width: 0;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 7px;
  box-shadow: none;
}

.collection-toolbar.collection-toolbar-compact {
  display: flex;
  min-height: 24px !important;
  justify-content: flex-end;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.collection-toolbar-compact .collection-count {
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--cabinet-muted, #718097);
  background: transparent;
  font-size: 11px;
  line-height: 1.35;
}

.collection-toolbar-compact .collection-count strong {
  color: var(--cabinet-text, #19263b);
  font-size: inherit;
}

body[data-page="teacher"] .student-management-page,
body[data-page="teacher"] .student-workspace,
body[data-page="teacher"] .student-workspace-main,
body[data-page="teacher"] .student-workspace-card {
  min-width: 0;
  max-width: 100%;
}

body[data-page="teacher"] .student-directory-head > span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

body[data-page="teacher"] .student-directory-head small {
  color: var(--cabinet-muted);
  font-size: 10px;
  font-weight: 500;
}

body[data-page="teacher"] .week-panel {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-color: var(--cabinet-border);
  background: #fff;
}

body[data-page="teacher"] .week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

body[data-page="teacher"] .week-day {
  box-sizing: border-box;
  width: auto;
  min-width: 0 !important;
  max-width: 100%;
  height: 350px;
  overflow: hidden;
}

body[data-page="teacher"] .week-lessons {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  height: calc(100% - 54px);
  padding: 8px;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

body[data-page="teacher"] .week-lesson {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 76px;
  max-width: 100%;
  gap: 6px;
  padding: 9px;
  overflow: hidden;
  border-radius: 7px;
  box-shadow: none;
  cursor: pointer;
}

body[data-page="teacher"] .week-lesson > strong {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

body[data-page="teacher"] .week-lesson-head,
body[data-page="teacher"] .week-lesson-foot {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

body[data-page="teacher"] .week-lesson-head span,
body[data-page="teacher"] .week-lesson-foot small {
  min-width: 0;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.all-lessons-panel,
body[data-page="teacher"] .test-card,
body[data-page="teacher"] .material-card,
:is(body[data-page="student"], .student-preview) .workspace-board,
:is(body[data-page="student"], .student-preview) .homework-side-card,
:is(body[data-page="student"], .student-preview) .student-test-list-card,
:is(body[data-page="student"], .student-preview) .student-homework-row {
  border-color: var(--cabinet-border);
  background: var(--cabinet-surface);
  box-shadow: 0 8px 24px rgba(24, 42, 72, .045);
}

.all-lessons-head {
  min-height: 58px;
  padding: 11px 14px;
}

.lesson-archive-item {
  min-height: 62px;
  gap: 10px;
  padding: 8px 4px;
}

.copy-link-button {
  border-color: #cbd8f2 !important;
  color: #2859cf !important;
  background: #f5f8ff !important;
}

.test-question-builder.has-validation-error {
  border-color: #e39aa8 !important;
  box-shadow: 0 0 0 3px rgba(195, 52, 76, .08);
}

:is(body[data-page="student"], .student-preview) .student-workspace-page.is-single-column {
  grid-template-columns: minmax(0, 1fr) !important;
}

:is(body[data-page="student"], .student-preview) .student-widget-grid {
  align-items: stretch;
}

:is(body[data-page="student"], .student-preview) .student-widget {
  min-width: 0;
  overflow: hidden;
}

:is(body[data-page="student"], .student-preview) .student-test-list-card {
  box-sizing: border-box;
  grid-template-columns: 4px minmax(0, 1fr) minmax(82px, auto) auto;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  overflow: hidden;
  border-radius: 8px;
  transform: none !important;
}

:is(body[data-page="student"], .student-preview) .student-test-list-main h4 {
  margin: 6px 0 3px;
  font-size: 14px;
}

:is(body[data-page="student"], .student-preview) .student-test-list-main p,
:is(body[data-page="student"], .student-preview) .student-test-list-result small {
  color: var(--cabinet-muted);
  font-size: 11px;
}

:is(body[data-page="student"], .student-preview) .student-test-list-card > button {
  min-width: 104px;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 11px;
}

:is(body[data-page="student"], .student-preview) .student-homework-row > summary {
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  max-width: 100%;
  gap: 12px;
  overflow: hidden;
}

:is(body[data-page="student"], .student-preview) .homework-row-main,
:is(body[data-page="student"], .student-preview) .homework-row-main > div,
:is(body[data-page="student"], .student-preview) .homework-row-side {
  min-width: 0;
}

:is(body[data-page="student"], .student-preview) .homework-row-main strong,
:is(body[data-page="student"], .student-preview) .homework-row-main p,
:is(body[data-page="student"], .student-preview) .homework-row-main small {
  overflow-wrap: anywhere;
}

:is(body[data-page="student"], .student-preview) .schedule-calendar,
:is(body[data-page="student"], .student-preview) .homework-calendar {
  min-width: 0;
  overflow: hidden;
}

:is(body[data-page="student"], .student-preview) .calendar-grid,
:is(body[data-page="student"], .student-preview) .calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 0;
  gap: 3px;
}

:is(body[data-page="student"], .student-preview) .calendar-grid > button,
:is(body[data-page="student"], .student-preview) .calendar-grid > span {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 38px;
  aspect-ratio: 1;
  justify-self: center;
  overflow: visible;
}

:is(body[data-page="student"], .student-preview) .calendar-grid > button i {
  position: absolute;
  right: -1px;
  bottom: -1px;
  display: grid;
  width: 13px;
  height: 13px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #3263e8;
  font-size: 7px;
  font-style: normal;
}

body[data-page="landing"] .reveal-ready .price-card,
body[data-page="landing"].reveal-ready .price-card,
body[data-page="landing"] .price-card {
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
}

@media (max-width: 1180px) {
  body[data-page="teacher"] .week-grid {
    grid-template-columns: repeat(7, minmax(138px, 1fr));
  }

  body[data-page="teacher"] .week-day {
    min-width: 138px !important;
  }

  :is(body[data-page="student"], .student-preview) .student-test-list-card {
    grid-template-columns: 4px minmax(0, 1fr) auto;
  }

  :is(body[data-page="student"], .student-preview) .student-test-list-result {
    display: none;
  }
}

@media (max-width: 760px) {
  body[data-page="teacher"] .dashboard-head,
  :is(body[data-page="student"], .student-preview) .dashboard-head {
    min-height: 62px;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  body[data-page="teacher"] .dashboard-head h2,
  :is(body[data-page="student"], .student-preview) .dashboard-head h2 {
    font-size: 25px;
  }

  .dashboard-create-button {
    width: 38px;
    height: 38px;
    padding: 0;
  }

  body[data-page="teacher"] .week-grid {
    grid-template-columns: repeat(7, 160px);
  }

  body[data-page="teacher"] .week-day {
    min-width: 160px !important;
    height: 326px;
  }

  .all-lessons-head {
    align-items: center;
  }

  :is(body[data-page="student"], .student-preview) .student-test-list-card {
    grid-template-columns: 4px minmax(0, 1fr);
    gap: 10px;
  }

  :is(body[data-page="student"], .student-preview) .student-test-list-card > button {
    grid-column: 2;
    width: fit-content;
    min-width: 0;
    justify-self: start;
  }

  :is(body[data-page="student"], .student-preview) .homework-row-side {
    align-items: flex-end;
  }
}

@media (max-width: 520px) {
  body[data-page="teacher"] .dashboard-head h2,
  :is(body[data-page="student"], .student-preview) .dashboard-head h2 {
    max-width: calc(100vw - 116px);
    font-size: 22px;
  }

  .collection-toolbar.collection-toolbar-compact {
    justify-content: flex-start;
  }

  .lesson-archive-item {
    grid-template-columns: 38px minmax(0, 1fr) 18px;
  }

  :is(body[data-page="student"], .student-preview) .student-homework-row > summary {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(body[data-page="student"], .student-preview) .homework-row-side {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Final compactness and alignment pass. */
body[data-page="teacher"] #dashboardContent,
:is(body[data-page="student"], .student-preview) #dashboardContent {
  align-content: start;
  grid-auto-rows: max-content;
}

body[data-page="teacher"] #dashboardContent > *,
:is(body[data-page="student"], .student-preview) #dashboardContent > * {
  align-self: start;
}

body[data-page="teacher"] :where(.homework-grid, .material-grid, .lead-grid),
:is(body[data-page="student"], .student-preview) :where(.student-widget-grid, .workspace-row-list) {
  align-items: start;
  grid-auto-rows: max-content;
}

body[data-page="teacher"] .material-folder-manager,
body[data-page="teacher"] .material-card,
body[data-page="teacher"] .test-card,
body[data-page="teacher"] .empty-state-panel {
  height: auto !important;
  min-height: 0 !important;
  align-self: start;
}

body[data-page="teacher"] .material-folder-manager {
  width: min(780px, 100%);
}

body[data-page="teacher"] .material-folder-overview { width: 100%; max-width: none; }

@media (max-width: 720px) {
  .dashboard-create-actions { width: 100%; justify-content: stretch; }
  .dashboard-create-actions > button { flex: 1; min-width: 0; }
  .material-folder-overview-head { align-items: flex-end; }
  .material-folder-add-current { flex: 0 0 auto; }
  .material-folder-overview-grid { grid-template-columns: 1fr; }
  .material-folder-empty { grid-template-columns: 1fr; align-items: flex-start; }
  .material-folder-empty .accent-button { width: 100%; }
}

body[data-page="teacher"] #dashboardContent .material-card > .material-assignment-panel {
  display: none;
}

body[data-page="teacher"] .material-card:not([open]) > summary,
body[data-page="teacher"] .test-card:not([open]) > summary {
  box-sizing: border-box;
  min-height: 68px !important;
  height: auto !important;
  padding: 11px 14px;
}

body[data-page="teacher"] .test-card > summary {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
}

body[data-page="teacher"] .test-card-summary-copy {
  display: block;
  width: 100%;
  min-width: 0;
}

body[data-page="teacher"] .test-card-summary-copy > span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

body[data-page="teacher"] .test-card-summary-copy strong,
body[data-page="teacher"] .test-card-summary-copy small {
  max-width: 100%;
}

body[data-page="teacher"] .test-card-summary-meta {
  flex-wrap: wrap;
  align-content: center;
}

.empty-state-panel {
  box-sizing: border-box;
  width: min(680px, 100%);
  min-height: 88px !important;
  align-items: center;
  padding: 18px 20px;
}

body[data-page="teacher"] .teacher-welcome {
  height: auto;
  min-height: 104px;
}

body[data-page="teacher"] .teacher-metric-card {
  height: auto;
  min-height: 88px;
}

:is(body[data-page="student"], .student-preview) .student-widget {
  height: auto;
  min-height: 0;
  align-self: start;
}

:is(body[data-page="student"], .student-preview) .student-mini-item.test,
:is(body[data-page="student"], .student-preview) .student-mini-item.material {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  align-items: center;
  gap: 10px;
}

:is(body[data-page="student"], .student-preview) .student-mini-item.test > div,
:is(body[data-page="student"], .student-preview) .student-mini-item.material > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

:is(body[data-page="student"], .student-preview) :where(.mini-test-result, .mini-test-status) {
  box-sizing: border-box;
  min-width: 34px;
  max-width: 92px;
  min-height: 28px;
  align-self: center;
  padding: 6px 8px;
  overflow: hidden;
  border-radius: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rich-text-toolbar {
  display: inline-flex;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  margin: 0 0 6px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid #dce4ef;
  border-radius: 7px;
  background: #f8fafd;
}

.rich-text-toolbar > button {
  display: grid;
  box-sizing: border-box;
  flex: 0 0 24px;
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px;
  height: 24px;
  min-height: 24px !important;
  place-items: center;
  margin: 0;
  padding: 0 !important;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  color: #233149;
  background: transparent;
  cursor: pointer;
}

.rich-text-toolbar > button:hover,
.rich-text-toolbar > button:focus-visible {
  background: #e9effb;
  outline: none;
}

.rich-text-toolbar > button.is-active {
  color: #1744b2;
  background: #dfe8ff;
  box-shadow: inset 0 0 0 1px #9bb4f2;
}

.rich-text-toolbar > span {
  flex: 0 0 1px;
  width: 1px;
  height: 18px;
  background: #dce4ef;
}

.rich-text-hint {
  min-width: 130px;
  color: #65758b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.rich-color-button i {
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #3263e8;
  box-shadow: 0 0 0 1px #c8d3e5;
}

.rich-color-button.is-purple i { background: #7356d8; }
.rich-color-button.is-teal i { background: #2b936c; }
.rich-color-button.is-rose i { background: #c44d68; }

.rich-color {
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 700;
}

.rich-color-blue { color: #2755c7; background: #edf3ff; }
.rich-color-purple { color: #6046c8; background: #f0edff; }
.rich-color-teal { color: #147252; background: #e8f7f0; }
.rich-color-rose { color: #b4233a; background: #fff0f2; }

.attachment-list-item:has(.attachment-remove) {
  padding-right: 34px;
}

.attachment-remove {
  position: absolute;
  z-index: 2;
  top: 6px;
  right: 6px;
  display: grid;
  box-sizing: border-box;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  padding: 0;
  border: 1px solid #e3a8b4;
  border-radius: 6px;
  color: #b33b52;
  background: #fff;
  font: 800 15px/1 Arial, sans-serif;
  cursor: pointer;
}

.attachment-remove:hover { background: #fff2f5; }
.attachment-list-item.is-removed { opacity: .48; }
.attachment-list-item.is-removed::after {
  position: absolute;
  inset: 50% 8px auto;
  height: 1px;
  background: #b33b52;
  content: "";
}

body[data-page="teacher"] .test-question-prompt,
body[data-page="teacher"] .test-question-config,
body[data-page="teacher"] .test-option-editor,
body[data-page="teacher"] .existing-attachments {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

body[data-page="teacher"] .test-question-prompt > *,
body[data-page="teacher"] .test-question-config > * {
  min-width: 0;
  max-width: 100%;
}

.lesson-score-grid .has-test-grade {
  border-color: #d8cdf8;
  background: #f7f4ff;
}

.lesson-score-grid .has-test-grade strong,
.lesson-grade.test-grade {
  color: #6646c7;
}

.lesson-score-grid .has-test-grade small {
  color: #7b6e9d;
  font-size: 10px;
}

@media (max-width: 760px) {
  body[data-page="teacher"] .test-card > summary {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 9px;
  }

  body[data-page="teacher"] .test-card-summary-meta {
    max-width: 150px;
    justify-content: flex-end;
  }

  .empty-state-panel { width: 100%; }
}

/* Stable interaction pass: scrolling and navigation never move the layout. */
body[data-page="teacher"] #dashboardContent,
:is(body[data-page="student"], .student-preview) #dashboardContent {
  isolation: isolate;
}

body[data-page="teacher"] #dashboardContent.is-section-entering,
:is(body[data-page="student"], .student-preview) #dashboardContent.is-section-entering {
  animation: cabinet-section-soft-in 160ms ease-out both !important;
}

@keyframes cabinet-section-soft-in {
  from { opacity: .96; }
  to { opacity: 1; }
}

body[data-page="teacher"] .week-grid {
  overscroll-behavior-x: contain;
  scroll-behavior: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

body[data-page="teacher"] .week-lessons {
  overscroll-behavior-y: contain;
  scroll-behavior: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

body[data-page="teacher"] .week-lesson {
  contain: layout paint;
}

body[data-page="teacher"] .teacher-overview-columns {
  align-items: start;
}

body[data-page="teacher"] .teacher-overview-panel {
  height: auto;
}

body[data-page="teacher"] #dashboardContent .test-editor-card > summary .test-card-summary-copy {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  grid-template-columns: none !important;
}

body[data-page="teacher"] #dashboardContent .test-editor-card > summary .test-card-summary-copy > span {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  grid-template-columns: minmax(0, 1fr) !important;
}

body[data-page="teacher"] #dashboardContent .test-editor-card > summary .test-card-summary-copy :where(strong, small) {
  width: 100%;
  min-width: 0;
}

.record-dialog-backdrop {
  animation: cabinet-overlay-soft-in 140ms ease-out both !important;
}

.record-dialog {
  animation: cabinet-dialog-soft-in 160ms ease-out both !important;
}

@keyframes cabinet-overlay-soft-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cabinet-dialog-soft-in {
  from { opacity: .96; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

body[data-page="teacher"] :where(button, a, summary),
:is(body[data-page="student"], .student-preview) :where(button, a, summary) {
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="teacher"] #dashboardContent.is-section-entering,
  :is(body[data-page="student"], .student-preview) #dashboardContent.is-section-entering,
  .record-dialog-backdrop,
  .record-dialog {
    animation: none !important;
  }
}

/* Final cabinet design-system pass: calmer SaaS surface, denser lists, fewer conflicting effects. */
:root {
  --cabinet-bg: #f5f7fb;
  --cabinet-surface: #ffffff;
  --cabinet-surface-soft: #f8fafc;
  --cabinet-border: #dbe4ef;
  --cabinet-border-strong: #c9d6e8;
  --cabinet-text: #172033;
  --cabinet-muted: #657086;
  --cabinet-primary: #2857ce;
  --cabinet-primary-weak: #edf3ff;
  --cabinet-success: #25815b;
  --cabinet-warning: #a15f12;
  --cabinet-danger: #b4233a;
  --cabinet-radius: 8px;
  --cabinet-shadow: none;
}

body[data-page="teacher"],
:is(body[data-page="student"], .student-preview) {
  background: var(--cabinet-bg);
  color: var(--cabinet-text);
}

body[data-page="teacher"] .dashboard,
:is(body[data-page="student"], .student-preview) .dashboard {
  border-color: var(--cabinet-border);
  background: transparent;
  box-shadow: none;
}

body[data-page="teacher"] .dashboard-head,
:is(body[data-page="student"], .student-preview) .dashboard-head {
  min-height: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--cabinet-border);
}

body[data-page="teacher"] .dashboard-head h2,
:is(body[data-page="student"], .student-preview) .dashboard-head h2 {
  font-family: Manrope, Inter, Roboto, Arial, sans-serif;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.15;
}

body[data-page="teacher"] :where(.data-card, .teacher-welcome, .teacher-overview-panel, .teacher-metric-card, .student-workspace-card, .student-directory-card, .all-lessons-panel, .week-panel, .homework-card, .material-card, .test-card, .lead-item, .email-item, .empty-state-panel),
:is(body[data-page="student"], .student-preview) :where(.data-card, .student-widget, .student-kpi-card, .workspace-board, .homework-side-card, .student-test-list-card, .student-homework-row, .student-goals-card) {
  border: 1px solid var(--cabinet-border) !important;
  border-radius: var(--cabinet-radius) !important;
  background: var(--cabinet-surface) !important;
  box-shadow: none !important;
}

body[data-page="teacher"] :where(.data-card, .teacher-overview-panel, .student-workspace-card, .student-directory-card, .homework-card, .material-card, .test-card, .lead-item, .email-item),
:is(body[data-page="student"], .student-preview) :where(.data-card, .student-widget, .workspace-board, .homework-side-card, .student-test-list-card) {
  padding: 14px !important;
}

body[data-page="teacher"] :where(.lesson-card, .homework-card, .material-card, .test-card, .lead-item, .email-item):hover,
:is(body[data-page="student"], .student-preview) :where(.student-kpi-card, .student-mini-item, .student-test-list-card, .student-homework-row):hover {
  transform: none !important;
  border-color: var(--cabinet-border-strong) !important;
  box-shadow: none !important;
}

body[data-page="teacher"] :where(.test-card, .material-card, .lesson-card) > summary,
:is(body[data-page="student"], .student-preview) :where(.student-homework-row) > summary {
  min-height: 56px !important;
  padding: 10px 12px !important;
  border-radius: var(--cabinet-radius) !important;
  background: var(--cabinet-surface) !important;
}

body[data-page="teacher"] .test-card:not([open]),
body[data-page="teacher"] .material-card:not([open]),
body[data-page="teacher"] .lesson-card:not([open]) {
  padding: 0 !important;
}

body[data-page="teacher"] .test-card:not([open]) > summary,
body[data-page="teacher"] .material-card:not([open]) > summary,
body[data-page="teacher"] .lesson-card:not([open]) > summary {
  border-bottom: 0 !important;
}

body[data-page="teacher"] .test-card-summary-copy strong,
body[data-page="teacher"] .lesson-card-title strong,
body[data-page="teacher"] .material-card strong,
:is(body[data-page="student"], .student-preview) .student-mini-item strong {
  color: var(--cabinet-text);
  font-size: 0.9rem;
  line-height: 1.25;
}

body[data-page="teacher"] .test-card-summary-copy small,
body[data-page="teacher"] .lesson-card-title small,
body[data-page="teacher"] .material-card small,
:is(body[data-page="student"], .student-preview) .student-mini-item small {
  color: var(--cabinet-muted);
  font-size: 0.72rem;
}

body[data-page="teacher"] :where(.pill, .test-card-assigned, .lesson-card-label),
:is(body[data-page="student"], .student-preview) :where(.pill, .mini-test-status, .homework-status) {
  border: 1px solid var(--cabinet-border);
  border-radius: 999px;
  background: var(--cabinet-surface-soft);
  color: var(--cabinet-muted);
  box-shadow: none;
}

body[data-page="teacher"] :where(.pill.blue),
:is(body[data-page="student"], .student-preview) :where(.pill.blue, .mini-test-status) {
  border-color: #c7d7fb;
  background: var(--cabinet-primary-weak);
  color: var(--cabinet-primary);
}

body[data-page="teacher"] :where(.pill.green),
:is(body[data-page="student"], .student-preview) :where(.pill.green) {
  border-color: #c8eadb;
  background: #ebf8f1;
  color: var(--cabinet-success);
}

body[data-page="teacher"] :where(.pill.draft, .pill.amber),
:is(body[data-page="student"], .student-preview) :where(.pill.draft, .pill.amber) {
  border-color: #d8c8f5;
  background: #f5f1ff;
  color: var(--cabinet-warning);
}

body[data-page="teacher"] :where(.danger-button, .pill.red),
:is(body[data-page="student"], .student-preview) :where(.danger-button, .pill.red) {
  --button-danger: var(--cabinet-danger);
}

body[data-page="teacher"] :where(.accent-button, .dark-button),
:is(body[data-page="student"], .student-preview) :where(.accent-button, .dark-button) {
  border-radius: var(--cabinet-radius);
  box-shadow: none !important;
}

body[data-page="teacher"] :where(.outline-button, .text-button, .ghost-button),
:is(body[data-page="student"], .student-preview) :where(.outline-button, .text-button, .ghost-button) {
  border-radius: var(--cabinet-radius);
}

body[data-page="teacher"] :where(.outline-button, .ghost-button, .light-button),
:is(body[data-page="student"], .student-preview) :where(.outline-button, .ghost-button, .light-button) {
  border-color: var(--cabinet-border);
  background: #ffffff;
  color: var(--cabinet-primary);
}

body[data-page="teacher"] .dashboard details.form-panel > summary::after {
  flex: 0 0 auto;
  width: 8px !important;
  height: 8px !important;
  margin-left: auto;
  margin-right: 6px;
  border: 0 !important;
  border-right: 2px solid #617088 !important;
  border-bottom: 2px solid #617088 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: rotate(45deg) !important;
  transition: none !important;
}

body[data-page="teacher"] .dashboard details.form-panel[open] > summary::after {
  transform: rotate(-135deg) !important;
}

body[data-page="teacher"] .settings-student-create > summary::after {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin: 0 6px 0 auto;
  border: 0;
  border-right: 2px solid var(--cabinet-muted);
  border-bottom: 2px solid var(--cabinet-muted);
  border-radius: 0;
  background: transparent;
  transform: rotate(45deg);
  transition: transform 180ms ease-out, border-color 180ms ease-out;
}

body[data-page="teacher"] .settings-student-create[open] > summary::after {
  transform: rotate(-135deg);
}

body[data-page="teacher"] .dashboard details.form-panel[open] > :not(summary),
body[data-page="teacher"] .settings-student-create[open] > :not(summary) {
  animation: none !important;
}

@supports (interpolate-size: allow-keywords) and selector(details::details-content) {
  body[data-page="teacher"] .dashboard details.form-panel::details-content,
  body[data-page="teacher"] .settings-student-create::details-content {
    transition: none !important;
  }
}

body[data-page="teacher"] .test-edit-actions .danger-button {
  border-color: #efb4bf;
  background: #fff5f7;
  color: var(--cabinet-danger);
}

body[data-page="teacher"] .test-edit-actions .danger-button:hover {
  border-color: #df6d80;
  background: #fff0f2;
  color: var(--cabinet-danger);
}

body[data-page="teacher"] .teacher-welcome {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px !important;
}

body[data-page="teacher"] .teacher-welcome h3 {
  margin: 2px 0 4px;
  font-family: Manrope, Inter, Roboto, Arial, sans-serif;
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
}

body[data-page="teacher"] .teacher-welcome p,
body[data-page="teacher"] .overview-panel-head p {
  color: var(--cabinet-muted);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
}

body[data-page="teacher"] .teacher-metric-grid {
  gap: 10px;
}

body[data-page="teacher"] .teacher-metric-card {
  min-height: 72px;
  padding: 12px 14px !important;
  text-align: left;
}

body[data-page="teacher"] .teacher-focus-item,
body[data-page="teacher"] .teacher-overview-lesson {
  position: relative;
  min-height: 50px;
  padding-right: 38px;
  box-shadow: none;
  cursor: pointer;
}

body[data-page="teacher"] .teacher-overview-lessons,
body[data-page="teacher"] .teacher-focus-list {
  overflow: hidden;
  border-radius: 6px;
}

body[data-page="teacher"] .teacher-overview-lesson,
body[data-page="teacher"] .teacher-focus-item {
  padding-inline: 10px 38px;
  border: 0;
  border-bottom: 1px solid #e7edf6;
  border-radius: 0;
  background: transparent;
}

body[data-page="teacher"] .teacher-overview-lesson:last-child,
body[data-page="teacher"] .teacher-focus-item:last-child {
  border-bottom: 0;
}

body[data-page="teacher"] .teacher-focus-item::after,
body[data-page="teacher"] .teacher-overview-lesson::after {
  content: "›";
  position: absolute;
  right: 13px;
  top: 50%;
  color: var(--cabinet-primary);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transform: translate(-3px, -50%);
  transition: opacity 150ms ease-out, transform 150ms ease-out;
}

body[data-page="teacher"] .teacher-overview-lesson:hover {
  transform: translateX(2px);
  background: #f5f8ff;
  box-shadow: none;
}

body[data-page="teacher"] .teacher-focus-item:hover {
  transform: translateX(2px);
  background: #f5f8ff;
  box-shadow: none;
}

body[data-page="teacher"] .teacher-focus-item:hover::after,
body[data-page="teacher"] .teacher-overview-lesson:hover::after,
body[data-page="teacher"] .teacher-focus-item:focus-visible::after,
body[data-page="teacher"] .teacher-overview-lesson:focus-visible::after {
  opacity: 0.9;
  transform: translate(0, -50%);
}

body[data-page="teacher"] .teacher-overview-lesson:active {
  transform: translateX(0);
  box-shadow: none;
}

body[data-page="teacher"] .teacher-focus-item:active {
  transform: translateX(0);
  box-shadow: none;
}

body[data-page="teacher"] .teacher-focus-item:focus,
body[data-page="teacher"] .teacher-overview-lesson:focus {
  outline: none;
}

body[data-page="teacher"] .teacher-overview-lesson:focus-visible {
  background: #f5f8ff;
  box-shadow: inset 3px 0 0 var(--cabinet-primary);
}

body[data-page="teacher"] .teacher-focus-item:focus-visible {
  background: #f5f8ff;
  box-shadow: inset 3px 0 0 var(--cabinet-primary);
}

body[data-page="teacher"] .test-edit-actions,
body[data-page="teacher"] .test-question-add-row,
body[data-page="teacher"] .form-actions,
body[data-page="teacher"] .button-row {
  gap: 8px;
  align-items: center;
}

body[data-page="teacher"] .test-edit-actions {
  position: static;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  justify-content: space-between;
  border-top: 1px solid var(--cabinet-border);
  border-bottom: 0;
  background: #fff;
}

body[data-page="teacher"] #dashboardContent.is-section-entering,
:is(body[data-page="student"], .student-preview) #dashboardContent.is-section-entering,
body[data-page="teacher"] :where(.test-card:not(.is-unreviewed), .material-card, .lesson-card, .teacher-metric-card, .teacher-focus-item, .teacher-overview-lesson),
:is(body[data-page="student"], .student-preview) :where(.student-widget, .student-mini-item, .student-test-list-card) {
  animation: none !important;
  transition-property: border-color, background-color, box-shadow, color, opacity, transform !important;
  transition-duration: 150ms !important;
  transition-timing-function: ease-out !important;
}

body[data-page="teacher"] :where(.test-card, .material-card, .lesson-card, .teacher-metric-card):hover,
:is(body[data-page="student"], .student-preview) :where(.student-widget, .student-mini-item, .student-test-list-card):hover {
  transform: none !important;
}

body[data-page="teacher"] .test-card.is-unreviewed,
body[data-page="teacher"] .test-card.is-unreviewed:hover {
  border-color: #4f7bea !important;
  outline: 2px solid rgba(45, 99, 230, .18);
  outline-offset: 1px;
  animation: test-unreviewed-outline 2.4s ease-in-out infinite !important;
}

@keyframes test-unreviewed-outline {
  0%, 100% {
    outline-color: rgba(45, 99, 230, .12);
  }
  50% {
    outline-color: rgba(45, 99, 230, .46);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="teacher"] .test-card.is-unreviewed {
    animation: none !important;
  }
}

@media (max-width: 760px) {
  body[data-page="teacher"] .teacher-welcome {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-page="teacher"] .teacher-welcome .dark-button {
    width: 100%;
  }

  body[data-page="teacher"] .test-edit-actions {
    align-items: stretch;
    padding: 10px 12px;
  }

  body[data-page="teacher"] .test-edit-actions .test-action-primary,
  body[data-page="teacher"] .test-builder-actions .test-action-primary {
    width: 100%;
  }
}

/* Landing desktop header: contacts remain available in the page footer and lead section. */
@media (min-width: 901px) {
  body[data-page="landing"] .topbar {
    display: grid;
    grid-template-columns: minmax(200px, 270px) minmax(0, 1fr) auto;
    gap: clamp(10px, 1.25vw, 22px);
    align-items: center;
    padding: 12px clamp(18px, 3vw, 52px);
  }

  body[data-page="landing"] .topbar .brand {
    width: auto;
    min-width: 0 !important;
    max-width: 270px;
  }

  body[data-page="landing"] .topbar .brand > span:last-child {
    min-width: 0;
    max-width: 205px;
    font-size: clamp(0.72rem, 0.85vw, 0.84rem);
    line-height: 1.16;
  }

  body[data-page="landing"] .topbar .main-nav {
    display: flex !important;
    min-width: 0;
    justify-content: center;
    flex-wrap: nowrap;
    gap: clamp(2px, 0.65vw, 12px);
  }

  body[data-page="landing"] .topbar .main-nav a {
    flex: 0 1 auto;
    min-width: 0;
    padding-inline: clamp(4px, 0.55vw, 9px);
    font-size: clamp(0.72rem, 0.8vw, 0.84rem);
    white-space: nowrap;
  }

  body[data-page="landing"] .topbar .topbar-actions {
    display: flex !important;
    min-width: 0;
    justify-content: end;
    flex-wrap: nowrap;
    gap: 8px;
  }

  body[data-page="landing"] .topbar .contact-icons {
    display: none !important;
  }

  body[data-page="landing"] .topbar .topbar-actions .ghost-button,
  body[data-page="landing"] .topbar .topbar-actions .dark-button {
    min-height: 40px;
    padding: 9px clamp(9px, 0.8vw, 14px);
    font-size: clamp(0.72rem, 0.78vw, 0.8rem);
    white-space: nowrap;
  }

  body[data-page="landing"] .topbar .menu-button {
    display: none !important;
  }
}
