:root {
  color-scheme: light;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  text-decoration: none;
}

svg {
  display: block;
}

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

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  width: min(100%, 560px);
  min-height: 68px;
  margin: 0 auto;
  padding: 7px 2px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--nav-bg) 92%, transparent);
  box-shadow: 0 -10px 36px color-mix(in srgb, var(--ink) 7%, transparent);
  backdrop-filter: blur(18px);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-flow: row;
}

.nav-item {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px 1px;
  border-radius: 12px;
  color: var(--nav-muted);
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -0.035em;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
  width: 100%;
  max-width: 100%;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

dialog.school-picker-dialog.school-picker-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  width: min(520px, calc(100% - 28px));
  max-width: none;
  max-height: min(720px, calc(100dvh - 36px));
  margin: auto;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(114, 224, 189, 0.24);
  border-radius: 24px;
  color: #eef8f5;
  background: #0b2730;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

dialog.school-picker-dialog::backdrop {
  background: rgba(3, 14, 18, 0.68);
  backdrop-filter: blur(5px);
}

.school-picker-dialog-close {
  position: absolute;
  z-index: 2;
  top: 15px;
  right: 15px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.07);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.school-picker-dialog [hidden] {
  display: none !important;
}

.school-picker-dialog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 1px 48px 15px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.school-picker-dialog-head small,
.school-picker-dialog-head h2,
.school-picker-dialog-head strong {
  margin: 0;
}

.school-picker-dialog-head small {
  color: #72e0bd;
  font: 800 10px/1.2 Consolas, monospace;
  letter-spacing: 0.1em;
}

.school-picker-dialog-head h2 {
  margin-top: 5px;
  color: white;
  font-size: 21px;
  letter-spacing: -0.04em;
}

.school-picker-dialog-head > strong {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.63);
  font-size: 12px;
}

.school-picker-current {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(114, 224, 189, 0.18);
  border-radius: 15px;
  background: rgba(114, 224, 189, 0.08);
}

.school-picker-current-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.school-picker-current small {
  margin-top: 6px;
  color: #72e0bd;
  font-size: 11px;
  font-weight: 800;
}

.school-picker-current strong {
  overflow: hidden;
  color: white;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-selection-meta.has-cohort {
  display: flex !important;
  min-width: 0;
  align-items: center;
  gap: 6px;
  letter-spacing: 0;
}

.school-cohort-badge {
  display: inline-flex;
  min-height: 20px;
  flex: 0 0 auto;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid rgba(157, 241, 214, 0.6);
  border-radius: 999px;
  color: #062b27;
  background: linear-gradient(135deg, #91efd1, #65d7b2);
  box-shadow: 0 4px 12px rgba(76, 211, 169, 0.2);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.school-disconnect-button[hidden] {
  display: none !important;
}

.school-picker-current > .school-disconnect-button {
  min-width: 0;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 211, 211, 0.5);
  border-radius: 11px;
  color: white;
  background: rgba(194, 67, 78, 0.72);
  font-size: 10px;
  font-weight: 850;
}

.school-picker-current > .school-disconnect-button:hover {
  border-color: rgba(255, 225, 225, 0.9);
  background: rgba(213, 73, 84, 0.94);
}

.school-picker-current > .school-disconnect-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.school-picker-search {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  margin: 12px 0 10px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
}

.school-picker-search .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.48);
}

.school-picker-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
  font: inherit;
  font-size: 13px;
}

.school-picker-search input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

dialog.school-picker-dialog [data-school-options] {
  display: grid;
  height: clamp(220px, 38dvh, 380px);
  gap: 7px;
  max-height: none;
  align-content: start;
  overflow-y: auto;
  padding-right: 3px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

dialog.school-picker-dialog [data-school-id] {
  display: flex;
  width: 100%;
  min-height: 62px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
  cursor: pointer;
}

dialog.school-picker-dialog [data-school-id]:hover,
dialog.school-picker-dialog [data-school-id]:focus-visible,
dialog.school-picker-dialog [data-school-id].is-selected {
  border-color: rgba(114, 224, 189, 0.26);
  outline: none;
  background: rgba(114, 224, 189, 0.11);
}

dialog.school-picker-dialog [data-school-id] small,
dialog.school-picker-dialog [data-school-id] strong {
  display: block;
  margin: 0;
}

dialog.school-picker-dialog [data-school-id] small {
  order: -1;
  color: #72e0bd;
  font-size: 11px;
  font-weight: 750;
}

dialog.school-picker-dialog [data-school-id] strong {
  color: white;
  font-size: 15px;
}

.school-year-choice {
  padding: 3px 2px 5px;
}

.school-year-back {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.school-year-back .icon {
  width: 14px;
  height: 14px;
  transform: rotate(180deg);
}

.school-year-choice > small {
  display: block;
  margin-top: 30px;
  color: #72e0bd;
  font-size: 12px;
  font-weight: 800;
}

.school-year-choice h2 {
  margin: 7px 0 0;
  color: white;
  font-size: clamp(23px, 5vw, 30px);
  letter-spacing: -0.05em;
}

.school-year-choice > p {
  margin: 8px 0 22px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 13px;
}

.school-year-choice [data-school-year-options] {
  display: grid;
  gap: 9px;
}

.school-year-choice [data-school-year-options] button {
  position: relative;
  min-height: 56px;
  overflow: hidden;
  border: 1px solid rgba(114, 224, 189, 0.22);
  border-radius: 15px;
  color: white;
  background: rgba(114, 224, 189, 0.1);
  font-size: 15px;
  font-weight: 850;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, opacity 160ms ease;
  cursor: pointer;
}

.school-year-choice [data-school-year-options] button:hover,
.school-year-choice [data-school-year-options] button:focus-visible {
  border-color: #72e0bd;
  outline: none;
  background: rgba(114, 224, 189, 0.18);
}

.school-year-choice [data-school-year-options] button:disabled:not(.is-clicked) {
  opacity: 0.42;
  cursor: default;
}

.school-year-choice [data-school-year-options] button.is-clicked {
  border-color: #72e0bd;
  background: rgba(114, 224, 189, 0.3);
  box-shadow: 0 0 0 3px rgba(114, 224, 189, 0.14) inset;
  animation: school-year-click 180ms ease-out both;
  cursor: default;
}

@keyframes school-year-click {
  0% { transform: scale(1); }
  45% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .school-year-choice [data-school-year-options] button.is-clicked {
    animation: none;
  }
}

.school-year-choice [data-school-year-options] em {
  display: block;
  padding: 24px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 13px;
  font-style: normal;
  text-align: center;
}

@media (max-width: 560px) {
  dialog.school-picker-dialog.school-picker-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 22px);
    padding: 18px;
    border-radius: 21px;
  }

  dialog.school-picker-dialog [data-school-options] {
    height: clamp(210px, 38dvh, calc(100dvh - 284px));
    max-height: none;
  }
}

.nav-item .icon {
  width: 21px;
  height: 21px;
}

.nav-item > span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: var(--primary);
  background: var(--brand-bg);
  outline: none;
}

.nav-item:active {
  transform: scale(0.94);
}

.nav-item[aria-current="page"] {
  color: var(--primary);
  background: var(--brand-bg);
}

.nav-item[aria-current="page"]::before {
  position: absolute;
  top: -7px;
  width: 23px;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: var(--primary);
  content: "";
}

@media (min-width: 561px) {
  .bottom-nav {
    right: auto;
    left: 50vw;
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 22px 22px 0 0;
    transform: translateX(-50%);
  }
}

@media (max-width: 390px) {
  .bottom-nav .nav-item {
    gap: 2px;
    font-size: 7.5px;
    letter-spacing: -0.06em;
  }

  .bottom-nav .nav-item .icon {
    width: 19px;
    height: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .nav-item {
    transition: none;
  }
}
