
#classHomeView:not(.hidden) { display: flex; flex-direction: column; }
#classHomeView > * { order: 60; min-width: 0; }
#classHomeView > .class-home-top { order: 0; }
#classHomeView > .class-hero { order: 1; }
#classHomeView > #classArchivedBanner { order: 2; }
#classHomeView > #csyncNotice { order: 3; }
#classHomeView > #classSetupHost { order: 4; }
#classHomeView > .class-stats { order: 41; margin-top: var(--space-md); }
#classHomeView > #classNewBlock { order: 6; }
#classHomeView > #classWeekBlock { order: 7; }
#classHomeView.class-home--student > #classAssignSection { order: 8; }
#classHomeView > #classLiveBlock, #classHomeView > #clvCardsLabel, #classHomeView > #clvCards { order: 10; }
#classHomeView > #classLiveBlock:has(.clv-card--live, [data-follow="1"]) { order: 5; }
#classHomeView > #classWordsBlock, #classHomeView > #clvRestLabel { order: 40; }
#classHomeView.class-home--teacher > #classAssignSection { order: 45; }
#classHomeView > #classMaterialsSection { order: 55; }
#classHomeView > #classMoreBlock { order: 70; }
#classHomeView > #classInvitePanel { order: 90; }
#classHomeView.class-home--empty > #classInvitePanel { order: 6; }   
#classHomeView > .class-spacer { order: 99; }

.class-block { margin-top: var(--space-md); }
.class-block > .section-label { margin-top: 0; }
.class-block:has(> .class-host:empty) { display: none; }
.class-host:empty { display: none; }
#classLiveHost.training-mode-list { margin-top: 0; }
.class-block--words .training-mode-list + .training-mode-list { margin-top: var(--space-sm); }

.class-hero__switch {
  display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%;
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
}
.class-hero__switch > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.class-hero__caret { font-size: 14px; opacity: .7; flex-shrink: 0; transition: transform var(--transition-fast); }
.class-hero__switch:hover .class-hero__caret, .class-hero__switch:focus-visible .class-hero__caret { opacity: 1; transform: translateY(1px); }
.class-hero__switch:focus-visible { outline: 2px solid rgba(255,255,255,.8); outline-offset: 3px; border-radius: 6px; }
.class-hero__more {
  position: relative; z-index: 1; flex-shrink: 0; min-width: 40px; font-size: 18px; line-height: 1;
  color: #fff !important; border-color: rgba(255,255,255,.4) !important;
}
.class-hero__acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; position: relative; z-index: 1; }

.class-banner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap;
  border-radius: var(--radius-md); padding: 10px 14px; margin-bottom: var(--space-sm);
  font-size: var(--font-size-sm); font-weight: 600;
}
.class-banner--archived { background: var(--color-surface-2); border: 1px dashed var(--color-border); color: var(--color-text-secondary); }
.class-main--archived .class-hero { filter: grayscale(.55); }

.cls-chip {
  display: inline-block; padding: 1px 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700;
  background: var(--color-surface-2); color: var(--color-text-secondary); border: 1px solid var(--color-border);
}
.cls-chip--admin, .cls-chip--co { background: var(--gold-light); color: #8a5a00; border-color: #f3d38b; }
.cls-chip--arch { background: transparent; border-style: dashed; }
.cls-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-full); background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 1;
}
.more-sheet__badge, .nav-sub__badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-full); background: var(--red); color: #fff; font-size: 11px; font-weight: 800; margin-left: auto;
}
.nav-sub__badge { margin-left: 8px; }
.more-sheet__badge.hidden, .nav-sub__badge.hidden { display: none; }

.cls-sheet { max-height: 88dvh; overflow-y: auto; }
.cls-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-sm); }
.cls-sheet__head .modal-title { margin-bottom: var(--space-sm); min-width: 0; overflow-wrap: anywhere; }
.cls-sheet__x {
  flex-shrink: 0; width: 36px; height: 36px; border: 0; border-radius: var(--radius-full);
  background: var(--color-surface-2); color: var(--color-text-secondary); font-size: 22px; line-height: 1; cursor: pointer;
}
.cls-lead { font-size: var(--font-size-sm); color: var(--color-text-secondary); margin: 0 0 var(--space-md); line-height: 1.5; }
.cls-note { font-size: 12px; color: var(--color-text-muted); margin: var(--space-sm) 0 0; line-height: 1.45; }

.cls-sw { display: flex; flex-direction: column; gap: 6px; }
.cls-sw__row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 12px; text-align: left;
  background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: var(--radius-md);
  color: var(--color-text); cursor: pointer; font: inherit;
}
.cls-sw__row:hover, .cls-sw__row:focus-visible { border-color: var(--red); }
.cls-sw__row--on { border-color: var(--red); background: var(--red-light); }
.cls-sw__row--arch { opacity: .75; }
.cls-sw__ic {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  background: var(--color-surface-2); font-weight: 800; color: var(--red);
}
.cls-sw__row--on .cls-sw__ic { background: var(--red); color: #fff; }
.cls-sw__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cls-sw__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-sw__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-secondary); }
.cls-sw__group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); margin: var(--space-sm) 2px 0; }
.cls-sw__acts { display: flex; flex-direction: column; gap: var(--space-sm); margin-top: var(--space-md); }

.cls-pv__facts { font-size: var(--font-size-sm); font-weight: 600; color: var(--color-text-secondary); margin: 0 0 var(--space-sm); }
.cls-pv__list { list-style: none; padding: 0; margin: 0 0 var(--space-md); display: flex; flex-direction: column; gap: 8px; }
.cls-pv__list li { font-size: var(--font-size-sm); line-height: 1.5; background: var(--color-surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.cls-pv__block { background: var(--red-light); color: var(--red-dark); border-radius: var(--radius-sm); padding: 10px 12px; font-weight: 600; font-size: var(--font-size-sm); }
.cls-pv__acts { flex-wrap: wrap; }
.cls-pv__acts .btn { min-width: 0; white-space: normal; }

.cls-menu { display: flex; flex-direction: column; gap: 6px; }
.cls-menu__row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; text-align: left; font: inherit; cursor: pointer;
  background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: var(--radius-md); color: var(--color-text);
}
.cls-menu__row > span:first-child { width: 24px; text-align: center; flex-shrink: 0; }
.cls-menu__row > span:last-child { display: flex; flex-direction: column; gap: 2px; font-weight: 600; min-width: 0; }
.cls-menu__row small { font-weight: 400; font-size: 12px; color: var(--color-text-secondary); }
.cls-menu__row:hover, .cls-menu__row:focus-visible { border-color: var(--red); }
.cls-menu__row--danger { color: var(--red-dark); }

.cls-feed {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px;
}
.cls-feed--all { border: 0; padding: 0; }
.cls-feed__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.cls-feed__title { font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.cls-feed__acts { display: inline-flex; gap: 12px; }
.cls-feed__row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 4px; text-align: left;
  background: none; border: 0; border-top: 1px solid var(--color-border); font: inherit; color: var(--color-text); cursor: pointer;
}
.cls-feed__head + .cls-feed__row, .cls-feed--all > .cls-feed__row:first-child { border-top: 0; }
.cls-feed__ic { width: 24px; text-align: center; flex-shrink: 0; }
.cls-feed__t { flex: 1; min-width: 0; font-size: var(--font-size-sm); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cls-feed__at { flex-shrink: 0; font-size: 11px; color: var(--color-text-muted); }
.cls-feed__row--new .cls-feed__t { font-weight: 700; }
.cls-feed__row--new .cls-feed__ic { position: relative; }
.cls-feed__row--new .cls-feed__ic::after {
  content: ''; position: absolute; top: -1px; right: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--red);
}
.cls-feed__row:hover .cls-feed__t { color: var(--red); }

.cls-home { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.cls-home__row, .cls-home__also {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font: inherit; cursor: pointer;
  background: var(--color-surface-2); border: 0; border-radius: var(--radius-sm); padding: 8px 10px; color: var(--color-text);
}
.cls-home__k { flex-shrink: 0; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; }
.cls-home__t { flex: 1; min-width: 0; font-size: var(--font-size-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-home__also { background: none; padding: 2px 10px; font-size: 12px; color: var(--color-text-secondary); font-weight: 600; }

.cls-setup__next { display: flex; }
.cls-setup:not(.cls-setup--open) .cls-setup__row:not(.cls-setup__row--next) { display: none; }
.cls-setup__more { background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 12px; font-weight: 700; color: var(--color-text-secondary); cursor: pointer; align-self: flex-start; }
.cls-setup__count { font-weight: 600; color: var(--color-text-secondary); font-size: 12px; margin-left: 6px; }
.cls-setup {
  background: var(--gold-light); border: 1px solid #f3d38b; border-radius: var(--radius-lg);
  padding: 10px 12px; margin-bottom: var(--space-md); display: flex; flex-direction: column; gap: 4px;
}
.cls-setup__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cls-setup__x { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--color-text-secondary); cursor: pointer; width: 36px; height: 36px; }
.cls-setup__row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 2px; text-align: left;
  background: none; border: 0; font: inherit; color: var(--color-text); cursor: pointer;
}
.cls-setup__box {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; border: 2px solid #d9a441; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #fff;
}
.cls-setup__row--done .cls-setup__box { background: #d9a441; }
.cls-setup__row--done .cls-setup__body > span { text-decoration: line-through; color: var(--color-text-secondary); }
.cls-setup__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-weight: 600; font-size: var(--font-size-sm); }
.cls-setup__body small { font-weight: 400; font-size: 12px; color: var(--color-text-secondary); }

.cls-sees { list-style: none; margin: 0 0 var(--space-md); padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cls-sees__row { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; background: var(--color-surface-2); border-radius: var(--radius-sm); font-size: var(--font-size-sm); }
.cls-sees__row small { color: var(--color-text-secondary); font-size: 12px; }
.cls-sees__state { align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--color-text-muted); }
.cls-sees__state--on { color: #1e7e34; }

.class-invite-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: var(--space-sm) 0; }
.class-invite-opt { display: inline-flex; align-items: center; gap: 6px; font-size: var(--font-size-sm); color: var(--color-text-secondary); }
.class-invite-sel {
  font: inherit; font-size: var(--font-size-sm); padding: 4px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); max-width: 140px;
}
.class-invite-uses { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--color-text-muted); }
.class-invite-uses:empty { display: none; }
.class-invite-co-btn { margin-top: var(--space-sm); }
#classCoCodeRow { margin-top: var(--space-sm); }

.cls-wiz__steps { list-style: none; display: flex; gap: 4px; margin: 0 0 var(--space-md); padding: 0; counter-reset: wiz; }
.cls-wiz__steps li {
  flex: 1; min-width: 0; font-size: 11px; font-weight: 700; color: var(--color-text-muted); text-align: center;
  border-top: 3px solid var(--color-border); padding-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cls-wiz__steps li.on { color: var(--red); border-color: var(--red); }
.cls-wiz__steps li.done { color: var(--color-text-secondary); border-color: #d9a441; }
.cls-wiz__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 var(--space-md); }
.cls-wiz__chip {
  font: inherit; font-size: var(--font-size-sm); font-weight: 700; min-height: 40px; min-width: 52px; padding: 6px 12px; cursor: pointer;
  border-radius: var(--radius-full); border: 1.5px solid var(--color-border); background: var(--color-surface); color: var(--color-text);
}
.cls-wiz__chip.on, .cls-wiz__chip[aria-pressed="true"] { border-color: var(--red); background: var(--red-light); color: var(--red-dark); }
.cls-wiz__time { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: var(--space-md); font-size: var(--font-size-sm); }
.cls-wiz__time input { font: inherit; padding: 6px 8px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); }
.cls-wiz__words { width: 100%; min-height: 80px; resize: vertical; }

.class-whatis { margin: var(--space-md) 0 0; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 10px 14px; }
.class-whatis summary { cursor: pointer; font-weight: 700; font-size: var(--font-size-sm); }
.class-whatis__list { margin: 8px 0 2px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: var(--font-size-sm); color: var(--color-text-secondary); line-height: 1.5; }

@media (max-width: 560px) {
  .class-hero { flex-wrap: wrap; row-gap: 10px; }
  .class-hero__body { flex-basis: 100%; }
  .class-hero__acts { flex-basis: 100%; justify-content: flex-start; flex-wrap: nowrap; flex-direction: row; }
  .class-hero__acts > .btn:not(.hidden) { flex: 1 1 0; width: auto; min-width: 0; margin: 0; }
  .class-hero__acts > .class-hero__more:not(.hidden) { flex: 0 0 auto; }
  .cls-pv__acts { flex-direction: column-reverse; }
  .cls-pv__acts .btn { flex: 0 0 auto; width: 100%; }
}
@media (max-width: 380px) {
  .class-hero { padding: 16px; }
  .class-hero__name { font-size: 20px; }
}
