:root {
  --blue: #0B3A5B;
  --amber: #E0A106;
  --lab: #2B6CB0;
  --sci: #2F855A;
  --red: #C53030;
  --forest: #1B4332;
  --paper: #F6F4EF;
  --ink: #1A2332;
}
* { box-sizing: border-box; }
html { height: 100%; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, Segoe UI, sans-serif; }
body { min-height: 100vh; min-height: 100dvh; }
.app-frame {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
body.has-footer .app-frame {
  background: #f1f5f9;
}
.app-content {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-content > main {
  flex: 1 1 auto;
  min-height: 0;
}
@media (prefers-color-scheme: dark) {
  body.has-footer .app-frame { background: #020617; }
}
h1, h2, strong { font-family: "Plus Jakarta Sans", Inter, sans-serif; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-brand { background: var(--blue); color: #fff; display: grid; place-content: center; text-align: center; }
.login-brand .tag { font-style: italic; opacity: .85; }
.keyhole { width: 28px; height: 40px; border: 2px solid #E0A106; border-radius: 14px 14px 8px 8px; margin: 0 auto 16px; }
.login-card { margin: auto; width: min(420px, 92vw); background: #fff; padding: 32px; border-radius: 16px; display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; }
input { padding: 10px 12px; border: 1px solid #E4DFD6; border-radius: 8px; }
.btn-amber { background: var(--amber); border: 0; padding: 12px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.error { color: var(--red); }
.hint { color: #5B6776; font-size: 12px; }
.topbar { background: var(--blue); color: #fff; display: flex; gap: 16px; align-items: center; padding: 12px 0; flex-shrink: 0; }
.badge { background: var(--amber); color: var(--blue); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.topbar-end { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-shrink: 0; padding-right: 16px; }
.topbar-end .badge { background: #f59e0b; color: #fff; padding: 2px 12px; }
.topbar-end .ghost { color: #e2e8f0; font-size: 14px; font-weight: 500; }
.topbar-end .ghost:hover { color: #fff; }
.ghost { background: transparent; color: #fff; border: 0; text-decoration: none; cursor: pointer; font: inherit; }
.month-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 24px; }
.month-card, .month-single { background: #fff; border-radius: 12px; padding: 16px; }
.today { padding: 0 24px 24px; }
.event { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #E4DFD6; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.bottombar { position: sticky; bottom: 0; background: #fff; display: flex; justify-content: space-around; padding: 12px; border-top: 1px solid #E4DFD6; z-index: 1; }
body.mobile .login-shell { grid-template-columns: 1fr; }
@media (max-width: 640px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 28vh; }
}

.keyhole { width: 52px; height: 72px; margin: 0 auto 16px; display: block; }
.layer-bar { display: flex; gap: 8px; padding: 12px 24px 0; }
.layer-bar button { border: 1px solid #E4DFD6; background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.layer-bar button.active { background: #0B3A5B; color: #fff; border-color: #0B3A5B; }
.crumb { padding: 8px 24px 0; color: #5B6776; font-size: 14px; }
.crumb a { color: #0B3A5B; cursor: pointer; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 16px 24px; }
.day-col { background: #fff; border-radius: 10px; padding: 10px; min-height: 120px; }
.day-col h4 { margin: 0 0 8px; font-size: 13px; }

.week-list { display: grid; gap: 6px; margin-top: 10px; }
.week-row { display: flex; justify-content: space-between; width: 100%; border: 1px solid #E4DFD6; background: #F6F4EF; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.week-row:hover { background: #fff; border-color: #0B3A5B; }
.mini { font-size: 12px; margin: 4px 0; padding: 4px 6px; background: #F6F4EF; border-left: 3px solid #E0A106; }

.month-grid.six { grid-template-columns: 1fr 1fr 1fr; }
.window-nav { display: flex; align-items: center; justify-content: space-between; padding: 8px 24px 0; gap: 12px; }
.nav-arrow { width: 40px; height: 40px; border: 1px solid #E4DFD6; background: #fff; border-radius: 999px; font-size: 22px; cursor: pointer; color: #0B3A5B; }
.nav-arrow:hover { border-color: #0B3A5B; }
.window-label { font-weight: 600; color: #0B3A5B; }
.month-card.current-month { outline: 2px solid #E0A106; }
@media (max-width: 900px) { .month-grid.six { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .month-grid.six { grid-template-columns: 1fr; } }

.level-bar { display: flex; gap: 8px; padding: 8px 24px 0; flex-wrap: wrap; }
.level-bar button { border: 1px solid #0B3A5B; background: #0B3A5B; color: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.level-bar button.active { background: #E0A106; border-color: #E0A106; color: #0B3A5B; }

.day-chips { display: flex; gap: 6px; padding: 8px 24px; flex-wrap: wrap; }
.day-chip { border: 1px solid #E4DFD6; background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.day-chip.active { background: #E0A106; border-color: #E0A106; color: #0B3A5B; }
button.day-col { text-align: left; border: 0; }

.lang-row { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: 13px; }
.lang-row select {
  background: #fff;
  color: #1A2332;
  border: 1px solid #E4DFD6;
  border-radius: 8px;
  padding: 4px 8px;
}
.topbar form { margin: 0; }
.test-shell { padding: 24px; max-width: 820px; margin: 0 auto; }
.test-card { display: block; background: #fff; border-radius: 12px; padding: 16px; margin: 0 0 12px; text-decoration: none; color: inherit; }
.test-card span { display: block; color: #5B6776; font-size: 13px; margin-top: 4px; }
.test-create, .test-detail { background: #fff; border-radius: 12px; padding: 20px; display: grid; gap: 12px; margin-top: 16px; }
.test-detail .q { border: 1px solid #E4DFD6; border-radius: 8px; padding: 12px; display: grid; gap: 8px; }

.test-detail .q label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
}
.test-detail .q input[type="radio"] {
  padding: 0;
  margin: 0;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #0B3A5B;
}

.results { width: 100%; border-collapse: collapse; }
.results td { padding: 8px; border-bottom: 1px solid #E4DFD6; }

.paper {
  width: 100%;
  min-height: 168px;
  background: #fffef8;
  background-image: repeating-linear-gradient(#fffef8 0 27px, #d7e3f0 27px 28px);
  line-height: 28px;
  border: 1px solid #cfd8e3;
  padding: 6px 12px;
  font-family: Georgia, "Times New Roman", serif;
  resize: vertical;
}
.integrity-notice { background: #F4EFE6; padding: 10px 12px; border-radius: 8px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.watch-dot { width: 8px; height: 8px; border-radius: 50%; background: #C53030; display: inline-block; }
.badge-ok { background: #2F855A; color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.badge-review { background: #C53030; color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.integrity-opts { display: grid; gap: 8px; border: 1px solid #E4DFD6; padding: 12px; border-radius: 8px; }
.hint { color: #5B6776; font-size: 13px; }

.penalty-box { position: fixed; inset: 0; background: rgba(11,58,91,.92); color: #fff; z-index: 80; display: grid; place-items: center; text-align: center; font-size: 28px; }
.penalty-box[hidden] { display: none !important; }
.fag-badge { background: #0B3A5B; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-style: normal; margin-right: 6px; }
h3.fag { margin: 16px 0 8px; color: #0B3A5B; }
.filter { display: block; margin: 8px 0 16px; }

#lists { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.list-col { min-width: 0; }
@media (max-width: 720px) { #lists { grid-template-columns: 1fr; } }

a.back { color: #0B3A5B; text-decoration: none; font-size: 14px; }

a.brand { color: #fff; text-decoration: none; font-weight: 700; white-space: nowrap; }
a.brand:hover { color: #E0A106; }
.brand-version { font-weight: 500; font-size: 12px; opacity: .75; margin-left: 4px; }
.login-brand .brand-version { color: inherit; }
.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;
}
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  align-self: stretch;
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  padding: 8px 24px;
  border-top: 1px solid #cbd5e1;
  background: rgba(255, 255, 255, 0.75);
  color: #64748b;
  font-size: 12px;
}
.site-footer .sysinfo-link {
  margin-left: auto;
  flex-shrink: 0;
}
.site-footer a { text-decoration: none; }
.sysinfo-link {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  font-size: 12px;
  padding: 0;
  font-family: inherit;
  transition: color .15s ease;
}
.sysinfo-link:hover { color: #1e293b; }
@media (prefers-color-scheme: dark) {
  .site-footer {
    border-top-color: #1e293b;
    background: rgba(15, 23, 42, 0.75);
  }
  .sysinfo-link:hover { color: #e2e8f0; }
}
.sysinfo-dialog {
  border: 1px solid #E4DFD6;
  border-radius: 12px;
  padding: 20px 24px;
  max-width: 520px;
}
.sysinfo-dialog h2 { margin: 0 0 12px; font-size: 18px; color: #0B3A5B; }
.sysinfo-dialog h3 { margin: 16px 0 8px; font-size: 14px; color: #0B3A5B; }
.sysinfo-dialog p { margin: 6px 0; font-size: 14px; }
.sysinfo-dialog ul { margin: 0; padding-left: 18px; font-size: 13px; }
.sysinfo-dialog::backdrop { background: rgba(11, 58, 91, .35); }
.shared-box { margin: 12px 24px 0; background: #fff; border-left: 4px solid #E0A106; border-radius: 8px; padding: 12px 16px; }
.shared-box[hidden] { display: none; }
.shared-box h2 { margin: 0 0 8px; font-size: 15px; color: #0B3A5B; }
.shared-box ul { margin: 0; padding-left: 18px; }
.shared-box li { margin: 4px 0; font-size: 14px; }

.week-grid.timed { grid-template-columns: 78px repeat(7, 1fr); }
.mod-col { background: #fff; border-radius: 10px; padding: 10px 6px; }
.mod-col h4 { margin: 0 0 8px; font-size: 13px; color: #0B3A5B; }
.mod { display: flex; flex-direction: column; border-bottom: 1px solid #E4DFD6; padding: 6px 4px; font-size: 12px; }
.mod span { font-weight: 700; color: #0B3A5B; }
.mod small { color: #5B6776; font-size: 10px; }
@media (max-width: 900px) {
  .week-grid.timed { grid-template-columns: 64px repeat(7, minmax(88px, 1fr)); overflow-x: auto; }
}

.week-grid.timed {
  display: grid;
  grid-template-columns: 78px repeat(7, 1fr);
  grid-template-rows: 44px repeat(8, minmax(56px, auto));
  column-gap: 8px;
  row-gap: 10px;
  align-items: stretch;
}
.mod-head, .day-head {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 10px; margin: 0; border: 0;
  font-weight: 600; font-size: 12px; color: #0B3A5B; text-align: center; line-height: 1.25; white-space: normal;
  padding: 6px 8px; cursor: pointer;
}
.mod-head { cursor: default; }
.mod { display: flex; flex-direction: column; justify-content: center; background: #fff; border-radius: 10px; padding: 4px 6px; }
.mod span { font-weight: 700; color: #0B3A5B; font-size: 13px; }
.mod small { color: #5B6776; font-size: 10px; }
.slot-cell {
  background: #EDE8DF; border: 0; border-radius: 8px; padding: 3px;
  text-align: left; cursor: pointer; min-height: 56px;
  display: flex; flex-direction: column;
}
.slot {
  flex: 1;
  background: #FFFEF8; border: 1px solid #E0A10666; border-left: 3px solid #E0A106;
  border-radius: 6px; padding: 6px 8px; font-size: 12px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.slot strong { font-size: 13px; color: #1A2332; font-weight: 600; }
.slot span { font-size: 11px; color: #5B6776; }

@media (max-width: 1100px) {
  .week-grid.timed { overflow-x: auto; min-width: 920px; }
}

a.school { color: #fff; text-decoration: none; display: block; flex-shrink: 0; }
a.school.nav-link { border-bottom: 0; padding: 0; }
a.school.nav-link.active .school-identity { color: #E0A106; }
.school-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  padding-left: 16px;
}
.school-year { color: #cbd5e1; font-weight: 400; }
a.school:hover .school-identity { color: #E0A106; }
a.school:hover .school-year { color: inherit; }
.campus-stage { min-height: calc(100vh - 56px); background: #0B3A5B; display: grid; place-items: center; padding: 24px; }
body.has-footer .campus-stage { min-height: calc(100vh - 100px); flex: 1 1 auto; }
.campus-reel { width: min(960px, 92vw); max-height: 70vh; background: #08283f; border-radius: 12px; }
.campus-caption { color: #d7e3f0; font-size: 14px; }

.campus-title { color: #fff; font-size: 28px; margin: 0 0 16px; text-align: center; }
.campus-stage { place-content: center; display: flex; flex-direction: column; align-items: center; padding: 24px 16px 48px; }
.campus-reel { width: min(960px, 92vw); max-height: 56vh; background: #08283f; border-radius: 12px; }
.campus-thumbs { display: flex; gap: 10px; overflow-x: auto; width: min(960px, 92vw); margin-top: 16px; padding-bottom: 6px; }
.campus-thumb { flex: 0 0 132px; height: 84px; border: 2px solid transparent; border-radius: 8px; background: #08283f; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.campus-thumb.active { border-color: #E0A106; }
.campus-thumb em { font-size: 11px; font-style: normal; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-ico { color: #E0A106; }
.campus-admin { width: min(960px, 92vw); margin-top: 20px; }
.campus-drop { border: 2px dashed #E0A106; border-radius: 12px; padding: 20px; text-align: center; color: #d7e3f0; }
.campus-drop.over { background: #08283f; }
.campus-choose { display: inline-block; margin-top: 8px; padding: 8px 16px; }
.campus-list { list-style: none; padding: 0; margin: 12px 0 0; }
.campus-list li { display: flex; justify-content: space-between; align-items: center; background: #08283f; color: #fff; border-radius: 8px; padding: 8px 12px; margin: 6px 0; }
.campus-list small { display: block; color: #d7e3f0; font-size: 12px; }
.ghost-dark { background: transparent; color: #E0A106; border: 1px solid #E0A106; border-radius: 6px; padding: 4px 10px; cursor: pointer; }

.top-nav { display: flex; gap: 12px; align-items: center; flex: 1; overflow-x: auto; }
.lab-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px;
  background: #F6F4EF;
  border-bottom: 1px solid #E4DFD6;
}
.lab-subnav-link {
  text-decoration: none;
  color: #0B3A5B;
  background: #fff;
  border: 1px solid #E4DFD6;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.lab-subnav-link:hover { border-color: #0B3A5B; }
.lab-subnav-link.on { background: #0B3A5B; color: #fff; border-color: #0B3A5B; }
.coming { max-width: 640px; margin: 48px auto; background: #fff; border-radius: 12px; padding: 32px; }

a.nav-link { color: #d7e3f0; text-decoration: none; white-space: nowrap; padding: 4px 0; border-bottom: 2px solid transparent; }
a.nav-link.active { color: #fff; border-bottom-color: #E0A106; }
a.nav-link.alarm { color: #C53030; font-weight: 700; }
.formal-page, .formal-admin { max-width: 960px; margin: 24px auto; padding: 0 16px 48px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip { border: 1px solid #0B3A5B; background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.chip.active { background: #E0A106; border-color: #E0A106; }
.formal-card { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 10px; padding: 12px 16px; margin: 8px 0; }
.formal-card small { display: block; color: #5a6a78; }
.drop-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.grade-form { display: flex; flex-wrap: wrap; gap: 8px; background: #fff; padding: 16px; border-radius: 10px; }
.grade-form h2 { width: 100%; margin: 0 0 8px; }
table.plain { width: 100%; background: #fff; border-collapse: collapse; }
table.plain th, table.plain td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eee; }

.hw-page { max-width: 1100px; margin: 24px auto; padding: 0 16px 48px; }
.hw-page .split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .hw-page .split { grid-template-columns: 1fr; } }

.slot-cell.hw-open, .event.hw-open { box-shadow: inset 4px 0 0 #C53030; }
.slot-cell.hw-done, .event.hw-done { box-shadow: inset 4px 0 0 #2F6B3A; }
.slot-cell.hw-set { box-shadow: inset 4px 0 0 #E0A106; }
.hw-line { display: block; font-size: 12px; font-style: normal; margin-top: 4px; }
.mod-page { max-width: 800px; margin: 24px auto; padding: 0 16px 48px; }
button.event { width: 100%; text-align: left; display: flex; gap: 10px; background: #fff; border: 0; border-bottom: 1px solid #eee; padding: 10px; cursor: pointer; }

a.layer-link { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; background: #0B3A5B; color: #fff; text-decoration: none; font-weight: 600; margin-left: 4px; }
.plan-out { background: #fff; padding: 12px; border-radius: 8px; overflow: auto; }

.plan-status { margin-top: 12px; font-weight: 600; }
.campus-drop.over { outline: 2px dashed #E0A106; background: #fff8e6; }
.plan-page h2 small { color: #E0A106; margin-left: 8px; }

.plan-board { margin-top: 28px; }
.plan-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0 16px; }
.plan-count { font-weight: 600; color: #0B3A5B; }
.schedule-grid {
  display: grid;
  grid-template-columns: 88px repeat(5, minmax(120px, 1fr));
  gap: 6px;
  overflow-x: auto;
}
.sched-corner, .sched-day, .sched-mod {
  background: #0B3A5B; color: #fff; border-radius: 10px; padding: 8px 10px; font-weight: 600;
}
.sched-mod { background: #fff; color: #0B3A5B; display: flex; flex-direction: column; justify-content: center; }
.sched-mod small { font-weight: 500; color: #5a6a78; }
.schedule-cell {
  min-height: 92px; background: #ece8df; border-radius: 10px; padding: 6px; transition: box-shadow .12s, background .12s;
}
.schedule-cell:hover { background: #e4dfd4; }
.schedule-cell.drag-over-free { box-shadow: inset 0 0 0 2px #2F6B3A; background: #e7f3ea; }
.schedule-cell.drag-over-swap { box-shadow: inset 0 0 0 2px #E0A106; background: #fff4d4; }
.schedule-card {
  background: #fff; border-radius: 8px; padding: 8px 10px; cursor: grab;
  box-shadow: inset 3px 0 0 #E0A106; display: flex; flex-direction: column; gap: 2px;
}
.schedule-card.special { box-shadow: inset 3px 0 0 #0B3A5B; }
.schedule-card.dragging { opacity: .55; }
.schedule-card strong { color: #0B3A5B; }
.schedule-card em { font-style: normal; color: #5a6a78; font-size: 12px; }
.schedule-card .room-badge { align-self: flex-start; background: #0B3A5B; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 999px; font-weight: 600; }
@media (max-width: 800px) {
  .schedule-grid { grid-template-columns: 64px repeat(5, 140px); }
}

.lab-shell { padding: 24px; max-width: 920px; margin: 0 auto; }
.lab-panel { display: grid; gap: 12px; }
.lab-tabs { display: flex; gap: 8px; }
.lab-tabs button { border: 1px solid #E4DFD6; background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.lab-tabs button.active { background: #2B6CB0; color: #fff; border-color: #2B6CB0; }
.lab-card { background: #fff; border: 1px solid #E4DFD6; border-radius: 12px; padding: 14px 16px; margin: 10px 0; }
.lab-card header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lab-card .meta { color: #5B6776; font-size: 13px; margin: 4px 0 8px; }
.lab-card ul { margin: 6px 0; padding-left: 18px; }
.lab-card.cmr { border-color: #C53030; }
.signal { font-size: 12px; border-radius: 999px; padding: 2px 8px; background: #E0A106; color: #0B3A5B; font-weight: 600; }
.signal.fare { background: #C53030; color: #fff; }
.cmr-flag { font-size: 12px; background: #C53030; color: #fff; border-radius: 999px; padding: 2px 8px; }
.hcode { display: inline-block; background: #F6F4EF; border-radius: 6px; padding: 2px 6px; margin: 0 4px 4px 0; font-size: 12px; }
.hcode.cmr { background: #C53030; color: #fff; }
.lab-table { width: 100%; border-collapse: collapse; background: #fff; }
.lab-table th, .lab-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #E4DFD6; vertical-align: top; }
.lab-table tr.cmr td { background: #fff5f5; }

/* MiftaLab desktop viewport locking and flex distribution */
@media (min-width: 1024px) {
  body.desktop.lab-page,
  body.desktop:has(#mifta-lab-app) {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  body.desktop.lab-page .app-frame,
  body.desktop:has(#mifta-lab-app) .app-frame {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: 100vh;
    overflow: hidden;
  }
  body.desktop.lab-page .app-content,
  body.desktop:has(#mifta-lab-app) .app-content {
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
  }
  body.desktop.lab-page .topbar,
  body.desktop:has(#mifta-lab-app) .topbar,
  body.desktop.lab-page .lab-subnav,
  body.desktop:has(#mifta-lab-app) .lab-subnav {
    flex-shrink: 0;
  }
  body.desktop.lab-page #mifta-lab-app,
  body.desktop:has(#mifta-lab-app) #mifta-lab-app {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.desktop.lab-page .site-footer,
  body.desktop:has(#mifta-lab-app) .site-footer {
    flex-shrink: 0;
  }
}
