:root {
  --ink: #213849;
  --muted: #708797;
  --line: #dce8ed;
  --paper: #f7fbfc;
  --card: #ffffff;
  --blue: #5e8fb1;
  --blue-dark: #356983;
  --mint: #71b4a2;
  --mint-soft: #e4f3ee;
  --yellow: #f5c970;
  --yellow-soft: #fff5dc;
  --shadow: 0 10px 30px rgba(58, 94, 111, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; color: var(--ink); background: linear-gradient(180deg, #eff8fa 0, var(--paper) 285px); min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100%, 760px); margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 18px calc(30px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 0 22px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; color: #fff; background: var(--blue); border-radius: 14px; font-size: 23px; box-shadow: 0 8px 15px rgba(94, 143, 177, .25); }
.eyebrow, .section-kicker { margin: 0 0 2px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 22px; line-height: 1.05; letter-spacing: -.03em; }
.grade-pill { margin-left: auto; padding: 8px 11px; color: var(--blue-dark); background: #e1f0f3; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 139px; padding: 24px; margin-bottom: 17px; color: #fff; background: linear-gradient(120deg, #5f91ad, #77b8a6); border-radius: 25px; box-shadow: var(--shadow); overflow: hidden; }
.welcome h2 { margin: 7px 0 6px; font-size: clamp(25px, 7vw, 34px); line-height: 1; letter-spacing: -.05em; }
.welcome .eyebrow { color: rgba(255,255,255,.76); }
.welcome-copy { max-width: 270px; margin: 0; color: rgba(255,255,255,.88); font-size: 13px; line-height: 1.45; }
.welcome-icon { display: grid; place-items: center; flex: 0 0 72px; width: 72px; height: 72px; font-size: 36px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.2); border-radius: 25px; transform: rotate(6deg); }
.search-wrap { position: relative; display: flex; align-items: center; margin-bottom: 29px; }
.search-wrap input { width: 100%; height: 52px; padding: 0 45px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 17px; outline: none; box-shadow: 0 7px 18px rgba(64, 94, 110, .06); transition: border-color .2s, box-shadow .2s; }
.search-wrap input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(94,143,177,.12); }
.search-icon { position: absolute; left: 17px; color: var(--blue); font-size: 28px; line-height: 1; transform: rotate(-20deg); pointer-events: none; }
.icon-button { position: absolute; right: 11px; width: 30px; height: 30px; color: var(--muted); background: #eef5f6; border: 0; border-radius: 50%; font-size: 21px; line-height: 1; }
.section-block { margin-bottom: 34px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.04em; }
.count-badge { display: grid; place-items: center; min-width: 27px; height: 27px; padding: 0 8px; color: var(--blue-dark); background: #deeff2; border-radius: 9px; font-size: 12px; font-weight: 800; }
.lesson-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lesson-card { position: relative; display: flex; min-height: 166px; flex-direction: column; justify-content: space-between; padding: 17px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 8px 24px rgba(64, 94, 110, .05); overflow: hidden; }
.lesson-card::after { content: ""; position: absolute; right: -22px; top: -26px; width: 72px; height: 72px; background: var(--accent-soft); border-radius: 50%; }
.lesson-top { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.lesson-icon { display: grid; place-items: center; width: 37px; height: 37px; color: var(--accent); background: var(--accent-soft); border-radius: 12px; font-size: 19px; }
.lesson-tag { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.lesson-card h3 { position: relative; z-index: 1; margin: 16px 0 2px; font-size: 16px; line-height: 1.16; letter-spacing: -.025em; }
.lesson-subtitle { position: relative; z-index: 1; margin: 0; color: var(--muted); font-size: 12px; }
.open-button { position: relative; z-index: 1; align-self: flex-start; margin-top: 13px; padding: 8px 11px; color: var(--accent); background: var(--accent-soft); border: 0; border-radius: 10px; font-size: 11px; font-weight: 800; }
.open-button:active, .primary-button:active, .upload-button:active { transform: scale(.97); }
.empty-state { padding: 23px 10px; margin: 0; color: var(--muted); text-align: center; font-size: 13px; }
.task-form { display: grid; grid-template-columns: 1fr; gap: 9px; padding: 15px; background: var(--card); border: 1px solid var(--line); border-radius: 19px; box-shadow: 0 7px 20px rgba(64, 94, 110, .05); }
.task-form input, .task-form select { width: 100%; height: 43px; padding: 0 12px; color: var(--ink); background: #f8fbfb; border: 1px solid var(--line); border-radius: 11px; outline: 0; }
.task-form input:focus, .task-form select:focus { border-color: var(--blue); }
.primary-button { height: 43px; padding: 0 15px; color: #fff; background: var(--blue-dark); border: 0; border-radius: 11px; font-size: 13px; font-weight: 800; }
.search-add { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 11px 13px; margin-top: 10px; color: var(--muted); background: var(--yellow-soft); border: 1px solid #f5e2ae; border-radius: 13px; font-size: 12px; }
.text-button { padding: 0; color: #9a6d16; background: transparent; border: 0; font-size: 12px; font-weight: 800; white-space: nowrap; }
.task-list { display: grid; gap: 9px; padding: 0; margin: 13px 0 0; list-style: none; }
.task-item { display: flex; align-items: center; gap: 10px; padding: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 15px; }
.task-item.done { opacity: .63; background: #f4faf8; }
.task-check { flex: 0 0 auto; width: 25px; height: 25px; padding: 0; color: var(--blue-dark); background: #edf6f4; border: 1px solid #c7e1d9; border-radius: 8px; font-size: 15px; }
.task-item.done .task-check { color: #fff; background: var(--mint); }
.task-content { min-width: 0; flex: 1; }
.task-text { display: block; overflow-wrap: anywhere; font-size: 14px; line-height: 1.3; }
.task-item.done .task-text { text-decoration: line-through; }
.task-subject { display: inline-block; margin-top: 5px; color: var(--blue-dark); font-size: 10px; font-weight: 800; }
.delete-task { flex: 0 0 auto; padding: 5px; color: #a4b2b8; background: transparent; border: 0; font-size: 18px; }
.footer-note { padding: 3px 0 0; color: #9aadb5; text-align: center; font-size: 11px; }
.sheet-backdrop, .viewer-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; align-items: end; background: rgba(26, 50, 62, .4); backdrop-filter: blur(4px); }
.sheet { position: relative; width: min(100%, 560px); padding: 28px 22px calc(25px + env(safe-area-inset-bottom)); margin: 0 auto; text-align: center; background: #fff; border-radius: 27px 27px 0 0; box-shadow: 0 -12px 35px rgba(20, 50, 65, .17); }
.sheet-icon { display: grid; place-items: center; width: 51px; height: 51px; margin: 0 auto 12px; background: #e5f3ef; border-radius: 16px; font-size: 25px; }
.sheet h2 { margin-bottom: 7px; font-size: 21px; letter-spacing: -.03em; }
.sheet p { max-width: 340px; margin: 0 auto 18px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.sheet-close { position: absolute; top: 14px; right: 16px; width: 31px; height: 31px; color: var(--muted); background: #f0f5f6; border: 0; border-radius: 50%; font-size: 21px; }
.upload-button { display: inline-flex; align-items: center; justify-content: center; min-height: 45px; padding: 0 22px; color: #fff; background: var(--blue-dark); border-radius: 12px; font-size: 13px; font-weight: 800; cursor: pointer; }
.upload-status { min-height: 18px; margin: 10px auto 0 !important; color: var(--blue-dark) !important; font-size: 12px !important; }
.viewer-backdrop { align-items: stretch; background: #17303d; }
.viewer { display: flex; width: min(100%, 1000px); height: 100%; flex-direction: column; margin: 0 auto; background: #edf3f5; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: max(8px, env(safe-area-inset-top)) 13px 8px; color: #fff; background: var(--blue-dark); }
.viewer-bar h2 { margin: 0; font-size: 16px; }
.viewer-close { padding: 8px 11px; color: #fff; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); border-radius: 9px; font-size: 12px; }
#pdf-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 20; max-width: calc(100% - 36px); padding: 11px 15px; color: #fff; background: #244b5c; border-radius: 12px; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translate(-50%, 15px); transition: opacity .25s, transform .25s; pointer-events: none; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.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; }
[hidden] { display: none !important; }
@media (min-width: 560px) { .task-form { grid-template-columns: 1fr 170px auto; align-items: center; } .primary-button { white-space: nowrap; } }
@media (max-width: 380px) { .app-shell { padding-left: 14px; padding-right: 14px; } .lesson-list { gap: 9px; } .lesson-card { padding: 13px; } .lesson-card h3 { font-size: 14px; } .welcome { padding: 19px; } .welcome-icon { flex-basis: 59px; width: 59px; height: 59px; font-size: 28px; } }


.schedule-card {
  display: block; width: 100%; padding: 0; margin: 0; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 8px 24px rgba(64, 94, 110, .05); text-align: left;
}
.schedule-thumb {
  display: block; width: 100%; height: auto; max-height: 220px; object-fit: cover; object-position: top center;
}
.schedule-hint {
  display: block; padding: 10px 14px 12px; color: var(--muted); font-size: 12px; font-weight: 700;
}
.schedule-viewer { background: #111; }
.schedule-scroll {
  flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom;
  display: flex; align-items: flex-start; justify-content: center; padding: 8px;
}
.schedule-full {
  width: 100%; max-width: 1200px; height: auto; border-radius: 8px;
}
