@import url('../assets/fonts/lxgw-wenkai-lite/academy.css');
body {
  background: #fff;
  color: #26362d;
  min-height: 100vh;
}
body > nav {
  border-bottom: 1px solid #eee;
  background: #fff;
  max-width: none;
  padding: 16px 5vw;
}
main {
  max-width: 1000px;
}
header {
  justify-content: center;
  text-align: center;
  padding: 30px 0 24px;
}
header > img {
  width: 64px;
}
header .eyebrow {
  display: none;
}
header h1 {
  font-size: clamp(26px, 4vw, 42px);
  margin: 0;
}
header p {
  margin-top: 12px;
  color: #67776c;
}
.methods {
  gap: 40px;
  align-items: start;
}
.panel {
  box-shadow: none;
}
.methods > .panel {
  border: 0;
  border-radius: 0;
  text-align: center;
  padding: 20px 12px;
  background: #fff;
}
.methods .step,
.methods .small {
  display: none;
}
.entry-symbol {
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  margin: 0 auto 25px;
  border-radius: 42px;
  background: #e7f1e6;
  font: 700 64px/1 sans-serif;
  color: #426b4a;
  box-shadow: 0 6px 0 #d4e2d1;
}
.google-symbol {
  border-radius: 50%;
  background: #f6f7f8;
  color: #426b4a;
  box-shadow: 0 5px 0 #e8eaed;
  font-size: 36px;
}
.methods h2 {
  font-size: 26px;
  margin: 18px 0 10px;
}
.methods p {
  font-size: 16px;
}
.methods #choose-code {
  background: transparent;
  border: 0;
  padding: 0;
  display: block;
  width: 100%;
  color: inherit;
}
.methods #choose-code:hover .entry-symbol {
  background: #d7ead4;
}
.methods #google-button {
  display: flex;
  justify-content: center;
  margin: 26px 0;
}
#code-form {
  max-width: 360px;
  margin: 24px auto 0;
  text-align: left;
}
#student-code {
  font: 32px/1.4 sans-serif;
}
.keypad button {
  font-family: system-ui, sans-serif;
}
#google-unavailable {
  font-size: 14px;
  background: #f6f7f8;
  color: #66736b;
}
#setup {
  display: none;
}
main > details {
  display: none;
}
footer {
  border: 0;
  margin-top: 30px;
  padding-top: 20px;
  font-size: 12px;
}
#guest-entry {
  display: inline-block;
  font:
    14px system-ui,
    sans-serif;
  color: #68736b;
  margin-bottom: 16px;
  text-decoration: underline;
}
#teacher-panel {
  background: #fffaf1;
}
#teacher-panel .panel {
  background: #fffaf1;
}
.identity {
  background: #fffaf1;
}
#teacher-open {
  font-size: 14px;
}
#message:empty {
  display: none;
}
@media (max-width: 600px) {
  header {
    display: block;
    padding: 25px 0 5px;
  }
  header > img {
    width: 56px;
    margin-bottom: 12px;
  }
  header p {
    font-size: 15px;
  }
  .methods {
    gap: 6px;
  }
  .entry-symbol {
    width: 100px;
    height: 100px;
    font-size: 38px;
    border-radius: 25px;
  }
  .google-symbol {
    border-radius: 50%;
  }
  .methods h2 {
    font-size: 23px;
  }
  .methods > .panel {
    padding: 18px 8px;
  }
  .methods p {
    font-size: 14px;
  }
  .methods #google-button {
    margin: 16px 0;
  }
  footer {
    margin-top: 10px;
  }
}

.code-panel {
  order: -1;
}
@media (max-width: 600px) {
  .google-symbol {
    font-size: 24px;
  }
}

html[data-login-entry='teacher'] main {
  max-width: 760px;
}
html[data-login-entry='teacher'] .methods {
  grid-template-columns: 1fr;
  max-width: 480px;
  margin: auto;
}
html[data-login-entry='teacher'] .code-panel {
  display: none !important;
}
html[data-login-entry='teacher'] #google-button {
  width: 160px;
  height: 160px;
  margin: 0 auto 28px;
  align-items: center;
  background: #f6f7f8;
  border-radius: 50%;
}
html[data-login-entry='teacher'] #google-button > div {
  transform: scale(4);
  transform-origin: center;
}
html[data-login-entry='teacher'] .google-panel h2 {
  font-size: 22px;
}
#teacher-password-entry {
  display: block;
  margin: 12px auto;
  text-decoration: underline;
}
.teacher-student-entry {
  text-align: center;
  color: #67776c;
  font-size: 14px;
  margin: 24px 0;
}
html[data-login-entry='teacher'] #google-unavailable {
  margin: 20px 0;
}
html[data-login-entry='teacher'] header {
  padding-bottom: 12px;
}

/* Fit both the sign-in and signed-in teacher view in the viewport. Management scrolls inside its panel. */
html[data-login-entry='teacher'] body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
html[data-login-entry='teacher'] body > nav {
  height: 52px;
  min-height: 52px;
  padding: 8px 4vw;
  gap: 12px;
  font-size: 13px;
}
html[data-login-entry='teacher'] main {
  flex: 1;
  width: min(94%, 760px);
  margin: 0 auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
html[data-login-entry='teacher'] header {
  padding: 4px 0 8px;
  margin: 0;
  gap: 14px;
}
html[data-login-entry='teacher'] header > img {
  width: 64px;
  height: 58px;
  object-fit: contain;
}
html[data-login-entry='teacher'] header h1 {
  font-size: 30px;
}
html[data-login-entry='teacher'] header p {
  font-size: 13px;
  margin: 5px 0 0;
}
html[data-login-entry='teacher'] .methods {
  width: 100%;
  margin: 0 auto;
}
html[data-login-entry='teacher'] .methods > .panel {
  padding: 8px;
}
html[data-login-entry='teacher'] #google-button {
  margin: 8px auto 18px;
}
html[data-login-entry='teacher'] .google-panel h2 {
  font-size: 19px;
  margin: 8px 0;
}
html[data-login-entry='teacher'] .google-panel > p {
  font-size: 14px;
  margin: 6px 0;
}
html[data-login-entry='teacher'] #message {
  margin: 3px 0;
  font-size: 13px;
  text-align: center;
}
html[data-login-entry='teacher'] #teacher-password-entry {
  margin: 4px auto;
  font-size: 13px;
  min-height: 32px;
  padding: 4px 10px;
}
html[data-login-entry='teacher'] footer {
  padding: 10px 0 0;
  margin: 4px 0 0;
}
html[data-login-entry='teacher'] #guest-entry {
  font-size: 13px;
  margin-bottom: 6px;
}
html[data-login-entry='teacher'] #identity {
  width: 100%;
  max-width: 560px;
  margin: 8px auto;
  padding: 16px;
  gap: 16px;
}
html[data-login-entry='teacher'] #identity .portrait {
  width: 86px;
  aspect-ratio: 1;
  height: auto;
}
html[data-login-entry='teacher'] #identity .portrait img.teacher-panda {
  position: static;
  width: 100%;
  height: auto;
  object-fit: contain;
}
html[data-login-entry='teacher'] #identity h2 {
  font-size: 23px;
  margin: 5px 0;
}
html[data-login-entry='teacher'] #identity p {
  font-size: 13px;
  margin: 5px 0;
}
html[data-login-entry='teacher'] #identity .actions {
  gap: 8px;
  margin: 10px 0 4px;
}
html[data-login-entry='teacher'] #identity .actions > * {
  font-size: 13px;
  padding: 8px 12px;
  min-height: 36px;
}
html[data-login-entry='teacher'] #logout {
  font-size: 13px;
  min-height: 34px;
  padding: 4px 8px;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] header,
html[data-login-entry='teacher'][data-teacher-view='manage'] #identity {
  display: none !important;
}
html[data-login-entry='teacher'] #teacher-panel {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] #teacher-panel {
  max-height: calc(100svh - 160px);
  overflow: auto;
  overscroll-behavior: contain;
}
@media (max-height: 700px) {
  html[data-login-entry='teacher'] main {
    padding: 6px 0;
    gap: 4px;
  }
  html[data-login-entry='teacher'] #google-button {
    width: 120px;
    height: 120px;
    margin: 5px auto 12px;
  }
  html[data-login-entry='teacher'] #google-button > div {
    transform: scale(3);
  }
  html[data-login-entry='teacher'] header > img {
    width: 48px;
    height: 44px;
  }
  html[data-login-entry='teacher'] header h1 {
    font-size: 26px;
  }
  html[data-login-entry='teacher'] header p {
    display: none;
  }
  html[data-login-entry='teacher'] #identity {
    padding: 10px;
    margin: 0 auto;
  }
  html[data-login-entry='teacher'] #identity .portrait {
    width: 60px;
  }
}
@media (max-width: 600px) {
  html[data-login-entry='teacher'] body > nav > span {
    display: none;
  }
  html[data-login-entry='teacher'] header {
    display: flex;
    text-align: left;
    justify-content: center;
  }
  html[data-login-entry='teacher'] header > img {
    margin: 0;
  }
  html[data-login-entry='teacher'] #identity {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }
  html[data-login-entry='teacher'] #identity .actions {
    justify-content: center;
    flex-wrap: wrap;
  }
}
/* Teacher account dashboard: one clear destination, with class management as a full page. */
html[data-login-entry='teacher'] #guest-entry {
  font-family: inherit;
  font-size: 14px;
}
html[data-login-entry='teacher'][data-teacher-view='account'] header > img {
  display: none;
}
html[data-login-entry='teacher'][data-teacher-view='account'] header {
  margin-bottom: 8px;
  text-align: center;
}
html[data-login-entry='teacher'][data-teacher-view='account'] #identity {
  max-width: 600px;
  background: linear-gradient(135deg, #fffdf6, #f2f6ed);
  border: 1px solid #e3ddcd;
  border-radius: 24px;
  box-shadow: 0 12px 35px #324d3210;
  padding: 24px;
  gap: 24px;
  align-items: center;
}
html[data-login-entry='teacher'][data-teacher-view='account'] #identity .portrait {
  width: 110px;
}
html[data-login-entry='teacher'][data-teacher-view='account'] #identity-note {
  display: none;
}
html[data-login-entry='teacher'][data-teacher-view='account'] #identity-eyebrow {
  color: #557453;
  font-size: 12px;
}
html[data-login-entry='teacher'][data-teacher-view='account'] #teacher-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
html[data-login-entry='teacher'][data-teacher-view='account'] #teacher-links > a:first-child {
  grid-column: 1/-1;
  font-size: 16px;
  min-height: 46px;
}
html[data-login-entry='teacher'][data-teacher-view='account'] #logout {
  margin-top: 12px;
  color: #8b7d6b;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] main {
  width: min(94%, 1120px);
  justify-content: flex-start;
  padding-top: 24px;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] #teacher-panel {
  max-width: none;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] #teacher-controls {
  background: transparent;
}
.management-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.management-heading h2 {
  margin: 0;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] .roster-row {
  background: #fffdf8;
  border: 1px solid #e4ddcf;
  border-radius: 16px;
  margin: 12px 0;
  padding: 18px;
}
@media (max-width: 600px) {
  html[data-login-entry='teacher'][data-teacher-view='account'] #identity {
    padding: 18px;
    gap: 8px;
  }
  html[data-login-entry='teacher'][data-teacher-view='account'] #identity .portrait {
    width: 80px;
  }
  .management-heading h2 {
    font-size: 22px;
  }
}
@media (max-height: 650px) {
  html[data-login-entry='teacher'][data-teacher-view='account'] #identity {
    padding: 12px;
    gap: 8px;
  }
  html[data-login-entry='teacher'][data-teacher-view='account'] #identity .portrait {
    width: 60px;
  }
  html[data-login-entry='teacher'][data-teacher-view='account'] #teacher-links {
    margin-top: 10px;
  }
}

/* Full-width navigation and a compact, paper-and-ink roster. */
html[data-login-entry='teacher'] body > nav {
  width: 100%;
  max-width: none;
  margin: 0;
  justify-content: space-between;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] body {
  background: #f5f2e9;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] main {
  width: min(96%, 1440px);
  padding: 20px 22px 40px;
  gap: 10px;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] body > nav {
  background: #fffaf0;
  border-bottom: 2px solid #365b48;
}
.management-heading {
  justify-content: flex-start;
  align-items: center;
  gap: 26px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d9d0ba;
}
.management-heading h2 {
  font-size: 28px;
}
.management-heading .eyebrow {
  font-size: 12px;
  color: #8c7958;
  margin: 0 0 5px;
}
#manage-back {
  padding: 6px 0;
  color: #365b48;
  white-space: nowrap;
}
.management-help {
  color: #746b58;
  font-size: 14px;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] .filters {
  margin: 0 0 12px;
  gap: 12px;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] #teacher-controls > .actions {
  margin: 12px 0;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] #teacher-controls > .small {
  font-size: 12px;
  margin: 8px 0 18px;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] .roster-row {
  grid-template-columns: 22px minmax(180px, 1fr) minmax(170px, 1fr) auto;
  padding: 14px 18px;
  margin: 0;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid #e2dac6;
  background: #fffcf4;
  gap: 16px;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] #roster {
  border: 1px solid #d9d0ba;
  border-top: 3px solid #416953;
}
.roster-row strong {
  font-size: 19px;
  font-weight: 400;
}
.roster-row .student-english {
  color: #3c5d4e;
  font-size: 14px;
  margin: 4px 0;
}
.roster-row .email-editor {
  font-size: 13px;
}
.roster-row .email-editor summary {
  cursor: pointer;
  color: #6b775e;
  padding: 10px 0;
}
.roster-row .email-input {
  font-family: var(--site-font);
}
.roster-row .row-actions button:first-child {
  background: #416953;
  color: #fff;
  border-color: #416953;
}
@media (max-width: 700px) {
  html[data-login-entry='teacher'][data-teacher-view='manage'] main {
    width: 100%;
    padding: 16px 12px 30px;
  }
  .management-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .management-heading h2 {
    font-size: 24px;
  }
  html[data-login-entry='teacher'][data-teacher-view='manage'] .roster-row {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 14px 12px;
  }
  html[data-login-entry='teacher'][data-teacher-view='manage'] .roster-row .email-editor,
  html[data-login-entry='teacher'][data-teacher-view='manage'] .roster-row .row-actions {
    grid-column: 2;
    min-width: 0;
  }
  .roster-row .row-actions {
    flex-wrap: wrap;
  }
}
html[data-login-entry='teacher'][data-teacher-view='manage'] main {
  max-width: 1440px;
}
html[data-login-entry='teacher'] input,
html[data-login-entry='teacher'] select {
  font-family: var(--site-font);
}
@media (max-width: 700px) {
  html[data-login-entry='teacher'][data-teacher-view='manage'] .filters {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
    gap: 8px;
  }
  html[data-login-entry='teacher'][data-teacher-view='manage'] .filters label {
    min-width: 0;
  }
  html[data-login-entry='teacher'][data-teacher-view='manage'] .filters select {
    width: 100%;
    padding-inline: 5px;
  }
  html[data-login-entry='teacher'][data-teacher-view='manage'] #teacher-controls > .actions {
    gap: 7px;
  }
  html[data-login-entry='teacher'][data-teacher-view='manage'] #teacher-controls > .actions button {
    font-size: 13px;
    padding: 8px 10px;
  }
}
html[data-login-entry='teacher'][data-teacher-view='manage'] body > nav {
  display: none;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] main {
  padding-top: 16px;
}
@media (max-width: 700px) {
  .management-heading {
    margin-bottom: 10px;
    padding-bottom: 10px;
    gap: 5px;
  }
}
.card-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}
#card-preview-panel {
  background: #eee7d7;
  border: 1px solid #d8caaa;
  padding: 16px;
  text-align: center;
  position: sticky;
  top: 16px;
}
#card-preview-panel h3 {
  margin: 0 0 8px;
  font-size: 22px;
}
#card-preview-note {
  font-size: 13px;
  line-height: 1.7;
  color: #76664d;
}
#card-preview {
  cursor: zoom-in;
}
#card-preview .rabbit-login-card {
  width: 100%;
}
#card-preview-panel > button {
  margin-top: 12px;
}
.student-card-select {
  font: inherit;
  font-size: 19px;
  border: 0;
  background: none;
  color: #294e3b;
  padding: 0;
  min-height: 32px;
  text-align: left;
}
.roster-row.selected {
  background: #edf1e4 !important;
}
#card-zoom-dialog {
  border: 1px solid #cbb47d;
  background: #f8f0de;
  border-radius: 7px;
  max-width: min(96vw, 560px);
  max-height: 94svh;
  padding: 20px;
  overflow: auto;
}
#card-zoom-dialog::backdrop {
  background: #1c302a99;
}
#card-zoom-dialog form {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
#card-zoom-content .rabbit-login-card {
  width: 420px;
  max-width: 100%;
}
html[data-login-entry='teacher'][data-teacher-view='manage'] .card-workspace .roster-row {
  grid-template-columns: 20px minmax(130px, 1fr) auto;
}
.card-workspace .email-editor {
  grid-column: 2/-1;
  grid-row: 2;
}
.card-workspace .row-actions {
  max-width: 210px;
}
@media (max-width: 950px) {
  .card-workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 12px;
  }
  .card-workspace .row-actions {
    grid-column: 2/-1;
  }
}
@media (max-width: 650px) {
  .card-workspace {
    grid-template-columns: 1fr;
  }
  #card-preview-panel {
    position: static;
    grid-row: 1;
  }
  #card-preview:empty {
    display: none;
  }
  #card-preview .rabbit-login-card {
    max-width: 320px;
    margin: auto;
  }
}
.card-preview-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}
.roster-row .student-card-select {
  font-size: 20px;
}

/* 2026-11-06: public-facing teacher welcome, without exposing private access.
   The existing Google and password authentication flows remain unchanged. */
html[data-login-entry='teacher'][data-teacher-view='login'] body {
  background: #f6f3e9;
}
html[data-login-entry='teacher'][data-teacher-view='login'] body > nav {
  background: #fffaf0;
  border-bottom: 1px solid #e6ddcb;
}
html[data-login-entry='teacher'][data-teacher-view='login'] main {
  width: min(94%, 1100px);
  max-width: 1100px;
  gap: 12px;
  padding: 22px 0 28px;
}
html[data-login-entry='teacher'][data-teacher-view='login'] header {
  padding: 8px 0 14px;
  gap: 18px;
}
html[data-login-entry='teacher'][data-teacher-view='login'] header > img {
  width: 76px;
  height: 76px;
}
html[data-login-entry='teacher'][data-teacher-view='login'] header h1 {
  font-size: clamp(30px,3.4vw,40px);
}
html[data-login-entry='teacher'][data-teacher-view='login'] header p {
  font-size: 16px;
}
html[data-login-entry='teacher'] .teacher-login-layout {
  display: grid;
  grid-template-columns: minmax(0, .93fr) minmax(0, 1.07fr);
  gap: 24px;
  align-items: stretch;
  width: 100%;
}
html[data-login-entry='teacher'] .teacher-login-layout #login-methods {
  width: 100%;
  max-width: none;
  margin: 0;
  min-width: 0;
}
html[data-login-entry='teacher'] .teacher-login-layout .google-panel {
  min-height: 0;
  height: 100%;
  border: 1px solid #d9dfcd;
  border-radius: 22px;
  background: #f8fbf5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 22px;
}
html[data-login-entry='teacher'] .teacher-login-layout #google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
  min-height: 220px;
  margin: 10px auto 20px;
  border: 2px solid #dee4df;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 5px 20px #3c594312;
}
html[data-login-entry='teacher'] .teacher-login-layout #google-button > div {
  transform: scale(5.2);
  transform-origin: center;
}
html[data-login-entry='teacher'] .teacher-login-layout .google-panel h2 {
  font-size: 23px;
  margin: 12px 0 8px;
}
html[data-login-entry='teacher'] .teacher-login-layout .google-panel > p {
  font-size: 15px;
  margin: 4px 0;
}
html[data-login-entry='teacher'] .teacher-login-layout #google-unavailable {
  width: 100%;
  max-width: 350px;
  margin: 8px auto;
  box-sizing: border-box;
}
html[data-login-entry='teacher'] .teacher-welcome {
  min-width: 0;
  padding: clamp(22px, 2.6vw, 34px);
  text-align: left;
  background: #fffaf0;
  border: 1px solid #e0d5bd;
  border-radius: 22px;
  color: #3c5545;
}
html[data-login-entry='teacher'] .teacher-welcome-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #9b7852;
}
html[data-login-entry='teacher'] .teacher-welcome h2 {
  margin: 0 0 2px;
  font-size: clamp(23px,2.5vw,29px);
  line-height: 1.5;
  font-weight: 400;
}
html[data-login-entry='teacher'] .teacher-welcome > p {
  margin: 10px 0;
  font-size: 15px;
  line-height: 1.75;
}
html[data-login-entry='teacher'] .teacher-welcome > .teacher-welcome-en,
html[data-login-entry='teacher'] .teacher-membership [lang=en] {
  display: block;
  color: #7c816c;
  font: 13px/1.55 'LXGW WenKai Lite',sans-serif;
}
html[data-login-entry='teacher'] .teacher-welcome > .teacher-welcome-en {
  margin: 4px 0 10px;
}
html[data-login-entry='teacher'] .teacher-welcome strong {
  font-weight: 600;
  color: #326548;
}
html[data-login-entry='teacher'] .teacher-library-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 12px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid #3b7658;
  background: #eaf1e5;
  color: #23563f;
  text-decoration: none;
  font-size: 18px;
}
html[data-login-entry='teacher'] .teacher-library-link:hover {
  background: #dcebd8;
}
html[data-login-entry='teacher'] .teacher-library-link small {
  font: 13px/1.35 'LXGW WenKai Lite',sans-serif;
}
html[data-login-entry='teacher'] .teacher-membership {
  border-top: 1px solid #e6dbc7;
  padding-top: 12px;
  color: #88745a;
  font-size: 13px !important;
}
html[data-login-entry='teacher'] .teacher-membership [lang=en] {
  margin-top: 5px;
}
html[data-login-entry='teacher'][data-teacher-view='login'] #teacher-password-entry {
  margin: 6px auto 0;
  padding: 7px 16px;
  min-height: 36px;
  font-size: 14px;
}
html[data-login-entry='teacher'][data-teacher-view='login'] main > footer {
  margin: 0;
  padding: 4px 0 0;
}
html[data-login-entry='teacher'][data-teacher-view='login'] #guest-entry {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  min-height: 50px;
  margin: 0;
  padding: 7px 24px;
  border: 1px solid #bfd2b9;
  border-radius: 12px;
  background: #f0f6ea;
  color: #315d44;
  text-decoration: none;
  font-size: 17px;
  line-height: 1.35;
}
html[data-login-entry='teacher'] #guest-entry [lang=en] {
  font: 12px/1.4 'LXGW WenKai Lite',sans-serif;
}
html[data-login-entry='teacher'][data-teacher-view='login'] #guest-entry:hover {
  background: #e0eed8;
}
html[data-login-entry='teacher']:is([data-teacher-view='account'],[data-teacher-view='manage'],[data-teacher-view='password']) .teacher-login-layout {
  display: none;
}
@media (max-width: 720px) {
  html[data-login-entry='teacher'] .teacher-login-layout {
    grid-template-columns: minmax(0,1fr);
    gap: 14px;
  }
  html[data-login-entry='teacher'][data-teacher-view='login'] main {
    width: min(94%,560px);
    justify-content: flex-start;
    padding: 14px 0 24px;
  }
  html[data-login-entry='teacher'] .teacher-login-layout .google-panel {
    padding: 16px;
  }
  html[data-login-entry='teacher'] .teacher-login-layout #google-button {
    width: 150px;
    height: 150px;
    min-height: 150px;
    margin: 8px auto 14px;
  }
  html[data-login-entry='teacher'] .teacher-login-layout #google-button > div {
    transform: scale(3.6);
  }
  html[data-login-entry='teacher'] .teacher-welcome { padding: 18px; }
  html[data-login-entry='teacher'][data-teacher-view='login'] header {
    text-align: center;
    justify-content: center;
  }
}
@media (min-width: 721px) and (max-height: 730px) {
  html[data-login-entry='teacher'][data-teacher-view='login'] main {
    justify-content: flex-start;
    padding: 12px 0 22px;
  }
  html[data-login-entry='teacher'] .teacher-login-layout #google-button {
    width: 170px;
    height: 170px;
    min-height: 170px;
    margin: 8px auto 14px;
  }
  html[data-login-entry='teacher'] .teacher-login-layout #google-button > div {
    transform: scale(4);
  }
  html[data-login-entry='teacher'] .teacher-welcome { padding: 18px 24px; }
  html[data-login-entry='teacher'] .teacher-welcome > p { margin: 6px 0; }
}
@media (max-width: 360px) {
  html[data-login-entry='teacher'] .teacher-welcome { padding: 14px; }
  html[data-login-entry='teacher'] .teacher-welcome h2 { font-size: 22px; }
  html[data-login-entry='teacher'] .teacher-library-link { padding: 10px 8px; }
}

/* 2026-11-06: Both teacher login methods have equal prominence, and the
   welcome stays in one desktop viewport. On small screens natural scroll wins. */
html[data-login-entry='teacher'] .teacher-signin-choices {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:stretch;
  gap:12px;
  width:100%;
}
html[data-login-entry='teacher'] .teacher-google-choice,
html[data-login-entry='teacher'] .teacher-password-choice {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  width:100%;
  min-width:0;
  min-height:250px;
  border:1px solid #d5dfd0;
  border-radius:18px;
  background:#fffdf7;
  text-align:center;
  padding:16px 8px;
  box-sizing:border-box;
}
html[data-login-entry='teacher'] .teacher-login-layout .teacher-google-choice #google-button {
  display:flex;
  align-items:center;
  justify-content:center;
  width:124px;
  height:124px;
  min-height:124px;
  flex:0 0 124px;
  margin:0 auto 6px;
  padding:0;
  background:#fff;
  border:2px solid #e0e4e2;
  border-radius:50%;
  box-shadow:0 4px 12px #47685010;
}
html[data-login-entry='teacher'] .teacher-login-layout .teacher-google-choice #google-button > div {
  transform:scale(2.85);
  transform-origin:center;
}
html[data-login-entry='teacher'] .teacher-google-choice h2 {
  margin:0;
  font-size:19px !important;
  line-height:1.3;
}
html[data-login-entry='teacher'] .teacher-google-choice p {
  margin:0;
  font-size:12px !important;
  color:#607665;
}
html[data-login-entry='teacher'] .teacher-google-choice p [lang=en],
html[data-login-entry='teacher'] .teacher-password-choice [lang=en] {
  display:block;
  margin-top:2px;
  font:12px/1.35 'LXGW WenKai Lite',sans-serif;
}
html[data-login-entry='teacher'][data-teacher-view='login'] .teacher-password-choice#teacher-password-entry {
  margin:0;
  min-height:250px;
  padding:16px 8px;
  font-size:19px;
  text-decoration:none;
  cursor:pointer;
  color:#315e49;
}
html[data-login-entry='teacher'] .teacher-password-choice:hover,
html[data-login-entry='teacher'] .teacher-password-choice:focus-visible {
  background:#e9f2e5;
  border-color:#8aab95;
}
html[data-login-entry='teacher'] .teacher-password-symbol {
  display:grid;
  place-items:center;
  flex:0 0 124px;
  width:124px;
  height:124px;
  margin:0 auto 6px;
  border-radius:50%;
  border:2px solid #c9ddce;
  background:#e5f0e4;
  color:#397656;
}
html[data-login-entry='teacher'] .teacher-password-symbol svg { width:65px; height:65px; }
html[data-login-entry='teacher'] .teacher-password-choice strong {
  display:block;
  font-size:19px;
  font-weight:400;
  line-height:1.3;
}
html[data-login-entry='teacher'] .teacher-login-layout .google-panel {
  padding:16px;
}
html[data-login-entry='teacher'] .teacher-login-layout .google-panel > .small {
  display:none;
}
html[data-login-entry='teacher'] .teacher-login-layout #google-unavailable:not([hidden]) {
  margin:10px 0 0;
  padding:8px;
  font-size:12px;
}
html[data-login-entry='teacher'][data-teacher-view='login'] .teacher-welcome #guest-entry {
  display:inline;
  min-height:0;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
  color:#2b7355;
  font:inherit;
  font-weight:600;
  line-height:inherit;
  text-decoration:underline;
  text-underline-offset:3px;
}
html[data-login-entry='teacher'][data-teacher-view='login'] .teacher-welcome #guest-entry:hover {
  color:#16583e;
  background:none;
}
html[data-login-entry='teacher'][data-teacher-view='login'] main > footer { display:none; }
html[data-login-entry='teacher'][data-teacher-view='login'] main {
  width:min(94%,1160px);
  max-width:1160px;
  padding:8px 0 12px;
  gap:5px;
}
html[data-login-entry='teacher'][data-teacher-view='login'] header {
  padding:0 0 8px;
  gap:12px;
}
html[data-login-entry='teacher'][data-teacher-view='login'] header > img {
  width:60px;
  height:60px;
}
html[data-login-entry='teacher'][data-teacher-view='login'] header h1 { font-size:32px; }
html[data-login-entry='teacher'][data-teacher-view='login'] header p { margin:3px 0 0; font-size:13px; }
html[data-login-entry='teacher'][data-teacher-view='login'] .teacher-login-layout { gap:18px; }
html[data-login-entry='teacher'][data-teacher-view='login'] .teacher-welcome {
  padding:clamp(16px,2.1vh,24px) clamp(18px,2vw,26px);
}
html[data-login-entry='teacher'][data-teacher-view='login'] .teacher-welcome-kicker {
  margin:0 0 6px;
}
html[data-login-entry='teacher'][data-teacher-view='login'] .teacher-welcome h2 {
  font-size:clamp(23px,2.1vw,28px);
  line-height:1.35;
}
html[data-login-entry='teacher'][data-teacher-view='login'] .teacher-welcome > p {
  margin:6px 0;
  font-size:14px;
  line-height:1.53;
}
html[data-login-entry='teacher'][data-teacher-view='login'] .teacher-welcome > .teacher-welcome-en {
  margin:3px 0 7px;
  font-size:12px;
  line-height:1.4;
}
html[data-login-entry='teacher'][data-teacher-view='login'] .teacher-library-link {
  margin:9px 0 7px;
  padding:8px 12px;
  font-size:16px;
}
html[data-login-entry='teacher'][data-teacher-view='login'] .teacher-membership {
  padding-top:8px;
  margin-top:8px;
}
@media (min-width: 850px) and (min-height: 690px) {
  html[data-login-entry='teacher'][data-teacher-view='login'] body {
    height:100svh;
    overflow:hidden;
  }
  html[data-login-entry='teacher'][data-teacher-view='login'] main {
    height:calc(100svh - 52px);
    min-height:0;
    flex:1 1 auto;
    justify-content:center;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
}
@media (max-width: 849px) {
  html[data-login-entry='teacher'] .teacher-login-layout {
    grid-template-columns:1fr;
    gap:12px;
  }
  html[data-login-entry='teacher'][data-teacher-view='login'] main {
    justify-content:flex-start;
    padding:12px 0 25px;
  }
}
@media (max-width: 500px) {
  html[data-login-entry='teacher'] .teacher-signin-choices { gap:8px; }
  html[data-login-entry='teacher'] .teacher-google-choice,
  html[data-login-entry='teacher'][data-teacher-view='login'] .teacher-password-choice#teacher-password-entry {
    min-height:185px;
    padding:12px 4px;
  }
  html[data-login-entry='teacher'] .teacher-login-layout .teacher-google-choice #google-button,
  html[data-login-entry='teacher'] .teacher-password-symbol {
    width:84px;
    height:84px;
    min-height:84px;
    flex-basis:84px;
  }
  html[data-login-entry='teacher'] .teacher-login-layout .teacher-google-choice #google-button > div { transform:scale(2); }
  html[data-login-entry='teacher'] .teacher-password-symbol svg { width:45px; height:45px; }
  html[data-login-entry='teacher'] .teacher-google-choice h2,
  html[data-login-entry='teacher'] .teacher-password-choice strong { font-size:16px !important; }
  html[data-login-entry='teacher'] .teacher-google-choice p [lang=en],
  html[data-login-entry='teacher'] .teacher-password-choice [lang=en] { font-size:11px; }
}

/* Short-lived collaborator fallback: compact beneath the shared Google sign-in. */
html[data-login-entry='teacher'] .temp-friend-section {
  margin:12px 0 4px;
  max-width:100%;
  border:1px solid #d9e4d4;
  border-radius:14px;
  background:#f3f7ed;
  padding:10px;
  color:#315e49;
}
html[data-login-entry='teacher'] .temp-friend-section[hidden],
html[data-login-entry='teacher'] #temp-friend-form[hidden] { display:none !important; }
html[data-login-entry='teacher'] #temp-friend-toggle {
  width:100%;
  border:0;
  background:transparent;
  color:#315e49;
  cursor:pointer;
  padding:7px 10px;
  font:500 17px/1.4 'LXGW WenKai Lite',serif;
  text-align:center;
}
html[data-login-entry='teacher'] #temp-friend-toggle small {
  display:block;
  color:#63816e;
  font:13px/1.3 'LXGW WenKai Lite',sans-serif;
}
html[data-login-entry='teacher'] #temp-friend-toggle:focus-visible,
html[data-login-entry='teacher'] #temp-friend-form :focus-visible {
  outline:3px solid #a66c2a;
  outline-offset:2px;
}
html[data-login-entry='teacher'] #temp-friend-form {
  display:flex;
  flex-wrap:wrap;
  align-items:end;
  justify-content:center;
  gap:10px;
  padding:8px 8px 4px;
}
html[data-login-entry='teacher'] #temp-friend-form label {
  width:100%;
  font-size:15px;
  text-align:center;
}
html[data-login-entry='teacher'] #temp-friend-form label small {
  display:block;
  font-size:12px;
  color:#607665;
}
html[data-login-entry='teacher'] #temp-friend-code {
  width:min(100%,235px);
  min-width:0;
  min-height:46px;
  border:1px solid #b7cdb5;
  border-radius:10px;
  padding:8px 12px;
  background:#fffef8;
  font:20px/1.3 ui-monospace,monospace;
  letter-spacing:3px;
}
html[data-login-entry='teacher'] #temp-friend-form button {
  min-height:46px;
  border:0;
  border-radius:10px;
  background:#237551;
  color:#fff;
  padding:9px 18px;
  font:16px/1.3 'LXGW WenKai Lite',serif;
  cursor:pointer;
}
html[data-login-entry='teacher'] #temp-friend-form button:disabled {
  opacity:.55;
  cursor:not-allowed;
}
html[data-login-entry='teacher'] #temp-friend-note {
  flex:0 0 100%;
  font-size:12px;
  line-height:1.5;
  text-align:center;
  margin:2px 0;
  color:#786f59;
}
