/* Cobalt school illustration system inspired by the approved mockup */
:root {
  --ink: #10234e;
  --muted: #526581;
  --line: #dce6f5;
  --paper: #fff;
  --sky: #f5f8ff;
  --blue: #1763dc;
  --blue-soft: #e8f2ff;
  --yellow: #ffdc4e;
  --yellow-soft: #fff5d5;
  --coral: #f45f72;
  --coral-soft: #ffedf0;
  --green: #18ac83;
  --green-soft: #dcfff3;
  --purple: #8358d4;
  --purple-soft: #f0eaff;
  --pink: #ef79ab;
  --pink-soft: #ffeff6;
  --shadow: 0 8px 24px rgba(13, 48, 112, .09);
  --radius: 21px;
  font-family: "Arial Rounded MT Bold", "PingFang HK", "Microsoft JhengHei", system-ui, sans-serif;
}
html { min-width: 0; }
html, body { background: var(--sky); }
body { color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, select { font-family: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible { outline: 3px solid #ffcb3d; outline-offset: 3px; }
.view { animation-duration: .16s; }

.topbar {
  gap: 10px;
  padding: 12px 16px;
  color: #fff;
  background: #115ac8;
  border-bottom: 1px solid rgba(255,255,255,.16);
  backdrop-filter: none;
}
.brand-mark {
  flex-basis: 44px;
  width: 44px;
  height: 44px;
  border: 2px solid var(--yellow);
  border-radius: 13px;
  box-shadow: none;
}
.brand-copy .eyebrow { color: #d8e8ff; font-size: 11px; letter-spacing: .03em; }
.brand-copy h1 { color: #fff; font-size: clamp(17px, 4.5vw, 24px); font-weight: 850; }
.brand-copy h1 span { color: #ffb6ca; }
.install-btn {
  min-height: 42px;
  padding: 8px 11px;
  color: #0e469e;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 3px 0 #073c95;
  font-size: 12px;
  font-weight: 800;
}
.install-btn:active { box-shadow: 0 1px 0 #073c95; }
.app-main { padding: 0 16px 24px; }
.offline-note { margin-top: 12px; }

.hero-card, .illustrated-heading {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(130deg, #0c4eae 0%, #1764d5 58%, #2481f2 100%);
  border: 0;
  box-shadow: 0 14px 30px rgba(14, 76, 179, .16);
}
.hero-card::before, .illustrated-heading::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle at 75% 8%, rgba(255,220,78,.2), transparent 28%),
              radial-gradient(circle at 96% 80%, rgba(68,229,222,.21), transparent 32%);
}
.hero-card::after, .illustrated-heading::after {
  content: "✦";
  position: absolute;
  right: 16px;
  top: 12px;
  color: #ffdc4e;
  font-size: 29px;
  opacity: .95;
  letter-spacing: 0;
}
.hero-card {
  display: block;
  min-height: 228px;
  padding: 22px 20px;
  margin: 0 -16px 17px;
  border-radius: 0 0 31px 31px;
}
.hero-copy { position: relative; z-index: 2; }
.hero-kicker, .illustrated-heading .section-kicker {
  margin: 0 0 8px;
  color: #d9ebff;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .09em;
}
.hero-card h2 {
  max-width: 60%;
  margin: 0;
  color: #fff;
  font-size: clamp(37px, 10vw, 58px);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -.05em;
}
.hero-card h2 span { display: block; margin-top: 5px; white-space: nowrap; font-size: .69em; letter-spacing: -.025em; }
.hero-subtitle { margin: 10px 0 0; color: #fff; font-size: 16px; font-weight: 800; }
.hero-art {
  position: absolute;
  z-index: 1;
  right: -28px;
  top: 6px;
  width: min(61%, 270px);
  height: 220px;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}
.quick-grid { gap: 10px; margin-bottom: 14px; }
.status-card {
  min-height: 158px;
  padding: 15px;
  border: 1px solid #f0e2ab;
  border-radius: 20px;
  box-shadow: 0 5px 15px rgba(13,48,112,.06);
}
.status-card::after { content: none; }
.current-card { background: #fff6d9; }
.next-card { background: #e8f3ff; border-color: #cee1fb; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 5px; }
.card-label { color: var(--ink); font-size: 13px; font-weight: 850; }
.live-dot { flex: 0 0 8px; width: 8px; height: 8px; background: #12ad77; box-shadow: 0 0 0 4px #d7f8e5; }
.card-icon {
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #115ac8;
  background: #fff;
  border-radius: 12px;
}
.card-icon svg, .heading-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.big-value { margin: 6px 0 4px; font-size: clamp(18px, 4.6vw, 29px); font-weight: 900; line-height: 1.22; overflow-wrap: anywhere; }
.muted, .tiny-note { color: #4f6280; font-size: 13px; font-weight: 650; }
.countdown-pill, .count-badge, .progress-badge { color: #124a9f; background: #e1efff; font-size: 12px; font-weight: 850; }
.countdown-pill { margin-top: 8px; }
.tiny-note { margin-top: 8px; }
.status-card #current-countdown:empty, .status-card #school-end:empty { display: none; }

.panel {
  padding: 18px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid #dce6f5;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section-heading { align-items: center; }
.section-heading h3 { font-size: 21px; font-weight: 900; letter-spacing: -.025em; }
.heading-with-icon { display: flex; align-items: center; gap: 11px; }
.heading-icon { display: grid; place-items: center; width: 40px; height: 40px; color: #114fae; background: #e8f2ff; border-radius: 12px; }
.section-kicker { color: #0c57bc; font-size: 12px; font-weight: 850; letter-spacing: .06em; }
.section-icon { color: #ffbe2e; font-size: 26px; opacity: 1; }
.count-badge { margin: 0; }
.schedule-list { gap: 0; }
.schedule-row { grid-template-columns: 63px minmax(0, 1fr); gap: 8px; min-height: 64px; border-bottom: 1px solid #edf1f8; }
.schedule-row:last-child { border-bottom: 0; }
.schedule-time { color: #274369; font-size: 12px; font-weight: 800; }
.schedule-time span { color: #60738d; font-size: 11px; }
.schedule-item { min-height: 54px; padding: 8px 10px; background: transparent; border: 1px solid transparent; border-radius: 12px; }
.schedule-item.current { background: #fff4ce; border-color: #ffdc75; box-shadow: none; }
.schedule-item.done { opacity: .7; }
.schedule-icon { flex-basis: 38px; width: 38px; height: 38px; border-radius: 12px; }
.schedule-icon svg, .event-icon svg, .check-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.schedule-title { font-size: 15px; font-weight: 800; }
.schedule-state { color: #0c57bc; font-size: 12px; }
.tone-blue { color: #1259cb; background: #e4efff; }
.tone-coral { color: #cb3f51; background: #ffe8ec; }
.tone-green { color: #087d70; background: #def9f3; }
.tone-yellow { color: #9b6800; background: #fff1c5; }
.tone-purple { color: #6741ad; background: #eee7ff; }
.tone-pink { color: #ba4b88; background: #ffeaf3; }
.two-column { gap: 14px; }
.event-card { min-height: 66px; background: #f8fbff; border: 1px solid #e6eef8; }
.event-icon { color: #115ac8; background: #e1efff; }
.event-title { font-size: 14px; font-weight: 800; }
.event-date { color: #576d8b; font-size: 12px; }
.event-remaining { color: #8f4e00; background: #fff0c5; font-size: 11px; }
.holiday-panel { background: #f1fcf7; border-color: #cbeedd; }
.holiday-countdown { color: #087e65; font-weight: 900; }
.install-help { color: #314f79; background: #e8f2ff; border-color: #c6dcfb; font-size: 12px; font-weight: 600; }
.install-help strong { color: #0c4fae; }

.illustrated-heading {
  display: block;
  min-height: 228px;
  margin: 0 -16px 16px;
  padding: 23px 20px 26px;
  border-radius: 0 0 31px 31px;
}
.illustrated-heading .page-heading-copy { position: relative; z-index: 2; max-width: 57%; }
.illustrated-heading h2 { margin: 0; color: #fff; font-size: clamp(29px, 7vw, 42px); font-weight: 900; line-height: 1.12; }
.illustrated-heading p:not(.section-kicker) { margin: 8px 0 0; color: #e1ecff; font-size: 14px; font-weight: 650; line-height: 1.35; }
.page-art { position: absolute; z-index: 1; right: -12px; bottom: -5px; width: min(55%, 250px); height: 215px; object-fit: contain; pointer-events: none; }
.view-toggle { min-height: 42px; margin-top: 15px; padding: 8px 12px; color: #0b4ca9; background: #fff; border: 1px solid #fff; border-radius: 11px; font-size: 12px; font-weight: 850; box-shadow: 0 3px 0 #0b439c; }
.view-toggle.active { color: #10234e; background: #ffdc4e; border-color: #ffdc4e; }
.week-day-tabs { position: sticky; z-index: 4; top: 68px; padding: 8px 0 12px; background: var(--sky); }
.day-tab, .filter-chip { min-height: 45px; color: #294364; border: 1px solid #cfddf0; border-radius: 13px; font-size: 13px; font-weight: 800; }
.day-tab.active, .filter-chip.active { color: #fff; background: #125bbf; border-color: #125bbf; box-shadow: none; }
.day-tab.active strong { color: #fff; }
.filter-row { gap: 8px; margin-bottom: 12px; }
.filter-chip[data-type="holiday"].active { background: #0d8d72; border-color: #0d8d72; box-shadow: none; }
.filter-chip[data-type="exam"].active { background: #bb4556; border-color: #bb4556; box-shadow: none; }
.filter-chip[data-type="family"].active { background: #7146bd; border-color: #7146bd; box-shadow: none; }
.tip-card { color: #61480a; background: #fff3cc; border-color: #ffdc78; }
.overall-day { background: #f8fbff; }
.overall-slot { border-left-color: #1464da; }
.overall-slot.break { border-left-color: #e9b823; }
.overall-slot-title svg { width: 17px; height: 17px; margin-right: 4px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.dictation-panel, .calendar-panel { box-shadow: var(--shadow); }
.panel-hint { color: #526581; font-size: 13px; font-weight: 650; }
.add-notice-trigger, .primary-small { min-height: 44px; padding: 9px 13px; color: #fff; background: #1260d3; border-radius: 12px; font-size: 13px; font-weight: 850; }
.add-notice-trigger { width: auto; white-space: nowrap; }
.dictation-list { margin-top: 0; }
.dictation-item { min-height: 86px; padding: 12px; background: #fff9ed; border: 1px solid #f1e1b6; border-left: 4px solid #edb837; border-radius: 14px; }
.dictation-date-box { color: #946614; }
.dictation-title { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 15px; font-weight: 850; }
.dictation-title .event-icon { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 8px; }
.dictation-title .event-icon svg { width: 17px; height: 17px; }
.dictation-note, .calendar-meta { color: #566983; font-size: 12px; font-weight: 650; }
.source-chip { color: #77520b; background: #ffedbb; }
.calendar-month-heading { margin: 14px 2px 4px; padding-bottom: 8px; color: #1656b3; border-bottom: 2px solid #d9e8ff; font-size: 14px; font-weight: 850; }
.calendar-month-heading:first-child { margin-top: 2px; }
.calendar-event { min-height: 86px; padding: 12px; background: #fff; border: 1px solid #dce6f5; border-left: 5px solid #1763dc; border-radius: 14px; }
.calendar-event.type-holiday { background: #f0fbf7; }
.calendar-event.type-exam { background: #fff3f4; }
.calendar-event.type-family { background: #f7f3ff; }
.calendar-event.type-activity { background: #fff9ec; }
.event-date-box { align-self: start; padding: 6px 3px; color: #134eae; background: #e6f0ff; border-radius: 10px; }
.event-date-box strong { font-size: 22px; }
.calendar-event-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; font-weight: 850; }
.calendar-event-title .event-icon { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 8px; }
.calendar-event-title .event-icon svg { width: 17px; height: 17px; }
.calendar-countdown { color: #704b07; background: #fff0c2; }
.calendar-actions { gap: 7px; margin-top: 9px; }
.calendar-actions a, .calendar-actions button, .calendar-actions .calendar-icon-button { min-height: 42px; color: #1156b6; background: #f6faff; border-color: #c8ddf7; border-radius: 10px; font-size: 12px; font-weight: 800; }
.calendar-actions button:not(.calendar-icon-button) { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.action-glyph { display: inline-grid; place-items: center; width: 17px; height: 17px; }
.action-glyph svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.calendar-actions .calendar-icon-button { width: 42px; height: 42px; }
.calendar-menu { flex-basis: 42px; }
.calendar-actions .preview-notice-image { color: #9d2d76; background: #fff1f8; border-color: #f1c9e4; }
.notice-editor { background: #edf5ff; border-color: #c7dfff; }
.notice-editor label, .dictation-form label, .notice-dialog-content label { color: #435c7a; font-size: 12px; font-weight: 800; }
.notice-editor input, .notice-editor select, .dictation-form input, .dictation-form select, .notice-dialog-content input { min-height: 44px; font-size: 14px; border-color: #cbdaf0; }
.notice-dialog { width: min(94vw, 540px); max-height: 88vh; overflow-y: auto; border-radius: 20px; }
.notice-dialog-content { padding: 22px; gap: 15px; }
.notice-dialog-content h3 { font-size: 20px; }
.entry-dialog .dictation-form { grid-template-columns: repeat(10,minmax(0,1fr)); }
.entry-dialog .field-category { grid-column: span 4; }
.entry-dialog .field-date { grid-column: span 6; }
.entry-dialog .field-note { grid-column: span 7; }
.entry-dialog .field-password { grid-column: span 3; }
.entry-dialog .dictation-form > .primary-small { grid-column: 1/-1; }
.text-button, .danger-button { min-height: 42px; font-size: 12px; font-weight: 800; }
.preview-heading button { width: 42px; height: 42px; }

.checklist-heading { min-height: 286px; }
.checklist-heading .page-art { width: min(60%, 275px); height: 235px; right: -13px; bottom: 34px; }
.checklist-heading .page-heading-copy { max-width: 60%; }
.checklist-progress-line { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 18px; display: flex; align-items: center; gap: 12px; }
.checklist-progress-track { flex: 1; height: 13px; overflow: hidden; background: rgba(255,255,255,.35); border-radius: 999px; }
.checklist-progress-track span { display: block; width: 0; height: 100%; background: #ffdc4e; border-radius: inherit; transition: width .25s ease; }
.checklist-progress-line .progress-badge { min-width: 48px; margin: 0; color: #103e89; background: #fff; font-size: 13px; }
.checklist-panel { padding: 16px; }
.checklist { gap: 9px; }
.check-item { min-height: 68px; padding: 10px 12px; background: #fff; border: 1px solid #dce6f5; border-radius: 15px; box-shadow: 0 3px 9px rgba(13,48,112,.04); }
.check-item.done { background: #f6faff; }
.check-item input { flex: 0 0 26px; width: 26px; height: 26px; accent-color: #1763dc; }
.check-item label { display: flex; align-items: center; gap: 10px; color: #10234e; font-size: 16px; font-weight: 800; }
.check-item.done label { color: #405b80; text-decoration: none; }
.check-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; color: #1763dc; background: #e8f2ff; border-radius: 10px; }
.delete-item { min-width: 40px; min-height: 40px; color: #6c7d97; }
.add-item-form input, .add-item-form button { min-height: 48px; }
.add-item-form button { width: 48px; background: #1763dc; }

.bottom-nav {
  padding: 9px 12px calc(10px + env(safe-area-inset-bottom));
  color: #fff;
  background: #102f67;
  border: 0;
  border-radius: 23px 23px 0 0;
  box-shadow: 0 -8px 22px rgba(10,39,91,.16);
}
.nav-item { position: relative; min-height: 60px; align-content: center; gap: 4px; color: #dbe9ff; border-radius: 12px; }
.nav-item.active { color: #ffdc4e; background: rgba(255,255,255,.07); }
.nav-item.active::after { content: ""; position: absolute; left: 34%; right: 34%; bottom: 1px; height: 3px; background: #ffdc4e; border-radius: 999px; }
.nav-item .nav-icon { display: grid; place-items: center; width: 25px; height: 25px; filter: none; opacity: 1; }
.nav-item .nav-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-item small { font-size: 12px; font-weight: 850; }
.toast { bottom: 84px; }

@media (min-width: 720px) {
  .topbar { padding: 16px 30px; }
  .app-main { padding: 17px 30px 30px; }
  .hero-card, .illustrated-heading { margin-left: 0; margin-right: 0; border-radius: 30px; }
  .hero-card { min-height: 245px; padding: 28px 30px; }
  .hero-art { right: 40px; top: -8px; width: 330px; height: 280px; }
  .illustrated-heading { min-height: 240px; padding: 28px 30px; }
  .page-art { right: 35px; width: 300px; height: 250px; }
  .checklist-heading { min-height: 270px; }
  .checklist-heading .page-art { right: 32px; width: 320px; height: 260px; bottom: 20px; }
  .checklist-progress-line { left: 30px; right: auto; width: min(55%, 460px); }
  .quick-grid { gap: 14px; }
  .status-card { min-height: 145px; padding: 20px; }
  .schedule-row { grid-template-columns: 92px minmax(0,1fr); }
  .two-column { grid-template-columns: 1.35fr .85fr; }
  .bottom-nav { border-radius: 23px 23px 0 0; }
}
@media (max-width: 520px) {
  .brand-copy h1 { font-size: 16px; }
  .install-btn { font-size: 11px; padding-inline: 8px; }
  .section-heading h3 { font-size: 19px; }
  .quick-grid { gap: 8px; }
  .status-card { padding: 12px; }
  .card-icon { flex-basis: 33px; width: 33px; height: 33px; }
  .card-icon svg { width: 21px; height: 21px; }
  .calendar-event { grid-template-columns: 45px minmax(0,1fr); gap: 10px; }
  .calendar-event .event-date-box strong { font-size: 20px; }
}
@media (max-width: 370px) {
  .brand-copy h1 { font-size: 14px; white-space: nowrap; }
  .brand-copy h1 span { display: none; }
  .hero-card { min-height: 240px; }
  .hero-art { width: 55%; right: -30px; top: 17px; }
  .status-card { min-height: 168px; }
  .card-label { font-size: 12px; }
  .big-value { font-size: 17px; }
  .illustrated-heading .page-heading-copy { max-width: 62%; }
  .page-art { width: 50%; }
  .add-notice-trigger { padding: 8px 9px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  .checklist-progress-track span { transition: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
