:root {
  --ink: #13243d;
  --muted: #6e7d93;
  --line: #e3eaf3;
  --paper: #ffffff;
  --sky: #f4fbff;
  --blue: #1464e8;
  --blue-soft: #e9f1ff;
  --yellow: #ffd84d;
  --yellow-soft: #fff6cf;
  --coral: #ff6b62;
  --coral-soft: #fff0ee;
  --green: #49bb73;
  --green-soft: #e8f8ee;
  --purple: #8c68e8;
  --purple-soft: #f0eaff;
  --pink: #f08ebd;
  --pink-soft: #fff0f7;
  --shadow: 0 12px 30px rgba(43, 76, 125, .09);
  --radius: 22px;
  font-family: "Arial Rounded MT Bold", "PingFang HK", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--sky);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--sky); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 88% 3%, #fff2a7 0 6rem, transparent 6.1rem), var(--sky); }
button, input { font: inherit; }
button { cursor: pointer; border: 0; }
.app-shell { width: min(100%, 1100px); margin: 0 auto; min-height: 100vh; padding-bottom: 90px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 18px 12px; position: sticky; top: 0; z-index: 5; background: rgba(244,251,255,.9); backdrop-filter: blur(12px); }
.brand-mark { flex: 0 0 50px; width: 50px; height: 50px; display: grid; place-items: center; overflow: hidden; background: #fff; border: 3px solid var(--yellow); border-radius: 15px; box-shadow: 0 5px 0 #a8c8ff; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-copy { min-width: 0; }
.eyebrow, .section-kicker { margin: 0 0 3px; font-size: 11px; letter-spacing: .12em; font-weight: 900; color: var(--blue); }
.brand-copy h1 { margin: 0; font-size: clamp(20px, 5vw, 30px); letter-spacing: -.04em; line-height: 1.08; }
.brand-copy h1 span { color: var(--coral); }
.install-btn { margin-left: auto; padding: 10px 13px; color: #fff; background: var(--blue); border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; box-shadow: 0 4px 0 #0c4aa9; }
.install-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #0c4aa9; }
.app-main { padding: 4px 16px 20px; }
.view { display: none; animation: lift .22s ease-out; }
.view.active { display: block; }
@keyframes lift { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.closure-indicator { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; padding: 15px; margin: 6px 0 14px; background: #fff; border: 2px solid var(--line); border-radius: 21px; box-shadow: var(--shadow); }
.closure-lamp { width: 44px; height: 44px; display: grid; place-items: center; background: #eef2f7; border-radius: 50%; }
.closure-lamp span { width: 23px; height: 23px; display: block; background: #aeb8c5; border: 4px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px rgba(19,36,61,.1); }
.closure-copy { min-width: 0; }
.closure-copy .section-kicker { margin-bottom: 2px; }
.closure-copy h2 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.closure-copy p:not(.section-kicker) { margin: 4px 0 0; font-size: 12px; line-height: 1.4; font-weight: 700; }
.closure-update { color: var(--muted); font-size: 11px !important; }
.closure-actions { grid-column: 1 / -1; display: flex; gap: 8px; padding-left: 60px; }
.closure-actions button, .closure-actions a { display: inline-flex; align-items: center; justify-content: center; padding: 7px 9px; color: var(--blue); background: var(--blue-soft); border: 1px solid #c9ddff; border-radius: 9px; font-size: 11px; font-weight: 900; text-decoration: none; }
.closure-actions button { cursor: pointer; }
.closure-indicator.status-safe { border-color: #b8e6c7; background: linear-gradient(120deg, #f6fff8, #fff); }
.closure-indicator.status-safe .closure-lamp { background: var(--green-soft); }.closure-indicator.status-safe .closure-lamp span { background: var(--green); box-shadow: 0 0 0 2px #b5e8c6, 0 0 17px rgba(73,187,115,.55); }
.closure-indicator.status-alert { border-color: #ffb4ae; background: linear-gradient(120deg, #fff4f2, #fff); }.closure-indicator.status-alert .closure-lamp { background: var(--coral-soft); }.closure-indicator.status-alert .closure-lamp span { background: var(--coral); box-shadow: 0 0 0 2px #ffb4ae, 0 0 18px rgba(255,107,98,.68); animation: lampPulse 1.15s infinite alternate; }
.closure-indicator.status-caution { border-color: #ffe18a; background: linear-gradient(120deg, #fffaf0, #fff); }.closure-indicator.status-caution .closure-lamp { background: var(--yellow-soft); }.closure-indicator.status-caution .closure-lamp span { background: #f3ad00; box-shadow: 0 0 0 2px #ffe18a, 0 0 15px rgba(255,216,77,.6); }
@keyframes lampPulse { from { transform: scale(.92); } to { transform: scale(1.08); } }
.hero-card { display: flex; align-items: center; justify-content: space-between; min-height: 142px; padding: 24px; margin: 10px 0 14px; color: var(--ink); background: linear-gradient(125deg, #fff2a8, #ffe16a 55%, #ffd34b); border-radius: 28px; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.hero-card::after { content: "✦  ✧  ✦"; position: absolute; right: 15px; top: 15px; font-size: 20px; color: rgba(255,255,255,.8); letter-spacing: 7px; }
.hero-kicker { margin: 0 0 4px; font-size: 13px; font-weight: 900; }
.hero-card h2 { margin: 0; font-size: clamp(28px, 8vw, 48px); line-height: .98; letter-spacing: -.05em; }
.hero-subtitle { margin: 8px 0 0; font-size: 15px; font-weight: 800; }
.hero-sun { font-size: 66px; filter: drop-shadow(0 8px 0 rgba(255,163,29,.22)); transform: rotate(8deg); }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.status-card, .panel { background: var(--paper); border: 1px solid rgba(212,224,239,.75); border-radius: var(--radius); box-shadow: var(--shadow); }
.status-card { min-height: 162px; padding: 18px; position: relative; overflow: hidden; }
.status-card::after { content: ""; position: absolute; width: 85px; height: 85px; border-radius: 50%; right: -25px; bottom: -32px; opacity: .35; }
.current-card::after { background: var(--blue-soft); }
.next-card::after { background: var(--green-soft); }
.card-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 900; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 5px var(--coral-soft); }
.big-value { margin: 17px 0 5px; font-size: clamp(20px, 5vw, 31px); font-weight: 900; line-height: 1.1; letter-spacing: -.045em; }
.muted, .tiny-note { color: var(--muted); font-size: 13px; font-weight: 700; }
.countdown-pill, .count-badge, .progress-badge { display: inline-flex; align-items: center; justify-content: center; margin-top: 10px; padding: 5px 9px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 900; }
.tiny-note { margin-top: 18px; }
.panel { padding: 18px; margin-bottom: 14px; }
.panel-hint { margin: -5px 0 14px; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.45; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 13px; }
.section-heading h3 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.section-icon, .page-emoji { font-size: 29px; }
.count-badge { margin: 0; color: var(--ink); background: var(--yellow-soft); }
.schedule-list { display: grid; gap: 8px; }
.schedule-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 9px; align-items: center; min-height: 56px; }
.schedule-time { color: var(--muted); font-size: 12px; font-weight: 900; line-height: 1.1; }
.schedule-time span { display: block; margin-top: 3px; color: #97a4b6; font-size: 11px; font-weight: 700; }
.schedule-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: 15px; background: #f7f9fc; border: 1px solid transparent; }
.schedule-item.current { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); background: #fff; }
.schedule-item.done { opacity: .52; }
.schedule-icon { flex: 0 0 31px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; font-size: 18px; }
.schedule-title { min-width: 0; font-size: 15px; font-weight: 900; overflow-wrap: anywhere; }
.schedule-state { margin-left: auto; padding-left: 4px; color: var(--blue); font-size: 11px; font-weight: 900; white-space: nowrap; }
.tone-blue { background: var(--blue-soft); } .tone-coral { background: var(--coral-soft); } .tone-green { background: var(--green-soft); } .tone-yellow { background: var(--yellow-soft); } .tone-purple { background: var(--purple-soft); } .tone-pink { background: var(--pink-soft); }
.two-column { display: grid; gap: 14px; }
.event-stack, .calendar-list { display: grid; gap: 9px; }
.event-card { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 11px; background: #f8fafc; border-radius: 14px; }
.event-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--yellow-soft); font-size: 18px; }
.event-title { font-size: 14px; font-weight: 900; line-height: 1.25; }
.event-date { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.event-remaining { padding: 5px 7px; color: #fff; background: var(--coral); border-radius: 999px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.holiday-panel { background: linear-gradient(145deg, #eaf8ef, #fff); }
.holiday-countdown { margin: 12px 0 3px; color: var(--green); font-size: 35px; font-weight: 900; letter-spacing: -.05em; }
.holiday-name { font-size: 16px; font-weight: 900; }
.page-heading { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 14px 2px 17px; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.view-toggle { padding: 9px 11px; color: var(--blue); background: var(--blue-soft); border: 1px solid #c9ddff; border-radius: 12px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.view-toggle.active { color: #fff; background: var(--blue); border-color: var(--blue); }
.page-heading h2 { margin: 0; font-size: clamp(28px, 8vw, 40px); letter-spacing: -.05em; }
.page-heading p:not(.section-kicker) { margin: 5px 0 0; color: var(--muted); font-size: 14px; font-weight: 700; }
.week-day-tabs, .filter-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 1px 1px 14px; }
.week-day-tabs::-webkit-scrollbar, .filter-row::-webkit-scrollbar { display: none; }
.day-tab, .filter-chip { flex: 0 0 auto; padding: 10px 14px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; font-size: 13px; font-weight: 900; }
.day-tab strong { display: block; color: var(--ink); font-size: 17px; }
.day-tab.active, .filter-chip.active { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 4px 0 #b6d2ff; }
.day-tab.active strong { color: #fff; }
.filter-chip[data-type="holiday"].active { background: var(--green); border-color: var(--green); box-shadow: 0 4px 0 #b9e6c7; }
.filter-chip[data-type="exam"].active { background: var(--coral); border-color: var(--coral); box-shadow: 0 4px 0 #ffc3bd; }
.filter-chip[data-type="family"].active { background: var(--purple); border-color: var(--purple); box-shadow: 0 4px 0 #d8c8ff; }
.calendar-event { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; background: #f8fafc; border-radius: 16px; border-left: 5px solid var(--blue); }
.calendar-event.type-holiday { border-left-color: var(--green); background: var(--green-soft); }
.calendar-event.type-exam { border-left-color: var(--coral); background: var(--coral-soft); }
.calendar-event.type-family { border-left-color: var(--purple); background: var(--purple-soft); }
.calendar-event.type-activity { border-left-color: var(--yellow); background: var(--yellow-soft); }
.event-date-box { text-align: center; color: var(--blue); font-weight: 900; }
.event-date-box strong { display: block; font-size: 23px; line-height: 1; }
.event-date-box small { font-size: 11px; }
.calendar-event-title { font-size: 15px; font-weight: 900; line-height: 1.3; }
.calendar-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.calendar-countdown { padding: 4px 7px; color: var(--ink); background: rgba(255,255,255,.78); border-radius: 999px; }
.calendar-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.calendar-actions a, .calendar-actions button { padding: 6px 8px; color: var(--blue); background: rgba(255,255,255,.85); border: 1px solid #c9ddff; border-radius: 9px; font-size: 11px; font-weight: 900; text-decoration: none; }
.calendar-actions button { cursor: pointer; }
.dictation-form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.dictation-form label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 900; }
.dictation-form input, .dictation-form select { width: 100%; min-width: 0; padding: 10px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 11px; outline-color: var(--blue); font-size: 13px; }
.dictation-form .wide-field { grid-column: 1 / -1; }
.primary-small { grid-column: 1 / -1; padding: 11px; color: #fff; background: var(--blue); border-radius: 12px; font-size: 13px; font-weight: 900; }
.notification-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; padding: 8px 10px; color: #674d00; background: var(--yellow-soft); border-radius: 11px; font-size: 12px; font-weight: 900; }
.notification-row .text-button { margin: 0; }
.dictation-list { display: grid; gap: 8px; margin-top: 12px; }
.dictation-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; background: var(--pink-soft); border-radius: 13px; border-left: 4px solid var(--pink); }
.dictation-date-box { text-align: center; color: #bd477e; font-weight: 900; }
.dictation-date-box strong { display: block; font-size: 20px; line-height: 1; }
.dictation-date-box small { font-size: 10px; }
.dictation-title { font-size: 14px; font-weight: 900; }
.dictation-note { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.dictation-reminder { margin-top: 3px; color: var(--coral); font-size: 11px; font-weight: 900; }
.delete-dictation { padding: 4px 6px; color: #a5afbc; background: transparent; font-size: 18px; }
.tip-card { display: flex; align-items: center; gap: 10px; padding: 14px 16px; color: #674d00; background: var(--yellow-soft); border: 1px solid #ffe58a; border-radius: 18px; font-size: 13px; font-weight: 900; }
.overall-week[hidden] { display: none; }
.overall-week-grid { display: grid; grid-template-columns: repeat(5, minmax(152px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.overall-day { min-width: 152px; padding: 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; }
.overall-day-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 2px 2px 9px; }
.overall-day-heading strong { font-size: 17px; }
.overall-day-heading span { color: var(--muted); font-size: 11px; font-weight: 800; }
.overall-slot { display: grid; gap: 3px; padding: 8px 7px; margin-top: 6px; border-radius: 11px; background: #fff; border-left: 4px solid var(--blue); }
.overall-slot.break { background: var(--yellow-soft); border-left-color: var(--yellow); }
.overall-slot-title { font-size: 12px; font-weight: 900; line-height: 1.25; }
.overall-slot-time { color: var(--muted); font-size: 10px; font-weight: 800; }
.tip-card p { margin: 0; }
.checklist { display: grid; gap: 8px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: #f8fafc; border-radius: 14px; }
.check-item input { width: 20px; height: 20px; accent-color: var(--green); }
.check-item label { flex: 1; font-size: 15px; font-weight: 800; }
.check-item.done label { color: var(--muted); text-decoration: line-through; }
.delete-item { padding: 3px 6px; color: #a5afbc; background: transparent; font-size: 19px; }
.add-item-form { display: flex; gap: 8px; margin-top: 12px; }
.add-item-form input { flex: 1; min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; outline-color: var(--blue); font-size: 14px; }
.add-item-form button { width: 45px; color: #fff; background: var(--blue); border-radius: 14px; font-size: 23px; }
.text-button { margin-top: 12px; padding: 5px 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 900; }
.bottom-nav { position: fixed; z-index: 10; left: 50%; bottom: 0; transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 1100px); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.95); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(43,76,125,.08); backdrop-filter: blur(12px); }
.nav-item { display: grid; justify-items: center; gap: 3px; color: #8190a3; background: transparent; padding: 2px 3px; border-radius: 12px; }
.nav-item span { font-size: 22px; line-height: 1; filter: grayscale(1); opacity: .75; }
.nav-item small { font-size: 11px; font-weight: 900; }
.nav-item.active { color: var(--blue); }
.nav-item.active span { filter: none; opacity: 1; }
.offline-note { margin: 4px 0 10px; padding: 8px 12px; color: #32623e; background: var(--green-soft); border-radius: 12px; font-size: 12px; font-weight: 800; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 86px; transform: translate(-50%, 15px); opacity: 0; pointer-events: none; padding: 10px 15px; color: #fff; background: var(--ink); border-radius: 999px; font-size: 13px; font-weight: 800; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.empty-state { padding: 22px 10px; color: var(--muted); text-align: center; font-size: 14px; font-weight: 800; }
.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; }
@media (min-width: 720px) {
  .topbar { padding: 24px 30px 16px; }
  .app-main { padding: 10px 30px 30px; }
  .two-column { grid-template-columns: 1.35fr .85fr; }
  .hero-card { min-height: 180px; padding: 32px; }
  .closure-indicator { grid-template-columns: 52px minmax(0, 1fr) auto; padding: 17px; }
  .closure-actions { grid-column: auto; padding-left: 0; align-self: center; }
  .hero-sun { font-size: 85px; }
  .schedule-row { grid-template-columns: 102px minmax(0, 1fr); }
  .schedule-item { padding: 12px 16px; }
  .dictation-form { grid-template-columns: 150px 170px 1fr auto; align-items: end; }
  .dictation-form .wide-field { grid-column: auto; }
  .primary-small { grid-column: auto; }
  .bottom-nav { border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; }
}
