@font-face {
  font-family: "Inter";
  src: url("assets/fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --blue: #008cff;
  --blue-text: #3e7ae4;
  --ink: #000b42;
  --ink-80: #333c68;
  --muted: #8085a0;
  --surface-soft: #ebf3ff;
  --surface-soft-2: #f5f8ff;
  --line: rgba(0, 11, 66, .15);
  --green-bg: #dbe6dd;
  --green-text: #2a533c;
  --dot-bg: #cadaef;
  --dot-text: #264a72;
  --change-bg: #f3ddd0;
  --change-text: #6b4222;
  --nav-height: 54px;
  --safe-top: env(safe-area-inset-top, 0px);
  --viewport-height: 100svh;
  --screen-height: var(--viewport-height);
}

@supports (height: 100dvh) {
  :root { --viewport-height: 100dvh; }
}

/* Installed iOS apps can exclude the status area from dynamic viewport units. */
@media (display-mode: standalone) {
  :root { --viewport-height: 100vh; }
}
:root.is-apple-standalone { --viewport-height: 100vh; }

.browser-top-tint { display: none; }
@media (max-width: 430px) and (display-mode: browser) {
  /* Safari extends the solid background of a fixed element into its top UI. */
  :root:not(.is-apple-standalone) .browser-top-tint {
    display: block;
    position: fixed;
    z-index: 46;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--blue);
    pointer-events: none;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-tap-highlight-color: transparent;
  min-width: 280px;
  min-height: 100%;
  background: #e8eef7;
  scrollbar-width: none;
}

body {
  margin: 0;
  min-width: 280px;
  min-height: 100%;
  color: var(--ink-80);
  background: #e8eef7;
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar { display: none; }

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(0, 140, 255, .3);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: var(--screen-height);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 11, 66, .12);
}

.screen-stage {
  min-height: var(--screen-height);
  background: #fff;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

.app-screen { min-height: var(--screen-height); }
.app-screen[hidden] { display: none !important; }

.schedule-screen { display: flex; flex-direction: column; }

.schedule-screen,
.standard-screen {
  background: var(--blue);
}

.hero {
  display: flex;
  min-height: calc(155px + var(--safe-top));
  flex-direction: column;
  gap: 32px;
  padding: calc(20px + var(--safe-top)) 20px 12px;
  color: #fff;
}

.hero-main {
  display: flex;
  min-height: 74px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.day-heading { min-width: 0; }
.day-heading h1 {
  margin: 0;
  color: #fff;
  font-size: 48px;
  font-weight: 700;
  line-height: 48px;
  letter-spacing: -2.88px;
  white-space: nowrap;
}
.day-heading p {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, .65);
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: -1.2px;
  white-space: nowrap;
}

.bell-button {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 12px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  transition: transform .16s ease;
}
.bell-button:active { transform: scale(.94); }
.bell-button img { display: block; width: 20px; height: 20px; }


.hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 17px;
  letter-spacing: -.84px;
  white-space: nowrap;
}

.content-panel {
  display: flex;
  min-height: calc(var(--screen-height) - 155px - var(--safe-top));
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 20px 20px 90px;
  overflow: hidden;
  border-radius: 48px 48px 0 0;
  background: #fff;
}

.status-row {
  display: flex;
  min-height: 27px;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 12px;
}
.status-chip {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 7px;
  border: 0;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 17px;
  letter-spacing: -.84px;
}
button.status-chip { transition: transform .16s ease; }
button.status-chip:active { transform: scale(.96); }
.status-chip img { display: block; width: 10px; height: 10px; }
.status-chip.info { background: var(--dot-bg); color: var(--dot-text); }
.status-chip.warning { background: #fff0d9; color: #7b4a12; }
.status-chip.error { background: #ffe0e0; color: #7f2929; }
.status-chip.neutral { background: #eef0f5; color: #555e78; }

.day-switcher {
  display: grid;
  width: 100%;
  min-height: 41px;
  grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr);
  align-items: center;
  padding: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}
.day-switcher button {
  min-width: 0;
  min-height: 33px;
  padding: 4px 8px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: rgba(0, 11, 68, .5);
  font-size: 14px;
  font-weight: 500;
  line-height: 17px;
  letter-spacing: -.84px;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.day-switcher button.active {
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.schedule-list { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.lesson-card {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 45px 1.5px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 14px 14px 4px;
  border-radius: 24px;
}
.lesson-divider { width: 1.5px; align-self: stretch; border-radius: 999px; background: var(--line); }
.lesson-time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}
.lesson-number { color: #125cdf; font-size: 12px; font-weight: 700; line-height: 15px; letter-spacing: -.72px; opacity: .8; text-transform: uppercase; }
.lesson-clock { display: flex; flex-direction: column; gap: 4px; }
.lesson-start { color: var(--ink); font-size: 18px; font-weight: 700; line-height: 22px; letter-spacing: -1.08px; opacity: .8; }
.lesson-end { color: var(--ink); font-size: 12px; font-weight: 500; line-height: 15px; letter-spacing: -.72px; opacity: .5; }
.lesson-main { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 8px; }
.lesson-title { margin: 0; color: var(--ink); font-size: 20px; font-weight: 700; line-height: 24px; letter-spacing: -.06em; opacity: .8; overflow-wrap: anywhere; }
.lesson-teacher { margin: 0; color: var(--ink); font-size: 14px; font-weight: 400; line-height: 17px; letter-spacing: -.84px; opacity: .5; overflow-wrap: anywhere; }
.lesson-details { display: flex; width: 100%; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.room { display: inline-flex; align-items: center; gap: 4px; color: var(--blue-text); font-size: 14px; font-weight: 400; line-height: 17px; letter-spacing: -.84px; }
.room img { display: block; width: 16px; height: 16px; object-fit: contain; }
.change-badge { display: inline-flex; min-height: 17px; align-items: center; justify-content: center; gap: 4px; padding: 3px 6px; border-radius: 999px; background: var(--change-bg); color: rgba(107, 66, 34, .85); font-size: 10px; font-weight: 600; line-height: 11px; letter-spacing: -.4px; }
.change-badge img { display: block; width: 6px; height: 6px; }
.cancelled-badge { background: var(--error-bg) !important; color: var(--error-text) !important; }
.lesson-card.cancelled .lesson-title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 50%, transparent); text-decoration-thickness: 1.5px; }
.student-note { width: 100%; padding: 8px 10px; border-radius: 10px; background: var(--surface-soft); color: rgba(0, 11, 66, .65); font-size: 12px; line-height: 16px; }
.schedule-separator { width: 100%; height: 1.5px; border-radius: 999px; background: var(--line); }

.state-card { padding: 24px 20px; border-radius: 24px; background: var(--surface-soft); text-align: center; }
.state-card strong { display: block; color: var(--ink-80); font-size: 17px; line-height: 22px; }
.state-card span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 18px; }
.special-card { padding: 16px; border-radius: 20px; background: #fff0d9; color: #6b4222; }
.special-card strong { display: block; font-size: 16px; line-height: 21px; }
.special-card span { display: block; margin-top: 5px; font-size: 13px; line-height: 18px; opacity: .78; }
.day-notices { display: grid; gap: 8px; margin-bottom: 8px; }
.day-notice { padding: 14px 16px; border-radius: 18px; background: #fff0d9; color: #6b4222; }
.day-notice strong { display: block; font-size: 15px; line-height: 20px; }
.day-notice span { display: block; margin-top: 4px; font-size: 12px; line-height: 17px; opacity: .78; }
.clarification-notice { margin-bottom: 12px; }
.clarification-notice a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.clarification-notice a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }

.quick-actions { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.quick-actions h2, .menu-section h2 { margin: 0; color: var(--ink-80); font-size: 18px; font-weight: 700; line-height: 22px; letter-spacing: -1.08px; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.action-card, .report-card { border: 0; text-align: left; transition: transform .16s ease, filter .16s ease; }
.action-card:active, .report-card:active { transform: scale(.985); }
.action-card:hover, .report-card:hover { filter: brightness(.985); }
.action-card { display: flex; min-width: 0; min-height: 93px; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface-soft); color: var(--ink-80); font-size: 14px; font-weight: 600; line-height: 17px; letter-spacing: -.84px; }
.action-icon, .report-icon { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; padding: 5.25px; border-radius: 8.75px; }
.action-icon { background: var(--blue); }
.report-icon { background: var(--blue); }
.report-icon img { filter: brightness(0) invert(1); }
.action-icon img, .report-icon img { display: block; width: 17.5px; height: 17.5px; }
.report-card { display: flex; min-height: 77px; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 16px; background: var(--blue); color: #fff; font-size: 14px; font-weight: 600; line-height: 17px; letter-spacing: -.84px; }

/* Full-screen root pages */
.detail-screen {
  background: var(--blue);
}
.page-hero {
  display: flex;
  min-height: calc(155px + var(--safe-top));
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: calc(20px + var(--safe-top)) 20px 12px;
  color: #fff;
}
.page-heading { min-width: 0; }
.page-heading h1 { margin: 0; color: #fff; font-size: 48px; font-weight: 700; line-height: 48px; letter-spacing: -2.88px; }
.page-heading p { margin: 2px 0 0; color: rgba(255,255,255,.65); font-size: 20px; font-weight: 500; line-height: 24px; letter-spacing: -1.2px; }
.page-content { padding: 20px 20px 92px; }
.content-panel-style { min-height: calc(var(--screen-height) - 155px - var(--safe-top)); border-radius: 48px 48px 0 0; background: #fff; }
.week-content { display: flex; flex-direction: column; gap: 16px; }
.week-switcher { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; padding: 4px; border-radius: 999px; background: var(--surface-soft); }
.week-switcher button { min-height: 40px; padding: 6px; border: 0; border-radius: 999px; background: transparent; color: rgba(0, 11, 68, .5); font-size: 20px; font-weight: 600; }
.week-switcher .current-week-button { padding-inline: 12px; background: var(--blue); color: #fff; font-size: 14px; font-weight: 700; }
.week-switcher .current-week-button:disabled { opacity: 1; }
.week-list { display: grid; gap: 18px; }
.week-day { overflow: hidden; border: 0; border-radius: 22px; background: var(--surface-soft-2); }
.week-day:last-child { border-bottom: 0; }
.week-day.today { border-radius: 22px; background: var(--surface-soft-2); }
.week-day-head { display: flex; width: 100%; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 10px 10px; border: 0; background: transparent; text-align: left; }
.week-date { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.week-date-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.week-day-head strong { color: var(--ink-80); font-size: 18px; line-height: 22px; }
.week-day-head small { color: var(--muted); font-size: 12px; line-height: 16px; }
.week-day-statuses { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.week-status { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 4px 7px; border-radius: 999px; background: var(--green-bg); color: var(--green-text); font-size: 11px; font-weight: 600; line-height: 14px; }
.week-status img { display: block; width: 8px; height: 8px; }
.week-status.info { background: var(--dot-bg); color: var(--dot-text); }
.week-status.warning { background: #fff0d9; color: #7b4a12; }
.week-status.replacement { background: var(--change-bg); color: var(--change-text); }
.week-status.replacement img { width: 12px; height: 12px; }
.week-status.neutral { background: #eef0f5; color: #555e78; }
.week-count { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: var(--surface-soft); color: var(--blue-text); font-size: 11px; font-style: normal; font-weight: 700; }
.week-lessons { display: flex; flex-direction: column; gap: 4px; padding: 0 6px 14px; }
.week-lessons .lesson-card { padding-inline: 4px 8px; }
.week-empty { margin: 0; padding: 4px 10px 18px; color: var(--muted); font-size: 13px; }

.more-content { display: grid; gap: 14px; }
.settings-card, .menu-card { border: 0; border-radius: 22px; background: var(--surface-soft); box-shadow: none; }
.settings-card { padding: 17px; }
.section-heading p { margin: 0; color: var(--blue-text); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.section-heading h2, .settings-card h2 { margin: 3px 0 0; color: var(--ink-80); font-size: 18px; line-height: 22px; }
.menu-card { overflow: hidden; }
.menu-row { display: flex; width: 100%; min-height: 66px; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border: 0; border-bottom: 1px solid rgba(0, 11, 66, .08); background: transparent; text-align: left; }
.menu-row:last-child { border-bottom: 0; }
.menu-row > span { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.menu-row b { color: var(--ink-80); font-size: 14px; line-height: 18px; }
.menu-row small { color: var(--muted); font-size: 11px; line-height: 15px; }
.menu-row i { color: var(--blue-text); font-size: 23px; font-style: normal; }
.about-copy { margin: 2px 0; color: var(--muted); font-size: 12px; line-height: 17px; text-align: center; }

/* Detail pages */
.back-button { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; padding: 0; border: 0; border-radius: 15px; background: #fff; color: var(--ink-80); font-size: 22px; font-weight: 600; }
.detail-header { display: grid; min-height: calc(155px + var(--safe-top)); grid-template-columns: 42px minmax(0, 1fr) 44px; align-items: flex-start; gap: 14px; padding: calc(20px + var(--safe-top)) 20px 12px; background: transparent; color: #fff; }
.detail-header > div { min-width: 0; padding-top: 2px; }
.detail-header p { margin: 0; color: rgba(255,255,255,.7); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.detail-header h1 { margin: 3px 0 0; color: #fff; font-size: 25px; line-height: 30px; letter-spacing: -1.3px; overflow-wrap: anywhere; }
.detail-content { min-height: calc(var(--screen-height) - 155px - var(--safe-top)); padding: 20px 20px 34px; border-radius: 48px 48px 0 0; background: #fff; }
.intro-copy, .helper-copy { margin: 0; color: var(--muted); font-size: 13px; line-height: 19px; }
.notice-list { display: grid; gap: 10px; }
.notice-item { padding: 14px; border-radius: 16px; background: var(--surface-soft); }
.notice-item strong { display: block; color: var(--ink-80); font-size: 14px; line-height: 18px; }
.notice-item span { display: block; margin-top: 4px; color: rgba(0, 11, 66, .56); font-size: 12px; line-height: 16px; }
.notice-item .notice-badge { display: inline-block; margin-top: 8px; padding: 4px 7px; border-radius: 999px; background: var(--change-bg); color: var(--change-text); font-size: 10px; font-weight: 700; }
.notification-settings { margin-top: 16px; box-shadow: none; background: var(--surface-soft-2); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 15px; }
.switch-row > span { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.switch-row b { font-size: 14px; line-height: 18px; }
.switch-row small { color: var(--muted); font-size: 11px; line-height: 15px; }
.switch-row input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; flex: 0 0 46px; margin: 0; border: 0; border-radius: 999px; background-color: #d7e7eb; background-image: radial-gradient(circle closest-side, #fff 98%, transparent); background-position: 4px center; background-size: 20px 20px; background-repeat: no-repeat; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,55,68,.06); transition: background-color 240ms ease, background-position 240ms ease; }
.switch-row input:checked { background-color: var(--blue); background-position: calc(100% - 4px) center; }
.helper-copy { margin-top: 14px; }
.detail-form { display: block; }

.field { display: grid; gap: 7px; margin-top: 16px; }
.owner-field { margin-top: 14px; }
.field > span { color: rgba(0, 11, 66, .62); font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 12px 13px; border: 1px solid rgba(0, 11, 66, .14); border-radius: 14px; background: #f8faff; color: var(--ink-80); }
.primary-button:disabled { opacity: .5; cursor: default; }
.field textarea { min-height: 126px; resize: vertical; }
.primary-button, .secondary-button { width: 100%; min-height: 50px; margin-top: 16px; padding: 12px 16px; border: 0; border-radius: 15px; font-size: 14px; font-weight: 700; }
.primary-button { background: var(--blue); color: #fff; }
.secondary-button { background: var(--surface-soft); color: var(--ink-80); }
.context-box { margin: 0 0 2px; padding: 13px 14px; border-radius: 14px; background: var(--surface-soft); color: rgba(0, 11, 66, .64); font-size: 13px; line-height: 18px; }

.materials-list { display: grid; gap: 10px; }
.materials-list details { overflow: hidden; border: 1px solid rgba(0, 11, 66, .08); border-radius: 16px; background: var(--surface-soft-2); }
.materials-list summary { padding: 15px 42px 15px 15px; color: var(--ink-80); font-size: 14px; font-weight: 700; line-height: 18px; cursor: pointer; }
.materials-list p { margin: 0; padding: 0 15px 16px; color: var(--muted); font-size: 13px; line-height: 19px; }

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 10px;
  display: grid;
  width: min(calc(100% - 20px), 410px);
  height: var(--nav-height);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  justify-content: center;
  padding: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
  box-shadow: 0 8px 28px rgba(0, 11, 66, .08);
  transform: translateX(-50%);
}
.bottom-nav.hidden-nav { opacity: 0; pointer-events: none; transform: translate(-50%, 16px); }
.nav-indicator { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / 3); border-radius: 999px; background: var(--blue); transform: translateX(100%); }
.bottom-nav[data-active="week"] .nav-indicator { transform: translateX(0); }
.bottom-nav[data-active="schedule"] .nav-indicator { transform: translateX(100%); }
.bottom-nav[data-active="more"] .nav-indicator { transform: translateX(200%); }
.nav-item { position: relative; z-index: 1; display: flex; min-width: 0; min-height: 49px; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 6px 5px; border: 0; border-radius: 16px; background: transparent; color: rgba(0, 11, 68, .5); font-size: 12px; font-weight: 500; line-height: 15px; letter-spacing: -.72px; white-space: nowrap; }
.nav-item img { display: block; width: 20px; height: 20px; object-fit: contain; filter: brightness(0) saturate(100%); opacity: .5; }
.nav-item.active { color: #fff; font-weight: 600; }
.nav-item.active img { filter: brightness(0) invert(1); opacity: 1; }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 74px; width: min(calc(100% - 40px), 350px); padding: 12px 15px; border-radius: 14px; background: #18213f; color: #fff; font-size: 13px; font-weight: 600; line-height: 17px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }

@media (max-width: 359px) {
  .day-heading h1 { font-size: 42px; line-height: 44px; }
  .day-heading p { font-size: 17px; }
  .day-switcher { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lesson-card { grid-template-columns: 42px 1.5px minmax(0, 1fr); gap: 8px; }
  .lesson-title { font-size: 18px; line-height: 22px; }
  .lesson-teacher, .room { font-size: 12px; line-height: 15px; }
  .nav-item { font-size: 10px; letter-spacing: -.5px; }
}

@media (max-width: 430px) {
  html, body {
    /* Keep the status area blue and the exposed bottom canvas white on iOS. */
    background: linear-gradient(to bottom, var(--blue) 0 50%, #fff 50% 100%) fixed;
    overscroll-behavior-y: none;
  }
  .app-shell { width: 100%; box-shadow: none; }
}

@media (min-width: 431px) {
  :root { --screen-height: calc(var(--viewport-height) - 40px); }
  body { padding: 20px; }
  .bottom-nav { width: 410px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
/* Beta: mobile screens from Figma, 27 September 2026. */
:root {
  --blue: #10c6f0;
  --blue-text: #008dae;
  --ink: #003744;
  --ink-80: #305e69;
  --muted: #7f9da5;
  --surface-soft: #e3f6fa;
  --surface-soft-2: #f4f7f7;
  --line: rgba(0, 55, 68, .15);
  --change-bg: rgba(241, 114, 2, .15);
  --change-text: #f17202;
  --source-accent: #ffae42;
  --source-surface: rgba(255, 174, 66, .14);
  --source-ink: #ffae42;
  --icon-stroke-width: 1.8px;
  --nav-height: 67px;
  --nav-gap: 10px;
  --nav-active-width: 160px;
  --page-edge: 0px;
  --page-panel-radius: 64px;
  --floating-surface: linear-gradient(rgba(0,55,68,.1),rgba(0,55,68,.1)), rgba(16,198,240,.1);
  --page-hero-height: calc(clamp(230px, calc(var(--screen-height) * .33056872), 310px) + var(--safe-top));
  --panel-top: calc(clamp(175px, calc(var(--screen-height) * .33056872), 310px) + var(--safe-top));
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
}
.app-shell[data-panel-position="high"] { --panel-top: calc(clamp(150px, calc(var(--screen-height) * .17772512), 180px) + var(--safe-top)); }
.app-shell[data-panel-position="low"] { --panel-top: calc(clamp(235px, calc(var(--screen-height) * .48815166), 455px) + var(--safe-top)); }
.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; }
.schedule-screen, .standard-screen { background: radial-gradient(ellipse 320.49px 281.54px at calc(50% + 1.83px) 281.5px, #0283f1 0%, #09a5f1 50%, #10c6f0 100%); }
.standard-screen { position: relative; }
.schedule-screen { position: relative; height: var(--screen-height); min-height: 0; overflow: hidden; background: radial-gradient(ellipse 320.49px 281.54px at calc(50% + 1.83px) 281.5px, #0283f1 0%, #09a5f1 50%, #10c6f0 100%); }
.hero-art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-art img { position: absolute; max-width: none; transition: opacity 480ms var(--motion-ease); }
.hero-star { top: calc(-110px + var(--safe-top)); left: calc(50% - 294px); }
.hero-mascot { top: calc(94px + var(--safe-top)); left: calc(50% - 198px); }
.hero-star-high { top: calc(-134px + var(--safe-top)); left: calc(87.5% - 264.248px); opacity: 0; }
.hero-mascot-high { top: calc(18.46px + var(--safe-top)); left: calc(25% + 51.24px); opacity: 0; }
[data-panel-position="high"] .hero-star, [data-panel-position="high"] .hero-mascot { opacity: 0; }
[data-panel-position="high"] .hero-star-high, [data-panel-position="high"] .hero-mascot-high { opacity: 1; }
.hero { position: absolute; z-index: 1; inset: 0 0 auto; height: var(--panel-top); min-height: 0; justify-content: space-between; gap: 12px; padding: calc(20px + var(--safe-top)) 20px 12px; transition: height 480ms var(--motion-ease); }
.hero-main { min-height: 82px; gap: 8px; }
.day-heading h1 { font-size: clamp(32px, 10.77vw, 42px); line-height: 51px; letter-spacing: -.06em; }
.day-heading p { margin: 0; color: rgba(255, 255, 255, .75); font-size: 26px; line-height: 31px; letter-spacing: -1.56px; font-weight: 500; }
.hero-meta { font-size: 14px; line-height: 17px; }
.content-panel { position: absolute; z-index: 2; top: var(--panel-top); bottom: 0; left: 0; right: 0; min-height: 0; gap: 12px; padding: 14px 14px 0 28px; border-radius: 64px 64px 0 0; transition: top 480ms var(--motion-ease); }
.panel-handle, .sheet-handle { display: flex; flex: 0 0 13px; width: 84px; height: 13px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; align-self: center; margin: 0 14px 0 0; padding: 2px 7px; border: 0; background: transparent; touch-action: none; cursor: ns-resize; position: relative; }
.panel-handle::before, .sheet-handle::before { content: ""; position: absolute; inset: -10px -22px; }
.panel-handle span, .sheet-handle span { width: 70px; height: 2px; flex: 0 0 2px; border-radius: 100px; background: rgba(0, 55, 68, .3); pointer-events: none; }
.panel-handle span + span, .sheet-handle span + span { width: 50px; }
.app-shell.is-dragging .hero, .app-shell.is-dragging .content-panel { transition: none; }
.day-switcher { display: flex; width: calc(100% - 14px); height: 41px; min-height: 41px; flex: 0 0 41px; padding: 4px; position: relative; touch-action: pan-y; }
.day-indicator { position: absolute; top: 4px; bottom: 4px; left: calc(50% - 70px); width: 140px; background: var(--blue); border-radius: 100px; pointer-events: none; }
.day-switcher button { position: relative; z-index: 1; flex: 1 1 auto; min-width: max-content; min-height: 33px; padding: 4px clamp(8px, 2.5vw, 12px); background: transparent; color: rgba(0,55,68,.6); font-size: 14px; line-height: 17px; letter-spacing: -.84px; white-space: nowrap; transition: color 240ms ease; }
.day-switcher button.active { flex: 1.3 1 auto; background: transparent; color: #fff; }
.panel-scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #10c6f0 #bff1fc; padding: 0 14px 92px 0; margin-right: 0; touch-action: pan-y; }
.panel-scroll::-webkit-scrollbar, .sheet-scroll::-webkit-scrollbar { width: 4px; }
.panel-scroll::-webkit-scrollbar-track, .sheet-scroll::-webkit-scrollbar-track { background: #bff1fc; border-radius: 100px; }
.panel-scroll::-webkit-scrollbar-thumb, .sheet-scroll::-webkit-scrollbar-thumb { background: #10c6f0; border-radius: 100px; }
.status-row { min-height: 0; }
.status-row:empty, .status-row.is-quiet { display: none; }
.status-row:not(.is-quiet):not(:empty) { margin-bottom: 8px; }
.schedule-list { gap: 4px; }
.lesson-card { min-height: 0; grid-template-columns: 45px 1.5px minmax(0, 1fr); padding: 12px 0 12px 4px; gap: 10px; }
/* Card height follows the taller column, including replacement controls and notes. */
.lesson-time { justify-content: flex-start; }
.lesson-number { color: #0283f1; }
.lesson-start, .lesson-end { color: #004682; }
.lesson-main { gap: 8px; }
.room { color: #008dae; }
.room img { width: auto; height: auto; object-fit: initial; }
.replacement-button { display: flex; width: 45px; height: 22px; align-items: center; justify-content: center; padding: 4px; border: 0; border-radius: 100px; background: rgba(241,114,2,.15); }
.replacement-button img { display: block; }
.replacement-button.cancellation-button { background: #fdebec; }
.official-link { display: flex; min-height: 49px; align-items: center; gap: 10px; margin-top: 16px; padding: 12px; border-radius: 16px; background: linear-gradient(rgba(0,141,174,.1),rgba(0,141,174,.1)), #f4f7f7; color: #305e69; text-decoration: none; font-size: 14px; font-weight: 600; line-height: 17px; letter-spacing: -.84px; }
.official-icon, .notice-icon { display: grid; width: 24.5px; height: 24.5px; flex: 0 0 24.5px; place-items: center; border-radius: 8.75px; background: #008dae; }
.official-icon img, .notice-icon img { display: block; }
.bottom-nav { z-index: 45; top: calc(var(--viewport-height) - var(--page-edge) - var(--nav-gap) - var(--nav-height)); bottom: auto; width: min(calc(100% - 2 * var(--nav-gap)), 410px); height: 67px; padding: 4px; grid-template-columns: minmax(0,1fr) var(--nav-active-width) minmax(0,1fr); background: var(--nav-surface, var(--floating-surface)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: none; transition: opacity 320ms var(--motion-ease), transform 480ms var(--motion-ease); }
.nav-indicator { top: 4px; bottom: 4px; left: calc(50% - var(--nav-active-width) / 2); width: var(--nav-active-width); transform: none; transition: left 480ms var(--motion-ease), width 480ms var(--motion-ease); }
.bottom-nav[data-active="schedule"] .nav-indicator { transform: none; }
.bottom-nav[data-active="week"] { grid-template-columns: var(--nav-active-width) minmax(0,1fr) minmax(0,1fr); }
.bottom-nav[data-active="week"] .nav-indicator { transform: none; left: 4px; }
.bottom-nav[data-active="more"] { grid-template-columns: minmax(0,1fr) minmax(0,1fr) var(--nav-active-width); }
.bottom-nav[data-active="more"] .nav-indicator { transform: none; left: calc(100% - var(--nav-active-width) - 4px); }
.nav-item { height: 59px; min-height: 59px; padding: 6px 0; color: rgba(0,55,68,.6); font-size: 12px; }
.nav-icon { display: grid; width: 32px; height: 32px; place-items: center; }
.nav-item .nav-icon img { width: auto; height: auto; object-fit: initial; filter: none; opacity: 1; }
.nav-item.active .nav-icon img { filter: brightness(0) invert(1); }
.nav-item:not(.active)[data-tab="schedule"] .nav-icon img { filter: brightness(0) saturate(100%) invert(34%) sepia(18%) saturate(889%) hue-rotate(145deg); }
.bell-button, .replacement-button, .official-link { transition: transform 320ms var(--motion-ease), background 240ms ease; }
.bell-button:active, .replacement-button:active, .official-link:active { transform: scale(.97); }
.notification-scroll { padding-left: 0; padding-right: 14px; }
.notification-screen .content-panel { padding-left: 20px; padding-right: 6px; }
.notification-screen .panel-handle { margin-right: 14px; }
.notice-list { gap: 8px; }
.notice-section-title { margin: 0 0 4px; font-size: 18px; font-weight: 700; line-height: 22px; letter-spacing: -1.08px; color: #305e69; }
.notice-section-title:not(:first-child) { margin-top: 8px; }
.notification-card { display: flex; width: 100%; gap: 10px; padding: 12px; border: 0; border-radius: 16px; background: rgba(48,94,105,.05); text-align: left; color: #305e69; }
.notification-card.is-read { opacity: .5; background: rgba(48,94,105,.1); }
.notice-icon { background: #f17202; }
.notice-icon.info { background: #10c6f0; opacity: .7; }
.notice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.notice-line { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.notice-line strong { font-size: 14px; line-height: 17px; letter-spacing: -.84px; }
.notice-line small, .notice-body > span { color: #7f9da5; font-size: 12px; line-height: 15px; letter-spacing: -.72px; }
.notice-line small { flex-shrink: 0; }
.sheet-layer { position: fixed; z-index: 35; inset: 0 0 auto; height: var(--viewport-height); width: min(100%,430px); margin: auto; pointer-events: none; }
.sheet-layer[hidden], .bottom-sheet[hidden] { display: none; }
.sheet-dimmer { position: absolute; inset: var(--sheet-dim-top, 279px) 0 0; border-radius: 64px 64px 0 0; background: rgba(0,55,68,.15); pointer-events: auto; }
.bottom-sheet { position: absolute; z-index: 1; display: flex; flex-direction: column; bottom: var(--page-edge); width: 100%; max-height: none; min-height: 0; padding: 14px 28px 87px; border-radius: 64px 64px 0 0; background: #fff; pointer-events: auto; overflow: hidden; }
.changes-sheet { top: var(--sheet-top, 279px); }
.original-sheet { z-index: 2; top: max(calc(var(--sheet-top, 279px) + 72px), calc(var(--viewport-height) - var(--page-edge) - 380px)); }
.sheet-handle { margin: 0 auto 12px; cursor: grab; }
.bottom-sheet h2 { margin: 0 0 12px; color: #305e69; font-size: 18px; line-height: 22px; letter-spacing: -1.08px; }
.bottom-sheet.is-dragging { transform: translate3d(0, var(--sheet-drag-y, 0px), 0); will-change: transform; }
.bottom-sheet.is-dragging .sheet-handle { cursor: grabbing; }
.bottom-sheet > h2 { touch-action: none; }
.sheet-scroll { flex: 1 1 0; overflow-y: auto; min-height: 0; padding-right: 14px; scrollbar-width: thin; scrollbar-color: #10c6f0 #bff1fc; overscroll-behavior-y: contain; }
.sheet-card { padding: 8px; border-radius: 24px; background: rgba(48,94,105,.05); margin-bottom: 12px; }
.sheet-card .lesson-card { min-height: 0; padding: 14px 4px; }
.changes-sheet.is-underneath::after { content: ""; position: absolute; inset: 0; background: rgba(0,55,68,.15); opacity: var(--sheet-underneath-opacity, 1); pointer-events: auto; }
.toast { bottom: calc(var(--page-edge) + 90px); background: var(--floating-surface); color: #335f69; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: opacity 320ms ease, transform 480ms var(--motion-ease); }
@media (max-width: 359px) {
  .content-panel { padding-left: 20px; padding-right: 10px; border-radius: 52px 52px 0 0; }
  .day-heading h1 { font-size: 34px; letter-spacing: -2px; }
  .day-heading p { font-size: 23px; }
  .day-switcher button { font-size: 12px; }
  .day-indicator { width: 120px; left: calc(50% - 60px); }
  .hero-meta { font-size: 12px; }
  .lesson-card { grid-template-columns: 42px 1.5px minmax(0,1fr); gap: 8px; }
  .replacement-button { width: 42px; }
  .bottom-sheet { padding-inline: 20px; }
  .official-link { font-size: 12px; }
  :root { --nav-active-width: 140px; }
}
@media (min-width: 431px) {
  :root { --page-edge: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.nav-item:not(.active) .nav-icon { opacity: .6; }
#scheduleList > .schedule-separator { width: calc(100% - 14px); }
.notification-card { font-weight: 500; }
.panel-scroll, .sheet-scroll { scrollbar-width: none; }
.panel-scroll::-webkit-scrollbar, .sheet-scroll::-webkit-scrollbar { display: none; }
.scroll-track { position: absolute; width: 4px; right: 14px; top: 100px; bottom: 87px; border-radius: 100px; background: #bff1fc; pointer-events: none; overflow: hidden; }
.notification-screen .scroll-track { right: 6px; top: 68px; }
.bottom-sheet .scroll-track { right: 28px; top: 74px; }
.scroll-thumb { display: block; width: 4px; min-height: 24px; border-radius: 100px; background: #10c6f0; }
.scroll-track[hidden] { display: none; }




/* Beta refinements from the screen comments. */
.day-switcher button.is-today { font-weight: 650; }
.day-switcher button.is-today:not(.active) { color: var(--blue); background: transparent; }
.nav-item { transition: color 240ms ease; }
.page-art { height: calc(var(--page-hero-height) + var(--page-panel-radius)); }
.page-art .hero-star, .page-art .hero-mascot { opacity: 1; }
.page-hero { position: relative; z-index: 1; height: var(--page-hero-height); gap: 12px; }
.page-heading h1 { font-size: 42px; line-height: 51px; letter-spacing: -.06em; }
.page-heading p { font-size: 20px; line-height: 25px; letter-spacing: -1px; }
.page-content { position: relative; z-index: 2; }
.content-panel-style { min-height: calc(var(--screen-height) - var(--page-hero-height)); border-radius: var(--page-panel-radius) var(--page-panel-radius) 0 0; }
.more-content .settings-card, .more-content .menu-card, .more-content .action-card, .more-content .report-card { background: #f4f7f7; }
.more-content .owner-settings { background: var(--surface-soft-2); border-radius: calc(var(--page-panel-radius) - 20px) calc(var(--page-panel-radius) - 20px) 22px 22px; }
.more-content .report-card { color: #305e69; }
.more-content .quick-actions { margin-top: 0; }
.menu-section { display: grid; gap: 12px; }
.owner-field input, .owner-field select { border: 0; background: #fff; box-shadow: none; }
.owner-field input { appearance: none; -webkit-appearance: none; }
.notification-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
.notification-heading .back-button { width: 44px; height: 44px; flex-basis: 44px; border-radius: 16px; }
@media (max-width: 359px) {
  :root { --page-panel-radius: 52px; }
  .bottom-sheet .scroll-track { right: 20px; }
}

/* Draggable root panels and separate notification preferences. */
.app-shell:is([data-screen="week"], [data-screen="more"])[data-panel-position="medium"] { --panel-top: var(--page-hero-height); }
.root-panel-content { padding: 14px 6px 0 20px; }
.root-panel-content .week-switcher { width: calc(100% - 14px); flex-shrink: 0; }
.week-screen .scroll-track { top: 99px; right: 6px; }
.more-screen .scroll-track, .notification-settings-screen .scroll-track { top: 39px; right: 6px; }
.notification-settings-screen .notification-settings { margin-top: 0; }
.owner-field > span { color: var(--ink-80); }
.owner-field input::placeholder { color: var(--muted); opacity: 1; }

/* Shared spacing, typography and surfaces across Beta screens. */
:root {
  --page-inset: 20px;
  --card-inset: 16px;
  --row-inset: 12px;
  --space-small: 8px;
  --section-gap: 24px;
  --scroll-gutter: 14px;
  --scroll-edge: 6px;
  --content-clearance: calc(var(--nav-height) + var(--nav-gap) + 16px);
  --card-radius: 22px;
  --control-radius: 16px;
  --font-section: 18px;
  --font-body: 14px;
  --font-meta: 12px;
  --muted: #58737c;
}
.content-panel,
.root-panel-content,
.notification-screen .content-panel {
  padding-inline: var(--page-inset) var(--scroll-edge);
  border-radius: var(--page-panel-radius) var(--page-panel-radius) 0 0;
}
.panel-scroll { padding-right: var(--scroll-gutter); padding-bottom: var(--content-clearance); }
.panel-handle { margin-right: var(--scroll-gutter); }
.hero-meta, .hero-main h1 { text-shadow: 0 1px 3px rgba(0, 55, 68, .35); }
.scroll-track,
.week-screen .scroll-track,
.more-screen .scroll-track,
.notification-screen .scroll-track { right: var(--scroll-edge); bottom: calc(var(--nav-height) + var(--nav-gap) + 10px); }
.day-switcher,
.root-panel-content .week-switcher { width: calc(100% - var(--scroll-gutter)); }
.week-switcher { gap: 4px; min-height: 41px; }
.week-switcher button { min-height: 33px; }
.week-switcher .current-week-button { font-size: var(--font-body); line-height: 17px; }
.schedule-list .lesson-card { padding-inline: 0; }
#scheduleList > .schedule-separator { width: 100%; }
.lesson-title { color: var(--ink-80); opacity: 1; }
.lesson-teacher, .lesson-end { color: var(--muted); opacity: 1; }
.lesson-teacher, .room { line-height: 20px; }
.lesson-end { line-height: 18px; }
.lesson-start { color: #336897; opacity: 1; }
.student-note { color: var(--ink-80); }

.week-list { gap: var(--card-inset); }
.week-day-head { padding: var(--card-inset) var(--card-inset) var(--space-small); }
.week-lessons { padding: 0 var(--card-inset) var(--card-inset); }
.week-lessons .lesson-card { padding-inline: 0; }
.week-empty { padding: var(--space-small) var(--card-inset) var(--card-inset); font-size: var(--font-meta); line-height: 18px; }
.week-day-head small, .week-count { font-size: var(--font-meta); line-height: 16px; }
.week-status { padding: 4px 8px; font-size: var(--font-meta); line-height: 16px; }
.week-status.neutral, .status-chip.neutral { background: var(--surface-soft-2); color: var(--muted); }

.more-content { gap: var(--section-gap); }
.settings-card { padding: var(--card-inset); }
.settings-card, .menu-card { background: var(--surface-soft-2); }
.more-content .owner-settings {
  padding: var(--section-gap);
  border-radius: calc(var(--page-panel-radius) - var(--page-inset)) calc(var(--page-panel-radius) - var(--page-inset)) var(--card-radius) var(--card-radius);
}
.quick-actions, .menu-section { gap: var(--row-inset); }
.action-grid { gap: var(--row-inset); }
.action-card, .report-card { padding: var(--card-inset); gap: var(--row-inset); border-radius: var(--card-radius); }
.menu-row { padding: var(--card-inset); border-color: var(--line); }
.menu-row > span, .switch-row > span { gap: 4px; }
.menu-row small, .switch-row small { font-size: var(--font-meta); line-height: 18px; }
.section-heading h2, .settings-card h2, .quick-actions h2, .menu-section h2,
.notice-section-title, .bottom-sheet h2, .week-day-head strong {
  margin-top: 0; font-size: var(--font-section); font-weight: 700; line-height: 22px; letter-spacing: -.06em;
}
.field { gap: var(--space-small); margin-top: var(--card-inset); }
.field > span { color: var(--ink-80); font-size: var(--font-body); line-height: 20px; }
.field input, .field select, .field textarea {
  padding: var(--row-inset) var(--card-inset); border: 0; border-radius: var(--control-radius);
  /* iOS zooms focused form controls when their text is smaller than 16px. */
  background: var(--surface-soft-2); color: var(--ink-80); font-size: 16px; line-height: 20px;
}
.owner-field input, .owner-field select { background: #fff; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.primary-button, .secondary-button { border-radius: var(--control-radius); font-size: var(--font-body); line-height: 20px; }
.helper-copy, .about-copy { font-size: var(--font-meta); line-height: 18px; }
.helper-copy { margin-top: var(--card-inset); }
.intro-copy { color: var(--muted); font-size: var(--font-body); line-height: 20px; }

.back-button { width: 44px; height: 44px; flex-basis: 44px; border-radius: var(--control-radius); }
.detail-header { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: var(--row-inset); padding-inline: var(--page-inset); }
.detail-header h1 { font-size: 26px; font-weight: 700; line-height: 31px; letter-spacing: -.06em; }
.detail-content { padding-top: 32px; padding-inline: var(--page-inset); border-radius: var(--page-panel-radius) var(--page-panel-radius) 0 0; }
.context-box { padding: var(--row-inset) var(--card-inset); border-radius: var(--control-radius); background: var(--surface-soft-2); color: var(--ink-80); font-size: var(--font-meta); line-height: 18px; }
.materials-list { gap: var(--row-inset); }
.materials-list details { border: 0; border-radius: var(--card-radius); }
.materials-list summary { padding: var(--card-inset); font-size: var(--font-body); line-height: 20px; }
.materials-list p { padding: 0 var(--card-inset) var(--card-inset); font-size: var(--font-body); line-height: 20px; }
.notice-list { gap: var(--row-inset); }
.notice-item, .notification-card { padding: var(--card-inset); border-radius: var(--card-radius); background: var(--surface-soft-2); }
.notification-card.is-read { opacity: 1; background: var(--surface-soft-2); }
.notification-card.is-read .notice-icon { opacity: .7; }
.notice-line { flex-wrap: wrap; gap: 4px var(--space-small); }
.notice-line strong { font-weight: 700; }
.notification-card.is-read .notice-line strong { font-weight: 600; }
.notice-line small, .notice-body > span, .notice-item span { color: var(--muted); font-size: var(--font-meta); line-height: 18px; }
.state-card { padding: var(--section-gap) var(--card-inset); border-radius: var(--card-radius); background: var(--surface-soft-2); }
.state-card strong { font-size: var(--font-section); line-height: 22px; }
.state-card span { font-size: var(--font-meta); line-height: 18px; }
.bottom-sheet { padding-inline: var(--page-inset) var(--scroll-edge); border-radius: var(--page-panel-radius) var(--page-panel-radius) 0 0; }
.sheet-dimmer { border-radius: var(--page-panel-radius) var(--page-panel-radius) 0 0; }
.bottom-sheet h2 { margin-right: var(--scroll-gutter); }
.sheet-handle { margin: 0 var(--scroll-gutter) var(--row-inset) 0; }
.sheet-scroll { padding-right: var(--scroll-gutter); }
.bottom-sheet .scroll-track { right: var(--scroll-edge); }
.sheet-card { padding: var(--card-inset); border-radius: var(--card-radius); background: var(--surface-soft-2); }
.sheet-card .lesson-card { padding: 0; }
.toast { border-radius: var(--control-radius); }
.app-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; }
.app-tools button { padding: 8px 0; border: 0; background: transparent; color: var(--blue-text); font-size: var(--font-meta); line-height: 18px; }
.viewport-check { width: min(calc(100% - 40px), 390px); max-height: calc(100dvh - 40px); margin: auto; padding: 24px; border: 0; border-radius: 24px; background: #fff; color: var(--ink-80); }
.viewport-check::backdrop { background: rgba(0, 55, 68, .3); }
.viewport-check h2 { margin: 0; font-size: 18px; line-height: 22px; letter-spacing: -.06em; }
.viewport-check p { font-size: 14px; line-height: 20px; color: var(--muted); }
.viewport-check textarea { display: block; width: 100%; height: 240px; padding: 12px; border: 0; border-radius: 16px; background: var(--surface-soft-2); color: var(--ink-80); font: 16px/22px ui-monospace, monospace; resize: none; }
@media (max-width: 359px) {
  .lesson-teacher, .room { line-height: 18px; }
}

/* Scrollable dates with a moving active indicator. */
.screen-stage { touch-action: auto; }
.hero, .detail-header { touch-action: pan-y; }
.day-switcher { gap: 4px; touch-action: auto; }
.day-viewport { flex: 1 1 0; min-width: 0; height: 33px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; border-radius: 999px; mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 8px), transparent); -webkit-mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 8px), transparent); }
.day-viewport::-webkit-scrollbar { display: none; }
.day-track { display: flex; position: relative; width: max-content; min-width: 100%; height: 33px; gap: 4px; }
.day-track button { flex: 0 0 auto; min-width: 76px; padding-inline: 12px; font-size: 14px; }
.day-track button.active { flex: 0 0 auto; }
.day-track .day-indicator { top: 0; bottom: 0; left: 0; }
.day-track button:focus-visible { outline-offset: -3px; }

/* Status hues share the saturation and 15% tint of the change badge. */
:root {
  --green-text: #179b64;
  --green-bg: rgba(23, 155, 100, .15);
  --dot-text: #2883de;
  --dot-bg: rgba(40, 131, 222, .15);
  --error-text: #d83a4a;
  --error-bg: rgba(216, 58, 74, .15);
}
.status-chip { font-weight: 600; }
.status-chip.info, .week-status.info, .status-chip.neutral, .week-status.neutral { color: var(--dot-text); background: var(--dot-bg); }
.status-chip.warning, .week-status.warning { color: var(--change-text); background: var(--change-bg); }
.status-chip.error, .week-status.error { color: var(--error-text); background: var(--error-bg); }
.status-dot { display: block; flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.week-status .status-dot { flex-basis: 8px; width: 8px; height: 8px; }

.push-heading { margin-top: 24px; margin-bottom: 16px; }
#pushButton { width: 100%; }

.telegram-card { text-decoration: none; }
.site-update-card { text-decoration: none; }
.calendar-dialog { box-sizing: border-box; width: min(430px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 0; border-radius: 28px; background: #fff; color: var(--ink-80); overflow-y: auto; overscroll-behavior: contain; }
.calendar-dialog::backdrop { background: rgba(0,55,68,.25); }
.calendar-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calendar-dialog h2 { margin: 0; font-size: 24px; line-height: 1.2; }
.calendar-dialog h3 { margin: 0 0 10px; font-size: 18px; line-height: 1.3; }
.calendar-dialog p { font-size: 14px; line-height: 1.5; margin: 12px 0; }
.calendar-owner { font-weight: 600; overflow-wrap: anywhere; }
.calendar-choice { margin-top: 20px; padding: 20px; border-radius: 22px; background: var(--surface-soft); }
.calendar-choice .field { margin-block: 16px; }
.calendar-choice input { min-width: 0; width: 100%; font-size: 16px; }
.calendar-choice .primary-button, .calendar-choice .secondary-button { width: 100%; }
.calendar-subscribe { display: flex; align-items: center; justify-content: center; padding: 14px 12px; text-decoration: none; text-align: center; }
.calendar-note, #calendarCopyStatus { color: var(--ink-60, #607d85); }
#calendarCopyStatus:empty { display: none; }
@media (max-width: 360px) { .calendar-dialog { padding: 20px; } .calendar-choice { padding: 16px; } }

/* Appearance families share the same layout and semantic status colors. */
.appearance-settings { border-radius: var(--card-radius); }
.appearance-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 16px 0; border: 0; }
.appearance-option { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 10px; border: 2px solid transparent; border-radius: 20px; background: #fff; cursor: pointer; }
.appearance-option:has(input:checked), .variant-option:has(input:checked) { border-color: var(--blue-text); }
.appearance-option:has(input:focus-visible), .variant-option:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }
.appearance-option input, .variant-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.appearance-preview { position: relative; display: block; height: 104px; overflow: hidden; border-radius: 12px; }
.azure-preview { background: #e8f5fa; }
.kitty-preview { background: linear-gradient(140deg, #f8c6d9, #ef93b7); }
.appearance-preview img { position: absolute; height: 100px; width: 100px; object-fit: contain; inset: 4px auto auto calc(50% - 50px); }
.appearance-option b, .variant-option b { display: block; color: var(--ink); font-size: 16px; line-height: 20px; }
.appearance-option small, .variant-option small { display: block; margin-top: 4px; color: var(--ink-80); font-size: 12px; line-height: 16px; }
.kitty-options { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.kitty-options[hidden] { display: none; }
.kitty-options legend { margin-bottom: 8px; color: var(--ink); font-size: 16px; font-weight: 600; }
.kitty-options .helper-copy { margin: 0 0 4px; }
.variant-option { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border: 2px solid transparent; border-radius: 16px; background: #fff; cursor: pointer; }
.variant-swatch { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; }
.marshmallow-swatch { background: linear-gradient(135deg, #ffdfeb, #ed91b6); }
.bow-swatch { background: linear-gradient(135deg, #fa98c0, #da3281); }
.pixel-swatch { border-radius: 0; background: conic-gradient(#6c2048 25%, #f993c5 0 50%, #c8f4ff 0 75%, #fff6e9 0); }
:root[data-theme="kitty"] {
  --blue: #b6577d; --blue-text: #a44670; --ink: #35333b; --ink-80: #48434d; --muted: #77727e; --ink-60: #77727e;
  --surface-soft: #fceef4; --surface-soft-2: #fffafc; --line: #ece8ed;
  --floating-surface: rgba(252,238,244,.94);
  --theme-hero: radial-gradient(ellipse at 50% 80%, #f3d9e5, #f9e8f0 70%, #fff7fb);
  --theme-scroll: #f8eaf0; --lesson-accent: #527b8a; --lesson-accent-soft: #edf7fa;
}
:root[data-theme="kitty"][data-theme-variant="bow"] {
  --blue: #b6537e; --blue-text: #a2446b; --theme-hero: radial-gradient(ellipse at 50% 80%, #edcddd, #f7e3ec 70%, #fff6fa);
}
:root[data-theme="kitty"][data-theme-variant="pixel"] {
  --blue: #b6577d; --blue-text: #9e4468;
  --theme-hero: repeating-conic-gradient(rgba(255,255,255,.12) 0 25%, transparent 0 50%) 0 0 / 32px 32px, #f6e1eb;
}
:root[data-theme="kitty"] :is(.schedule-screen, .standard-screen, .detail-screen) { background: var(--theme-hero); }
:root[data-theme="kitty"] :is(.hero-star, .hero-star-high) { filter: hue-rotate(125deg) saturate(.3); opacity: .22; }
:root[data-theme="kitty"] [data-panel-position="high"] .hero-star { opacity: 0; }
:root[data-theme="kitty"] .hero-star-high { opacity: 0; }
:root[data-theme="kitty"] [data-panel-position="high"] .hero-star-high { opacity: .22; }
:root[data-theme="kitty"] .hero-mascot { width: 300px; height: 300px; object-fit: contain; left: calc(50% - 135px); top: calc(28px + var(--safe-top)); transform: rotate(6deg); }
:root[data-theme="kitty"] .hero-mascot-high { width: 215px; height: 215px; object-fit: contain; left: calc(50% - 25px); top: calc(14px + var(--safe-top)); transform: rotate(6deg); }
:root[data-theme="kitty"][data-theme-variant="pixel"] :is(.hero-mascot, .hero-mascot-high) { image-rendering: pixelated; transform: none; }
:root[data-theme="kitty"] :is(.hero, .page-hero, .detail-header),
:root[data-theme="kitty"] :is(.hero h1, .hero-main h1, .detail-header h1) { color: var(--ink); text-shadow: none; }
:root[data-theme="kitty"] :is(.day-heading p, .page-heading p, .detail-header p, .hero-meta, .back-button) { color: var(--ink-80); text-shadow: none; }
:root[data-theme="kitty"] :is(.content-panel, .detail-content, .bottom-sheet, .calendar-dialog, .viewport-check) { background: #fff; }
:root[data-theme="kitty"] :is(.lesson-start, .lesson-number, .room) { color: var(--lesson-accent); }
:root[data-theme="kitty"] .lesson-end { color: var(--muted); }
:root[data-theme="kitty"] .lesson-title { color: var(--ink); }
:root[data-theme="kitty"] :is(.lesson-teacher, .notice-line small, .notice-body > span, .notice-item span) { color: var(--muted); }
:root[data-theme="kitty"] .room img { filter: none; }
:root[data-theme="kitty"] .official-link { color: var(--lesson-accent); background: var(--lesson-accent-soft); }
:root[data-theme="kitty"] :is(.official-icon, .notice-icon.info) { background: var(--lesson-accent); opacity: 1; }
:root[data-theme="kitty"] .more-content :is(.settings-card, .menu-card, .action-card, .report-card) { background: var(--surface-soft-2); color: var(--ink-80); }
:root[data-theme="kitty"] :is(.notification-card, .notice-item, .sheet-card, .context-box, .materials-list details, .calendar-choice) { background: var(--surface-soft-2); color: var(--ink-80); }
:root[data-theme="kitty"] :is(.notice-section-title, .bottom-sheet h2) { color: var(--ink); }
:root[data-theme="kitty"] :is(.field input, .field select, .field textarea) { background: #fff; color: var(--ink); border-color: var(--line); }
:root[data-theme="kitty"] :is(.panel-scroll, .sheet-scroll) { scrollbar-color: var(--blue) var(--theme-scroll); }
:root[data-theme="kitty"] :is(.scroll-track, .panel-scroll::-webkit-scrollbar-track, .sheet-scroll::-webkit-scrollbar-track) { background: var(--theme-scroll); }
:root[data-theme="kitty"] :is(.scroll-thumb, .panel-scroll::-webkit-scrollbar-thumb, .sheet-scroll::-webkit-scrollbar-thumb) { background: #d99bb6; }
:root[data-theme="kitty"] .day-switcher button { color: var(--ink-80); }
:root[data-theme="kitty"] .day-switcher button.active { color: #fff; }
:root[data-theme="kitty"] .toast { color: var(--ink); }
:root[data-theme="kitty"] :is(.action-icon, .report-icon) { background: var(--lesson-accent); }
:root[data-theme="kitty"] :is(.action-icon img, .report-icon img) { filter: brightness(0) invert(1); }
:root[data-theme="kitty"] .bell-button img { filter: none; }
:root[data-theme="kitty"] .switch-row input { background-color: var(--lesson-accent-soft); border-color: var(--line); }
:root[data-theme="kitty"] .switch-row input:checked { background-color: var(--blue); }
:root[data-theme="kitty"] .kitty-preview { background: #f9e8f0; }
:root[data-theme="kitty"] .marshmallow-swatch { background: linear-gradient(135deg, #fff7fb, #f3d9e5); }
:root[data-theme="kitty"] .bow-swatch { background: linear-gradient(135deg, #f7e3ec, #edcddd); }
:root[data-theme="kitty"] .pixel-swatch { background: conic-gradient(#527b8a 25%, #f3d9e5 0 50%, #edf7fa 0 75%, #fffafc 0); }
/* Inactive navigation stays dark; white is reserved for the active item. */
:root[data-theme="kitty"] .nav-item:not(.active) .nav-icon { opacity: 1; }
:root[data-theme="kitty"] .nav-item:not(.active)[data-tab] .nav-icon img { filter: brightness(0) saturate(100%); opacity: 1; }
:root[data-theme="kitty"] .nav-item:not(.active) { color: var(--ink); }
:root[data-theme="kitty"] .nav-item.active { color: #fff; }

:root[data-theme="kitty"] .browser-top-tint { background-color: #f9e8f0; }

/* Approved YGK-Schedule Figma palette, shared by all Hello Kitty screens. */
:root[data-theme="kitty"] {
  --blue: #ff5691; --blue-text: #ff5691;
  --ink: #945767; --ink-80: #945767; --ink-60: #bc96a0; --muted: #bc96a0;
  --surface-soft: #ffe7f0; --surface-soft-2: #fffafc;
  --line: rgba(0,55,68,.15); --floating-surface: #fceef4;
  --theme-hero: radial-gradient(ellipse 320.49px 281.54px at calc(50% + 1.83px) 281.5px, #ffbbbc 0%, #ff829c 50%, #ff668d 75%, #ff497d 100%);
  --theme-scroll: rgba(255,86,145,.25);
  --lesson-accent: #ffad42; --lesson-accent-soft: #fff3e4;
}
:root[data-theme="kitty"][data-theme-variant="bow"],
:root[data-theme="kitty"][data-theme-variant="pixel"] { --blue: #ff5691; --blue-text: #ff5691; --theme-hero: radial-gradient(ellipse 320.49px 281.54px at calc(50% + 1.83px) 281.5px, #ffbbbc 0%, #ff829c 50%, #ff668d 75%, #ff497d 100%); }
:root[data-theme="kitty"] :is(.hero-star, .hero-star-high) { filter: none; }
:root[data-theme="kitty"][data-theme-variant="marshmallow"] .hero-mascot { width: 458.65px; height: 380.582px; left: calc(50% - 190.391px); top: calc(var(--panel-top) - 271.608px); transform: rotate(9.25deg); transition: top 480ms var(--motion-ease), opacity 480ms var(--motion-ease); }
:root[data-theme="kitty"] .app-shell.is-dragging .hero-mascot { transition: none; }
:root[data-theme="kitty"][data-theme-variant="marshmallow"] .hero-mascot-high { width: 300px; height: 249px; left: calc(50% - 70px); top: calc(-14px + var(--safe-top)); transform: rotate(9.25deg); }
:root[data-theme="kitty"] :is(.day-heading h1, .page-heading h1, .day-heading p, .page-heading p, .hero-meta, .detail-header h1, .detail-header p, .back-button) { color: #682135; text-shadow: none; }
:root[data-theme="kitty"] .lesson-number { color: #ff5691; }
:root[data-theme="kitty"] :is(.lesson-start, .lesson-end) { color: #640e26; }
:root[data-theme="kitty"] :is(.lesson-title, .lesson-teacher) { color: #792d42; }
:root[data-theme="kitty"] :is(.lesson-start, .lesson-title) { opacity: .8; }
:root[data-theme="kitty"] :is(.lesson-end, .lesson-teacher) { opacity: .5; }
:root[data-theme="kitty"] :is(.lesson-divider, .schedule-separator) { background: rgba(121,45,66,.15); }
:root[data-theme="kitty"] .room { color: #ffad42; }
:root[data-theme="kitty"] .room img { width: 12px; height: 16px; object-fit: contain; }
:root[data-theme="kitty"] .more-content .owner-settings { background: #f9eff4; }
:root[data-theme="kitty"] :is(.field input, .field select, .field textarea, .field input::placeholder, .field textarea::placeholder) { color: #945767; }
:root[data-theme="kitty"] :is(.scroll-thumb, .panel-scroll::-webkit-scrollbar-thumb, .sheet-scroll::-webkit-scrollbar-thumb) { background: #ff5691; }
:root[data-theme="kitty"] .day-switcher button { color: #99465c; }
:root[data-theme="kitty"] .day-switcher button.is-today:not(.active) { color: #ff5691; }
:root[data-theme="kitty"] .day-switcher button.active { color: #fff; }
:root[data-theme="kitty"] .nav-item:not(.active) { color: #945767; }
:root[data-theme="kitty"] .nav-item:not(.active)[data-tab] .nav-icon img { filter: none; }
:root[data-theme="kitty"] .nav-item:not(.active)[data-tab="schedule"] .nav-icon img { filter: brightness(0) saturate(100%) invert(39%) sepia(19%) saturate(969%) hue-rotate(293deg) brightness(90%) contrast(85%); }
:root[data-theme="kitty"] .browser-top-tint { background-color: #ff497d; }

/* Center theme thumbnails independently of the large header mascot. */
.appearance-preview { display: grid; place-items: center; }
.appearance-preview img { position: static; inset: auto; margin: 0; width: 100px; max-width: 100%; height: 100px; object-fit: contain; transform: none; }

/* The floating navigation uses the same translucency in both appearances. */
:root[data-theme="kitty"] { --floating-surface: linear-gradient(rgba(104,33,53,.1), rgba(104,33,53,.1)), rgba(255,86,145,.1); }
.nav-item:not(.active) .nav-icon { opacity: .6; }
.nav-item:not(.active)[data-tab] .nav-icon img { filter: brightness(0) saturate(100%) invert(34%) sepia(18%) saturate(889%) hue-rotate(145deg); opacity: 1; }
:root[data-theme="kitty"] .nav-item:not(.active) .nav-icon { opacity: .6; }
:root[data-theme="kitty"] .nav-item:not(.active) { color: rgba(148,87,103,.6); }
:root[data-theme="kitty"] .nav-item:not(.active)[data-tab] .nav-icon img { filter: brightness(0) saturate(100%) invert(39%) sepia(19%) saturate(969%) hue-rotate(293deg) brightness(90%) contrast(85%); opacity: 1; }

/* Hide decorative art across all screens without changing the header layout. */
:root[data-mascot="hidden"] :is(.hero-star, .hero-star-high, .hero-mascot, .hero-mascot-high) { visibility: hidden; }
.mascot-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 0; padding: 0; margin: 16px 0; }
.mascot-options legend { color: var(--ink); font-weight: 600; margin-bottom: 8px; }

/* Community views retain the existing layout, typography and theme tokens. */
.app-screen [hidden] { display: none !important; }
.lesson-card[data-community-lesson] { cursor: pointer; }
.lesson-card[data-community-lesson]:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.community-section { margin-top: 28px; }
.community-section h2 { font-size: 18px; line-height: 24px; }
.community-post { margin-top: 12px; overflow-wrap: anywhere; }
.community-post-hidden { opacity: .72; }
.community-text { white-space: pre-wrap; line-height: 1.5; margin: 10px 0; }
.community-text a { color: var(--blue); text-decoration: underline; overflow-wrap: anywhere; }
.community-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.community-actions .secondary-button { width: auto; margin-top: 4px; min-height: 42px; padding: 10px 12px; flex: 1 1 auto; }
.community-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.community-photos img { display: block; width: 100%; height: auto; max-height: 240px; object-fit: contain; border-radius: var(--control-radius, 14px); background: var(--surface-soft); }
.community-photos .secondary-button { margin-top: 6px; }
.community-marks { display: flex; flex-wrap: wrap; gap: 5px; }
.community-marks:empty { display: none; }
.community-mark { margin-top: 7px; border-radius: 6px; padding: 3px 6px; background: var(--surface-soft-2, #ebf3ff); font-size: 11px; line-height: 16px; color: var(--ink-80); }
#communityAccount form[hidden], #communityAccount div[hidden] { display: none; }
#cCode { letter-spacing: .2em; }
#cAccountId { overflow-wrap: anywhere; user-select: all; }
#cEditorForm[aria-busy="true"] { pointer-events: none; }

/* Support uses the same panels, typography and cards as schedule details. */
.s-inbox-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.s-inbox-heading h2 { margin:0; }
.s-support-layout { display:grid; grid-template-columns:minmax(230px, .8fr) minmax(0,1.5fr); gap:24px; }
.s-sidebar,.s-conversation { min-width:0; }
.s-search-tools { display:flex; gap:8px; }
.s-search-tools select { min-width:0; width:100%; border:1px solid var(--line); border-radius:var(--control-radius); padding:10px; background:var(--surface-soft-2); color:var(--ink); font:inherit; }
.s-ticket { display:flex; flex-direction:column; text-align:left; gap:8px; width:100%; margin-top:12px; border:2px solid transparent; cursor:pointer; }
.s-ticket-heading { display:flex; flex-wrap:wrap; gap:8px; justify-content:space-between; }
.s-ticket b,.s-preview,#sTicketTitle { overflow-wrap:anywhere; }
.s-selected { border-color:var(--blue); }
.s-preview { display:block; font-size:14px; }
.s-messages { max-height:48vh; min-height:180px; overflow-y:auto; overscroll-behavior:contain; padding:4px 6px; margin:16px -6px; }
.s-message { display:flex; flex-direction:column; margin-bottom:12px; margin-right:24px; overflow-wrap:anywhere; }
.s-mine { margin-right:0; margin-left:24px; background:var(--surface-soft-2); }
.s-internal { border:2px dashed var(--muted); }
.s-check { display:flex; align-items:flex-start; gap:10px; font-size:14px; line-height:20px; }
.s-check input { width:20px; height:20px; flex:none; }
.s-file { display:flex; gap:10px; justify-content:space-between; align-items:center; overflow-wrap:anywhere; }
.s-file span { min-width:0; }
.s-anonymous { margin-top:28px; }
.s-anonymous summary { cursor:pointer; font-weight:600; padding:12px 0; }
.s-support-content #sChat h2 { margin:12px 0 8px; }
@media (max-width:700px) {
 .s-support-layout { display:block; }
 .s-chat-open .s-sidebar { display:none; }
 .s-support-layout:not(.s-chat-open) .s-conversation { display:none; }
 .s-messages { max-height:45vh; }
 .s-inbox-heading .primary-button { width:auto; }
}

@media (min-width:701px) { .app-shell[data-screen="support"] { width:min(100%,1100px); } }
.s-inbox-heading > button { width:auto; min-height:44px; margin-top:0; flex-shrink:0; }
.s-inbox-heading .primary-button { padding-inline:20px; }
.s-inbox-heading .text-button, .s-file .text-button { min-height:40px; padding:10px 14px; border:0; border-radius:var(--control-radius); background:var(--surface-soft-2); color:var(--ink-80); font:inherit; cursor:pointer; }
.s-message { width:calc(100% - 24px); }
.s-messages { overflow-x:hidden; }
.s-support-content h2 { font-size:20px; line-height:26px; }
.s-check { margin-top:16px; }
.s-message .community-text { min-width:0; }

.s-push-setting { display:block; margin:12px 0 20px; }
.s-push-setting .switch-row { margin-top:0; }

/* Four icon-only destinations keep a stable width while the active pill moves. */
.bottom-nav[data-active] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#bottomNav .nav-indicator { width: calc((100% - 8px) / 4); left: calc(4px + var(--nav-index, 2) * (100% - 8px) / 4); transform: none; }
#bottomNav .nav-item { gap: 0; }
.nav-icon { position: relative; }
.nav-icon svg { display: block; width: 24px; height: 24px; }
/* Fixed strokes keep small action icons as clear as menu and navigation icons. */
.ui-icon { display: block; overflow: visible; }
.ui-icon, .ui-icon g { stroke-width: var(--icon-stroke-width); stroke-linecap: round; stroke-linejoin: round; }
.ui-icon :is(path, circle, rect, line, polyline, polygon, ellipse) { stroke-width: var(--icon-stroke-width); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.nav-icon-filled { display: none; }
.nav-item.active .nav-icon-outline { display: none; }
.nav-item.active .nav-icon-filled { display: inline; }
.nav-badge { position: absolute; top: -4px; right: -8px; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 3px; border: 2px solid var(--floating-surface); border-radius: 99px; background: #b63543; color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; letter-spacing: 0; }
.nav-badge[hidden] { display: none; }

/* The artwork and white panel share the same top value, duration and easing. */
.schedule-screen .hero-star { width: 720px; height: 820px; left: calc(50% - 245px); top: calc(var(--panel-top) - 470px); opacity: 1; transition: top 480ms var(--motion-ease); }
.schedule-screen .hero-mascot { top: calc(var(--panel-top) - 185px); opacity: 1; transition: top 480ms var(--motion-ease); }
.schedule-screen :is(.hero-star-high, .hero-mascot-high) { display: none; }
:root[data-theme="kitty"] .schedule-screen .hero-star { opacity: .36; }
:root[data-theme="kitty"][data-theme-variant="marshmallow"] .schedule-screen .hero-mascot { width: 270px; height: 225px; left: calc(100% - 230px); top: calc(var(--panel-top) - 232px); transition: top 480ms var(--motion-ease), left 480ms var(--motion-ease), width 480ms var(--motion-ease), height 480ms var(--motion-ease); }
.app-shell.is-dragging .schedule-screen :is(.hero-star, .hero-mascot) { transition: none; }
:root[data-theme="kitty"][data-theme-variant="marshmallow"] .app-shell.is-dragging .schedule-screen .hero-mascot { transition: none; }
.lesson-card.cancelled .lesson-title { text-decoration: none; opacity: .48; }
.lesson-card.cancelled .lesson-time :is(.lesson-number, .lesson-clock) { opacity: .48; }
.lesson-meta-line { display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; row-gap: 4px; font-size: 16px; line-height: 20px; }
.lesson-meta-line :is(.lesson-teacher, .room) { font-size: inherit; line-height: inherit; letter-spacing: -.06em; }
.lesson-meta-line .lesson-teacher { margin: 0; }
.lesson-meta-line .room { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.lesson-meta-line .room :is(img, svg) { flex: 0 0 auto; width: 12px; height: 16px; object-fit: contain; }
.replacement-button { color: var(--change-text); }
.replacement-button.cancellation-button { color: #b4232c; }
.replacement-button svg { width: 14px; height: 14px; }
.notice-icon { color: #fff; }
.notice-icon svg { width: 14px; height: 14px; }
.subgroup-note { background: #f3f4f4; color: #687277; }
.schedule-source-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 16px; }
.schedule-source-actions .official-link { display: flex; min-width: 0; min-height: 48px; margin: 0; padding: 12px 16px; gap: 8px; justify-content: center; align-items: center; border: 0; text-align: center; font-size: 14px; line-height: 20px; font-weight: 600; }
:root a.official-link[data-official-link] { background: var(--source-surface); color: var(--source-ink); }
:root a.official-link[data-official-link] .official-icon { color: inherit; background: transparent; }
a.official-link[data-official-link] .official-icon svg { width: 18px; height: 18px; }
:root .schedule-source-actions button.official-link { min-height: 48px; padding: 12px 16px; border: 1px solid var(--card-line); background: transparent; color: var(--source-accent); }
:root button.official-link[data-open-regular] { color: var(--source-accent); font-weight: 500; }
button.official-link[data-open-regular] .official-icon svg { width: 18px; height: 18px; }
.schedule-source-actions .official-icon { display: flex; width: 18px; height: 18px; flex: 0 0 18px; padding: 0; background: transparent; }
.schedule-source-actions .official-icon :is(img, svg) { display: block; width: 18px; height: 18px; }
.schedule-source-actions a .official-icon img { filter: brightness(0) invert(1); }

.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.menu-tile { display: flex; min-width: 0; min-height: 112px; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; border: 0; border-radius: var(--card-radius); background: var(--surface-soft-2); color: var(--ink); text-decoration: none; text-align: left; }
.menu-tile-icon { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 2px; color: var(--blue-text); }
.menu-tile-icon svg { width: 24px; height: 24px; }
.menu-tile b { font-size: 15px; line-height: 19px; }
.menu-tile small { display: none; }
.menu-tile:active { transform: scale(.98); }
.app-tools .primary-button { margin-top: 12px; padding: 14px 20px; min-height: 50px; background: var(--blue); color: #fff; font-size: var(--font-body); line-height: 20px; }
.site-news-toggle { justify-self: end; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 0; background: transparent; color: var(--blue-text); font-size: 14px; font-weight: 600; line-height: 20px; }
@media (max-height: 600px) {
  :root[data-theme="kitty"][data-theme-variant="marshmallow"] .schedule-screen .hero-mascot { width: 200px; height: 166px; left: calc(100% - 145px); top: calc(var(--panel-top) - 180px); }
}
.settings-detail .settings-card { margin: 0; }
.detail-header { grid-template-columns: 44px minmax(0, 1fr); }
.homework-content { display: flex; flex-direction: column; gap: 16px; }
.homework-content #cHomeworkHelp:empty { display: none; }
.homework-content #cAllHomework { display: flex; flex-direction: column; gap: 12px; }
.homework-content .switch-row { margin: 0; padding: 12px 14px; gap: 12px; border: 1px solid var(--card-line); border-radius: var(--control-radius); background: var(--surface-soft-2); }

/* The regular day reuses the replacement sheet and its downward gesture. */
.sheet-layer.is-full { z-index: 50; width: 100%; }
.sheet-layer.is-full .sheet-dimmer { inset: 0; border-radius: 0; background: rgba(0, 20, 35, .45); }
.regular-sheet { top: 0; bottom: 0; left: 0; right: 0; width: min(100%, 430px); margin: auto; padding: 0; border-radius: 0; background: var(--blue); }
:root[data-theme="kitty"] .regular-sheet { background: var(--theme-hero); }
.regular-sheet .detail-header { flex: 0 0 auto; min-height: calc(138px + var(--safe-top)); }
.regular-sheet-panel { display: flex; flex: 1; flex-direction: column; min-height: 0; gap: 12px; padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px)); border-radius: var(--page-panel-radius) var(--page-panel-radius) 0 0; background: #fff; }
.regular-sheet .sheet-scroll { padding-right: 0; }
.regular-sheet .sheet-card { padding: 8px 12px; }
.regular-sheet .sheet-handle { margin: 0 auto; }
.regular-sheet .scroll-track { right: 6px; top: 176px; bottom: 24px; }
@media (max-width: 359px) {
  .menu-grid { gap: 8px; }
  .menu-tile { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .schedule-screen :is(.hero-star, .hero-mascot) { transition: none; }
  :root[data-theme="kitty"][data-theme-variant="marshmallow"] .schedule-screen .hero-mascot { transition: none; }
}

/* Menu refinements share the existing palette and rounded controls. */
.menu-tile { min-height: 100px; gap: 8px; }
.menu-preference { min-height: 44px; margin: 6px 4px 0; color: var(--ink-80); font-size: 14px; line-height: 20px; }
.app-tools .primary-button { display: flex; align-items: center; justify-content: center; gap: 10px; }
.app-tools .primary-button svg { flex: 0 0 18px; width: 18px; height: 18px; }
.app-tools .secondary-button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; margin-top: 12px; padding: 14px 20px; background: transparent; color: var(--blue-text); font-size: var(--font-body); line-height: 20px; }
.app-tools .secondary-button svg { flex: 0 0 18px; width: 18px; height: 18px; }
:root[data-lesson-separators="hidden"] .schedule-separator { visibility: hidden; }
:root[data-theme="kitty"] .switch-row input { background-color: #f1d8e2; }
:root[data-theme="kitty"] .switch-row input:checked { background-color: var(--blue); }
:root[data-theme="kitty"] .subgroup-note { background: #faf2f5; color: #a17684; }
:root[data-theme="kitty"] .special-card { background: var(--surface-soft); color: var(--ink-80); }
:root[data-theme="kitty"] .schedule-source-actions .official-icon { background: transparent; }

/* Internal pages use the same hero artwork and white panel as the timetable. */
.detail-screen { --detail-hero-height: calc(clamp(200px, calc(var(--screen-height) * .27), 240px) + var(--safe-top)); position: relative; background: radial-gradient(ellipse 320px 282px at 50% 282px, #0283f1, #09a5f1 50%, #10c6f0); }
/* Continue the artwork behind rounded panel corners instead of clipping at the header. */
.detail-screen .hero-art { height: auto; }
.detail-screen .hero-star { width: 720px; height: 820px; left: calc(50% - 245px); top: calc(var(--detail-hero-height) - 470px); opacity: 1; }
.detail-screen .hero-mascot { width: 190px; height: 190px; left: calc(100% - 150px); top: calc(10px + var(--safe-top)); object-fit: contain; opacity: 1; }
:root[data-theme="kitty"] .detail-screen .hero-star { opacity: .36; }
:root[data-theme="kitty"][data-theme-variant="marshmallow"] .detail-screen .hero-mascot { width: 180px; height: 150px; left: calc(100% - 136px); top: calc(10px + var(--safe-top)); }
.detail-screen > .detail-header { position: relative; z-index: 1; min-height: var(--detail-hero-height); grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; padding: calc(16px + var(--safe-top)) var(--page-inset) 20px; }
.detail-screen .detail-header > div { display: flex; max-width: calc(100% - 70px); flex-direction: column; gap: 5px; padding-top: 0; }
.detail-screen .detail-header h1 { order: -1; margin: 0; color: #fff; font-size: 34px; line-height: 38px; letter-spacing: -.06em; }
.detail-screen .detail-header p { font-size: 16px; line-height: 20px; font-weight: 500; text-transform: none; }
.detail-screen > .detail-content { position: relative; z-index: 2; min-height: calc(var(--screen-height) - var(--detail-hero-height)); padding-top: 30px; border-radius: var(--page-panel-radius) var(--page-panel-radius) 0 0; }
.settings-detail #communityAccount { padding: 0; border-radius: 0; background: transparent; }
#communityAccount > .helper-copy { margin-top: 0; }
#communityAccount .field input { background: var(--surface-soft); }
@media (prefers-reduced-motion: reduce) { .switch-row input { transition: none; } }

/* Shared control edges are subtle in every theme and form. */
:root { --control-line: rgba(0, 55, 68, .22); --card-line: rgba(0, 55, 68, .11); }
:root[data-theme="kitty"] { --control-line: rgba(148, 87, 103, .26); --card-line: rgba(148, 87, 103, .13); }
:root :is(.field input, .field select, .field textarea, .s-search-tools select) {
  display: block; min-width: 0; max-width: 100%; min-height: 48px;
  border: 1.5px solid var(--control-line); background-color: #fff;
  text-align: left; transition: border-color 160ms ease, box-shadow 160ms ease;
}
:root :is(.field input, .field select, .field textarea, .s-search-tools select):focus {
  border-color: var(--blue-text); outline: none; box-shadow: none;
}
:root :is(.field input, .field textarea)::placeholder { color: var(--ink-80); opacity: .65; }
.field { min-width: 0; }
:root :is(.secondary-button, .menu-tile, .action-card, .calendar-choice, .context-box, .materials-list details, .notification-card, .notice-item, .sheet-card, .state-card) { border: 1px solid var(--card-line); }
:root :is(.appearance-option, .variant-option):not(:has(input:checked)) { border-color: var(--control-line); }
:root .s-selected { border-color: var(--blue); }
:root .s-internal { border: 2px dashed var(--muted); }
:root .switch-row input { box-shadow: none; }

/* Let long headers and panels grow with their content; keep the white bottom square. */
.detail-screen { display: flex; flex-direction: column; background-color: #fff; }
.detail-screen > .detail-header { flex: 0 0 auto; padding-bottom: 28px; }
.detail-screen > .detail-content {
  flex: 1 0 auto; width: 100%; min-width: 0;
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  border-radius: var(--page-panel-radius) var(--page-panel-radius) 0 0;
}
.detail-screen .detail-header > div { max-width: calc(100% - 60px); }
.detail-content > :first-child { margin-top: 0; }
.detail-content, .root-page-scroll { overflow-wrap: anywhere; }

.editor-date-row { display: grid; grid-template-columns: minmax(0, 1fr) 146px; align-items: start; gap: 12px; margin-top: 18px; }
.editor-date-row > .field { margin-top: 0; }
.editor-date-row:has(#cDueField[hidden]) { grid-template-columns: minmax(0, 1fr); }
.subject-field { position: relative; }
.subject-field > label { color: var(--ink-80); font-size: var(--font-body); font-weight: 600; line-height: 20px; }
.subject-control { position: relative; min-width: 0; }
:root .subject-control input { padding: 12px 40px 12px 12px; }
:root .subject-control input[readonly] { background: var(--surface-soft-2); padding-right: 12px; }
.subject-toggle { position: absolute; inset: 2px 2px 2px auto; display: grid; place-items: center; width: 36px; padding: 8px; border: 0; border-radius: 0 var(--control-radius) var(--control-radius) 0; background: transparent; }
.subject-toggle img { width: 14px; height: 14px; filter: brightness(0) saturate(100%); opacity: .65; transition: transform 160ms ease; }
.subject-toggle[aria-expanded="true"] img { transform: rotate(180deg); }
.subject-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 8; width: calc(100% + 158px); border: 1.5px solid var(--control-line); border-radius: var(--control-radius); background: #fff; box-shadow: 0 8px 24px rgba(0, 11, 66, .12); overflow: hidden; }
#cSubjectList { max-height: 224px; overflow-y: auto; overscroll-behavior: contain; }
.subject-option { padding: 12px 14px; min-height: 46px; color: var(--ink-80); font-size: 15px; line-height: 20px; cursor: pointer; overflow-wrap: anywhere; }
.subject-option + .subject-option { border-top: 1px solid var(--card-line); }
.subject-option:hover, .subject-option[aria-selected="true"] { background: var(--surface-soft); color: var(--ink); }
.subject-hint { margin: 0; padding: 10px 14px; border-top: 1px solid var(--card-line); color: var(--ink-80); font-size: 12px; line-height: 16px; background: var(--surface-soft-2); }
.subject-help { margin-top: 10px; }
:root .field input[type="date"] { width: 100%; min-width: 0; padding: 12px 10px; text-align: left; -webkit-appearance: none; appearance: none; }
.field input[type="date"]::-webkit-date-and-time-value { min-height: 20px; text-align: left; }
.field input[type="date"]::-webkit-datetime-edit { display: inline-flex; padding: 0; }
:root .field input[type="file"] { padding: 10px 12px; color: var(--ink-80); font-size: 13px; line-height: 24px; overflow: hidden; }
.field input[type="file"]::file-selector-button { margin: 0 10px 0 0; padding: 6px 10px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--surface-soft); color: var(--ink-80); font: inherit; }
@media (max-width: 359px) {
  .editor-date-row { grid-template-columns: minmax(0, 1fr) 138px; gap: 10px; }
  .subject-menu { width: calc(100% + 148px); }
  :root .subject-control input { padding-left: 10px; }
}
@media (max-width: 319px) {
  .editor-date-row { grid-template-columns: minmax(0, 1fr); }
  .subject-menu { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  :root :is(.field input, .field select, .field textarea), .subject-toggle img { transition: none; }
}

:root .field textarea { min-height: 126px; }
/* Form cards stack their fields instead of inheriting notification rows. */
.detail-form.notification-card { display: block; }
.detail-form .s-check { margin-top: 16px; }
/* Reserve space for the mascot so long titles do not run underneath it. */
.detail-screen .detail-header > div { max-width: calc(100% - 110px); }
@media (max-width: 359px) {
  .detail-screen .detail-header h1 { font-size: 31px; line-height: 35px; }
}


/* Both decorations share the mascot center in every panel position. */
.app-shell {
  --hero-mascot-width: 440px; --hero-mascot-height: 344px;
  --hero-mascot-left: calc(100% - 340px);
  --hero-mascot-top: max(calc(45px + var(--safe-top)), calc(var(--panel-top) - 245px));
  --hero-star-width: 720px; --hero-star-height: 820px;
}
.app-shell[data-panel-position="high"] {
  --hero-mascot-width: 190px; --hero-mascot-height: 149px;
  --hero-mascot-left: calc(100% - 160px); --hero-mascot-top: calc(var(--panel-top) - 160px);
  --hero-star-width: 240px; --hero-star-height: 273.5px;
}
.app-shell[data-panel-position="low"] {
  --hero-mascot-width: 640px; --hero-mascot-height: 501px;
  --hero-mascot-left: calc(100% - 490px);
  --hero-mascot-top: max(calc(45px + var(--safe-top)), calc(var(--panel-top) - 365px));
  --hero-star-width: 1000px; --hero-star-height: 1139px;
}
:root[data-mascot-family="kitty"] .app-shell {
  --hero-mascot-width: 440px; --hero-mascot-height: 365px;
  --hero-mascot-left: calc(100% - 365px); --hero-mascot-top: calc(var(--panel-top) - 245px);
}
:root[data-mascot-family="kitty"] .app-shell[data-panel-position="high"] {
  --hero-mascot-width: 180px; --hero-mascot-height: 150px;
  --hero-mascot-left: calc(100% - 140px); --hero-mascot-top: calc(var(--panel-top) - 160px);
}
:root[data-mascot-family="kitty"] .app-shell[data-panel-position="low"] {
  --hero-mascot-width: 640px; --hero-mascot-height: 531px;
  --hero-mascot-left: calc(100% - 480px);
  --hero-mascot-top: max(calc(28px + var(--safe-top)), calc(var(--panel-top) - 385px));
}
@media (max-height: 600px) {
  .app-shell[data-panel-position="medium"] {
    --hero-mascot-width: 300px; --hero-mascot-height: 235px;
    --hero-mascot-left: calc(100% - 235px);
    --hero-mascot-top: max(calc(40px + var(--safe-top)), calc(var(--panel-top) - 190px));
    --hero-star-width: 600px; --hero-star-height: 683px;
  }
  .app-shell[data-panel-position="low"] {
    --hero-mascot-width: 380px; --hero-mascot-height: 298px;
    --hero-mascot-left: calc(100% - 305px);
    --hero-mascot-top: max(calc(40px + var(--safe-top)), calc(var(--panel-top) - 230px));
    --hero-star-width: 760px; --hero-star-height: 865px;
  }
  :root[data-mascot-family="kitty"] .app-shell[data-panel-position="medium"] {
    --hero-mascot-width: 300px; --hero-mascot-height: 249px;
    --hero-mascot-left: calc(100% - 252px); --hero-mascot-top: calc(var(--panel-top) - 190px);
  }
  :root[data-mascot-family="kitty"] .app-shell[data-panel-position="low"] {
    --hero-mascot-width: 380px; --hero-mascot-height: 315px;
    --hero-mascot-left: calc(100% - 300px); --hero-mascot-top: calc(var(--panel-top) - 250px);
  }
}
:root .app-shell[data-panel-position] .schedule-screen .hero-mascot {
  width: var(--hero-mascot-width); height: var(--hero-mascot-height);
  left: var(--hero-mascot-left); top: var(--hero-mascot-top);
}
.app-shell[data-panel-position] .schedule-screen .hero-star {
  width: var(--hero-star-width); height: var(--hero-star-height);
  left: calc(var(--hero-mascot-left) + var(--hero-mascot-width) / 2 - var(--hero-star-width) / 2);
  top: calc(var(--hero-mascot-top) + var(--hero-mascot-height) / 2 - var(--hero-star-height) / 2);
}
:root .app-shell[data-panel-position] .schedule-screen :is(.hero-star, .hero-mascot) {
  transition: top 480ms var(--motion-ease), left 480ms var(--motion-ease), width 480ms var(--motion-ease), height 480ms var(--motion-ease);
}
:root .app-shell[data-panel-position].is-dragging .schedule-screen :is(.hero-star, .hero-mascot) { transition: none; }
@media (prefers-reduced-motion: reduce) {
  :root .app-shell[data-panel-position] .schedule-screen :is(.hero-star, .hero-mascot) { transition: none; }
}

/* Detail headers use the same center calculation with their existing mascot size. */
.detail-screen {
  --hero-mascot-width: 190px; --hero-mascot-height: 190px;
  --hero-mascot-left: calc(100% - 150px); --hero-mascot-top: calc(10px + var(--safe-top));
  --hero-star-width: 720px; --hero-star-height: 820px;
}
:root[data-mascot-family="kitty"] .detail-screen {
  --hero-mascot-width: 180px; --hero-mascot-height: 150px;
  --hero-mascot-left: calc(100% - 136px);
}
.detail-screen .hero-star {
  left: calc(var(--hero-mascot-left) + var(--hero-mascot-width) / 2 - var(--hero-star-width) / 2);
  top: calc(var(--hero-mascot-top) + var(--hero-mascot-height) / 2 - var(--hero-star-height) / 2);
}

/* Appearance mode is independent of the selected palette. */
:root[data-color-mode] {
  --canvas-surface: #e8eef7; --page-surface: #fff; --input-surface: #fff;
  --accent-fill: #087b95; --accent-ink: #fff; --blue-text: #08778e;
  --muted: #58737c; --ink-60: var(--muted); --hero-ink: #fff; --hero-muted: #e4f8ff;
  --hero-tint: #10c6f0; --theme-scroll: #d0ecf2; --control-line: #819ba4;
  --green-text: #23734c; --green-bg: #e4f3ea; --dot-text: #2166a3; --dot-bg: #e5f0fb;
  --change-text: #95500b; --change-bg: #fff0de; --error-text: #b4233a; --error-bg: #fce8ed;
  --source-accent: #08778e; --source-ink: #08778e; --source-surface: #e3f6fa;
  --theme-hero: radial-gradient(ellipse 320px 282px at 50% 282px, #0283f1, #09a5f1 50%, #10c6f0);
}
:root[data-color-mode][data-theme="kitty"] {
  --canvas-surface: #f4eaf0; --ink: #792d42; --ink-80: #794a59; --muted: #89606d;
  --accent-fill: #c52c60; --blue-text: #b52a5a; --hero-ink: #682135; --hero-muted: #682135;
  --hero-tint: #ff497d; --control-line: #b18797;
  --source-accent: #966019; --source-ink: #966019; --source-surface: #fff3e4; --lesson-accent: #966019;
  --theme-hero: radial-gradient(ellipse 320px 282px at 50% 282px, #ffbbbc, #ff829c 50%, #ff668d 75%, #ff497d);
}
:root[data-color-mode="dark"] {
  color-scheme: dark;
  --canvas-surface: #07141d; --page-surface: #101f29; --input-surface: #142936;
  --ink: #e3f0f4; --ink-80: #d3e4eb; --muted: #abc1ca; --ink-60: var(--muted);
  --surface-soft: #203946; --surface-soft-2: #192c37; --line: #304651;
  --control-line: #6b8795; --card-line: #304651;
  --accent-fill: #146e89; --blue-text: #79d7ef; --hero-ink: #e3f0f4; --hero-muted: #bdd5df;
  --hero-tint: #0b2231; --theme-scroll: #243c49;
  --floating-surface: rgba(28, 49, 61, .94); --nav-surface: rgba(28, 49, 61, .55);
  --source-accent: #79d7ef; --source-ink: #79d7ef; --source-surface: #203946;
  --theme-hero: radial-gradient(ellipse 360px 340px at 50% 280px, #163e50, #102d3c 60%, #0b2231);
}
:root[data-color-mode="dark"][data-theme="kitty"] {
  --canvas-surface: #140f16; --page-surface: #231822; --input-surface: #2b1e2a;
  --ink: #f9e9f0; --ink-80: #efdce7; --muted: #c9adbd;
  --surface-soft: #3a2938; --surface-soft-2: #30222f; --line: #533b4e;
  --control-line: #9b7b90; --card-line: #533b4e;
  --accent-fill: #a93666; --blue-text: #ffaacb; --hero-ink: #f9e9f0; --hero-muted: #dbc2d1;
  --hero-tint: #271321; --theme-scroll: #57354d;
  --floating-surface: rgba(57, 38, 53, .94); --nav-surface: rgba(57, 38, 53, .55);
  --source-accent: #ffd092; --source-ink: #ffd092; --source-surface: #3b2b18; --lesson-accent: #ffd092;
  --theme-hero: radial-gradient(ellipse 360px 340px at 50% 280px, #542b44, #3a1d31 60%, #271321);
}
:root[data-color-mode="dark"] {
  --green-text: #7bddab; --green-bg: #162f28; --dot-text: #8fc9ff; --dot-bg: #183349;
  --change-text: #ffd092; --change-bg: #3b2b18; --error-text: #ffadb5; --error-bg: #3c202a;
}
:root[data-color-mode] { background: var(--canvas-surface); }
:root[data-color-mode] body { background: var(--canvas-surface); }
:root[data-color-mode] :is(.app-shell, .screen-stage, .content-panel, .detail-content, .bottom-sheet, .calendar-dialog, .viewport-check, .regular-sheet-panel) { background: var(--page-surface); }
:root[data-color-mode] :is(.schedule-screen, .standard-screen, .detail-screen, .regular-sheet) { background: var(--theme-hero); }
:root[data-color-mode] .browser-top-tint { background-color: var(--hero-tint); }
:root[data-color-mode] :is(.hero, .page-hero, .detail-header, .hero h1, .hero-main h1, .day-heading h1, .page-heading h1, .detail-header h1) { color: var(--hero-ink); }
:root[data-color-mode] :is(.day-heading p, .page-heading p, .hero-meta, .detail-header p) { color: var(--hero-muted); }
:root[data-color-mode] .back-button { color: var(--ink); background: var(--input-surface); }
:root[data-color-mode] :is(.settings-card, .menu-card, .menu-tile, .action-card, .report-card, .notification-card, .notice-item, .sheet-card, .state-card, .context-box, .materials-list details, .calendar-choice) { background: var(--surface-soft-2); color: var(--ink-80); }
:root[data-color-mode] .more-content .owner-settings { background: var(--surface-soft); }
:root[data-color-mode] :is(.field input, .field select, .field textarea, .s-search-tools select, .subject-menu) { background: var(--input-surface); color: var(--ink); border-color: var(--control-line); }
:root[data-color-mode] :is(.field input, .field textarea)::placeholder { color: var(--muted); opacity: 1; }
:root[data-color-mode] :is(.field input, .field select, .field textarea, .s-search-tools select):focus { border-color: var(--blue-text); }
:root[data-color-mode] :is(button, input, select, textarea, summary, a):focus-visible { outline-color: var(--blue-text); }
:root[data-color-mode] :is(.primary-button, .app-tools .primary-button, .nav-indicator, .day-indicator) { background: var(--accent-fill); color: var(--accent-ink); }
:root[data-color-mode] :is(.nav-item.active, .day-switcher button.active) { color: var(--accent-ink); }
:root[data-color-mode] :is(.nav-item:not(.active), .day-switcher button) { color: var(--ink-80); }
:root[data-color-mode] .day-switcher button.is-today:not(.active) { color: var(--blue-text); }
:root[data-color-mode] .switch-row input { background-color: var(--surface-soft); border-color: var(--control-line); }
:root[data-color-mode] .switch-row input:checked { background-color: var(--accent-fill); border-color: var(--accent-fill); }
:root[data-color-mode] .switch-row input::before { background: #fff; }
:root[data-color-mode] :is(.lesson-title, .lesson-start) { color: var(--ink); opacity: 1; }
:root[data-color-mode] :is(.lesson-end, .lesson-teacher, .notice-line small, .notice-body > span, .notice-item span) { color: var(--muted); opacity: 1; }
:root[data-color-mode] .lesson-number { color: var(--blue-text); }
:root[data-color-mode] .room { color: var(--blue-text); }
:root[data-color-mode][data-theme="kitty"] .room { color: var(--lesson-accent); }
:root[data-color-mode="light"][data-theme="kitty"] .room img { filter: brightness(.56) saturate(.9); }
:root[data-color-mode] :is(.lesson-divider, .schedule-separator) { background: var(--line); }
:root[data-color-mode] .official-link { color: var(--source-ink); background: var(--source-surface); }
:root[data-color-mode] :is(.official-icon, .action-icon, .report-icon, .notice-icon.info) { background: var(--accent-fill); }
:root[data-color-mode] .change-badge { color: var(--change-text); }
:root[data-color-mode] .replacement-button { color: var(--change-text); background: var(--change-bg); }
:root[data-color-mode] .replacement-button.cancellation-button { color: var(--error-text); background: var(--error-bg); }
:root[data-color-mode] :is(.special-card, .day-notice) { color: var(--change-text); background: var(--change-bg); }
:root[data-color-mode] :is(.special-card span, .day-notice span) { opacity: 1; }
:root[data-color-mode] .subgroup-note { color: var(--muted); background: var(--surface-soft-2); }
:root[data-color-mode] .community-text a { color: var(--blue-text); }
:root[data-color-mode] :is(.panel-handle span, .sheet-handle span) { background: var(--control-line); }
:root[data-color-mode] :is(.scroll-track, .panel-scroll::-webkit-scrollbar-track, .sheet-scroll::-webkit-scrollbar-track) { background: var(--theme-scroll); }
:root[data-color-mode] :is(.scroll-thumb, .panel-scroll::-webkit-scrollbar-thumb, .sheet-scroll::-webkit-scrollbar-thumb) { background: var(--blue-text); }
:root[data-color-mode] :is(.panel-scroll, .sheet-scroll) { scrollbar-color: var(--blue-text) var(--theme-scroll); }
:root[data-color-mode="dark"] :is(.hero-star, .hero-star-high) { opacity: .16; }
:root[data-color-mode="dark"] :is(.hero-mascot, .hero-mascot-high) { filter: brightness(.85) saturate(.85); }
:root[data-color-mode="dark"] .nav-item:not(.active)[data-tab] .nav-icon img { filter: brightness(0) invert(1); opacity: .9; }
:root[data-color-mode="dark"] .nav-item:not(.active) .nav-icon { opacity: .8; }
:root[data-color-mode="dark"] .subject-toggle img { filter: brightness(0) invert(1); opacity: .85; }
:root[data-color-mode="dark"] .room img { filter: brightness(0) invert(1); opacity: .85; }
:root[data-color-mode="dark"] :is(.calendar-dialog, .viewport-check)::backdrop { background: rgba(0,0,0,.6); }

.color-mode-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 20px 0 8px; border: 0; }
.color-mode-options legend { margin-bottom: 12px; font-size: 16px; font-weight: 600; color: var(--ink); }
.color-mode-option { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 90px; min-width: 0; gap: 10px; padding: 12px 4px; border: 2px solid var(--control-line); border-radius: 16px; background: var(--input-surface); color: var(--ink-80); cursor: pointer; }
.color-mode-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.color-mode-option svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.color-mode-option span { font-size: 12px; line-height: 16px; font-weight: 600; text-align: center; }
.color-mode-option:has(input:checked) { background: var(--surface-soft); color: var(--blue-text); border-color: var(--blue-text); }
.color-mode-option:has(input:focus-visible) { outline: 3px solid var(--blue-text); outline-offset: 3px; }
.color-mode-status { margin: 8px 0 24px; }
:root[data-color-mode] :is(.appearance-option, .variant-option) { background: var(--input-surface); }
:root[data-color-mode] :is(.appearance-option, .variant-option):has(input:checked) { background: var(--surface-soft); }
:root[data-color-mode="dark"] .azure-preview { background: #163e50; }
:root[data-color-mode="dark"] .kitty-preview { background: #542b44; }
:root[data-color-mode] .more-content :is(.settings-card, .menu-card, .action-card, .report-card) { background: var(--surface-soft-2); color: var(--ink-80); }
:root[data-color-mode] :is(.bottom-sheet h2, .notice-section-title, .toast) { color: var(--ink); }
:root[data-color-mode="dark"] .sheet-dimmer, :root[data-color-mode="dark"] .changes-sheet.is-underneath::after { background: rgba(0,0,0,.4); }
:root[data-color-mode] .lesson-card.cancelled .lesson-title { color: var(--muted); }
:root[data-color-mode][data-theme] .back-button { color: var(--ink); }
:root[data-color-mode="dark"][data-theme] :is(.schedule-screen .hero-star, .detail-screen .hero-star) { opacity: .12; }
@media (max-width: 359px) {
  [data-screen="appearance"] .detail-header > div { max-width: calc(100% - 80px); }
  [data-screen="appearance"] .detail-header h1 { font-size: 28px; line-height: 32px; }
}
:root[data-color-mode="light"] { --hero-ink: #001b24; --hero-muted: #001b24; }
:root[data-color-mode="light"][data-theme="kitty"] { --hero-ink: #4b1427; --hero-muted: #4b1427; }
:root[data-color-mode] :is(.hero-meta, .hero-main h1) { text-shadow: none; }

/* Additional themes share controls and semantic status colors. */
:root[data-theme="cat"][data-color-mode="light"] {
  --canvas-surface: #e7ddd2;
  --page-surface: #fffdf8;
  --input-surface: #fffdf8;
  --surface-soft: #e9ddcf;
  --surface-soft-2: #f3ece4;
  --ink: #362b25;
  --ink-80: #534439;
  --muted: #76604f;
  --accent-fill: #795940;
  --blue-text: #795940;
  --control-line: #9c816a;
  --line: #d6c6b4;
  --hero-ink: #362b25;
  --hero-tint: #c4ab90;
  --ink-60: var(--muted); --hero-muted: #362b25; --card-line: #d6c6b4; --theme-scroll: #e9ddcf;
  --source-ink: var(--blue-text); --source-accent: var(--blue-text); --source-surface: var(--surface-soft);
  --floating-surface: #e9ddcff2; --nav-surface: #e9ddcf47;
  --theme-hero: radial-gradient(ellipse 360px 330px at 65% 250px, #c4ab90, #eadbc8);
}
:root[data-theme="cat"][data-color-mode="dark"] {
  --canvas-surface: #15120f;
  --page-surface: #221d1a;
  --input-surface: #29221d;
  --surface-soft: #413329;
  --surface-soft-2: #302720;
  --ink: #f6eee4;
  --ink-80: #e7d9c8;
  --muted: #cbb8a7;
  --accent-fill: #856446;
  --blue-text: #edc49a;
  --control-line: #ac8d70;
  --line: #584534;
  --hero-ink: #f6eee4;
  --hero-tint: #302620;
  --ink-60: var(--muted); --hero-muted: #f6eee4; --card-line: #584534; --theme-scroll: #413329;
  --source-ink: var(--blue-text); --source-accent: var(--blue-text); --source-surface: var(--surface-soft);
  --floating-surface: #413329f2; --nav-surface: #4133298c;
  --theme-hero: radial-gradient(ellipse 360px 330px at 65% 250px, #49392f, #302620);
}
:root[data-theme="sheep"][data-color-mode="light"] {
  --canvas-surface: #e8ddca;
  --page-surface: #fffaf1;
  --input-surface: #fffdf7;
  --surface-soft: #eadbc4;
  --surface-soft-2: #f3e8d6;
  --ink: #473521;
  --ink-80: #5d4731;
  --muted: #79644f;
  --accent-fill: #7c5737;
  --blue-text: #75502e;
  --control-line: #9d8161;
  --line: #d5c2a8;
  --hero-ink: #3b2a1b;
  --hero-tint: #c6a67f;
  --ink-60: var(--muted); --hero-muted: #3b2a1b; --card-line: #d5c2a8; --theme-scroll: #eadbc4;
  --source-ink: var(--blue-text); --source-accent: var(--blue-text); --source-surface: var(--surface-soft);
  --floating-surface: #eadbc4f2; --nav-surface: #eadbc447;
  --theme-hero: radial-gradient(ellipse 360px 330px at 65% 250px, #c6a67f, #eddbba);
}
:root[data-theme="sheep"][data-color-mode="dark"] {
  --canvas-surface: #14110d;
  --page-surface: #211c16;
  --input-surface: #282219;
  --surface-soft: #423322;
  --surface-soft-2: #30281f;
  --ink: #f6eedf;
  --ink-80: #e8d8bf;
  --muted: #cdb79b;
  --accent-fill: #876341;
  --blue-text: #ecc494;
  --control-line: #a88a65;
  --line: #5a4630;
  --hero-ink: #f6eedf;
  --hero-tint: #32291f;
  --ink-60: var(--muted); --hero-muted: #f6eedf; --card-line: #5a4630; --theme-scroll: #423322;
  --source-ink: var(--blue-text); --source-accent: var(--blue-text); --source-surface: var(--surface-soft);
  --floating-surface: #423322f2; --nav-surface: #4233228c;
  --theme-hero: radial-gradient(ellipse 360px 330px at 65% 250px, #51402c, #32291f);
}
:root[data-theme="kitty-classic"][data-color-mode="light"] {
  --canvas-surface: #e8edf5;
  --page-surface: #fffdf6;
  --input-surface: #fffef9;
  --surface-soft: #e5edf9;
  --surface-soft-2: #f1f4fa;
  --ink: #243b5b;
  --ink-80: #3b506c;
  --muted: #5e6d81;
  --accent-fill: #b73243;
  --blue-text: #245c9b;
  --control-line: #7b92af;
  --line: #ccd6e4;
  --hero-ink: #243b5b;
  --hero-tint: #bcd1f0;
  --ink-60: var(--muted); --hero-muted: #243b5b; --card-line: #ccd6e4; --theme-scroll: #e5edf9;
  --source-ink: var(--blue-text); --source-accent: var(--blue-text); --source-surface: var(--surface-soft);
  --floating-surface: #e5edf9f2; --nav-surface: #e5edf947;
  --theme-hero: radial-gradient(ellipse 360px 330px at 65% 250px, #bcd1f0, #edf3ff);
}
:root[data-theme="kitty-classic"][data-color-mode="dark"] {
  --canvas-surface: #0e1420;
  --page-surface: #171f2d;
  --input-surface: #1d293b;
  --surface-soft: #2b3b55;
  --surface-soft-2: #202c40;
  --ink: #f0f4fc;
  --ink-80: #dbe5f4;
  --muted: #b1c1d8;
  --accent-fill: #a53245;
  --blue-text: #aacbff;
  --control-line: #8198b8;
  --line: #3e536f;
  --hero-ink: #f0f4fc;
  --hero-tint: #17263e;
  --ink-60: var(--muted); --hero-muted: #f0f4fc; --card-line: #3e536f; --theme-scroll: #2b3b55;
  --source-ink: var(--blue-text); --source-accent: var(--blue-text); --source-surface: var(--surface-soft);
  --floating-surface: #2b3b55f2; --nav-surface: #2b3b558c;
  --theme-hero: radial-gradient(ellipse 360px 330px at 65% 250px, #2b3f61, #17263e);
}
:root[data-theme="kitty-navy"][data-color-mode="light"] {
  --canvas-surface: #e2e8f0;
  --page-surface: #f9fbff;
  --input-surface: #fff;
  --surface-soft: #dfe9f5;
  --surface-soft-2: #edf2f9;
  --ink: #203859;
  --ink-80: #384f6e;
  --muted: #5c6e85;
  --accent-fill: #234b79;
  --blue-text: #234b79;
  --control-line: #7a91ad;
  --line: #c4d2e3;
  --hero-ink: #f3f7ff;
  --hero-tint: #163253;
  --ink-60: var(--muted); --hero-muted: #f3f7ff; --card-line: #c4d2e3; --theme-scroll: #dfe9f5;
  --source-ink: var(--blue-text); --source-accent: var(--blue-text); --source-surface: var(--surface-soft);
  --floating-surface: #dfe9f5f2; --nav-surface: #dfe9f547;
  --theme-hero: radial-gradient(ellipse 360px 330px at 65% 250px, #244a77, #163253);
}
:root[data-theme="kitty-navy"][data-color-mode="dark"] {
  --canvas-surface: #080f1b;
  --page-surface: #111c2d;
  --input-surface: #17253a;
  --surface-soft: #243c5a;
  --surface-soft-2: #1a2b43;
  --ink: #edf4ff;
  --ink-80: #d6e4f8;
  --muted: #afc3df;
  --accent-fill: #325b8a;
  --blue-text: #b0d2ff;
  --control-line: #7995b9;
  --line: #354e6c;
  --hero-ink: #edf4ff;
  --hero-tint: #10223d;
  --ink-60: var(--muted); --hero-muted: #edf4ff; --card-line: #354e6c; --theme-scroll: #243c5a;
  --source-ink: var(--blue-text); --source-accent: var(--blue-text); --source-surface: var(--surface-soft);
  --floating-surface: #243c5af2; --nav-surface: #243c5a8c;
  --theme-hero: radial-gradient(ellipse 360px 330px at 65% 250px, #213d62, #10223d);
}

.theme-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.theme-picker-heading h3 { margin: 0; color: var(--ink); font-size: 16px; line-height: 20px; }
.theme-picker-heading .secondary-button { width: auto; min-height: 40px; margin: 0; padding: 8px 14px; font-size: 14px; white-space: nowrap; }
.appearance-option[hidden] { display: none !important; }
.cat-preview { background: #e9ddcf; }
.sheep-preview { background: #eadbc4; }
.classic-preview { background: #e5edf9; }
.navy-preview { background: #244a77; }
:root[data-color-mode="dark"] .cat-preview { background: #49392f; }
:root[data-color-mode="dark"] .sheep-preview { background: #51402c; }
:root[data-color-mode="dark"] .classic-preview { background: #2b3f61; }
:root[data-color-mode="dark"] .navy-preview { background: #213d62; }
.appearance-preview:has(img[src$="cat-portrait-20261007-perf-20261014.webp"]) img { height: 108px; width: 100%; object-fit: contain; top: 0; left: 0; transform: none; }
.appearance-preview:has(img[src$="sheep-perf-20261014.webp"]) img { height: 98px; width: 100%; object-fit: contain; top: 3px; left: 0; transform: none; }
:root[data-mascot-family="kitty"] :is(.hero-mascot, .hero-mascot-high) { object-fit: contain; transform: rotate(9.25deg); }
:root[data-mascot-family="kitty"] .detail-screen .hero-mascot { width: var(--hero-mascot-width); height: var(--hero-mascot-height); left: var(--hero-mascot-left); top: var(--hero-mascot-top); }
:root[data-mascot-family="cat"] .app-shell {
  --hero-mascot-width: 360px; --hero-mascot-height: 400px;
  --hero-mascot-left: calc(100% - 285px); --hero-mascot-top: max(calc(28px + var(--safe-top)), calc(var(--panel-top) - 245px));
}
:root[data-mascot-family="cat"] .app-shell[data-panel-position="high"] {
  --hero-mascot-width: 140px; --hero-mascot-height: 160px;
  --hero-mascot-left: calc(100% - 120px); --hero-mascot-top: calc(var(--panel-top) - 155px);
}
:root[data-mascot-family="cat"] .app-shell[data-panel-position="low"] {
  --hero-mascot-width: 520px; --hero-mascot-height: 578px;
  --hero-mascot-left: calc(100% - 405px); --hero-mascot-top: max(calc(28px + var(--safe-top)), calc(var(--panel-top) - 350px));
}
:root[data-mascot-family="sheep"] .app-shell {
  --hero-mascot-width: 360px; --hero-mascot-height: 330px;
  --hero-mascot-left: calc(100% - 290px); --hero-mascot-top: calc(var(--panel-top) - 230px);
}
:root[data-mascot-family="sheep"] .app-shell[data-panel-position="high"] {
  --hero-mascot-width: 160px; --hero-mascot-height: 146px;
  --hero-mascot-left: calc(100% - 140px); --hero-mascot-top: calc(var(--panel-top) - 145px);
}
:root[data-mascot-family="sheep"] .app-shell[data-panel-position="low"] {
  --hero-mascot-width: 540px; --hero-mascot-height: 495px;
  --hero-mascot-left: calc(100% - 420px); --hero-mascot-top: max(calc(28px + var(--safe-top)), calc(var(--panel-top) - 340px));
}
:root:is([data-mascot-family="cat"], [data-mascot-family="sheep"]) .hero-mascot { object-fit: contain; }
:root[data-mascot-family="cat"] .detail-screen { --hero-mascot-width: 145px; --hero-mascot-height: 165px; --hero-mascot-left: calc(100% - 125px); }
:root[data-mascot-family="sheep"] .detail-screen { --hero-mascot-width: 180px; --hero-mascot-height: 165px; --hero-mascot-left: calc(100% - 145px); }
:root:is([data-mascot-family="cat"], [data-mascot-family="sheep"]) .detail-screen .hero-mascot { width: var(--hero-mascot-width); height: var(--hero-mascot-height); left: var(--hero-mascot-left); top: var(--hero-mascot-top); }
:root:is([data-theme="cat"], [data-theme="sheep"], [data-theme="kitty-classic"], [data-theme="kitty-navy"]) :is(.schedule-screen .hero-star, .detail-screen .hero-star) { opacity: .14; }
:root:is([data-theme="cat"], [data-theme="sheep"], [data-theme="kitty-classic"], [data-theme="kitty-navy"])[data-color-mode="light"] .nav-item:not(.active)[data-tab] .nav-icon img { filter: brightness(0); opacity: .8; }
@media (max-height: 600px) {
  :root[data-mascot-family="cat"] .app-shell[data-panel-position="medium"] { --hero-mascot-width: 260px; --hero-mascot-height: 290px; --hero-mascot-left: calc(100% - 210px); --hero-mascot-top: calc(var(--panel-top) - 195px); }
  :root[data-mascot-family="cat"] .app-shell[data-panel-position="low"] { --hero-mascot-width: 340px; --hero-mascot-height: 380px; --hero-mascot-left: calc(100% - 270px); --hero-mascot-top: calc(var(--panel-top) - 250px); }
  :root[data-mascot-family="sheep"] .app-shell[data-panel-position="medium"] { --hero-mascot-width: 280px; --hero-mascot-height: 257px; --hero-mascot-left: calc(100% - 235px); --hero-mascot-top: calc(var(--panel-top) - 195px); }
  :root[data-mascot-family="sheep"] .app-shell[data-panel-position="low"] { --hero-mascot-width: 360px; --hero-mascot-height: 330px; --hero-mascot-left: calc(100% - 290px); --hero-mascot-top: calc(var(--panel-top) - 240px); }
}

/* Keep frosted navigation and source icons consistent across theme palettes. */
:root[data-color-mode] button.official-link[data-open-regular] .official-icon { background: transparent; color: inherit; }
:root[data-color-mode] button.official-link[data-open-regular] .official-icon svg { fill: none; stroke: currentColor; }

/* Match the room marker to the regular weight of the room label. */
.room .ui-icon { --icon-stroke-width: 1.1px; }

/* A calmer hierarchy: cards for records, plain sections for settings and forms. */
.notification-settings-screen .notification-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.notification-settings-screen .day-heading h1 { font-size: clamp(26px, 8.2vw, 32px); line-height: 1.12; letter-spacing: -.055em; }
:root[data-color-mode] section.notification-settings, :root[data-color-mode] .settings-detail > .settings-card,
:root #sNewForm, :root[data-color-mode] #sPushSetting { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.notification-settings h2 { font-size: 18px; line-height: 24px; margin: 0 0 12px; }
.notification-settings .push-heading { margin-top: 28px; }
.notification-settings .switch-row { margin-top: 0; }
.notification-settings > .helper-copy { margin: 8px 0 0; }
.detail-screen[data-screen="site-news"] .notice-section-title { margin-top: 16px; margin-bottom: 0; font-size: 18px; line-height: 24px; }
.detail-screen[data-screen="site-news"] .notice-section-title:first-child { margin-top: 0; }
.detail-screen[data-screen="site-news"] .notice-list { gap: 12px; }
:root .detail-screen[data-screen="site-news"] .site-update-card { padding: 16px; }
.detail-screen[data-screen="site-news"] .site-update-card .notice-body { gap: 8px; font-size: 15px; line-height: 22px; }
.detail-screen[data-screen="site-news"] .site-update-card .notice-line { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.detail-screen[data-screen="site-news"] .site-update-card .notice-line strong { font-size: 16px; line-height: 22px; letter-spacing: -.025em; }
.detail-screen[data-screen="site-news"] .site-update-card .notice-line small { font-size: 12px; line-height: 18px; color: var(--muted); }
.detail-screen[data-screen="site-news"] .site-news-toggle { min-height: 44px; align-self: flex-start; margin-top: 0; }

/* Compact detail screens keep a large enough title and put the form higher. */
:root .detail-screen { --detail-hero-height: calc(168px + var(--safe-top)); --hero-mascot-width: 112px; --hero-mascot-height: 112px; --hero-mascot-left: calc(100% - 112px); --hero-mascot-top: calc(50px + var(--safe-top)); }
:root[data-mascot-family="kitty"] .detail-screen { --hero-mascot-width: 112px; --hero-mascot-height: 94px; --hero-mascot-left: calc(100% - 112px); }
:root[data-mascot-family="cat"] .detail-screen { --hero-mascot-width: 96px; --hero-mascot-height: 110px; --hero-mascot-left: calc(100% - 100px); }
:root[data-mascot-family="sheep"] .detail-screen { --hero-mascot-width: 120px; --hero-mascot-height: 110px; --hero-mascot-left: calc(100% - 115px); }
.detail-screen > .detail-header { gap: 10px; min-height: var(--detail-hero-height); padding-top: calc(14px + var(--safe-top)); padding-bottom: 20px; }
.detail-screen .detail-header > div { max-width: calc(100% - 90px); }
.detail-screen .detail-header h1 { font-size: 28px; line-height: 32px; letter-spacing: -.045em; white-space: normal; }
.detail-screen .detail-header p { font-size: 14px; line-height: 18px; }
.detail-screen > .detail-content { padding-top: 24px; }
:root[data-color-mode] .detail-form > .context-box { padding: 0; margin: 0 0 16px; border: 0; border-radius: 0; background: transparent; font-size: 14px; line-height: 21px; }
.detail-content .field { margin-top: 18px; gap: 8px; }
.detail-content .field:first-child { margin-top: 0; }
.detail-content .helper-copy { margin-top: 8px; font-size: 13px; line-height: 20px; }
.detail-content .detail-form > .primary-button { margin-top: 20px; }
.detail-content .detail-form > .secondary-button { margin-top: 10px; }
:root .homework-content > .switch-row { padding: 0; border: 0; border-radius: 0; background: transparent; }
.homework-content > .helper-copy:empty { display: none; }
.homework-content { gap: 18px; }
.homework-subject { margin: 0 0 6px; font-size: 18px; line-height: 24px; font-weight: 650; letter-spacing: -.025em; }
.homework-due { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; color: var(--ink-80); font-size: 14px; line-height: 21px; }
.homework-overdue { color: var(--muted); }
.community-post .community-text { margin-top: 14px; font-size: 15px; line-height: 23px; }
:root .community-post .helper-copy { margin-top: 14px; font-size: 12px; line-height: 18px; }
.community-post .community-actions { margin-top: 14px; }
:root[data-color-mode] .switch-row input { border: 1.5px solid var(--control-line); background-color: var(--surface-soft-2); }
:root[data-color-mode] .switch-row input:checked { border-color: var(--blue-text); background-color: var(--accent-fill); }
:root[data-color-mode] .switch-row input:focus-visible { outline: 2px solid var(--blue-text); outline-offset: 3px; }
:root[data-color-mode] .switch-row input:disabled { opacity: .45; cursor: not-allowed; }
.form-error { margin: 14px 0 0; color: var(--error-text); font-size: 14px; line-height: 21px; }
:root[data-color-mode] .field [aria-invalid="true"] { border-color: var(--error-text); }
#communityAccount > .helper-copy { margin-top: 0; font-size: 14px; line-height: 21px; }
.editor-date-row { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 18px; }
.editor-date-row .field { margin-top: 0; }
.editor-date-row .subject-menu { width: 100%; }
#cDueField input { max-width: 220px; }
.subject-help { margin-bottom: 0; }
.upload-picker { position: relative; display: flex; justify-content: center; align-items: center; min-height: 48px; border: 1.5px solid var(--control-line); border-radius: var(--control-radius); background: var(--surface-soft-2); color: var(--ink); font-size: 15px; font-weight: 600; overflow: hidden; }
:root .upload-picker input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-picker:focus-within { outline: 2px solid var(--blue-text); outline-offset: 3px; }
.upload-picker:has(input:disabled) { opacity: .45; }
.upload-status { color: var(--ink-80); }
.community-photos:empty { display: none; }
.attachment-preview { position: relative; margin: 0; min-width: 0; border: 1px solid var(--card-line); border-radius: var(--control-radius); overflow: hidden; background: var(--surface-soft-2); }
.community-photos .attachment-preview img { display: block; width: 100%; height: 140px; object-fit: contain; border-radius: 0; }
.attachment-preview figcaption { padding: 8px 10px; color: var(--muted); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.attachment-preview.preview-unavailable { padding-top: 44px; }
.attachment-preview.preview-unavailable::before { content: 'Фото прикреплено'; display: block; padding: 8px 10px; color: var(--ink); font-size: 14px; }
.attachment-remove { position: absolute; right: 0; top: 0; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0 0 0 12px; background: var(--page-surface); color: var(--ink); font-size: 26px; line-height: 1; box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.attachment-remove:focus-visible { outline: 2px solid var(--blue-text); outline-offset: -3px; }
@media (max-width: 359px) {
  .detail-screen .detail-header h1 { font-size: 25px; line-height: 29px; }
  .editor-date-row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
/* Long notification titles occupy a clear row above the illustration. */
:root[data-color-mode] .notification-settings-screen { --hero-mascot-top: max(calc(62px + var(--safe-top)), calc(var(--panel-top) - var(--hero-mascot-height) + 32px)); }
.notification-settings-screen .notification-heading { flex-direction: row; align-items: center; gap: 10px; }

.editor-date-row .subject-help { margin: -8px 0 0; }


/* Space belongs to the row or section; sibling controls share one baseline. */
.s-support-content .s-inbox-heading { margin-bottom: 0; gap: 16px; }
.s-support-content .s-inbox-heading > button { margin-top: 0; }
.s-support-content .s-push-setting { margin: 24px 0 0; }
.s-support-content .s-support-layout { margin-top: 24px; align-items: start; }
.s-sidebar { display: flex; flex-direction: column; gap: 16px; }
#sSearchForm { display: grid; gap: 12px; }
#sSearchForm > .field { margin-top: 0; }
.s-search-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: stretch; }
.s-search-tools > :is(select, button) { width: 100%; min-height: 48px; margin: 0; }
#sTicketList { display: grid; gap: 12px; }
#sTicketList > .s-ticket, #sMoreTickets, #sInboxTools, #sTicketList > .community-meta { margin: 0; }
#sTicketList:empty { display: none; }
#sInboxTools { font-size: 14px; line-height: 21px; }
.s-support-content .s-anonymous { margin-top: 32px; }
.s-support-content .s-anonymous > .community-meta { margin: 12px 0 20px; }
.s-support-content #sChat > .s-inbox-heading { margin-bottom: 20px; }
.s-support-content #sNewForm > .s-inbox-heading { margin-bottom: 24px; }
.s-support-content #sNewForm > .s-inbox-heading + .field { margin-top: 0; }
.detail-content .community-actions > button { margin-top: 0; }
.detail-content .upload-status { margin-bottom: 0; }

/* The full announcement is an article, with comfortable reading space. */
:root .detail-screen[data-screen="site-news"] .site-news-article { display: block; padding: 20px; }
.site-news-article > header { display: grid; gap: 8px; margin-bottom: 24px; }
.site-news-article > header h2 { margin: 0; font-size: 21px; line-height: 28px; letter-spacing: -.035em; }
.site-news-article > header time { color: var(--muted); font-size: 12px; line-height: 18px; }
.site-news-article p { margin: 0; font-size: 15px; line-height: 23px; }
.site-news-article > section { margin-top: 24px; }
.site-news-article h3 { margin: 0 0 10px; font-size: 17px; line-height: 24px; letter-spacing: -.02em; }
.site-news-article section p + p { margin-top: 12px; }
.site-news-article .site-news-themes { margin-top: 16px; }

/* White translucent stars on the four additional light palettes. */
:root:is([data-theme="cat"], [data-theme="sheep"], [data-theme="kitty-classic"], [data-theme="kitty-navy"])[data-color-mode="light"] :is(.schedule-screen .hero-star, .detail-screen .hero-star) { opacity: .34; filter: none; }

/* Lift the shared decoration center to keep a portrait above the metadata. */
.app-shell { --hero-portrait-top: max(var(--safe-top), calc(var(--hero-mascot-top) - 44px)); }
.app-shell[data-panel-position="high"] { --hero-portrait-top: calc(var(--hero-mascot-top) - 8px); }
:root[data-mascot-family="kitty"] .app-shell[data-panel-position="low"] { --hero-mascot-left: calc(100% - 452px); }
@media (max-height: 600px) { :root[data-mascot-family="kitty"] .app-shell[data-panel-position="low"] { --hero-mascot-left: calc(100% - 286px); } }
:root[data-color-mode="dark"] .hero-main :is(h1, p), :root[data-theme="kitty-navy"][data-color-mode="light"] .hero-main :is(h1, p) { text-shadow: 0 1px 5px rgba(8, 16, 28, .55); }
:root[data-theme="kitty-navy"][data-color-mode="light"] .hero-meta { color: #243b5b; }
:root .app-shell[data-panel-position] .schedule-screen .hero-mascot { top: var(--hero-portrait-top); }
.app-shell[data-panel-position] .schedule-screen .hero-star { top: calc(var(--hero-portrait-top) + var(--hero-mascot-height) / 2 - var(--hero-star-height) / 2); }

/* Overlapping masked backdrop layers gradually increase blur toward the panel.
   The band starts 10px above the 17px metadata line plus its 12px bottom gap. */
.hero-meta-blur { position: absolute; z-index: 0; pointer-events: none; left: 0; right: 0; top: calc(var(--panel-top) - 39px); height: calc(39px + var(--page-panel-radius)); transition: top 480ms var(--motion-ease); }
.hero-meta-blur > span { position: absolute; inset: 0; -webkit-backdrop-filter: blur(var(--meta-blur)); backdrop-filter: blur(var(--meta-blur)); -webkit-mask-image: var(--meta-blur-mask); mask-image: var(--meta-blur-mask); }
.hero-meta-blur > span:nth-child(1) { --meta-blur: 2px; --meta-blur-mask: linear-gradient(to bottom, transparent, #000 12%, #000 28%, transparent 45%); }
.hero-meta-blur > span:nth-child(2) { --meta-blur: 4px; --meta-blur-mask: linear-gradient(to bottom, transparent 12%, #000 28%, #000 44%, transparent 60%); }
.hero-meta-blur > span:nth-child(3) { --meta-blur: 8px; --meta-blur-mask: linear-gradient(to bottom, transparent 28%, #000 44%, #000 60%, transparent 76%); }
.hero-meta-blur > span:nth-child(4) { --meta-blur: 16px; --meta-blur-mask: linear-gradient(to bottom, transparent 44%, #000 60%, #000 76%, transparent 92%); }
.hero-meta-blur > span:nth-child(5) { --meta-blur: 24px; --meta-blur-mask: linear-gradient(to bottom, transparent 60%, #000 76%); }
.hero-meta-blur::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--page-surface) 45%, transparent) 25%, color-mix(in srgb, var(--page-surface) 85%, transparent) 65%, var(--page-surface)); }
.app-shell.is-dragging .hero-meta-blur { transition: none; }
@media (prefers-reduced-motion: reduce) { .hero-meta-blur { transition: none; } }
