@import url("../fonts/fonts.css");

:root {
  --shared-shell-control-height:36px;
  --shared-shell-small-text:.8rem;
  --shared-shell-student-color:#475569;
  --shared-shell-footer-text:.76rem;
  --shared-shell-footer-line:#e6ebf2;
  --assessment-ui-font:"Pretendard Variable",Pretendard,"Noto Sans KR","Malgun Gothic",system-ui,sans-serif;
  --assessment-ui-page-title:clamp(1.5rem,3vw,2.15rem);
  --assessment-ui-section-title:1.15rem;
  --assessment-ui-body-text:.86rem;
  --assessment-ui-label-text:.78rem;
}

body.assessment-teacher-page {
  font-family:var(--assessment-ui-font) !important;
  font-weight:400;
}

.assessment-teacher-page :is(.assessment-hero h1,.teacher-wall-heading h1,.formative-header h1,.topbar h1) {
  margin-bottom:0;
  font-family:var(--assessment-ui-font);
  font-size:var(--assessment-ui-page-title);
  font-weight:700;
  line-height:1.25;
  letter-spacing:-.02em;
}

.assessment-teacher-page :is(.assessment-hero .eyebrow,.teacher-wall-heading .eyebrow,.formative-header .eyebrow,.topbar .eyebrow,.panel-heading .step-label) {
  font-family:var(--assessment-ui-font);
  font-size:.82rem;
  font-weight:700;
  line-height:1.35;
  letter-spacing:.04em;
}

.assessment-teacher-page :is(.assessment-hero > p:last-child,.teacher-wall-heading .wall-prompt,.formative-header .lead) {
  font-family:var(--assessment-ui-font);
  font-size:var(--assessment-ui-body-text);
  font-weight:400;
  line-height:1.55;
  letter-spacing:normal;
}

.assessment-teacher-page :is(.assessment-option h2,.wall-list-heading h2,.panel h2,.intro-card h2,.access-gate h2,.drive-dialog-header h2) {
  font-family:var(--assessment-ui-font);
  font-size:var(--assessment-ui-section-title);
  font-weight:700;
  line-height:1.35;
  letter-spacing:-.015em;
}

.assessment-teacher-page :is(.assessment-option p,.wall-list-heading > p,.panel > .lead,.intro-card > div > p:last-child,.empty-state p,.loading-state > p) {
  font-family:var(--assessment-ui-font);
  font-size:var(--assessment-ui-body-text);
  font-weight:400;
  line-height:1.55;
}

.assessment-teacher-page :is(.blank-quiz-form label,.manual-quiz-form > label,.quiz-review-meta label,.quiz-review-question label,.form-grid label,.mode-picker legend,.drive-save-row label) {
  font-family:var(--assessment-ui-font);
  font-size:var(--assessment-ui-label-text);
  font-weight:700;
  line-height:1.4;
}

.assessment-teacher-page :is(button,.primary-button,.secondary-button,.primary,.secondary,.assessment-open) {
  font-family:var(--assessment-ui-font);
  font-weight:700;
}

html[lang="ko"] body {
  word-break:keep-all;
  overflow-wrap:normal;
}

html[lang="ko"] :is(code,pre,[data-wrap-anywhere]) {
  word-break:normal;
  overflow-wrap:anywhere;
}

body:has(:is(.game-footer,.site-footer)) {
  padding-top:0 !important;
  padding-bottom:0 !important;
}

:is(.app,.app-shell,.embed-shell,.shell,.landing-shell):has(> :is(.game-footer,.site-footer)) {
  min-height:100vh !important;
  min-height:100dvh !important;
  padding-top:0 !important;
  padding-bottom:0 !important;
}

.embed-shell:has(> .frame-wrap),
.embed-shell.is-search,
.embed-shell.is-frame {
  height:var(--embed-viewport-height,var(--march-exam-viewport-height,100vh)) !important;
  height:var(--embed-viewport-height,var(--march-exam-viewport-height,100dvh)) !important;
  min-height:0 !important;
}

.shell:has(> .site-footer) {
  display:flex !important;
  flex-direction:column !important;
}

.shell > .site-footer,
.landing-shell > .site-footer {
  margin-top:auto !important;
}

:is(.utility-bar,.utility,.utility-row,.pi-utility) {
  box-sizing:border-box !important;
  display:flex !important;
  width:100% !important;
  align-items:center !important;
  min-height:42px !important;
  padding-block:3px !important;
  gap:8px !important;
}

:is(.app,.app-shell,.embed-shell,.shell,.landing-shell) > :is(.utility-bar,.utility,.utility-row,.pi-utility) {
  margin-bottom:10px !important;
}

.archive-link,
.utility-link {
  margin-right:auto;
  color:#4338ca !important;
  font-size:var(--shared-shell-small-text) !important;
  font-weight:800 !important;
  line-height:1.4 !important;
  text-decoration:none !important;
  white-space:nowrap;
}

.assessment-teacher-page .assessment-return-link {
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  column-gap:4px;
  min-height:var(--shared-shell-control-height) !important;
  padding:7px 11px !important;
  font-family:var(--assessment-ui-font);
  font-size:var(--shared-shell-small-text) !important;
  font-weight:700;
  line-height:1.2 !important;
  white-space:nowrap;
}

.assessment-teacher-page :is(.assessment-return-icon,.assessment-return-label) {
  display:block;
  flex:none;
  line-height:1.2;
}

.student-chip:not([data-shared-shell-identity="custom"]) {
  color:var(--shared-shell-student-color) !important;
  font-size:.82rem !important;
  font-weight:800 !important;
}

:is(.utility-bar,.utility,.utility-row,.pi-utility) > .math-song-compact {
  margin-left:auto;
}

:is(.utility-bar,.utility,.utility-row,.pi-utility,.nav-actions,.topnav) > .electronic-board-launcher {
  margin-left:auto;
}

:is(.utility-bar,.utility,.utility-row,.pi-utility,.nav-actions,.topnav) > .electronic-board-launcher ~ .math-song-compact {
  margin-left:0;
}

:is(.utility-bar,.utility,.utility-row,.pi-utility) > .math-song-compact + .student-chip:not([data-shared-shell-identity="custom"]) {
  margin-left:0 !important;
}
:is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .electronic-board-launcher) > .math-song-compact {
  margin-left:0;
}

.math-song-compact {
  display:grid;
  flex:0 0 32px;
  width:32px;
  min-width:32px;
  height:32px;
  min-height:32px;
  place-items:center;
  padding:0;
  border:1px solid #d1d5db;
  border-radius:9px;
  background:#fff;
  color:#4338ca;
  font:inherit;
  font-size:.7rem;
  line-height:1;
  cursor:pointer;
}

.math-song-compact:hover,
.math-song-compact:focus-visible {
  border-color:#aeb6f4;
  background:#f7f7ff;
  outline:2px solid rgba(91,95,233,.16);
  outline-offset:1px;
}

.math-song-compact:active { transform:scale(.96); }
.math-song-compact.is-playing { border-color:#9ea8ef;background:#eceeff; }
.math-song-compact[disabled] { opacity:.5;cursor:not-allowed; }

.student-site-notice-bell {
  position:relative;
  box-sizing:border-box;
  display:grid;
  flex:0 0 32px;
  width:32px;
  min-width:32px;
  height:32px;
  min-height:32px;
  place-items:center;
  padding:0;
  border:1px solid #d1d5db;
  border-radius:9px;
  background:#fff;
  color:#475569;
  cursor:pointer;
}

.participant-control > .student-site-notice-bell { margin-right:8px; }

.student-site-notice-bell[hidden],
.student-site-notice-toast[hidden],
.student-site-notice-panel[hidden],
.student-site-notice-badge[hidden],
.student-site-notice-image-button[hidden],
.student-site-notice-actions button[hidden] { display:none !important; }

.student-site-notice-bell svg {
  width:17px;
  height:17px;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.student-site-notice-bell:hover,
.student-site-notice-bell:focus-visible,
.student-site-notice-bell.has-unread {
  border-color:#aeb6f4;
  background:#f7f7ff;
  color:#4338ca;
  outline:2px solid rgba(91,95,233,.16);
  outline-offset:1px;
}

.student-site-notice-badge {
  position:absolute;
  top:-5px;
  right:-5px;
  display:grid;
  width:15px;
  height:15px;
  place-items:center;
  border:2px solid #fff;
  border-radius:50%;
  background:#dc2626;
  color:#fff;
  font-size:9px;
  font-weight:900;
  line-height:1;
}

.student-site-notice-toast {
  position:fixed;
  z-index:920;
  right:max(14px,env(safe-area-inset-right,0px));
  bottom:calc(70px + env(safe-area-inset-bottom,0px));
  display:flex;
  width:min(340px,calc(100vw - 28px));
  align-items:flex-start;
  gap:10px;
  padding:13px 14px;
  border:1px solid #c9c7f7;
  border-radius:14px;
  background:#fff;
  color:#172033;
  box-shadow:0 14px 34px rgba(46,39,132,.18);
  font:inherit;
  text-align:left;
  cursor:pointer;
  animation:student-site-notice-in .2s ease-out;
}

.student-site-notice-toast-icon { flex:none;font-size:1.08rem;line-height:1.25; }
.student-site-notice-toast-copy { display:grid;min-width:0;gap:3px; }
.student-site-notice-toast-copy strong { font-size:.88rem;line-height:1.35; }
.student-site-notice-toast-copy > span { color:#596579;font-size:.79rem;line-height:1.45; }

@keyframes student-site-notice-in {
  from { opacity:0;transform:translateY(10px); }
  to { opacity:1;transform:translateY(0); }
}

.student-site-notice-panel {
  position:fixed;
  z-index:930;
  max-height:min(520px,calc(100dvh - 72px));
  overflow:auto;
  padding:0 15px 15px;
  border:1px solid #d9d7f7;
  border-radius:15px;
  background:#fff;
  color:#172033;
  box-shadow:0 18px 44px rgba(32,37,74,.2);
}

.student-site-notice-panel header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:42px;
  margin:0 -7px 8px;
  padding:0 3px 0 7px;
  border-bottom:1px solid #ececf8;
  color:#6156bd;
  font-size:.74rem;
  font-weight:800;
}

.student-site-notice-panel header button,
.student-site-notice-image-dialog > button {
  display:grid;
  width:34px;
  height:34px;
  place-items:center;
  padding:0;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#667085;
  font:inherit;
  font-size:1.35rem;
  cursor:pointer;
}

.student-site-notice-panel header button:hover,
.student-site-notice-panel header button:focus-visible,
.student-site-notice-image-dialog > button:hover,
.student-site-notice-image-dialog > button:focus-visible { background:#f2f4f7;outline:none; }
.student-site-notice-panel h2 { margin:0 0 8px;font-size:1.05rem;line-height:1.4; }
.student-site-notice-panel > p { margin:0 0 12px;color:#475467;font-size:.84rem;line-height:1.55;white-space:pre-wrap; }

.student-site-notice-image-button {
  display:block;
  width:100%;
  margin:0 0 12px;
  padding:0;
  overflow:hidden;
  border:1px solid #e2e8f0;
  border-radius:11px;
  background:#f8fafc;
  cursor:zoom-in;
}

.student-site-notice-image-button img { display:block;width:100%;max-height:180px;object-fit:contain; }
.student-site-notice-actions { display:flex;justify-content:flex-end; }
.student-site-notice-actions button {
  min-height:36px;
  padding:8px 13px;
  border:0;
  border-radius:9px;
  background:#5b5fe9;
  color:#fff;
  font:inherit;
  font-size:.8rem;
  font-weight:800;
  cursor:pointer;
}

.student-site-notice-image-dialog {
  position:fixed;
  z-index:1100;
  inset:0;
  width:min(920px,calc(100vw - 24px));
  height:min(760px,calc(100dvh - 24px));
  margin:auto;
  padding:44px 12px 12px;
  border:1px solid #d8deea;
  border-radius:15px;
  background:#111827;
}

.student-site-notice-image-dialog::backdrop { background:rgba(15,23,42,.72); }
.student-site-notice-image-dialog > button { position:absolute;top:6px;right:7px;background:rgba(255,255,255,.12);color:#fff; }
.student-site-notice-image-dialog img { display:block;width:100%;height:100%;object-fit:contain;touch-action:pinch-zoom; }

.electronic-board-launcher {
  box-sizing:border-box;
  display:inline-flex;
  flex:0 0 auto;
  min-width:52px;
  height:32px;
  min-height:32px;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  border:1px solid #15803d;
  border-radius:9px;
  background:#15803d;
  color:#fff !important;
  font:inherit;
  font-size:.72rem;
  font-weight:800;
  line-height:1;
  text-decoration:none !important;
  white-space:nowrap;
}

.electronic-board-launcher:hover,
.electronic-board-launcher:focus-visible {
  border-color:#166534;
  background:#166534;
  outline:2px solid rgba(21,128,61,.2);
  outline-offset:1px;
}

.electronic-board-launcher:active { transform:scale(.97); }

@media (max-width:760px) {
  .teacher-shell .nav-actions:has(> .electronic-board-launcher) {
    display:grid;
    grid-template-columns:52px 104px;
    align-items:center;
    justify-items:end;
  }

  .teacher-shell .nav-actions > .electronic-board-launcher {
    grid-column:1;
    grid-row:1;
    margin-left:0;
  }

  .teacher-shell .nav-actions > :is(.locale-select,[data-locale-select]) {
    grid-column:2;
    grid-row:1;
    width:104px !important;
    min-width:104px !important;
  }

  .teacher-shell .nav-actions > :is(.link-btn,.button) {
    grid-column:1 / -1;
    grid-row:2;
  }
}

:is(.locale-select,[data-locale-select]) {
  box-sizing:border-box;
  height:var(--shared-shell-control-height) !important;
  min-height:var(--shared-shell-control-height) !important;
  min-width:112px;
  padding:7px 30px 7px 10px !important;
  border:1px solid #d1d5db !important;
  border-radius:10px !important;
  background:#fff !important;
  font-size:var(--shared-shell-small-text) !important;
  font-weight:800 !important;
  line-height:1.2 !important;
}

.utility-bar .utility-link,
.utility .utility-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:var(--shared-shell-control-height) !important;
}

.utility-bar :is(.fullscreen-button,.fullscreen-btn,.icon-button),
.utility :is(.fullscreen-button,.fullscreen-btn,.icon-button),
.topnav :is(.student-fullscreen-button,.fullscreen-button,.fullscreen-btn,.icon-button) {
  width:var(--shared-shell-control-height) !important;
  min-width:var(--shared-shell-control-height) !important;
  height:var(--shared-shell-control-height) !important;
  min-height:var(--shared-shell-control-height) !important;
  padding:0 !important;
  border:1px solid #d1d5db !important;
  border-radius:10px !important;
  background:#fff !important;
  color:#374151 !important;
  font-size:.8rem !important;
  line-height:1 !important;
  cursor:pointer;
}

.utility-bar :is(.fullscreen-button,.fullscreen-btn,.icon-button):hover,
.utility :is(.fullscreen-button,.fullscreen-btn,.icon-button):hover,
.topnav :is(.student-fullscreen-button,.fullscreen-button,.fullscreen-btn,.icon-button):hover {
  background:#f8fafc !important;
}

.topnav {
  min-height:42px !important;
  padding-block:3px !important;
  gap:8px !important;
}

.topnav .brand {
  gap:7px !important;
  font-size:1rem !important;
}

.topnav .brand::before {
  width:24px !important;
  height:24px !important;
  flex-basis:24px !important;
}

.topnav :is(.link-btn,.button) {
  min-height:var(--shared-shell-control-height) !important;
  padding:8px 12px !important;
  font-size:.82rem !important;
}

/* Public footer typography and layout belong to the shared shell. Layered
   important rules prevent later page styles from changing the common UI.
   Workspace positioning and explicitly omitted tools remain page contracts. */
@layer archive-footer {
  :is(.game-footer,.site-footer) {
    box-sizing:border-box !important;
    font-family:"Noto Sans KR","Noto Sans JP","Noto Sans TC",system-ui,sans-serif !important;
    font-size:12.16px !important;
    font-weight:400 !important;
    line-height:1.5 !important;
    letter-spacing:normal !important;
    color:#667085 !important;
    text-align:left !important;
    border-top:1px solid #e6ebf2 !important;
    padding:10px 2px calc(10px + env(safe-area-inset-bottom,0px)) !important;
    gap:8px 24px !important;
  }

  :is(.game-footer,.site-footer) :is(p,.footer-contact-tools,.footer-contact-button,.footer-privacy-link,.footer-terms-link,.footer-tools-menu,summary) {
    font-family:"Noto Sans KR","Noto Sans JP","Noto Sans TC",system-ui,sans-serif !important;
    font-size:12.16px !important;
    font-weight:400 !important;
    line-height:1.5 !important;
    letter-spacing:normal !important;
    color:inherit !important;
  }

  :is(.game-footer,.site-footer) p { margin:0 !important; }
  :is(.game-footer,.site-footer) .footer-contact-button {
    min-width:0 !important;
    min-height:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
  }
  :is(.game-footer,.site-footer) :is(.footer-contact-button,.footer-privacy-link,.footer-terms-link) {
    white-space:nowrap !important;
    text-decoration:underline !important;
    text-underline-offset:3px !important;
  }
  /* The shared script draws the same underline with a border on iOS. */
  :is(.game-footer,.site-footer) summary { white-space:nowrap !important; }
  :is(.game-footer,.site-footer) :is(.footer-contact-button,.footer-privacy-link,.footer-terms-link,summary):is(:hover,:focus-visible) {
    color:#4338ca !important;
  }
  :is(.game-footer,.site-footer) .footer-contact-tools {
    display:flex !important;
    align-items:center !important;
    flex-wrap:wrap !important;
    min-width:0 !important;
  }
  :is(.game-footer,.site-footer):not([data-shared-shell-footer="custom"]) {
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:wrap !important;
    justify-content:space-between !important;
    align-items:center !important;
  }
  :is(.game-footer,.site-footer)[hidden] { display:none !important; }

  /* Standalone duel footers span the viewport, without an outer shell inset. */
  .game-footer.public-footer {
    padding-left:max(24px,env(safe-area-inset-left,0px)) !important;
    padding-right:max(24px,env(safe-area-inset-right,0px)) !important;
  }

  @media (max-width:600px) {
    .game-footer.public-footer {
      padding-left:max(16px,env(safe-area-inset-left,0px)) !important;
      padding-right:max(16px,env(safe-area-inset-right,0px)) !important;
    }
  }

  .board-app > .site-footer[data-shared-shell-footer="custom"] {
    padding:10px max(clamp(16px,2vw,24px),env(safe-area-inset-right,0px)) calc(10px + env(safe-area-inset-bottom,0px)) max(clamp(16px,2vw,24px),env(safe-area-inset-left,0px)) !important;
  }

  /* The electronic board keeps its compact workspace footer, but its mobile
     link row still needs the same comfortable edge inset as the public shell. */
  @media (max-width:700px) {
    .board-app > .site-footer[data-shared-shell-footer="custom"] {
      padding:5px max(16px,env(safe-area-inset-right,0px)) calc(5px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px)) !important;
    }
  }

  @media (max-width:600px) {
    :is(.game-footer,.site-footer):not([data-shared-shell-footer="custom"]) {
      flex-direction:column !important;
      align-items:flex-start !important;
      row-gap:4px !important;
    }
    html[data-march-exam-source-footer="inline"] .embed-shell > .site-footer:not([data-shared-shell-footer="custom"]) {
      flex-direction:row !important;
      flex-wrap:nowrap !important;
      align-items:center !important;
      gap:8px !important;
    }
    html[data-march-exam-source-footer="inline"] .landing-shell > .site-footer:not([data-shared-shell-footer="custom"]) {
      flex-direction:row !important;
      flex-wrap:nowrap !important;
      align-items:center !important;
      gap:8px !important;
    }
  }
}

.game-footer,
.site-footer {
  align-items:center;
  margin-bottom:0 !important;
  border-top:1px solid var(--shared-shell-footer-line) !important;
  padding-top:10px !important;
  padding-right:2px !important;
  padding-bottom:calc(10px + env(safe-area-inset-bottom,0px)) !important;
  padding-left:2px !important;
  gap:8px 24px !important;
  font-size:var(--shared-shell-footer-text) !important;
  line-height:1.5 !important;
}

:is(.game-footer,.site-footer):not([data-third-party-content="true"]):not([data-shared-shell-footer="custom"]) {
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
}

.game-footer p,
.site-footer p {
  margin:0;
}

.game-footer a,
.site-footer a {
  color:inherit;
  text-underline-offset:3px;
}

.footer-contact-button {
  -webkit-appearance:none;
  appearance:none;
  display:inline;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  font:inherit;
  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:3px;
}

.footer-contact-button:hover,
.footer-contact-button:focus-visible {
  color:#4338ca;
}

.footer-contact-separator {
  display:inline-block;
  margin-right:5px;
  color:#98a2b3;
}

.game-footer :is(.footer-contact-button,.footer-tools-pending),
.site-footer :is(.footer-contact-button,.footer-tools-pending) {
  font-weight:inherit;
}

.contact-dialog {
  position:fixed;
  z-index:1000;
  inset:0;
  margin:auto;
  width:min(460px,calc(100vw - 28px));
  height:min(570px,calc(100dvh - 28px));
  max-width:none;
  max-height:none;
  padding:0;
  border:1px solid #d8deea;
  border-radius:16px;
  background:#fff;
  box-shadow:0 24px 64px rgba(15,23,42,.24);
  overflow:hidden;
}

.contact-dialog::backdrop {
  background:rgba(15,23,42,.42);
  backdrop-filter:blur(2px);
}

.contact-dialog-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:48px;
  padding:0 10px 0 18px;
  border-bottom:1px solid #e8ecf2;
  background:linear-gradient(90deg,#f7f5ff 0%,#fff 72%);
  color:#172033;
  font-size:.94rem;
  cursor:move;
  touch-action:none;
  user-select:none;
}

.contact-dialog[data-dragging="true"] .contact-dialog-header { cursor:grabbing; }

.contact-dialog-heading {
  display:flex;
  align-items:center;
  gap:8px;
}

.contact-dialog-icon {
  font-size:1.12rem;
  line-height:1;
}

.contact-dialog-body {
  position:relative;
  height:calc(100% - 48px);
  background:#fff;
}

.contact-dialog-loading {
  position:absolute;
  z-index:1;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:24px;
  background:linear-gradient(180deg,#fbfaff 0%,#fff 38%);
  color:#667085;
  font-size:.86rem;
  text-align:center;
  transition:opacity .18s ease,visibility .18s ease;
}

.contact-dialog-body[data-loaded="true"] .contact-dialog-loading {
  visibility:hidden;
  opacity:0;
  pointer-events:none;
}

.contact-dialog-spinner {
  width:18px;
  height:18px;
  flex:0 0 auto;
  border:2px solid #d9ddf7;
  border-top-color:#5b5fe9;
  border-radius:50%;
  animation:contact-dialog-spin .75s linear infinite;
}

@keyframes contact-dialog-spin {
  to { transform:rotate(360deg); }
}

.contact-dialog-close {
  display:grid;
  width:36px;
  height:36px;
  place-items:center;
  padding:0;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#667085;
  font-size:1.5rem;
  line-height:1;
  cursor:pointer;
  touch-action:manipulation;
}

.contact-dialog-close:hover,
.contact-dialog-close:focus-visible {
  background:#f2f4f7;
  color:#172033;
  outline:none;
}

.contact-dialog-frame {
  display:block;
  width:100%;
  height:100%;
  border:0;
  background:#fff;
}

.footer-contact-tools {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  min-width:0;
}

.footer-contact-tools > p {
  margin:0;
}

.footer-privacy-separator,
.footer-terms-separator {
  display:inline-block;
  margin:0 5px 0 12px;
  color:#98a2b3;
}

.footer-privacy-link,
.footer-terms-link {
  color:inherit;
  text-decoration:underline;
  text-underline-offset:3px;
}

.footer-privacy-link:hover,
.footer-privacy-link:focus-visible,
.footer-terms-link:hover,
.footer-terms-link:focus-visible {
  color:#4338ca;
}

.footer-tools-separator {
  margin:0 4px 0 16px;
  color:#98a2b3;
}

.footer-tools-menu {
  position:relative;
  display:inline-block;
}

.footer-tools-menu summary {
  color:inherit;
  cursor:pointer;
  list-style:none;
  text-decoration:underline;
  text-underline-offset:3px;
}

.footer-tools-menu summary::-webkit-details-marker { display:none; }
.footer-tools-menu summary::marker { content:""; }

.footer-tools-popover {
  position:absolute;
  z-index:40;
  bottom:calc(100% + 10px);
  left:0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px 0;
  width:300px;
  padding:8px 10px;
  border:1px solid #d7dee9;
  border-radius:12px;
  background:#fff;
  box-shadow:0 10px 28px rgba(16,24,40,.14);
}

.footer-tools-divider {
  grid-column:1 / -1;
  height:1px;
  background:#edf1f5;
}

.footer-tools-link,
.footer-tools-pending {
  position:relative;
  display:flex;
  align-items:center;
  min-height:32px;
  padding:5px 8px 5px 19px;
  border:1px solid transparent;
  border-radius:8px;
  background:transparent;
  color:#475467;
  font:inherit;
  font-size:.75rem;
  line-height:1.3;
  text-align:left;
  text-decoration:none;
}

.footer-tools-pending {
  -webkit-appearance:none;
  appearance:none;
}

.footer-tools-link::before,
.footer-tools-pending::before {
  position:absolute;
  left:8px;
  content:"·";
  color:#98a2b3;
}

.site-footer .footer-tools-link,
.game-footer .footer-tools-link,
.site-footer .footer-tools-pending,
.game-footer .footer-tools-pending {
  color:inherit;
}

.site-footer .footer-tools-link,
.game-footer .footer-tools-link {
  cursor:pointer;
  text-decoration:none;
}

.footer-tools-link:hover,
.footer-tools-link:focus-visible {
  border-color:#cbd5e1;
  background:#f8fafc;
  color:#1d4ed8;
  outline:none;
  transform:translateY(-1px);
}

.footer-tools-pending { cursor:default; }
.footer-tools-pending:focus { outline:none; }

.footer-tools-hot {
  position:absolute;
  top:-5px;
  left:calc(100% - 6px);
  right:auto;
  margin:0;
  padding:1px 5px;
  border-radius:999px;
  background:#fff1f2;
  color:#be123c;
  font-size:.62rem;
  font-weight:700;
  letter-spacing:.02em;
  line-height:1.35;
  pointer-events:none;
  transform:rotate(-8deg);
}

.footer-tools-link-hot [data-footer-tools-label] {
  text-decoration:underline wavy #fb7185 1px;
  text-decoration-thickness:1px;
  text-underline-offset:4px;
}

.footer-tools-link-hot { justify-self:start; }

.footer-tools-tooltip {
  position:absolute;
  z-index:1;
  bottom:calc(100% + 6px);
  left:50%;
  width:max-content;
  max-width:160px;
  padding:5px 7px;
  border-radius:6px;
  background:#344054;
  color:#fff;
  font-size:.69rem;
  line-height:1.25;
  opacity:0;
  pointer-events:none;
  transform:translate(-50%,2px);
  transition:opacity .15s ease,transform .15s ease;
}

.footer-tools-pending:hover .footer-tools-tooltip,
.footer-tools-pending:focus .footer-tools-tooltip {
  opacity:1;
  transform:translate(-50%,0);
}

.catalog-shell.catalog-shell:has(> .site-footer),
.landing-shell.landing-shell:has(> .site-footer) {
  padding-top:22px !important;
  padding-bottom:0 !important;
}

@media (max-width:420px) {
  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .student-site-notice-bell) {
    flex-wrap:wrap !important;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .student-site-notice-bell)::after {
    order:4;
    flex:0 0 100%;
    width:0;
    height:0;
    content:"";
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility) > .student-site-notice-bell {
    order:5;
    margin-left:auto;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility) > .student-site-notice-bell + .student-chip {
    order:5;
    flex:0 1 auto;
    width:auto !important;
    max-width:calc(100% - 40px);
    margin-left:0 !important;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility) > .math-song-compact + .student-site-notice-bell {
    margin-left:0;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .math-song-compact) > .math-song-compact {
    margin-left:auto;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .math-song-compact) > .student-site-notice-bell + .student-chip {
    max-width:calc(100% - 80px);
  }

  .student-site-notice-toast {
    right:8px;
    bottom:calc(68px + env(safe-area-inset-bottom,0px));
    width:calc(100vw - 16px);
  }

  .student-site-notice-panel { max-height:calc(100dvh - 64px); }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .math-song-compact) {
    flex-wrap:wrap !important;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .electronic-board-launcher) {
    flex-wrap:wrap !important;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .electronic-board-launcher):has(> .student-chip)::after {
    order:4;
    flex:0 0 100%;
    width:0;
    height:0;
    content:"";
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .electronic-board-launcher) > .archive-link {
    order:1;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .electronic-board-launcher) > .electronic-board-launcher {
    order:2;
    margin-left:auto;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .electronic-board-launcher) > :is(.locale-select,[data-locale-select]) {
    order:2;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .electronic-board-launcher) > :is(.fullscreen-button,.fullscreen-btn,[id*="fullscreen" i]) {
    order:3;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .electronic-board-launcher) > .student-chip {
    order:5;
    flex:0 1 auto;
    width:auto !important;
    max-width:calc(100% - 40px);
    margin-left:0 !important;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .electronic-board-launcher):not(:has(> .math-song-compact)) > .student-chip {
    max-width:100%;
    margin-left:auto !important;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .math-song-compact)::after {
    order:4;
    flex:0 0 100%;
    width:0;
    height:0;
    content:"";
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .math-song-compact) > .math-song-compact {
    order:5;
    margin-left:auto;
  }

  :is(.utility-bar,.utility,.utility-row,.pi-utility):has(> .math-song-compact) > .student-chip {
    order:5;
    flex:0 1 auto;
    width:auto !important;
    max-width:calc(100% - 40px);
    margin-left:0 !important;
  }

  .contact-dialog {
    width:calc(100vw - 16px);
    height:min(580px,calc(100dvh - 16px));
    border-radius:13px;
  }

  .contact-dialog-header {
    cursor:default;
    touch-action:auto;
  }

  :is(.game-footer,.site-footer):not([data-third-party-content="true"]):not([data-shared-shell-footer="custom"]) {
    display:block;
  }

  .game-footer p + p,
  .site-footer p + p {
    margin-top:4px;
  }
}


/* Shared, opt-in default for newly added learning pages. */
[data-game-shell="standard"] {
  width:100%;
  max-width:820px;
  margin-inline:auto;
  padding-inline:12px;
}
@media (max-width:600px) {
  [data-game-shell="standard"] { padding-inline:8px; }
}
