/* Shared shell */
.site-header {
  padding: 0;
  background: linear-gradient(120deg, var(--site-inset, #101a23), var(--site-panel, #17262e));
  border-bottom-color: var(--site-border, #334851);
  box-shadow: none;
}
.site-header .site-nav-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px clamp(12px, 1.4vw, 22px);
  box-sizing: border-box;
  width: 100%;
  max-width: 1440px;
  padding-block: 12px;
}
.site-header .logo { min-width: 0; }
.site-header .logo a {
  display: inline-block;
  max-width: none;
  color: var(--site-text, #edf7fb);
  font-size: clamp(1rem, 1.6vw, 1.38rem);
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
  word-break: keep-all;
  text-decoration: none;
}
.site-header .site-user-tools {
  flex: 0 1 auto;
  margin: 0;
  gap: 10px;
  flex-wrap: nowrap;
}
.site-header .site-user-tools .user-section {
  display: flex;
  align-items: center;
  gap: 12px;
  width: auto;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--site-border, #3c515c);
  border-radius: 12px;
  background: var(--site-panel, #17262e);
}
.site-header .site-user-identity {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  min-width: 0;
}
.site-header .site-user-identity > .site-user-level-badge { grid-area: 1 / 1 / span 2; }
.site-header .site-user-identity > .welcome-mypage-link {
  grid-area: 1 / 2;
  padding: 0;
  margin: 0;
  line-height: 1.4;
  min-width: 0;
}
.site-header .site-user-identity > .welcome-mypage-link > span:first-child {
  max-width: 115px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header .site-user-identity > .points {
  grid-area: 2 / 2;
  color: var(--site-muted, #abbfc9);
  font-size: .78rem;
  line-height: 1.4;
  white-space: nowrap;
}
body[data-site-theme] .site-header .user-section > form {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body[data-site-theme] .site-header .user-section > form .btn {
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--site-border, #3c515c);
  border-radius: 8px;
  background: transparent;
  color: var(--site-text, #edf7fb);
  font-size: .8rem;
  white-space: nowrap;
  box-shadow: none;
}
body[data-site-theme] .site-header .user-section > form .btn:hover {
  background: var(--site-inset, #243842);
}
.site-header .site-user-tools > .snow-toggle { margin: 0; }
.site-header .snow-toggle input {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.site-header .snow-toggle input:focus-visible + .snow-toggle-slider {
  outline: 2px solid var(--site-accent, #7fe6e0);
  outline-offset: 3px;
}

/* Color and icons identify each destination without a button surface. */
.site-header [data-nav-color="mint"] { --nav-hue:165; }
.site-header [data-nav-color="blue"] { --nav-hue:210; }
.site-header [data-nav-color="violet"] { --nav-hue:270; }
.site-header [data-nav-color="gold"] { --nav-hue:40; }
.site-header [data-nav-color="pink"] { --nav-hue:325; }
.site-header [data-nav-color="cyan"] { --nav-hue:185; }
.site-header [data-nav-color="coral"] { --nav-hue:5; }
.site-header [data-nav-color="green"] { --nav-hue:140; }
body[data-site-theme] .site-header .nav-links [data-nav-color] {
  --nav-ink: hsl(var(--nav-hue) 78% 80%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 5px 6px;
  color: var(--nav-ink);
  font-size: 1.0625rem;
  font-weight: 700;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-decoration: none;
}
body[data-site-theme] .site-header .nav-links [data-nav-color]:is(:hover, :focus-visible) {
  color: var(--nav-ink);
  background: transparent;
}
body[data-site-theme] .site-header .nav-links [data-nav-color]:focus-visible {
  outline: 2px solid var(--nav-ink);
  outline-offset: 2px;
}
body:is([data-site-theme="light"], [data-site-theme="sakura"], [data-site-theme="latte"], .public-student-scratcher-base[data-site-theme=""]) .site-header .nav-links [data-nav-color] {
  --nav-ink: hsl(var(--nav-hue) 68% 29%);
}

body[data-site-theme] .site-header .site-nav-inner .nav-links {
  order: 0;
  align-items: center;
  justify-content: center;
  flex-flow: row wrap;
  gap: 0 1px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}
.site-header .nav-links > li {
  position: relative;
  flex: 0 0 auto;
  list-style: none;
}
.site-header .nav-links > li + li {
  padding-inline-start: 2px;
}
.site-header .nav-links > li + li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  width: 1px;
  height: 1em;
  transform: translateY(-50%);
  background: var(--site-muted, #a4b9c5);
  opacity: .55;
  pointer-events: none;
}
.site-header .site-nav-icon {
  display: block;
  flex: 0 0 18px;
}
body[data-site-theme] .site-header #online-students summary {
  font-size: 1.0625rem;
  font-weight: 700;
  padding-inline: 6px;
}
.site-header #online-students summary .site-nav-icon {
  color: var(--site-presence-ink, #80e8a8);
}

.site-header .nav-links :is([data-nav-color], #online-students summary) {
  --nav-glow-opacity: .24;
  position: relative;
  isolation: isolate;
}
body:is([data-site-theme="light"], [data-site-theme="sakura"], [data-site-theme="latte"], .public-student-scratcher-base[data-site-theme=""]) .site-header .nav-links :is([data-nav-color], #online-students summary) {
  --nav-glow-opacity: .16;
}
.site-header .nav-links :is([data-nav-color], #online-students summary)::before {
  content: "";
  position: absolute;
  inset: 1px -8px;
  z-index: -1;
  background: radial-gradient(ellipse, var(--nav-ink, var(--site-presence-ink, #80e8a8)), transparent 72%);
  opacity: 0;
  transform: scale(.8);
  pointer-events: none;
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}
.site-header .nav-links :is([data-nav-color], #online-students summary)::after {
  content: "";
  position: absolute;
  inset-inline: 2px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--nav-ink, var(--site-presence-ink, #80e8a8));
  transform: scaleX(0);
  pointer-events: none;
  transition: transform 180ms ease-out;
}
.site-header .nav-links :is([data-nav-color], #online-students summary) .site-nav-icon {
  transition: transform 180ms ease-out;
}
.site-header .nav-links :is([data-nav-color], #online-students summary):focus-visible::after {
  transform: scaleX(1);
}
@media (hover: hover) {
  .site-header .nav-links :is([data-nav-color], #online-students summary):hover::before {
    opacity: var(--nav-glow-opacity);
    transform: scale(1);
  }
  .site-header .nav-links :is([data-nav-color], #online-students summary):hover::after {
    transform: scaleX(1);
  }
  .site-header .nav-links :is([data-nav-color], #online-students summary):hover .site-nav-icon {
    transform: translateY(-2px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-header .nav-links :is([data-nav-color], #online-students summary)::before,
  .site-header .nav-links :is([data-nav-color], #online-students summary)::after,
  .site-header .nav-links :is([data-nav-color], #online-students summary) .site-nav-icon {
    transition: none;
  }
  .site-header .nav-links :is([data-nav-color], #online-students summary):hover .site-nav-icon {
    transform: none;
  }
}
body:is([data-site-theme="light"], [data-site-theme="sakura"], [data-site-theme="latte"], .public-student-scratcher-base[data-site-theme=""]) .site-header #online-students {
  --site-presence-ink: #20704a;
}
body[data-site-theme] .site-header .notification-box {
  box-sizing: border-box;
  width: min(320px, calc(100vw - 32px));
  max-width: none;
  background: var(--site-panel, #17262e);
  color: var(--site-text, #edf7fb);
  border-color: var(--site-border, #3c515c);
}
body[data-site-theme] .site-header .notification-box .notification-item {
  border-bottom-color: var(--site-border, #3c515c);
  white-space: normal;
}
body[data-site-theme] .site-header .notification-box :is(a.read, .notification-time, .notification-state.is-read) {
  color: var(--site-muted, #abbfc9);
}
body[data-site-theme] .site-header .notification-box a.unread { color: var(--site-text, #edf7fb); }
body[data-site-theme] .site-header .notification-box :is(.mark-all-read, .notification-preview-more, .highlight-title, .notification-state.is-unread) {
  color: var(--site-accent, #7fe6e0);
}
body[data-site-theme] .site-header .notification-box :is(a.read, a.unread):hover {
  background: var(--site-inset, #243842);
}
body[data-site-theme] .site-header .online-students-panel { left: auto; right: 0; }
@media (min-width: 1360px) {
  .site-header .site-nav-inner {
    max-width: none;
    padding-inline: clamp(16px, 1.4vw, 32px);
  }
  body[data-site-theme] .site-header .site-nav-inner .nav-links {
    justify-content: space-between;
  }
  body[data-site-theme] .site-header :is(.nav-links [data-nav-color], #online-students summary) {
    font-size: clamp(1.125rem, 1.3vw, 1.375rem);
    gap: 7px;
  }
  .site-header .nav-links .site-nav-icon {
    width: 1.1em;
    height: 1.1em;
    flex-basis: 1.1em;
  }
  .site-header .nav-links:where(:not(:has(.nav-question-link))) > li {
    display: flex;
    flex-grow: 1;
    justify-content: center;
  }
  /* Let the native link or disclosure occupy its full menu segment. */
  .site-header .nav-links:where(:not(:has(.nav-question-link))) > li > :is(a, details, .notification-header) {
    flex: 1 0 auto;
  }
  body[data-site-theme] .site-header .nav-links :is(li > [data-nav-color], #notification-toggle, #online-students summary) {
    width: 100%;
    justify-content: center;
  }
  body[data-site-theme] .site-header .notification-box {
    top: calc(100% + 6px);
  }
}
@media (max-width: 1000px) {
  .site-header .site-nav-inner { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  body[data-site-theme] .site-header .site-nav-inner .nav-links {
    position: relative;
    justify-content: flex-start;
  }
  .site-header .site-user-tools { gap: 8px; flex-wrap: wrap; }
  .site-header .site-user-tools .site-social-actions { flex-direction: row; flex-wrap: wrap; }
  .site-header .site-user-tools .user-section { flex-direction: row; gap: 8px; padding-inline: 8px; }
  .site-header .site-user-identity > .welcome-mypage-link > span:first-child { max-width: 90px; }
  body[data-site-theme] .site-header :is(.nav-links [data-nav-color], #online-students summary) {
    font-size: 1rem;
  }
  .site-header .nav-links > :is(.online-students-menu, .notification-dropdown) {
    position: static;
    border-inline-start: 1px solid var(--site-border, #334851);
  }
  .site-header .nav-links > :is(.online-students-menu, .notification-dropdown)::before { display: none; }
  body[data-site-theme] .site-header :is(.online-students-panel, .notification-box) {
    top: calc(100% + 6px);
    right: 12px;
  }
}

body[data-site-theme] .site-footer {
  background: var(--site-inset, #101a23);
  border-top-color: var(--site-border, #334851);
}
.site-footer .site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 16px 12px;
  box-sizing: border-box;
}
.site-footer .site-footer-text { margin: 0; color: var(--site-muted, #abbfc9); }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .82rem; }
.site-footer-links a { color: var(--site-text, #edf7fb); text-underline-offset: 3px; }
.site-footer #footer-social-slot:empty { display: none; }
.site-footer #footer-social-slot .site-social-actions { margin: 0; }
