/* The original campus switcher sits outside the scrolling business document. */
body:has(#workspace:not([hidden])) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  margin: 0;
}
#workspace:not([hidden]) { flex: 1; min-height: 0; }
#workspace iframe { display: block; width: 100%; height: 100%; border: 0; }
#workspace iframe[hidden], .app-header[hidden] { display: none; }
.app-header {
  box-sizing: border-box;
  min-height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 10px 24px;
  padding-top: max(10px, env(safe-area-inset-top));
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid #dce3df;
  color: #243330;
  font: normal 16px/normal -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-synthesis: none;
}
.app-header a { box-sizing: border-box; color: inherit; text-decoration: none; }
.app-header a:focus-visible { outline: 3px solid #c98123; outline-offset: 3px; }
.app-header .brand { display: flex; align-items: center; gap: 11px; font-size: 16px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.app-header .brand-mark { display: block; width: 38px; height: 38px; }
.app-header .brand-sub { display: block; margin-top: 2px; color: #62726c; font-size: 10px; font-weight: 500; letter-spacing: .08em; }
.app-header nav { display: flex; align-self: stretch; align-items: center; gap: 8px; }
.app-header nav a { padding: 11px 16px; border-radius: 7px; color: #5b6b64; font-size: 14px; font-weight: 600; white-space: nowrap; }
.app-header nav a:hover { background: #f4f6f5; }
.app-header nav a[aria-current="page"] { background: #e8f0ec; color: #24453a; }
@media (max-width: 700px) {
  .app-header { flex-wrap: wrap; gap: 8px 14px; padding: 9px 12px; }
  .app-header .brand { font-size: 14px; }
  .app-header .brand-mark { width: 32px; height: 32px; }
  .app-header .brand-sub { font-size: 9px; }
  .app-header nav { order: 2; width: 100%; gap: 6px; }
  .app-header nav a { flex: 1; text-align: center; padding: 9px 12px; font-size: 13px; }
}

/* Keep the protected workspace hidden while loading or rechecking the session. */
#entrance.shell-loading, #entrance.shell-reconnect {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 24px;
  background: #f4f6f5;
  color: #243330;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic", sans-serif;
}
#entrance:is(.shell-loading,.shell-reconnect) > h1,
#entrance:is(.shell-loading,.shell-reconnect) #help,
#entrance.shell-loading .controls, #entrance.shell-loading h2 { display: none; }
#entrance.shell-loading section { padding: 0; border: 0; background: transparent; }
#entrance.shell-loading #status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #52635b;
  font-size: 14px;
}
#entrance.shell-loading #status::before {
  content: "";
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  border: 2px solid #d1dcd5;
  border-top-color: #385a48;
  border-radius: 50%;
  animation: shell-spin .8s linear infinite;
}
@keyframes shell-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  #entrance.shell-loading #status::before { animation: none; }
}
#entrance.shell-reconnect section {
  max-width: 520px;
  padding: 24px;
  border: 1px solid #dce3df;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 18px #152a1812;
  line-height: 1.7;
}
#entrance.shell-reconnect h2 { margin: 0 0 12px; font-size: 20px; }
#entrance.shell-reconnect #status { margin: 1em 0; }
#entrance.shell-reconnect #action { padding: 8px 16px; border: 1px solid #243d39; border-radius: 6px; background: #243d39; }
#entrance.shell-reconnect #action:focus-visible { outline: 3px solid #c98123; outline-offset: 3px; }
