@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap');

:root {
  font-family: 'Noto Sans KR', sans-serif;
  color: #23354b;
  background: #f5f7fa;
  font-synthesis: none;
  --ink: #23354b;
  --blue: #304f78;
  --muted: #596b7e;
  --line: #dce3eb;
  --teal: #286858;
  --surface: #fff;
  --soft: #edf2f8;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.75; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid #527faf; outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { word-break: keep-all; overflow-wrap: anywhere; }
p { line-height: 1.9; }
h1 { font-family: inherit; font-weight: 700; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.5; letter-spacing: -1.2px; margin: 14px 0; }
h2 { font-size: 23px; line-height: 1.5; letter-spacing: -.6px; }
h3 { font-size: 17px; line-height: 1.6; }
.header { max-width: 1240px; padding: 24px 36px; display: flex; align-items: center; justify-content: space-between; margin: auto; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; letter-spacing: -.6px; }
.brand-mark { background: var(--ink); color: white; width: 42px; height: 46px; border-radius: 8px 8px 18px 8px; display: grid; place-items: center; font-size: 26px; }
.brand small { display: block; font-size: 10px; line-height: 1.5; letter-spacing: 2.5px; font-weight: 600; margin-top: 3px; color: var(--muted); }
nav { display: flex; gap: 8px; font-size: 15px; color: var(--muted); }
nav a { padding: 10px 18px; border-radius: 10px; transition: background .2s, color .2s; }
nav a:hover { background: var(--soft); color: var(--ink); }
nav a.active { color: var(--blue); background: #e7edf5; font-weight: 700; }
.button { border: 1px solid transparent; border-radius: 10px; min-height: 48px; padding: 12px 22px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--blue); color: white; font-weight: 600; font-size: 15px; line-height: 1.6; text-align: center; transition: background .2s, box-shadow .2s; }
.button:hover:not(:disabled) { background: #233e61; box-shadow: 0 3px 10px #23354b14; }
.button-outline { border-color: #c9d3df; background: var(--surface); color: var(--ink); padding: 10px 18px; }
.button-outline:hover:not(:disabled) { background: var(--soft); }
.button-quiet { background: var(--soft); color: var(--blue); }
.button-quiet:hover:not(:disabled) { background: #dfe8f3; }
main { max-width: 1168px; margin: 36px auto 72px; min-height: 60vh; }
.eyebrow { font-size: 13px; letter-spacing: .09em; font-weight: 700; color: var(--blue); }
.muted { color: var(--muted); font-size: 16px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 36px; gap: 24px; }
.intro p { margin-bottom: 0; max-width: 42em; word-break: keep-all; overflow-wrap: anywhere; }
.date-note { font-size: 13px; color: var(--muted); white-space: nowrap; padding-bottom: 4px; }
.today-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 24px; align-items: stretch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 4px 24px #23354b04; }
.lesson-card { padding: 28px; }
.lesson-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.day-tag { color: var(--blue); background: var(--soft); border-radius: 6px; padding: 4px 10px; font-weight: 700; letter-spacing: .07em; font-variant-numeric: tabular-nums; }
.thumbnail { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: #e0e6ef; }
.thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.thumbnail:hover img, .video-card:hover img { transform: scale(1.025); }
.play { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(transparent 50%, #0005); }
.play svg { width: 64px; height: 64px; filter: drop-shadow(0 2px 10px #0004); }
.lesson-title { font-size: 23px; line-height: 1.65; margin: 22px 0 10px; letter-spacing: -.5px; }
.lesson-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); gap: 14px; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 500; color: var(--blue); text-decoration: underline; text-underline-offset: 5px; text-decoration-color: #9bacc1; }
.text-link:hover { text-decoration-color: currentColor; }
.stamp-card { padding: 30px; display: flex; flex-direction: column; align-items: center; text-align: center; background: #f9fbfd; }
.stamp-card .eyebrow { align-self: flex-start; font-size: 12px; letter-spacing: .13em; }
.stamp-circle { width: 156px; height: 156px; flex-shrink: 0; border: 1px dashed #9aadc2; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-direction: column; margin: 26px 0 24px; color: #536f8e; gap: 8px; position: relative; background: #f0f4f9; box-shadow: 0 0 0 8px #f4f7fb; }
.stamp-circle svg { width: 34px; height: 34px; }
.stamp-circle span { font-family: inherit; font-size: 17px; font-weight: 700; }
.stamp-circle.done { border: 3px double var(--teal); color: var(--teal); transform: rotate(-10deg); background: #edf6f1; box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 6px #347a7044; }
.stamp-circle.done small { font-size: 12px; letter-spacing: 1px; }
.stamp-circle.animate { animation: stamp .5s cubic-bezier(.2,.8,.3,1); }
@keyframes stamp { 0% { transform: scale(1.5) rotate(-22deg); opacity: 0; } 70% { transform: scale(.94) rotate(-10deg); } 100% { transform: scale(1) rotate(-10deg); } }
.stamp-card .button { width: 100%; }
.stamp-card h2 { font-family: inherit; font-weight: 700; font-size: 22px; margin-bottom: 12px; }
.stamp-card p { font-size: 15px; color: var(--muted); }
.check-label { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 15px; margin-bottom: 16px; min-height: 44px; line-height: 1.8; cursor: pointer; }
.check-label input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--blue); }
.stats-strip { display: grid; grid-template-columns: repeat(3, 1fr); padding: 26px 0; margin: 32px 0; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.stat { padding: 0 32px; border-right: 1px solid var(--line); display: flex; align-items: baseline; gap: 14px; }
.stat:first-child { padding-left: 4px; }
.stat:last-child { border: 0; }
.stat strong { font-size: 30px; line-height: 1.4; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.stat strong small { font-size: 15px; font-weight: 400; letter-spacing: 0; }
.stat span { font-size: 14px; color: var(--muted); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 36px 0 18px; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 21px; }
.thumb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.video-card { display: block; min-width: 0; border-radius: 10px; }
.video-meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--blue); }
.video-meta > span { font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.video-title { display: block; margin-top: 5px; font-size: 15px; font-weight: 500; line-height: 1.75; word-break: keep-all; overflow-wrap: anywhere; }
.video-card:hover .video-title { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
.video-duration { position: absolute; bottom: 8px; right: 8px; background: #172b46eF; color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.thumb-stamp { position: absolute; left: 8px; top: 8px; background: #edf7f3; color: var(--teal); border: 1px solid var(--teal); border-radius: 5px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.note { font-size: 14px; line-height: 1.85; color: var(--muted); margin-top: 24px; }
.stamp-card .note { font-size: 13px; margin-bottom: 0; }
#next-video { margin-top: 18px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0; }
.filters input { flex: 1; min-width: 170px; }
.filters input, .filters select { border: 1px solid #c9d3df; background: white; border-radius: 10px; min-height: 48px; padding: 12px 16px; color: var(--ink); font-size: 16px; }
.filters input::placeholder { color: var(--muted); opacity: 1; }
.empty { padding: 46px 24px; text-align: center; color: var(--muted); }
.record-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; }
.calendar-card, .settings-card { padding: 28px; }
.calendar-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.calendar-top h2 { margin: 0; font-size: 21px; }
.icon-button { background: white; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; font-size: 24px; color: var(--ink); }
.icon-button:hover { background: var(--soft); }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.weekday { text-align: center; font-size: 14px; color: var(--muted); padding-bottom: 12px; }
.calendar-day { min-height: 60px; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; font-size: 14px; gap: 5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.calendar-day.today { background: var(--soft); box-shadow: inset 0 0 0 1px #bacbe0; color: var(--blue); font-weight: 700; }
.calendar-day.attended { background: #edf7f3; color: var(--teal); }
.mini-stamp { width: 28px; height: 28px; border: 2px double var(--teal); border-radius: 50%; display: grid; place-items: center; transform: rotate(-12deg); font-size: 15px; }
.settings-card p { font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.setting { padding: 22px 0; border-bottom: 1px solid var(--line); }
.setting:first-of-type { padding-top: 0; }
.setting .button { font-size: 14px; padding: 10px 16px; }
.danger { color: #963c3c; border: 0; background: none; padding: 10px 0; min-height: 44px; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.progress-line { height: 6px; background: var(--soft); border-radius: 9px; margin-top: 12px; overflow: hidden; }
.progress-line div { height: 100%; background: var(--blue); border-radius: 9px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 32px; font-size: 15px; }
.privacy { max-width: 720px; }
.privacy h2 { margin-top: 36px; }
.privacy p { font-size: 16px; color: var(--muted); }
footer { max-width: 1168px; margin: auto; padding: 28px 0 36px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); }
footer a { text-decoration: underline; text-underline-offset: 4px; }
dialog { border: 1px solid var(--line); border-radius: 20px; padding: 44px 28px 32px; max-width: 420px; width: calc(100% - 32px); text-align: center; color: var(--ink); box-shadow: 0 24px 100px #172b4633; }
dialog::backdrop { background: #12243f80; backdrop-filter: blur(4px); }
dialog h2 { font-family: inherit; font-size: 28px; margin: 18px 0; }
dialog p { font-size: 16px; color: var(--muted); }
dialog small { display: block; font-size: 13px; line-height: 1.9; color: var(--muted); margin-top: 24px; }
dialog small a { text-decoration: underline; text-underline-offset: 3px; }
.dialog-close { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; font-size: 28px; color: var(--muted); }
#google-signin { display: flex; justify-content: center; }
#toast { position: fixed; bottom: 36px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 14px 24px; border-radius: 12px; box-shadow: 0 5px 20px #172b4620; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; max-width: calc(100% - 32px); width: max-content; font-size: 15px; }
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
.loading { text-align: center; padding: 100px 20px; color: var(--muted); }
.skip { position: fixed; left: 16px; top: -100px; z-index: 50; padding: 12px; background: white; }
.skip:focus { top: 16px; }
.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; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 16px; border-bottom: 1px solid var(--line); }
.table-scroll { overflow-x: auto; }
.account-note { margin-bottom: 18px; font-size: 15px; color: var(--muted); }
::selection { background: #dce7f4; color: var(--ink); }
@media (max-width: 1240px) {
  main, footer { margin-left: 36px; margin-right: 36px; }
  .intro { align-items: flex-start; flex-direction: column; gap: 16px; }
}
@media (max-width: 960px) and (min-width: 761px) {
  .today-layout { grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); gap: 20px; }
  .lesson-card, .stamp-card { padding: 22px; }
  .thumb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { display: block; }
  .stat span { display: block; margin-top: 4px; }
}
@media (max-width: 760px) {
  .header { padding: 20px; gap: 12px; }
  .brand { font-size: 17px; }
  .brand-mark { width: 36px; height: 42px; }
  nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: #fffffff5; backdrop-filter: blur(12px); justify-content: space-around; gap: 4px; border-top: 1px solid var(--line); padding: 8px 12px max(8px, env(safe-area-inset-bottom)); }
  nav a { flex: 1; text-align: center; padding: 12px 4px; font-size: 14px; }
  .header > .button { font-size: 14px; padding: 8px 14px; min-height: 44px; }
  main { margin: 24px 20px 48px; }
  h1 { font-size: clamp(28px, 6.8vw, 34px); letter-spacing: -.9px; }
  .intro { margin-bottom: 28px; gap: 12px; }
  .intro p { font-size: 15px; }
  .date-note { font-size: 12px; white-space: normal; }
  .today-layout, .record-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .lesson-card { padding: 20px; }
  .lesson-title { font-size: 21px; }
  .lesson-meta { font-size: 13px; }
  .lesson-actions { gap: 12px; margin-top: 20px; padding-top: 18px; }
  .lesson-actions .button { padding: 12px 16px; }
  .stamp-card { padding: 28px 24px; }
  .stamp-circle { margin: 26px 0; width: 148px; height: 148px; }
  .stamp-card .eyebrow { align-self: center; }
  .stats-strip { margin: 28px 0; padding: 22px 0; }
  .stat { display: block; padding: 0 12px; }
  .stat strong { font-size: 26px; }
  .stat span { display: block; margin-top: 6px; font-size: 13px; }
  .stat strong small { font-size: 13px; }
  .thumb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .video-title { font-size: 14px; line-height: 1.8; }
  .section-heading h2 { font-size: 20px; }
  .calendar-card, .settings-card { padding: 20px; }
  .calendar { gap: 3px; }
  .calendar-day { min-height: 44px; font-size: 13px; }
  .mini-stamp { width: 23px; height: 23px; font-size: 13px; }
  footer { margin: 0 20px; padding-bottom: calc(112px + env(safe-area-inset-bottom)); display: block; line-height: 2.2; }
  footer > span { display: block; }
  .filters { gap: 10px; }
  .filters input { flex-basis: 100%; min-width: 0; }
  .filters select { flex: 1; min-width: 0; padding: 12px 10px; }
  #toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  main { margin-inline: 16px; }
  .lesson-card { padding: 16px; }
  .lesson-actions { flex-direction: column; align-items: stretch; }
  .lesson-actions .text-link { justify-content: center; }
  .stat { padding-inline: 8px; }
  .stat span { font-size: 12px; }
  .calendar-card { padding: 16px; }
  .calendar-day { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
