:root {
  color-scheme: light;
  --ink: #23251f;
  --muted: #73776b;
  --canvas: #f3f0e7;
  --panel: #fffdf8;
  --line: #deddd4;
  --green: #244b3b;
  --green-soft: #dce9df;
  --coral: #df7559;
  --blue: #5b82a8;
  --yellow: #d7a84a;
  --purple: #826ea3;
  --shadow: 0 18px 50px rgba(45, 48, 39, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

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

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 248px;
  flex-direction: column;
  padding: 28px 18px 22px;
  color: #f7f4ec;
  background: #1f352d;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 28px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: var(--green);
  background: #f5c56d;
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 700;
  transform: rotate(-3deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.06em;
}

.brand small {
  margin-top: 4px;
  color: #b7c5bc;
  font-size: 11px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  color: #cbd6cf;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: 160ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  font-size: 12px;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.feedback-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  margin-bottom: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  color: #f5f3ea;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  text-align: left;
}

.feedback-entry:hover {
  background: rgba(255, 255, 255, 0.12);
}

.feedback-entry strong,
.feedback-entry small {
  display: block;
}

.feedback-entry strong {
  font-size: 12px;
}

.feedback-entry small {
  margin-top: 3px;
  color: #aebcb3;
  font-size: 9px;
}

.privacy-note strong,
.privacy-note small {
  display: block;
}

.privacy-note strong {
  font-size: 12px;
}

.privacy-note small {
  margin-top: 3px;
  color: #aebcb3;
  font-size: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #79ca91;
  box-shadow: 0 0 0 5px rgba(121, 202, 145, 0.12);
}

.main {
  min-height: 100vh;
  margin-left: 248px;
  padding: 0 4vw 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 112px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 4px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 500;
}

.eyebrow {
  margin: 0;
  color: var(--coral);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.class-switcher {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.class-switcher span,
.field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #fff;
}

select,
input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.7;
}

select:focus,
input:focus,
textarea:focus {
  border-color: #789184;
  box-shadow: 0 0 0 3px rgba(36, 75, 59, 0.09);
}

.menu-button {
  display: none;
}

.view {
  display: none;
  padding-top: 34px;
}

.view.active {
  display: block;
}

.hero-card {
  position: relative;
  display: flex;
  min-height: 310px;
  align-items: center;
  overflow: hidden;
  padding: 48px;
  border-radius: 24px;
  color: #f9f6ee;
  background:
    radial-gradient(circle at 76% 20%, rgba(239, 189, 104, 0.25), transparent 28%),
    linear-gradient(125deg, #244b3b, #182e27);
  box-shadow: var(--shadow);
}

.hero-card::after {
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 330px;
  height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.hero-label {
  display: inline-flex;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #e6e8df;
  font-size: 11px;
}

.hero-copy h2 {
  max-width: 560px;
  margin: 22px 0 14px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(34px, 5vw, 57px);
  font-weight: 500;
  line-height: 1.1;
}

.hero-copy p {
  max-width: 540px;
  margin: 0;
  color: #ced9d2;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.primary-button,
.secondary-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--coral);
  box-shadow: 0 8px 22px rgba(223, 117, 89, 0.22);
}

.primary-button:hover {
  background: #cc674e;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fffdf8;
}

.secondary-button:hover {
  border-color: #b9b9af;
  background: #fff;
}

.danger-button {
  border: 1px solid #e6b6a9;
  color: #a54b39;
  background: #fff8f5;
}

.danger-button:hover {
  border-color: #d99382;
  background: #fff1ec;
}

.hero-card .secondary-button {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.primary-button.small,
.secondary-button.small,
.danger-button.small {
  min-height: 36px;
  padding: 0 13px;
}

.text-button {
  padding: 8px;
  color: var(--muted);
  background: transparent;
}

.danger-text:not(:disabled) {
  color: #b4513e;
}

.hero-visual {
  position: absolute;
  right: 8%;
  width: 230px;
  height: 220px;
  opacity: 0.9;
}

.paper {
  position: absolute;
  width: 160px;
  height: 190px;
  border-radius: 8px;
  background: #f5f0df;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.2);
}

.paper-back {
  top: 10px;
  right: 0;
  transform: rotate(9deg);
}

.paper-front {
  top: 0;
  right: 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 34px 18px;
  transform: rotate(-4deg);
}

.paper-front span {
  display: block;
  height: 30px;
  border: 1px solid #b9b7aa;
  border-radius: 5px;
  background: rgba(36, 75, 59, 0.05);
}

.pencil {
  position: absolute;
  right: 10px;
  bottom: 17px;
  width: 175px;
  height: 14px;
  border-radius: 8px;
  background: #efb959;
  transform: rotate(-27deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.pencil::after {
  position: absolute;
  right: -20px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 24px solid #e8d6b8;
  content: "";
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 38px 0 20px;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 30px;
  font-weight: 500;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

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

.tool-card {
  min-height: 210px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  cursor: pointer;
  transition: 180ms ease;
}

.tool-card:hover,
.tool-card:focus {
  border-color: #c7c5ba;
  outline: none;
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.tool-card.featured {
  grid-column: span 2;
  background:
    linear-gradient(120deg, rgba(223, 117, 89, 0.08), transparent 50%),
    var(--panel);
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 17px;
  font-weight: 700;
}

.tool-icon.coral {
  color: #a94b36;
  background: #f5d9d0;
}

.tool-icon.blue {
  color: #3e678e;
  background: #dce8f2;
}

.tool-icon.green {
  color: #315b48;
  background: #dceade;
}

.tool-icon.yellow {
  color: #8b681e;
  background: #f2e6bd;
}

.tool-icon.purple {
  color: #655282;
  background: #e7e0ef;
}

.tool-icon.large {
  width: 62px;
  height: 62px;
  margin-bottom: 20px;
  border-radius: 18px;
  font-size: 26px;
}

.available-tag,
.soon-tag {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.available-tag {
  color: #315b48;
  background: var(--green-soft);
}

.soon-tag {
  color: #7e8079;
  background: #efeee8;
}

.tool-card h3 {
  margin: 20px 0 9px;
  font-size: 16px;
}

.tool-card p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.tool-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.class-layout,
.seating-layout {
  display: grid;
  gap: 18px;
}

.class-layout {
  grid-template-columns: minmax(240px, 0.8fr) minmax(420px, 2fr);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.panel-title h3 {
  margin: 0;
  font-size: 14px;
}

.panel-title span {
  color: var(--muted);
  font-size: 11px;
}

.class-list {
  min-height: 390px;
  padding: 10px;
}

.class-list-empty {
  padding: 40px 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.class-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 6px;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.class-row:hover {
  background: #f7f5ee;
}

.class-row.active {
  border-color: #d9ded7;
  background: #edf3ee;
}

.class-row strong,
.class-row small {
  display: block;
}

.class-row strong {
  font-size: 13px;
}

.class-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.class-badge {
  display: grid;
  min-width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  color: var(--green);
  background: #dbe7dc;
  font-size: 10px;
  font-weight: 700;
}

.student-title-row {
  min-height: 74px;
}

.student-title-row > div:first-child span {
  display: block;
  margin-top: 5px;
}

.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.empty-state {
  display: grid;
  min-height: 390px;
  place-items: center;
  align-content: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin: 16px 0 7px;
  color: var(--ink);
  font-size: 15px;
}

.empty-state p {
  max-width: 370px;
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.7;
}

.empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px dashed #c7c7bc;
  border-radius: 16px;
  color: var(--green);
  background: #f1f3ec;
  font-family: Georgia, serif;
  font-size: 22px;
}

.student-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-height: 390px;
  align-content: start;
  padding: 18px;
}

.student-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #e5e4dc;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.student-item:hover {
  border-color: #b9c6bd;
}

.student-item.selected {
  border-color: var(--coral);
  background: #f9e6df;
  box-shadow: 0 0 0 2px rgba(223, 117, 89, 0.1);
}

.student-number {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: #6e776f;
  background: #eef0eb;
  font-size: 9px;
}

.hidden {
  display: none !important;
}

.seating-layout {
  grid-template-columns: 250px minmax(540px, 1fr);
}

.settings-panel {
  align-self: start;
  padding-bottom: 18px;
}

.field {
  display: grid;
  gap: 7px;
  padding: 14px 20px 0;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 20px 0;
}

.check-field input {
  width: 16px;
  min-height: auto;
  margin-top: 2px;
}

.check-field strong,
.check-field small {
  display: block;
}

.check-field strong {
  font-size: 12px;
}

.check-field small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.info-box {
  margin: 22px 20px 0;
  padding: 14px;
  border-radius: 12px;
  background: #f0f2eb;
}

.info-box strong {
  font-size: 11px;
}

.info-box p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.classroom-panel {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  padding: 28px;
}

.blackboard {
  display: flex;
  width: min(360px, 65%);
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto 36px;
  padding: 0 18px;
  border: 7px solid #a98961;
  border-radius: 4px;
  color: #eff3ed;
  background: #315446;
  box-shadow: 0 5px 12px rgba(37, 58, 50, 0.15);
}

.blackboard span {
  font-family: "Kaiti SC", serif;
  font-size: 16px;
}

.blackboard small {
  color: #cbd8d1;
}

.seat-grid {
  display: grid;
  gap: 10px;
  margin: 0 auto;
}

.seat {
  display: grid;
  min-width: 60px;
  min-height: 48px;
  place-items: center;
  padding: 6px;
  border: 1px solid #d9d8cf;
  border-radius: 9px;
  color: #3d443d;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  text-align: center;
  touch-action: none;
  user-select: none;
  transition: 150ms ease;
}

.seat:hover {
  border-color: #9eaa9f;
  transform: translateY(-1px);
}

.seat.dragging {
  cursor: grabbing;
  opacity: 0.45;
  transform: scale(0.96);
}

.seat.drag-over {
  border-color: var(--coral);
  background: #f9e6df;
  box-shadow: 0 0 0 3px rgba(223, 117, 89, 0.1);
  transform: translateY(-2px);
}

.seat.empty {
  border-style: dashed;
  color: #b0b1aa;
  background: #f7f6f1;
}

.seating-empty {
  position: absolute;
  inset: 84px 0 0;
  min-height: auto;
  background: var(--panel);
}

.compact-select {
  display: grid;
  gap: 4px;
  min-width: 130px;
}

.compact-select span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.compact-select select {
  min-height: 38px;
}

.calling-layout {
  display: grid;
  grid-template-columns: minmax(480px, 1.35fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.calling-stage {
  min-height: 540px;
  padding: 26px;
}

.calling-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.caller-display {
  display: grid;
  min-height: 255px;
  place-items: center;
  align-content: center;
  margin-top: 22px;
  padding: 30px;
  border: 1px solid #d8dfd9;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 20%, rgba(91, 130, 168, 0.13), transparent 38%),
    #f4f7f4;
  text-align: center;
}

.caller-display.has-student {
  border-color: #b8c9bc;
  background:
    radial-gradient(circle at 50% 20%, rgba(121, 202, 145, 0.18), transparent 42%),
    #edf4ee;
}

.caller-kicker {
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.caller-display strong {
  margin: 14px 0 10px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(35px, 5vw, 58px);
  font-weight: 500;
}

.caller-display small {
  color: var(--muted);
  font-size: 11px;
}

.caller-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 28px;
}

.caller-actions .primary-button,
.caller-actions .secondary-button {
  min-width: 150px;
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.history-block {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.panel-title.compact {
  min-height: 50px;
  padding: 0 15px;
}

.calling-history {
  display: flex;
  min-height: 62px;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 11px 15px;
}

.history-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #456050;
  background: #e8f0e9;
  font-size: 11px;
}

.history-chip b {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: #6b917a;
  font-size: 9px;
}

.calling-roster-panel {
  min-height: 540px;
  overflow: hidden;
}

.absence-legend {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f0efe9;
}

.calling-roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  max-height: 470px;
  overflow-y: auto;
  padding: 15px;
}

.calling-roster-empty {
  grid-column: 1 / -1;
  padding: 75px 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.calling-student {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e2e2da;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.calling-student:hover {
  border-color: #b9c6bd;
}

.calling-student.absent {
  border-style: dashed;
  color: #999b95;
  background: #f2f1ed;
  text-decoration: line-through;
}

.calling-student.current {
  border-color: var(--blue);
  background: #eaf1f7;
  box-shadow: 0 0 0 2px rgba(91, 130, 168, 0.1);
}

.calling-student span {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calling-student b {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  color: #4a6b57;
  background: #e5eee6;
  font-size: 9px;
}

.homework-task-select {
  min-width: 210px;
}

.homework-empty {
  display: grid;
  min-height: 500px;
  place-items: center;
  align-content: center;
  padding: 40px;
  text-align: center;
}

.homework-empty h3 {
  margin: 16px 0 8px;
  font-size: 16px;
}

.homework-empty p {
  max-width: 440px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.homework-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.homework-summary-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.homework-summary-card span,
.homework-summary-card strong {
  display: block;
}

.homework-summary-card span {
  color: var(--muted);
  font-size: 10px;
}

.homework-summary-card strong {
  margin-top: 7px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 25px;
  font-weight: 500;
}

.homework-summary-card.attention {
  border-color: #efd4cb;
  background: #fff7f3;
}

.homework-layout {
  display: grid;
  grid-template-columns: minmax(600px, 1.7fr) minmax(280px, 0.7fr);
  gap: 18px;
}

.homework-students-panel {
  overflow: hidden;
}

.homework-student-list {
  max-height: 620px;
  overflow-y: auto;
}

.homework-student-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.55fr) minmax(125px, 0.7fr) minmax(360px, 2fr);
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 11px 18px;
  border-bottom: 1px solid #e9e7df;
}

.homework-student-row:last-child {
  border-bottom: 0;
}

.homework-student-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
}

.homework-student-name span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.homework-status {
  min-height: 38px;
  font-size: 11px;
}

.error-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.error-option {
  min-height: 27px;
  padding: 0 8px;
  border: 1px solid #deddd5;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: 9px;
}

.error-option:hover {
  border-color: #c6aaa0;
}

.error-option.selected {
  border-color: var(--coral);
  color: #fff;
  background: var(--coral);
}

.homework-insights {
  display: grid;
  gap: 18px;
  align-content: start;
}

.insight-card {
  overflow: hidden;
}

.insight-content {
  display: grid;
  gap: 8px;
  min-height: 110px;
  padding: 14px;
}

.insight-empty {
  display: grid;
  min-height: 82px;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.follow-up-group {
  padding: 10px;
  border-radius: 10px;
  background: #f5f3ed;
}

.follow-up-group strong {
  display: block;
  margin-bottom: 6px;
  color: #8a563f;
  font-size: 10px;
}

.follow-up-group p {
  margin: 0;
  color: #555a52;
  font-size: 11px;
  line-height: 1.6;
}

.error-rank-row {
  display: grid;
  grid-template-columns: 72px 1fr 24px;
  gap: 8px;
  align-items: center;
  font-size: 10px;
}

.error-rank-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edeae3;
}

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

.error-rank-row b {
  text-align: right;
}

.exam-layout {
  display: grid;
  grid-template-columns: 280px minmax(580px, 1fr);
  gap: 18px;
}

.exam-settings {
  align-self: start;
  padding-bottom: 20px;
}

.exam-reminders {
  margin: 20px 20px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.exam-reminders strong {
  display: block;
  margin-bottom: 9px;
  font-size: 11px;
}

.exam-reminders div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exam-reminders span {
  padding: 5px 7px;
  border-radius: 7px;
  color: #516058;
  background: #edf1eb;
  font-size: 9px;
}

.exam-board {
  position: relative;
  display: flex;
  min-height: 560px;
  flex-direction: column;
  overflow: hidden;
  padding: 32px 38px;
  border: 10px solid #9a7957;
  border-radius: 16px;
  color: #f5f4eb;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.05), transparent 35%),
    #284b3e;
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.12),
    0 20px 45px rgba(38, 56, 48, 0.12);
}

.exam-board::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(95deg, transparent 20%, rgba(255, 255, 255, 0.018) 50%, transparent 80%);
  content: "";
  pointer-events: none;
}

.exam-board-top,
.exam-board-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.exam-board-top {
  color: #c9d7d0;
  font-size: 12px;
}

.exam-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
}

.exam-live::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9c5bf;
  content: "";
}

.exam-live.running::before {
  background: #77d195;
  box-shadow: 0 0 0 5px rgba(119, 209, 149, 0.12);
}

.exam-live.finished::before {
  background: #ef9b82;
}

.exam-board-main {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  place-items: center;
  align-content: center;
  text-align: center;
}

.exam-board-main p {
  margin: 0 0 10px;
  color: #d0ddd6;
  font-size: 13px;
  letter-spacing: 0.2em;
}

.exam-board-main h2 {
  margin: 0 0 26px;
  font-family: "Kaiti SC", "Songti SC", serif;
  font-size: clamp(27px, 4vw, 48px);
  font-weight: 500;
}

.exam-countdown {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(58px, 9vw, 112px);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  text-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

.exam-countdown-label {
  margin-top: 15px;
  color: #b7c9c0;
  font-size: 11px;
}

.exam-board-bottom {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.exam-board-bottom div {
  text-align: center;
}

.exam-board-bottom div + div {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.exam-board-bottom span,
.exam-board-bottom strong {
  display: block;
}

.exam-board-bottom span {
  margin-bottom: 6px;
  color: #aebfb7;
  font-size: 9px;
}

.exam-board-bottom strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.exam-alert {
  position: absolute;
  inset: 18px 50% auto auto;
  z-index: 3;
  padding: 11px 17px;
  border-radius: 10px;
  color: #703e30;
  background: #ffd9c9;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 700;
  transform: translateX(50%);
}

.exam-board:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  padding: 5vh 6vw;
  border-width: 14px;
  border-radius: 0;
}

.exam-board:fullscreen .exam-countdown {
  font-size: min(15vw, 180px);
}

.coming-soon {
  display: grid;
  min-height: 520px;
  place-items: center;
  align-content: center;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  text-align: center;
}

.coming-soon h2 {
  margin: 8px 0 12px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 34px;
  font-weight: 500;
}

.coming-soon > p:not(.eyebrow) {
  max-width: 460px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

dialog {
  width: min(500px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(25, 35, 30, 0.25);
}

dialog::backdrop {
  background: rgba(22, 31, 27, 0.54);
  backdrop-filter: blur(3px);
}

dialog form {
  padding: 24px;
}

dialog .field {
  padding: 18px 0 0;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.dialog-heading h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 25px;
  font-weight: 500;
}

.dialog-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: #f0efe9;
  cursor: pointer;
  font-size: 20px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.form-tip {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
}

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

.feedback-content-field {
  grid-column: 1 / -1;
}

.feedback-privacy {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  color: #687168;
  background: #f0f2eb;
  font-size: 10px;
  line-height: 1.7;
}

.feedback-privacy a {
  color: var(--green);
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  padding: 13px 17px;
  border-radius: 11px;
  color: #fff;
  background: #1f352d;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

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

@media (max-width: 1050px) {
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-card.featured {
    grid-column: span 2;
  }

  .hero-visual {
    opacity: 0.3;
  }

  .seating-layout {
    grid-template-columns: 1fr;
  }

  .calling-layout {
    grid-template-columns: 1fr;
  }

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

  .homework-layout {
    grid-template-columns: 1fr;
  }

  .exam-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding: 0 18px 40px;
  }

  .menu-button {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
  }

  .topbar {
    min-height: 94px;
    gap: 13px;
  }

  .topbar > div {
    flex: 1;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .class-switcher {
    min-width: 118px;
  }

  .hero-card {
    min-height: 360px;
    padding: 32px 24px;
  }

  .hero-copy h2 {
    font-size: 38px;
  }

  .hero-actions,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-grid,
  .class-layout {
    grid-template-columns: 1fr;
  }

  .tool-card.featured {
    grid-column: auto;
  }

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

  .classroom-panel {
    min-height: 520px;
    padding: 20px 12px;
    overflow-x: auto;
  }

  .seat-grid {
    min-width: 520px;
  }

  .caller-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .calling-roster {
    grid-template-columns: 1fr;
  }

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

  .homework-student-row {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 15px;
  }

  .homework-student-list {
    max-height: none;
  }

  .feedback-fields {
    grid-template-columns: 1fr;
  }

  .feedback-content-field {
    grid-column: auto;
  }

  .exam-board {
    min-height: 480px;
    padding: 25px 18px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .classroom-panel,
  .classroom-panel * {
    visibility: visible;
  }

  .classroom-panel {
    position: absolute;
    inset: 0;
    border: 0;
  }

  .seating-empty {
    display: none;
  }
}
