:root {
  --bg-top: #f2f7ff;
  --bg-bottom: #f6f7fb;
  --label: #111317;
  --secondary-label: rgba(60, 60, 67, 0.76);
  --tertiary-label: rgba(60, 60, 67, 0.46);
  --separator: rgba(60, 60, 67, 0.14);
  --surface: rgba(255, 255, 255, 0.68);
  --surface-strong: rgba(255, 255, 255, 0.82);
  --surface-line: rgba(255, 255, 255, 0.72);
  --blue: #007aff;
  --blue-deep: #005ecb;
  --blue-soft: rgba(0, 122, 255, 0.14);
  --teal: #5ac8fa;
  --teal-soft: rgba(90, 200, 250, 0.16);
  --orange: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, 0.16);
  --shadow: 0 22px 52px rgba(15, 23, 42, 0.09), 0 8px 20px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--label);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "SF Pro Display",
    "Hiragino Sans",
    "Yu Gothic",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 34%),
    radial-gradient(circle at 86% 12%, rgba(90, 200, 250, 0.18), transparent 24%),
    radial-gradient(circle at 18% 86%, rgba(0, 122, 255, 0.12), transparent 26%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 14%, rgba(255, 255, 255, 0.65), transparent 24%),
    radial-gradient(circle at 92% 22%, rgba(0, 122, 255, 0.1), transparent 18%),
    radial-gradient(circle at 74% 88%, rgba(90, 200, 250, 0.1), transparent 20%);
  filter: blur(24px);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px calc(104px + env(safe-area-inset-bottom));
}

.current-card,
.empty-card,
.schedule-item {
  border: 1px solid var(--surface-line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.current-card {
  position: sticky;
  top: max(10px, env(safe-area-inset-top));
  z-index: 5;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(180deg, #2b9cff 0%, var(--blue) 55%, var(--blue-deep) 100%);
}

.current-card::before {
  content: "";
  position: absolute;
  inset: -24% -8% auto auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.38), transparent 68%);
}

.icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.icon-button.is-active {
  background: rgba(255, 255, 255, 0.28);
}

.current-card__inner {
  position: relative;
  padding: 18px 18px 20px;
  color: #ffffff;
}

.current-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 56px);
  min-height: 28px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.current-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
}

.current-badge.is-live {
  background: rgba(255, 255, 255, 0.22);
}

.current-badge.is-live::before {
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14);
}

.current-badge.is-next {
  background: rgba(215, 244, 255, 0.22);
  color: #eefbff;
}

.current-badge.is-elective {
  background: rgba(255, 196, 92, 0.22);
  color: #fff4d2;
}

.current-badge.is-next::before {
  background: #d8f6ff;
}

.current-badge.is-elective::before {
  background: #ffd27a;
}

.current-period {
  margin: 14px 0 8px;
  font-size: clamp(2rem, 9vw, 2.7rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
  font-weight: 700;
}

.current-period.is-elective {
  color: #fff4d3;
}

.current-summary {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
  font-size: 0.96rem;
  font-weight: 500;
}

.nav-button {
  appearance: none;
  border: 0;
  min-height: 44px;
  border-radius: 18px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--blue);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.nav-button:active {
  transform: scale(0.985);
}

.view-label {
  margin: 0 0 14px;
  padding-left: 4px;
  color: var(--secondary-label);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.empty-card {
  margin-bottom: 14px;
  padding: 18px;
  border-radius: 26px;
  background: var(--surface);
  text-align: center;
}

.empty-card__lead {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.empty-card__text {
  margin: 8px 0 0;
  color: var(--secondary-label);
  line-height: 1.58;
}

.schedule-list {
  display: grid;
  gap: 12px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(calc(100% - 28px), 430px);
  padding: 10px;
  transform: translateX(-50%);
  border: 1px solid var(--surface-line);
  border-radius: 24px;
  background: rgba(242, 247, 255, 0.7);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.day-section {
  display: grid;
  gap: 10px;
}

.day-section__label {
  padding-left: 4px;
  color: var(--secondary-label);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.day-section__list {
  display: grid;
  gap: 12px;
}

.schedule-item {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 250, 255, 0.68));
}

.schedule-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: rgba(60, 60, 67, 0.12);
}

.schedule-item.is-current {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 249, 255, 0.82));
}

.schedule-item.is-current::before {
  background: var(--blue);
}

.schedule-item.is-next {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(244, 252, 255, 0.78));
}

.schedule-item.is-next::before {
  background: var(--teal);
}

.schedule-item.is-elective {
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.9), rgba(255, 247, 232, 0.76));
}

.schedule-item.is-elective .schedule-item__subject {
  color: #9a5b00;
}

.schedule-item__body {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 16px 17px 18px;
}

.schedule-item__meta {
  display: grid;
  gap: 6px;
}

.schedule-item__period {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.schedule-item__time {
  color: var(--tertiary-label);
  font-size: 0.8rem;
  line-height: 1.45;
}

.schedule-item__content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.schedule-item__subject {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-weight: 680;
  word-break: break-word;
}

.schedule-item__detail {
  margin: 0;
  color: var(--secondary-label);
  line-height: 1.5;
  font-size: 0.9rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.12);
  color: var(--secondary-label);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.chip.is-current {
  background: var(--blue-soft);
  color: var(--blue-deep);
}

.chip.is-next {
  background: var(--teal-soft);
  color: #0d7496;
}

.chip--elective {
  background: var(--orange-soft);
  color: #a35f00;
}

@media (max-width: 389px) {
  .shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .schedule-item__body {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
    padding-left: 16px;
  }

  .current-card__inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .icon-button {
    top: 12px;
    right: 12px;
  }

  .bottom-nav {
    width: calc(100% - 24px);
    bottom: calc(12px + env(safe-area-inset-bottom));
    padding: 8px;
  }
}
