:root {
  --ink: #162118;
  --muted: #6c756d;
  --paper: #f5f1e7;
  --card: #fffdf7;
  --line: #ded9cc;
  --lime: #d9ff57;
  --green: #345f3b;
  --orange: #ff7a45;
  --shadow: 0 14px 40px rgba(36, 48, 38, .1);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
.auth-gate { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 22px; background: var(--ink); }.auth-gate[hidden] { display: none; }.auth-card { width: min(100%, 430px); padding: 34px 26px; border-radius: 27px; background: var(--paper); text-align: center; box-shadow: var(--shadow); }.auth-logo { width: 64px; height: 64px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 20px; background: var(--lime); font: 800 36px Georgia, serif; }.auth-card h2 { margin: 6px 0 10px; font-family: Georgia, serif; font-size: 28px; }.auth-card > p:not(.eyebrow) { margin: 0 auto 22px; color: var(--muted); font-size: 13px; line-height: 1.65; }.auth-card form { display: grid; gap: 9px; }.auth-card form button { width: 100%; }.auth-card small { display: block; margin-top: 15px; color: var(--muted); font-size: 11px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100%, 680px); min-height: 100vh; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 20px calc(100px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0 0 3px; font-size: 10px; font-weight: 900; letter-spacing: .18em; color: var(--green); }
h1 { margin: 0; font-family: Georgia, serif; font-size: 26px; letter-spacing: -.04em; }
.icon-button, .close-button { border: 0; background: transparent; font-size: 25px; font-weight: 800; padding: 8px; }
.hero { margin: 28px 0 20px; border-radius: 28px; padding: 24px; min-height: 178px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; color: white; background: var(--ink); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.hero::before { content: ""; position: absolute; width: 220px; height: 220px; border: 42px solid rgba(217,255,87,.08); border-radius: 50%; right: -95px; top: -85px; }
.hero p { margin: 0 0 12px; color: #b9c1ba; font-size: 12px; }
.hero h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(24px, 7vw, 32px); line-height: 1.25; letter-spacing: -.04em; }
.progress-ring { flex: 0 0 82px; height: 82px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: conic-gradient(var(--lime) 0%, rgba(255,255,255,.14) 0); position: relative; }
.progress-ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--ink); }
.progress-ring strong, .progress-ring span { position: relative; z-index: 1; }
.progress-ring strong { font-size: 18px; }.progress-ring span { font-size: 9px; color: #b9c1ba; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px 4px; }
.stats div { display: grid; text-align: center; gap: 3px; border-right: 1px solid var(--line); }.stats div:last-child { border: 0; }
.stats strong { font-size: 21px; }.stats span { font-size: 10px; color: var(--muted); }
.day-selector { display: grid; grid-template-columns: 46px 1fr 46px; align-items: stretch; gap: 8px; margin-top: 12px; }.day-selector > button { border: 1px solid var(--line); border-radius: 15px; background: var(--card); font-weight: 900; }.day-selector label { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--lime); }.day-selector label span { font-size: 10px; font-weight: 800; color: var(--green); }.day-selector select { grid-row: 2; border: 0; padding: 0; background: transparent; font-family: Georgia, serif; font-size: 20px; font-weight: 800; outline: 0; }.day-selector small { grid-row: 1 / span 2; grid-column: 2; color: var(--muted); font-size: 10px; }
.mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 25px 0 18px; border-bottom: 1px solid var(--line); }
.mode-tabs button { border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 12px 4px; color: var(--muted); font-weight: 800; font-size: 13px; }
.mode-tabs button.active { color: var(--ink); border-color: var(--ink); }
.view { display: none; }.view.active { display: block; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.search-row { display: flex; gap: 8px; }.search-box { flex: 1; display: flex; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; padding: 13px 0; }
.filter-button { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 0 14px; font-size: 12px; font-weight: 800; }
.word-list { display: grid; gap: 10px; margin-top: 14px; }
.word-item { border: 1px solid var(--line); background: var(--card); border-radius: 17px; padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; text-align: left; }
.word-item.mastered { background: #f0f4df; }.word-item strong { font-family: Georgia, serif; font-size: 20px; }.word-item p { grid-column: 1; margin: 0; font-size: 13px; color: var(--muted); }
.word-item .check { grid-row: 1 / span 2; grid-column: 2; align-self: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-weight: 900; }
.word-item.mastered .check { background: var(--green); border-color: var(--green); color: white; }
.empty-state { text-align: center; padding: 55px 20px; color: var(--muted); }.empty-state span { font-size: 28px; }.empty-state h3 { color: var(--ink); margin: 10px 0 5px; }.empty-state p { margin: 0; font-size: 13px; }
.fab { position: fixed; right: max(22px, calc((100vw - 680px) / 2 + 22px)); bottom: calc(22px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--lime); box-shadow: 0 10px 26px rgba(30,44,32,.25); font-size: 34px; font-weight: 300; }
.study-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 14px; }.study-meta button { border: 0; background: transparent; color: var(--green); font-weight: 800; }
.flashcard { width: 100%; height: 330px; border: 0; background: transparent; perspective: 1000px; padding: 0; }
.flashcard-inner { width: 100%; height: 100%; position: relative; transition: transform .5s; transform-style: preserve-3d; }.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face { position: absolute; inset: 0; border-radius: 26px; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; backface-visibility: hidden; box-shadow: var(--shadow); }
.flashcard-face.front { background: var(--ink); color: white; }.flashcard-face.back { transform: rotateY(180deg); background: var(--lime); }
.card-label { position: absolute; top: 25px; font-size: 10px; letter-spacing: .2em; opacity: .65; }.flashcard-face strong { font-family: Georgia, serif; font-size: clamp(30px, 9vw, 46px); text-align: center; }.flashcard-face small { position: absolute; bottom: 25px; opacity: .55; }.flashcard-face p { margin: 18px 0 0; font-size: 13px; line-height: 1.6; }
.card-actions { display: grid; grid-template-columns: 44px 1fr 1fr 44px; gap: 8px; margin-top: 14px; }.card-actions button { min-height: 46px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); font-size: 12px; font-weight: 800; }.card-actions .again { color: var(--orange); }.card-actions .know { background: var(--green); color: white; border-color: var(--green); }
.quiz-panel { min-height: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 25px; padding: 28px 22px; text-align: center; }.quiz-panel[hidden] { display: none; }.quiz-panel h2 { font-family: Georgia, serif; margin: 18px 0 8px; }.quiz-panel p { color: var(--muted); font-size: 13px; }.quiz-mark { margin: 35px auto 0; width: 70px; height: 70px; display: grid; place-content: center; border-radius: 50%; background: var(--lime); font: 700 34px Georgia, serif; }
.primary-button { border: 0; border-radius: 14px; background: var(--ink); color: white; padding: 14px 22px; font-weight: 800; }.quiz-panel .primary-button { width: 100%; margin-top: 30px; }
.quiz-progress { height: 5px; background: var(--line); border-radius: 10px; overflow: hidden; }.quiz-progress span { display: block; width: 0; height: 100%; background: var(--green); transition: width .2s; }.quiz-options { display: grid; gap: 9px; margin-top: 25px; }.quiz-options button { border: 1px solid var(--line); background: white; border-radius: 14px; padding: 14px; text-align: left; }.quiz-options button.correct { background: #dff2ce; border-color: #86ad65; }.quiz-options button.wrong { background: #ffe0d5; border-color: #e68c6d; }
dialog { width: min(calc(100% - 28px), 540px); border: 0; border-radius: 26px; padding: 24px; background: var(--paper); box-shadow: var(--shadow); }dialog::backdrop { background: rgba(15,24,16,.62); backdrop-filter: blur(3px); }.dialog-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 22px; }.dialog-head h2 { margin: 0; font-family: Georgia, serif; }
#word-form > label { display: grid; gap: 7px; margin: 14px 0; font-size: 12px; font-weight: 800; }#word-form label span { color: var(--muted); font-weight: 400; }input, textarea, #word-form select { border: 1px solid var(--line); border-radius: 13px; background: var(--card); padding: 13px; outline: 0; }input:focus, textarea:focus, #word-form select:focus { border-color: var(--green); }.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }.danger-button { border: 0; background: transparent; color: #b94435; margin-right: auto; font-weight: 800; }
.settings-copy { color: var(--muted); font-size: 13px; line-height: 1.6; }.settings-actions { display: grid; gap: 9px; }.settings-actions button, .import-label { text-align: center; border: 1px solid var(--line); border-radius: 13px; background: var(--card); padding: 13px; font-weight: 800; font-size: 13px; }.import-label input { display: none; }
.cloud-panel { margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--card); }.cloud-status-row { display: flex; align-items: center; gap: 10px; }.cloud-status-row div { display: grid; gap: 2px; }.cloud-status-row small { color: var(--muted); font-size: 11px; }.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #aaa; box-shadow: 0 0 0 4px rgba(0,0,0,.05); }.status-dot.online { background: #4f963f; }.status-dot.offline { background: var(--orange); }.cloud-panel form { display: grid; gap: 9px; margin-top: 14px; }.cloud-panel form label { display: grid; gap: 6px; font-size: 11px; font-weight: 800; }.cloud-panel form button { width: 100%; }.cloud-panel > button { width: 100%; margin-top: 14px; border: 1px solid var(--line); border-radius: 13px; background: transparent; padding: 11px; font-weight: 800; }.word-score { grid-column: 1; display: flex; gap: 10px; font-size: 10px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 15px); padding: 11px 17px; border-radius: 30px; color: white; background: var(--ink); font-size: 12px; opacity: 0; pointer-events: none; transition: .25s; white-space: nowrap; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 700px) { .app-shell { padding-left: 28px; padding-right: 28px; }.hero { min-height: 200px; }.word-list { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
