:root {
  --msh-brand: #1d50a2;
  --msh-brand-700: #163f82;
  --msh-bg: #f4f6fb;
  --msh-header-h: 36px;
  color-scheme: light;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--msh-bg);
  color: #0f172a;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

.msh-site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 0;
  height: var(--msh-header-h);
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  line-height: 1;
}

.msh-brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #0f172a;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.msh-brand:hover {
  text-decoration: none;
  color: var(--msh-brand-700);
}

.msh-brand-mark {
  color: var(--msh-brand);
  letter-spacing: -0.03em;
}

.msh-brand-mark span {
  color: #e62e4d;
}

.msh-brand-itls {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.msh-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.msh-nav a,
.msh-nav button {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: #334155;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.msh-nav a:hover,
.msh-nav button:hover {
  background: none;
  text-decoration: underline;
  color: var(--msh-brand-700);
}

.msh-nav form {
  margin: 0;
}

.msh-user {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-size: 13px;
  line-height: 1;
}

.hub {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

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

.hub-card {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 960 / 420;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: var(--msh-bg);
  border: 1px solid #d8e0ea;
  border-radius: 16px;
  color: #fff;
  text-decoration: none;
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.3;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.hub-card-preview {
  position: absolute;
  inset: 0;
  background-color: var(--msh-bg);
  background-position: center top;
  background-size: 100% auto;
  background-repeat: no-repeat;
  z-index: 0;
}

.hub-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    185deg,
    rgba(12, 22, 42, 0.04) 0%,
    rgba(12, 22, 42, 0.12) 40%,
    rgba(8, 16, 32, 0.9) 100%
  );
}

.hub-card-title {
  position: relative;
  z-index: 2;
  padding: 18px 20px 16px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.hub-card:hover {
  border-color: #93c5fd;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(29, 80, 162, 0.18);
}

.hub-card--contain .hub-card-preview {
  background-color: var(--msh-bg);
  background-size: 100% auto;
  background-position: center top;
}

.view-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

.view-switcher {
  position: sticky;
  top: var(--msh-header-h);
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 16px;
  padding: 10px 0;
  background: var(--msh-bg);
  border-bottom: 1px solid #e2e8f0;
}

.view-switcher[hidden] {
  display: none !important;
}

.view-switcher a {
  color: #334155;
  text-decoration: none;
  font-size: 15px;
}

.view-switcher a:hover {
  text-decoration: underline;
}

.view-switcher a.is-current {
  color: var(--msh-brand);
  font-weight: 650;
  text-decoration: underline;
}

body.is-view {
  --topbar-h: 0px;
  --doc-toolbar-h: 0px;
  --page-heading-h: 0px;
}

body.is-view .content {
  max-width: 920px;
  margin: 0;
  padding: 0 0 2rem;
  overflow-x: auto;
}

html[data-view="student-schedule"] .content {
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
}

html[data-view="teacher-schedule"] .content {
  max-width: none;
}

html[data-view="student-schedule"] .doc-section > .section-body,
html[data-view="teacher-schedule"] .doc-section > .section-body,
html[data-view="student-schedule"] .doc-section[data-kind="schedule"] .section-body,
html[data-view="teacher-schedule"] .doc-section[data-kind="schedule"] .section-body {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
}

html[data-view="student-schedule"] .doc-fold-body,
html[data-view="student-schedule"] .doc-fold-body .doc-fold-body,
html[data-view="teacher-schedule"] .doc-fold-body,
html[data-view="teacher-schedule"] .doc-fold-body .doc-fold-body {
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
}

.view-back-to-list {
  display: inline-block;
  margin: 8px 0 2px;
  color: var(--msh-brand);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.view-back-to-list:hover {
  text-decoration: underline;
  color: var(--msh-brand-700);
}

body.is-view .content > .doc-section:first-child > .section-title,
body.is-view .content > .doc-section:first-child > .view-back-to-list + .section-title {
  margin-top: 0;
}

html[data-view="teacher-schedule"] .doc-section > .section-title {
  display: none !important;
}

html[data-view="teacher-schedule"] .doc-fold-title .doc-fold-head {
  margin-top: 0;
}

body.is-view .doc-section {
  scroll-margin-top: calc(var(--msh-header-h) + var(--view-switcher-h, 3.25rem) + 8px);
}

body.is-view .doc-section[hidden] {
  display: none;
}

html[data-view="student-schedule"] .doc-section[data-doc-level] > .section-title.doc-fold-head,
html[data-view="student-schedule"] .doc-fold-title > .doc-fold-head,
html[data-view="teacher-schedule"] .doc-section[data-doc-level] > .section-title.doc-fold-head,
html[data-view="teacher-schedule"] .doc-fold-title > .doc-fold-head {
  justify-content: flex-start;
  align-items: baseline;
}

html[data-view="student-schedule"] .doc-fold-title-text,
html[data-view="teacher-schedule"] .doc-fold-title-text {
  flex: 0 1 auto;
}

.schedule-fs-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  width: 0.7em;
  height: 0.7em;
  margin: 0 0 0 0.28em;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: none;
  color: inherit;
  line-height: 1;
  overflow: visible;
  cursor: pointer;
}

.schedule-fs-btn:hover {
  background: rgba(21, 101, 192, 0.12);
  color: inherit;
}

.schedule-fs-btn svg {
  display: block;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  overflow: visible;
}

.schedule-now-clock {
  margin-left: auto;
  flex-shrink: 0;
  padding-left: 12px;
  color: inherit;
  font-family: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

html[data-view="teacher-schedule"] .schedule-timeline--comments .schedule-row,
html[data-view="teacher-schedule"] .schedule-row--with-comment {
  grid-template-columns: 3.25rem minmax(0, 1fr) auto minmax(8.5rem, 12.5rem);
  align-items: start;
}

.schedule-comment {
  min-width: 0;
  align-self: center;
}

html[data-view="teacher-schedule"] .doc-section.is-schedule-presenting .schedule-comment {
  align-self: start;
  padding-top: 0.12rem;
}

.schedule-comment-input {
  display: block;
  width: 100%;
  min-height: 1.3em;
  box-sizing: border-box;
  margin: 0;
  padding: 0.1rem 0.35rem;
  border: 1px dashed transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  resize: none;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  field-sizing: content;
}

.schedule-comment-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.schedule-comment-input:hover,
.schedule-comment-input:focus {
  border-color: rgba(21, 101, 192, 0.35);
  background: #fff;
  outline: none;
}

.schedule-comment-text {
  display: block;
  min-width: 0;
  padding: 0.1rem 0.35rem;
  color: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.schedule-duration--empty {
  visibility: hidden;
  padding: 0;
  border: none;
  background: none;
}

html.is-schedule-fs-page {
  overflow: hidden;
}

html.is-schedule-fs-page .msh-site-header {
  display: none;
}

.doc-section.is-schedule-fs,
.doc-section.is-schedule-presenting,
.doc-section:fullscreen,
.doc-section:-webkit-full-screen {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 4px 12px 6px;
  background: var(--msh-bg, #f4f6fb);
  overflow: auto;
}

.doc-section.is-schedule-fs {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.doc-section.is-schedule-presenting > .section-title,
.doc-section.is-schedule-presenting > .section-body,
.doc-section.is-schedule-presenting .schedule-fs-stage,
.doc-section.is-schedule-presenting .doc-fold-title {
  width: var(--schedule-fs-width, max-content);
  max-width: 100%;
  box-sizing: border-box;
}

html[data-view="student-schedule"] .doc-section.is-schedule-presenting {
  overflow: hidden;
  justify-content: flex-start;
  padding: 4px 8px;
}

html[data-view="student-schedule"] .doc-section.is-schedule-presenting .schedule-fs-stage {
  transform: scale(var(--schedule-fs-scale, 1));
  transform-origin: top center;
  margin-bottom: calc(var(--schedule-fs-natural-h, 0px) * (var(--schedule-fs-scale, 1) - 1));
}

html[data-view="student-schedule"] .doc-section.is-schedule-presenting .schedule-live-status {
  font-size: 0.9rem;
  padding: 0.4rem 0.65rem;
}

html[data-view="student-schedule"] .doc-section.is-schedule-presenting .schedule-timeline {
  font-size: 0.9rem;
}

html[data-view="student-schedule"] .doc-section.is-schedule-presenting .schedule-row {
  padding: 0.22rem 0.7rem;
}

html[data-view="student-schedule"] .doc-section.is-schedule-presenting .schedule-time {
  font-size: 0.8rem;
}

html[data-view="student-schedule"] .doc-section.is-schedule-presenting > .section-title,
html[data-view="student-schedule"] .doc-section.is-schedule-presenting .section-title {
  margin: 0 0 4px;
}

.doc-section.is-schedule-fs-measure .schedule-row {
  width: max-content;
  grid-template-columns: auto max-content auto;
}

html[data-view="teacher-schedule"] .doc-section.is-schedule-fs-measure .schedule-row {
  grid-template-columns: auto max-content auto max-content;
}

.doc-section.is-schedule-fs-measure .schedule-content,
.doc-section.is-schedule-fs-measure .schedule-title,
.doc-section.is-schedule-fs-measure .schedule-scenario-link--row {
  white-space: nowrap;
  min-width: max-content;
  flex: 0 0 auto;
  overflow-wrap: normal;
}

.doc-section.is-schedule-presenting .schedule-row {
  width: 100%;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  align-items: start;
}

html[data-view="teacher-schedule"] .doc-section.is-schedule-presenting .schedule-row {
  grid-template-columns: 4.5rem minmax(0, 1fr) auto minmax(10rem, 15rem);
}

.doc-section.is-schedule-presenting .schedule-content,
.doc-section.is-schedule-presenting .schedule-scenario-link--row {
  min-width: 0;
  flex-wrap: nowrap;
}

.doc-section.is-schedule-presenting .schedule-title {
  white-space: normal;
  min-width: 0;
  overflow-wrap: break-word;
}

.doc-section.is-schedule-presenting .schedule-duration {
  flex-shrink: 0;
  white-space: nowrap;
  align-self: start;
}

.doc-section:fullscreen::backdrop,
.doc-section:-webkit-full-screen::backdrop {
  background: var(--msh-bg, #f4f6fb);
}

.doc-section.is-schedule-fs > .section-title,
.doc-section:fullscreen > .section-title,
.doc-section:-webkit-full-screen > .section-title {
  margin: 0 0 4px;
}

.doc-section.is-schedule-fs .schedule-notes,
.doc-section.is-schedule-fs .schedule-role-grids,
.doc-section:fullscreen .schedule-notes,
.doc-section:fullscreen .schedule-role-grids,
.doc-section:-webkit-full-screen .schedule-notes,
.doc-section:-webkit-full-screen .schedule-role-grids {
  display: none;
}

.doc-section.is-schedule-fs .schedule-live-status,
.doc-section:fullscreen .schedule-live-status,
.doc-section:-webkit-full-screen .schedule-live-status {
  font-size: 1.05rem;
  padding: 0.7rem 0.9rem;
}

.doc-section.is-schedule-fs .schedule-timeline,
.doc-section:fullscreen .schedule-timeline,
.doc-section:-webkit-full-screen .schedule-timeline {
  font-size: 1.12rem;
}

.doc-section.is-schedule-fs .schedule-row,
.doc-section:fullscreen .schedule-row,
.doc-section:-webkit-full-screen .schedule-row {
  padding: 0.55rem 0.9rem;
}

.doc-section.is-schedule-fs .schedule-time,
.doc-section:fullscreen .schedule-time,
.doc-section:-webkit-full-screen .schedule-time {
  font-size: 1rem;
}

.publish-page {
  max-width: 42rem;
  margin: 3rem auto;
  padding: 0 16px;
}

.publish-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.publish-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  color: #0f172a;
}

.publish-card p {
  margin: 0 0 1rem;
  color: #475569;
  line-height: 1.5;
}

.publish-error {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #9f1239;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 14px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.publish-login-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 1rem;
}

.publish-login-form label {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.publish-login-form input[type="password"] {
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 4px;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 16px;
}

.publish-login-form input[type="password"]:focus {
  outline: 2px solid rgba(29, 80, 162, 0.35);
  outline-offset: 1px;
  border-color: var(--msh-brand);
}

.publish-login-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.publish-login-form button[type="submit"] {
  padding: 0.55rem 1.15rem;
  border: none;
  border-radius: 8px;
  background: var(--msh-brand);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.publish-login-form button[type="submit"]:hover {
  background: var(--msh-brand-700);
}

.publish-login-form button.publish-login-admin {
  background: #fff;
  color: var(--msh-brand);
  border: 1px solid var(--msh-brand);
}

.publish-login-form button.publish-login-admin:hover {
  background: #eef4fb;
}

.publish-sso-wrap {
  margin: 0;
  font-size: 14px;
}

.publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.publish-actions form {
  margin: 0;
}

.publish-actions a,
.publish-actions button {
  font: inherit;
  font-size: 15px;
  color: #334155;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.publish-actions a:hover,
.publish-actions button:hover {
  text-decoration: underline;
  color: var(--msh-brand-700);
}

.sp-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4px 16px 48px;
}

body.is-publish .doc-fold-chevron {
  display: none !important;
}

.sp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.sp-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  min-height: 280px;
}

.sp-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 8px 24px rgba(29, 80, 162, 0.12);
  text-decoration: none;
  color: inherit;
}

.sp-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e2e8f0;
}

.sp-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sp-card-kicker {
  font-size: 12px;
  font-weight: 600;
  color: var(--msh-brand);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sp-card-title {
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.3;
}

.sp-card-meta {
  font-size: 14px;
  color: #475569;
  line-height: 1.4;
}

.sp-empty {
  padding: 2rem;
  text-align: center;
  color: #64748b;
}

.publish-no-access {
  margin: 1rem 0 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #fecdd3;
}

.publish-no-access h1 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}

.textbook-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.textbook-page h1 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.textbook-page > p {
  margin: 0 0 20px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.45;
}

.textbook-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 18px 14px;
}

.textbook-cover {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.textbook-cover:hover {
  text-decoration: none;
  color: inherit;
}

.textbook-cover-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  padding: 12px;
  border-radius: 6px 10px 10px 6px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
  text-align: center;
  background-size: cover;
  background-position: center top;
}

.textbook-cover-face strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.textbook-cover-face em {
  margin-top: 6px;
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 650;
  opacity: 0.9;
}

.textbook-cover-face.has-image {
  padding: 0;
  overflow: hidden;
  background-color: #e8eef5;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.textbook-cover--blue .textbook-cover-face { background-color: #1d50a2; color: #fff; }
.textbook-cover--red .textbook-cover-face { background-color: #e62e4d; color: #fff; }
.textbook-cover--rose .textbook-cover-face { background-color: #9f1239; color: #fff; }
.textbook-cover--sky .textbook-cover-face { background-color: #0369a1; color: #fff; }
.textbook-cover--navy .textbook-cover-face { background-color: #163f82; color: #fff; }
.textbook-cover--slate .textbook-cover-face { background-color: #334155; color: #fff; }
.textbook-cover--orange .textbook-cover-face { background-color: #c2410c; color: #fff; }
.textbook-cover--teal .textbook-cover-face { background-color: #0f766e; color: #fff; }
.textbook-cover--purple .textbook-cover-face { background-color: #6d28d9; color: #fff; }
.textbook-cover--magenta .textbook-cover-face { background-color: #be185d; color: #fff; }

.textbook-cover:hover .textbook-cover-face {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.2);
}

.textbook-cover-cap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 3.2em;
}

.textbook-cover-cap b {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  color: #0f172a;
}

.textbook-cover-cap i {
  font-style: normal;
  font-size: 12px;
  color: #64748b;
}

.textbook-cover.is-muted {
  opacity: 0.72;
  pointer-events: none;
}

@media (max-width: 700px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
  .sp-grid {
    grid-template-columns: 1fr;
  }
  .sp-card {
    min-height: 0;
  }
  .sp-card img {
    aspect-ratio: 16 / 10;
  }
}
