:root {
  color-scheme: light;
  --page: #eeece6;
  --panel: #f2f0eb;
  --panel-light: #f7f5f0;
  --ink: #45443f;
  --muted: #99978f;
  --quiet: #b7b4ad;
  --line: rgba(125, 121, 110, 0.12);
  --mint: #9fceb9;
  --mint-deep: #5a947a;
  --mint-wash: #e0eee6;
  --coral: #e69c89;
  --coral-deep: #b76e5c;
  --coral-wash: #f5e4de;
  --peach: #e9c2a8;
  --lavender: #c4bed7;
  --shadow-raised: 8px 8px 19px rgba(165, 161, 150, 0.25), -8px -8px 19px rgba(255, 255, 252, 0.83);
  --shadow-soft: 5px 5px 13px rgba(165, 161, 150, 0.22), -5px -5px 13px rgba(255, 255, 252, 0.82);
  --shadow-small: 3px 3px 8px rgba(165, 161, 150, 0.2), -3px -3px 8px rgba(255, 255, 252, 0.75);
  --shadow-inset: inset 4px 4px 9px rgba(174, 170, 159, 0.22), inset -4px -4px 9px rgba(255, 255, 252, 0.8);
  --radius-xl: 25px;
  --radius-lg: 20px;
  --radius-md: 15px;
  --radius-sm: 12px;
  font-family: Inter, Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 5%, rgba(255, 255, 255, 0.35), transparent 22rem),
    var(--page);
  min-height: 100vh;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid rgba(90, 148, 122, 0.7);
  outline-offset: 3px;
}

.hidden { display: none !important; }

.app-shell { min-height: 100vh; }

.sidebar {
  width: 248px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 32px 22px 20px;
  background: rgba(239, 237, 231, 0.92);
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 5px 0 18px rgba(142, 138, 128, 0.055);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  justify-content: center;
  width: 35px;
  height: 35px;
  padding: 8px 7px;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-small);
}

.brand-mark span {
  display: block;
  width: 5px;
  border-radius: 4px;
  background: linear-gradient(180deg, #a4d2bb, #73ad91);
}
.brand-mark span:nth-child(1) { height: 10px; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 13px; }
.brand-name { font-size: 24px; font-weight: 750; letter-spacing: -1.5px; }
.brand-dot { color: var(--mint-deep); }

.profile-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 42px 2px 39px;
  padding: 11px;
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.avatar, .top-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #537965;
  border-radius: 50%;
  background: linear-gradient(140deg, #dce9de, #c9ddce);
  font-weight: 700;
}
.avatar { width: 38px; height: 38px; font-size: 14px; }
.profile-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.profile-copy strong { font-size: 12px; font-weight: 680; }
.profile-copy span { color: var(--muted); font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #95c9ae; box-shadow: 0 0 0 3px #e0eee5; }

.nav-caption, .eyebrow {
  margin: 0;
  color: #a09d95;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1.5px;
}
.nav-caption { padding: 0 12px; margin-bottom: 12px; }
.primary-nav { display: grid; gap: 8px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 13px;
  color: #85827b;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
  font-size: 12px;
}
.nav-link:hover { color: var(--ink); background: rgba(255,255,255,.36); }
.nav-link.active {
  color: #4d7561;
  font-weight: 680;
  background: #eff3ed;
  box-shadow: var(--shadow-small);
}
.nav-icon {
  width: 18px;
  height: 18px;
  position: relative;
  display: inline-block;
  flex: 0 0 18px;
  color: #a5a198;
}
.active .nav-icon { color: #6f9f83; }
.icon-grid::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1.6px solid currentColor;
  border-radius: 4px;
  box-shadow: inset 5px 0 0 -3.7px currentColor, inset -5px 0 0 -3.7px currentColor, inset 0 5px 0 -3.7px currentColor;
}
.icon-book::before { content: "▤"; position: absolute; inset: -3px 0 0; font-size: 20px; text-align: center; }
.icon-library::before { content: "▱"; position: absolute; inset: -6px 0 0; font-size: 25px; text-align: center; }
.icon-settings::before { content: "◌"; position: absolute; inset: -4px 0 0; font-size: 24px; text-align: center; }
.icon-settings::after { content: "·"; position: absolute; inset: 1px 0 0; font-size: 22px; text-align: center; }
.nav-count {
  margin-left: auto;
  min-width: 23px;
  padding: 3px 5px;
  color: #847f74;
  text-align: center;
  background: #e9e6df;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 650;
}
.active .nav-count { color: #5a846c; background: #dcebe1; }

.sidebar-bottom { margin-top: auto; }
.sidebar-note {
  position: relative;
  margin: 0 1px 21px;
  padding: 17px 15px;
  border-radius: 15px;
  background: linear-gradient(145deg, #f3f1eb, #eceae3);
  box-shadow: var(--shadow-inset);
}
.sidebar-note p { margin: 9px 0 0; color: #8d8a82; font-size: 10px; line-height: 1.7; }
.note-sparkle { color: #86b79b; font-size: 15px; }
.logout-button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 12px;
  color: #98958d;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 10px;
}
.logout-button:hover { color: var(--coral-deep); }
.logout-icon { font-size: 16px; transform: rotate(45deg); }
.sidebar-version { display: block; padding: 8px 12px 0; color: #b3b0a8; font-size: 8px; letter-spacing: 1.2px; }

.main-area {
  min-height: 100vh;
  margin-left: 248px;
  padding: 0 52px 25px;
}
.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #a19e96; font-size: 10px; }
.breadcrumb strong { color: #5b5953; font-weight: 650; }
.breadcrumb-slash { color: #c5c1b9; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.date-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  color: #8c8981;
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow-small);
  font-size: 10px;
}
.sun-icon { color: #d6a879; font-size: 15px; }
.icon-button {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: #6d9b7f;
  border: 0;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-small);
  cursor: pointer;
  font-size: 20px;
  transition: transform 150ms ease;
}
.icon-button:hover { transform: translateY(-2px); }
.top-avatar { width: 34px; height: 34px; font-size: 12px; }

.view { max-width: 1210px; margin: 0 auto; animation: view-in 260ms ease both; }
@keyframes view-in { from { opacity: .55; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.dashboard-view { padding-top: 41px; }
.welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 27px; }
.eyebrow { display: flex; align-items: center; gap: 7px; }
.eyebrow-dot { width: 6px; height: 6px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 0 3px #e2eee6; }
h1, h2, p { overflow-wrap: anywhere; }
.welcome-row h1, .page-heading-row h1 {
  margin: 11px 0 8px;
  color: #474640;
  font-size: clamp(25px, 2.5vw, 34px);
  font-weight: 650;
  letter-spacing: -1.7px;
  line-height: 1.3;
}
.welcome-row h1 span { color: #83a991; }
.welcome-subtitle { margin: 0; color: #a09d95; font-size: 11px; line-height: 1.7; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  min-height: 42px;
  padding: 0 19px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 680;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { opacity: .55; cursor: wait; }
.button-primary {
  color: #466d59;
  background: linear-gradient(140deg, #e3efe6, #d6e9dc);
  box-shadow: 6px 6px 13px rgba(151, 171, 157, .25), -5px -5px 13px rgba(255, 255, 252, .78);
}
.button-primary:hover:not(:disabled) { box-shadow: 7px 8px 15px rgba(151, 171, 157, .29), -5px -5px 13px rgba(255, 255, 252, .8); }
.button-arrow { font-size: 16px; font-weight: 400; }
.start-button { min-width: 161px; min-height: 46px; border-radius: 14px; }
.button-soft { color: #747169; background: var(--panel); box-shadow: var(--shadow-small); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card {
  min-height: 128px;
  padding: 18px 19px 16px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #f4f2ed, #efede7);
  box-shadow: var(--shadow-soft);
}
.stat-card-focus { background: linear-gradient(145deg, #f5f1eb, #eeece6); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: #8f8c84; font-size: 10px; font-weight: 580; }
.stat-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 10px; font-size: 15px; }
.coral-icon { color: #c77d69; background: var(--coral-wash); }
.mint-icon { color: #62987b; background: #dfede4; }
.peach-icon { color: #b1886d; background: #f1e6dc; }
.lavender-icon { color: #837b9a; background: #e8e5ef; }
.stat-value-row { display: flex; align-items: baseline; gap: 5px; margin-top: 8px; }
.stat-value-row strong { color: #4c4a44; font-size: 31px; font-weight: 620; letter-spacing: -1.5px; line-height: 1; }
.stat-unit { color: #9f9c94; font-size: 10px; }
.stat-foot { margin: 8px 0 0; color: #aaa79f; font-size: 9px; }
.stat-accent { font-weight: 650; }
.coral-text { color: #c78170; }

.dashboard-columns { display: grid; grid-template-columns: 1.08fr .92fr; gap: 18px; margin-top: 21px; }
.panel {
  min-width: 0;
  padding: 22px 23px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, #f3f1eb, #efede7);
  box-shadow: var(--shadow-soft);
}
.deck-panel, .rhythm-panel { min-height: 249px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading .eyebrow { margin-bottom: 7px; }
.panel h2 { margin: 0; color: #53514b; font-size: 16px; font-weight: 620; letter-spacing: -.5px; }
.text-button { padding: 5px 1px; color: #a09d95; background: transparent; border: 0; cursor: pointer; font-size: 9px; }
.text-button:hover { color: var(--mint-deep); }
.text-button span { margin-left: 4px; }
.deck-list { display: grid; gap: 8px; margin-top: 17px; }
.deck-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 9px 11px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(248, 247, 242, .54);
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.deck-row:hover { transform: translateY(-1px); background: #f7f5f0; box-shadow: var(--shadow-small); }
.deck-row.selected { border-color: rgba(128, 173, 144, .2); background: #edf3ed; }
.deck-symbol { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: #7da78e; background: #e0ece3; font-size: 16px; }
.deck-row:nth-child(3n) .deck-symbol { color: #c18471; background: #f4e5de; }
.deck-row:nth-child(3n + 2) .deck-symbol { color: #9389a5; background: #e9e6ef; }
.deck-row-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.deck-row-copy strong { overflow: hidden; color: #626057; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.deck-row-copy small { color: #aaa69e; font-size: 8px; }
.deck-row-arrow { color: #b3afa7; font-size: 14px; }
.add-deck-hint { display: flex; align-items: center; gap: 9px; width: 100%; margin-top: 10px; padding: 8px 3px 2px; color: #a29f97; background: transparent; border: 0; cursor: pointer; text-align: left; font-size: 9px; }
.add-deck-hint:hover { color: var(--mint-deep); }
.add-small { display: grid; width: 22px; height: 22px; place-items: center; border: 1px dashed #bcb9b0; border-radius: 8px; font-size: 13px; }
.loading-row { display: flex; align-items: center; gap: 9px; color: #aaa79f; font-size: 10px; padding: 15px 2px; }
.spinner { width: 13px; height: 13px; border: 2px solid #d8d5cd; border-top-color: #86b79b; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 18px 12px; color: #aaa69f; text-align: center; font-size: 10px; line-height: 1.7; }
.panel-unit { color: #aaa69e; font-size: 9px; }
.chart { display: flex; height: 136px; align-items: stretch; justify-content: space-around; gap: 8px; margin-top: 15px; padding: 7px 4px 0; }
.chart-column { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.chart-track { display: flex; width: min(100%, 27px); height: 104px; align-items: flex-end; border-radius: 11px; background: #ebe9e2; box-shadow: var(--shadow-inset); overflow: hidden; }
.chart-track span { display: block; width: 100%; min-height: 4px; border-radius: 11px; background: linear-gradient(180deg, #b5d8c3, #88b79a); box-shadow: 0 -2px 8px rgba(97, 150, 118, .12); transition: height 350ms ease; }
.chart-today .chart-track span { background: linear-gradient(180deg, #f0bba8, #dc957f); }
.chart-column small { color: #aaa69e; font-size: 8px; }
.chart-footer { display: flex; justify-content: space-between; margin-top: 6px; color: #aaa69e; font-size: 8px; }
.chart-footer span:first-child { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; background: #9fc9ad; }

.gentle-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 19px;
  padding: 15px 18px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 17px;
  background: linear-gradient(105deg, #e7eee7, #f0eee7);
  box-shadow: var(--shadow-small);
}
.banner-symbol { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; border-radius: 12px; color: #78a489; background: #e4efe5; box-shadow: var(--shadow-small); font-size: 17px; }
.banner-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 5px; }
.banner-copy strong { color: #647a68; font-size: 10px; font-weight: 670; }
.banner-copy span { color: #9b9b8e; font-size: 9px; }
.banner-link { padding: 7px; color: #819784; background: transparent; border: 0; cursor: pointer; white-space: nowrap; font-size: 9px; }
.banner-link span { margin-left: 6px; font-size: 14px; }

.page-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 45px 0 28px; }
.page-heading-row h1 { margin-top: 10px; }
.library-grid { display: grid; grid-template-columns: 1.03fr .97fr; align-items: start; gap: 20px; }
.library-decks-panel, .package-panel { min-height: 343px; }
.deck-list-large { gap: 9px; margin-top: 20px; }
.deck-row-compact { min-height: 53px; }
.package-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 12px; color: #6c9e81; background: #e0ece3; box-shadow: var(--shadow-small); font-size: 19px; }
.package-description { margin: 17px 0 18px; color: #a09d95; font-size: 10px; line-height: 1.8; }
.package-action { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 13px 12px; text-align: left; border: 1px solid transparent; border-radius: 15px; background: rgba(248, 247, 242, .62); cursor: pointer; }
.package-action:hover { border-color: rgba(134, 183, 155, .25); background: #f6f4ef; box-shadow: var(--shadow-small); }
.package-action-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; color: #62977a; background: #e0ede4; border-radius: 11px; font-size: 17px; }
.package-action-icon.export-icon { color: #bb8170; background: #f4e5df; }
.package-action > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.package-action strong { color: #6b685f; font-size: 10px; font-weight: 650; }
.package-action small { color: #aaa69e; font-size: 8px; }
.package-chevron { color: #b9b5ac; font-size: 14px; }
.package-footnote { display: flex; gap: 7px; margin-top: 18px; padding: 11px 12px; color: #a6a39b; border-radius: 12px; background: #edeae3; font-size: 8px; line-height: 1.6; }
.package-footnote span { color: #9d9a91; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 19px; }
.setting-panel { min-height: 266px; }
.retention-panel { grid-row: span 2; min-height: 440px; }
.retention-current { color: #71947b; font-size: 15px; font-weight: 700; }
.setting-description { margin: 14px 0 18px; color: #a09d95; font-size: 9px; line-height: 1.8; }
.retention-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-top: 19px; }
.retention-option {
  position: relative;
  display: flex;
  min-height: 92px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 15px;
  background: #f1efe9;
  box-shadow: var(--shadow-small);
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease;
}
.retention-option:hover:not(:disabled) { transform: translateY(-2px); }
.retention-option strong { color: #66645c; font-size: 19px; font-weight: 630; letter-spacing: -.5px; }
.retention-option small { color: #aaa69e; font-size: 8px; }
.retention-option.selected { border-color: rgba(106, 165, 129, .33); background: linear-gradient(145deg, #e7f0e8, #e1ece3); box-shadow: inset 2px 2px 5px rgba(158, 183, 163, .15), 4px 4px 11px rgba(165, 161, 150, .12); }
.retention-option.selected strong { color: #59836a; }
.retention-option.locked { opacity: .58; cursor: not-allowed; box-shadow: var(--shadow-inset); }
.retention-check { position: absolute; top: 11px; right: 12px; color: #8aaa94; font-size: 12px; }
.locked .retention-check { color: #aaa69e; }
.streak-unlock-note, .backlog-note { display: flex; align-items: center; gap: 11px; margin-top: 17px; padding: 13px; border-radius: 14px; background: #eceae3; }
.unlock-icon { display: grid; flex: 0 0 29px; width: 29px; height: 29px; place-items: center; color: #9e9ab0; background: #e6e3ed; border-radius: 10px; }
.streak-unlock-note p, .backlog-note p { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.streak-unlock-note strong, .backlog-note strong { color: #79766e; font-size: 9px; font-weight: 650; }
.streak-unlock-note span:last-child, .backlog-note span { color: #aaa69e; font-size: 8px; line-height: 1.5; }
.setting-footnote { margin-top: 17px; color: #aaa69e; font-size: 8px; line-height: 1.6; }
.field-label { display: flex; align-items: center; justify-content: space-between; margin: 23px 1px 13px; color: #77746c; font-size: 9px; font-weight: 620; }
.field-label span { color: #659276; font-size: 10px; }
.range-input { width: 100%; height: 7px; margin: 4px 0 10px; appearance: none; border-radius: 10px; background: #e3e0d9; box-shadow: var(--shadow-inset); cursor: pointer; }
.range-input::-webkit-slider-thumb { width: 18px; height: 18px; appearance: none; border: 3px solid #eff3ed; border-radius: 50%; background: #87b195; box-shadow: 2px 2px 5px rgba(115, 154, 126, .25), -2px -2px 4px rgba(255,255,255,.7); }
.range-input::-moz-range-thumb { width: 13px; height: 13px; border: 3px solid #eff3ed; border-radius: 50%; background: #87b195; box-shadow: 2px 2px 5px rgba(115, 154, 126, .25), -2px -2px 4px rgba(255,255,255,.7); }
.range-scale { display: flex; justify-content: space-between; color: #b1ada5; font-size: 8px; }
.backlog-note { margin-top: 20px; background: #f0ebe4; }
.backlog-note > span { display: grid; flex: 0 0 29px; width: 29px; height: 29px; place-items: center; color: #c38672; border-radius: 10px; background: #f4e5dc; font-size: 15px; }
.text-input, .modal-card select {
  width: 100%;
  min-height: 41px;
  padding: 0 12px;
  color: #6d6a62;
  border: 1px solid rgba(255,255,255,.52);
  border-radius: 12px;
  background: #eeece5;
  box-shadow: var(--shadow-inset);
  font-size: 10px;
}
.save-timezone { margin-top: 13px; min-height: 36px; padding: 0 13px; font-size: 9px; }
.page-footer { display: flex; justify-content: space-between; max-width: 1210px; margin: 29px auto 0; padding: 15px 2px 0; color: #b1ada5; border-top: 1px solid rgba(125,121,110,.08); font-size: 8px; }
.page-footer span:last-child { display: flex; align-items: center; gap: 6px; }
.page-footer i { width: 6px; height: 6px; border-radius: 50%; background: #9bc4a8; }

.study-view { min-height: calc(100vh - 108px); padding: 19px 0 30px; }
.study-topline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.back-button { width: fit-content; padding: 8px 0; color: #929087; background: transparent; border: 0; cursor: pointer; font-size: 10px; }
.back-button:hover { color: var(--mint-deep); }
.back-button span { margin-right: 7px; font-size: 15px; }
.study-progress-copy { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.study-deck-label { color: #66635b; font-size: 10px; font-weight: 650; }
.study-progress-text { color: #aaa69e; font-size: 8px; }
.study-progress-track { width: min(170px, 100%); height: 6px; justify-self: end; overflow: hidden; border-radius: 9px; background: #e4e1da; box-shadow: var(--shadow-inset); }
.study-progress-track span { display: block; width: 8%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #a8cfb5, #7caf8e); transition: width 300ms ease; }
.study-stage { display: flex; width: min(770px, 100%); flex-direction: column; align-items: center; margin: 37px auto 0; }
.review-card {
  display: flex;
  width: 100%;
  min-height: 420px;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .73);
  border-radius: 27px;
  background: linear-gradient(145deg, #f5f3ee, #f0eee8);
  box-shadow: 13px 13px 28px rgba(162, 158, 147, .24), -13px -13px 27px rgba(255, 255, 252, .86);
  overflow: hidden;
}
.review-card-top, .review-card-bottom { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; }
.card-type-chip { padding: 7px 10px; color: #6d947a; border-radius: 9px; background: #e1ede4; font-size: 8px; font-weight: 650; }
.card-key-hint { color: #b1ada5; font-size: 8px; }
.review-card-body { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 325px; flex: 1; place-items: stretch; padding: 4px 23px; }
.card-frame { display: block; width: 100%; min-height: 320px; height: 100%; border: 0; border-radius: 16px; background: #f4f2ed; }
.type-answer-inputs { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 14px; }
.type-answer-row { display: flex; align-items: center; gap: 12px; color: #99958d; font-size: 9px; }
.type-answer-row span { flex: 0 0 58px; }
.type-answer-row input { width: 100%; min-height: 43px; padding: 0 13px; color: #5e5b54; border: 1px solid rgba(255,255,255,.65); border-radius: 12px; background: #efede7; box-shadow: var(--shadow-inset); }
.review-card-bottom { padding-top: 15px; padding-bottom: 17px; color: #b0aca4; font-size: 8px; letter-spacing: .7px; }
.card-center-mark { color: #a5c6af; font-size: 12px; }
.review-controls { display: flex; width: 100%; justify-content: center; margin-top: 23px; }
.button-show { min-width: 190px; min-height: 48px; color: #6c906f; background: linear-gradient(145deg, #e5eee5, #dceadd); box-shadow: var(--shadow-soft); }
.button-show span { font-size: 14px; }
.rating-buttons { display: grid; width: min(590px, 100%); grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rating-button { position: relative; display: flex; min-height: 68px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid rgba(255,255,255,.55); border-radius: 16px; background: #f2f0eb; box-shadow: var(--shadow-soft); cursor: pointer; transition: transform 130ms ease, opacity 130ms ease; }
.rating-button:hover:not(:disabled) { transform: translateY(-3px); }
.rating-button:disabled { opacity: .55; cursor: wait; }
.rating-button strong { color: #77746b; font-size: 10px; font-weight: 650; }
.rating-button small { color: #a8a49c; font-size: 8px; }
.rating-number { position: absolute; top: 7px; left: 10px; color: #bbb7af; font-size: 7px; }
.rating-0 { background: linear-gradient(145deg, #f7e8e2, #f3e2dc); }
.rating-0 strong { color: #b87160; }
.rating-1 { background: linear-gradient(145deg, #f4eee4, #f1eadf); }
.rating-1 strong { color: #9f8568; }
.rating-2 { background: linear-gradient(145deg, #e7f0e7, #dfecdf); }
.rating-2 strong { color: #638b6d; }
.rating-3 { background: linear-gradient(145deg, #e4efe8, #dbeae0); }
.rating-3 strong { color: #4f8463; }
.study-encouragement { margin: 14px 0 0; color: #aaa69e; font-size: 9px; }
.study-complete { display: flex; min-height: 65vh; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.complete-art { position: relative; display: grid; width: 110px; height: 110px; place-items: center; margin-bottom: 24px; border: 1px solid rgba(255,255,255,.7); border-radius: 38px; background: linear-gradient(145deg,#e5efe6,#dceadd); box-shadow: var(--shadow-raised); }
.complete-art span { color: #6d9f7e; font-size: 44px; }
.complete-art i, .complete-art b { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #e1a18b; }
.complete-art i { top: 12px; right: 7px; }
.complete-art b { bottom: 13px; left: 7px; width: 6px; height: 6px; background: #a99fc2; }
.study-complete h2 { margin: 13px 0 7px; font-size: 27px; font-weight: 620; letter-spacing: -1px; }
.study-complete > p:not(.eyebrow) { margin: 0 0 24px; color: #a09d95; font-size: 11px; }

.modal { width: min(520px, calc(100% - 30px)); max-height: calc(100% - 32px); padding: 0; color: var(--ink); border: 1px solid rgba(255,255,255,.76); border-radius: 24px; background: #f2f0eb; box-shadow: 18px 18px 40px rgba(104,101,92,.22), -10px -10px 30px rgba(255,255,252,.65); }
.modal::backdrop { background: rgba(74, 72, 66, .24); backdrop-filter: blur(4px); }
.modal-card { display: flex; flex-direction: column; gap: 10px; padding: 25px; }
.modal-card { max-height: calc(100vh - 34px); overflow-y: auto; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.modal-heading .eyebrow { margin-bottom: 7px; }
.modal-heading h2 { margin: 0; font-size: 19px; font-weight: 630; letter-spacing: -.7px; }
.modal-close { display: grid; width: 32px; height: 32px; place-items: center; color: #9b978f; border: 0; border-radius: 11px; background: #efede7; box-shadow: var(--shadow-small); cursor: pointer; font-size: 19px; }
.modal-card > label:not(.drop-zone):not(.checkbox-row) { margin-top: 8px; color: #77746b; font-size: 9px; font-weight: 630; }
.modal-card textarea { resize: vertical; min-height: 86px; padding: 12px; color: #66635b; border: 1px solid rgba(255,255,255,.55); border-radius: 13px; background: #eeece5; box-shadow: var(--shadow-inset); font-size: 10px; line-height: 1.6; }
.modal-card textarea::placeholder { color: #b6b2aa; }
.modal-card select { margin-top: 1px; }
.note-type-hint { margin: -3px 1px 2px; color: #aaa69e; font-size: 8px; line-height: 1.55; }
.note-fields { display: flex; flex-direction: column; gap: 10px; }
.note-field-group { display: flex; flex-direction: column; gap: 6px; }
.note-field-group label { color: #77746b; font-size: 9px; font-weight: 630; }
.note-field-group textarea { width: 100%; min-height: 72px; }
.optional-label { margin-left: 4px; color: #aaa69e; font-size: 8px; font-weight: 400; }
.io-editor { display: flex; flex-direction: column; gap: 9px; }
.io-image-picker { display: flex; min-height: 83px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px dashed #c5c5b9; border-radius: 14px; background: rgba(255,255,255,.24); cursor: pointer; }
.io-image-picker:hover { border-color: #8fb399; background: #eef3ed; }
.io-image-picker > span { display: grid; width: 25px; height: 25px; place-items: center; color: #6b9a7e; border-radius: 8px; background: #dfede4; font-size: 14px; }
.io-image-picker strong { color: #79766d; font-size: 9px; font-weight: 600; }
.io-image-picker small { color: #aaa69e; font-size: 7px; }
.io-image-picker input { max-width: 90%; color: #a09d95; font-size: 8px; }
.io-canvas-wrap { display: grid; max-height: 350px; place-items: center; overflow: auto; border-radius: 12px; background: #e8e6df; }
.io-canvas-wrap canvas { display: block; width: 100%; max-height: 350px; object-fit: contain; cursor: crosshair; touch-action: none; }
.io-editor-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #aaa69e; font-size: 8px; }
.io-editor-tools > div { display: flex; gap: 6px; }
.io-tool-button { padding: 6px 9px; color: #758d79; border: 1px solid rgba(255,255,255,.6); border-radius: 8px; background: #e9eee7; box-shadow: var(--shadow-small); cursor: pointer; font-size: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.drop-zone { display: flex; min-height: 155px; flex-direction: column; align-items: center; justify-content: center; gap: 8px; margin: 7px 0; border: 1px dashed #c5c5b9; border-radius: 17px; background: rgba(255,255,255,.22); cursor: pointer; }
.drop-zone:hover { border-color: #8fb399; background: #eef3ed; }
.drop-icon { display: grid; width: 36px; height: 36px; place-items: center; color: #6b9a7e; border-radius: 12px; background: #dfede4; font-size: 17px; }
.drop-zone strong { color: #79766d; font-size: 10px; }
.drop-zone small { color: #aaa69e; font-size: 8px; }
.drop-zone input { width: min(270px, 88%); margin-top: 5px; color: #a09d95; font-size: 8px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 13px; background: #eceae3; cursor: pointer; }
.checkbox-row input { accent-color: #76a587; }
.checkbox-row span { display: flex; flex-direction: column; gap: 5px; }
.checkbox-row strong { color: #77746b; font-size: 9px; font-weight: 630; }
.checkbox-row small { color: #aaa69e; font-size: 8px; line-height: 1.5; }
.toast { position: fixed; z-index: 20; right: 25px; bottom: 23px; max-width: min(390px, calc(100% - 30px)); padding: 13px 17px; color: #5b7561; border: 1px solid rgba(255,255,255,.68); border-radius: 14px; background: #e7f0e8; box-shadow: 7px 7px 19px rgba(124, 132, 119, .2), -4px -4px 14px rgba(255,255,252,.6); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 180ms ease, transform 180ms ease; font-size: 10px; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast-error { color: #9d6052; background: #f5e6e0; }

.login-page { min-height: 100vh; }
.login-layout { display: grid; min-height: 100vh; grid-template-columns: 1.02fr .98fr; }
.login-intro { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 42px clamp(35px, 8vw, 116px); background: linear-gradient(142deg, #e9e8df, #edebe4 68%, #e6ebe2); }
.login-intro::before, .login-intro::after { position: absolute; content: ""; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; pointer-events: none; }
.login-intro::before { width: 520px; height: 520px; right: -240px; bottom: -220px; box-shadow: 10px 10px 25px rgba(160,158,145,.09), -8px -8px 25px rgba(255,255,255,.35); }
.login-intro::after { width: 340px; height: 340px; right: -150px; bottom: -130px; }
.login-message { position: relative; z-index: 1; margin-top: -20px; }
.login-message .eyebrow { margin-bottom: 24px; }
.login-message h1 { margin: 0; color: #4a4943; font-size: clamp(36px, 4vw, 52px); font-weight: 620; letter-spacing: -3px; line-height: 1.35; }
.login-message h1 span { color: #83a991; }
.login-message > p:last-of-type { margin-top: 19px; color: #98968e; font-size: 13px; line-height: 1.9; }
.login-foot { position: relative; z-index: 1; color: #aaa79f; font-size: 9px; letter-spacing: .6px; }
.login-orbit { position: absolute; right: 13px; bottom: -116px; width: 210px; height: 210px; display: grid; place-items: center; }
.login-orbit i { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.67); border-radius: 50%; box-shadow: var(--shadow-small); }
.login-orbit i:nth-child(2) { inset: 22px; }
.login-orbit i:nth-child(3) { inset: 44px; background: linear-gradient(145deg,#e8efe6,#e1e9df); }
.login-orbit b { z-index: 1; color: #82a98c; font-size: 32px; font-weight: 400; }
.login-form-section { display: grid; min-height: 100vh; place-items: center; padding: 30px; }
.login-card { width: min(370px, 100%); padding: 35px 34px 27px; border: 1px solid rgba(255,255,255,.63); border-radius: 25px; background: linear-gradient(145deg,#f4f2ed,#f0eee8); box-shadow: 12px 12px 28px rgba(160,156,146,.2), -12px -12px 26px rgba(255,255,252,.79); }
.login-card-icon { display: grid; width: 43px; height: 43px; place-items: center; margin-bottom: 22px; color: #78a58a; border-radius: 14px; background: #e0ece3; box-shadow: var(--shadow-small); font-size: 18px; }
.login-card h2 { margin: 10px 0 7px; color: #4c4a44; font-size: 24px; font-weight: 640; letter-spacing: -1px; }
.login-hint { margin: 0 0 25px; color: #a09d95; font-size: 10px; }
.login-card label { display: block; margin-bottom: 8px; color: #77746b; font-size: 9px; font-weight: 650; }
.login-card input { width: 100%; height: 45px; padding: 0 13px; color: #615f58; border: 1px solid rgba(255,255,255,.47); border-radius: 12px; background: #eeece5; box-shadow: var(--shadow-inset); font-size: 10px; }
.login-card input::placeholder { color: #b3afa7; }
.login-submit { width: 100%; margin-top: 17px; }
.login-error { min-height: 16px; margin: 9px 0 0; color: #bd7563; font-size: 9px; }
.login-protected { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 15px; color: #aaa69e; font-size: 8px; }
.login-protected i { width: 5px; height: 5px; border-radius: 50%; background: #8db79a; }

@media (min-width: 1500px) {
  .main-area { padding-right: 7vw; padding-left: 7vw; }
}

@media (max-width: 1120px) {
  .main-area { padding-right: 30px; padding-left: 30px; }
  .sidebar { width: 220px; padding-right: 18px; padding-left: 18px; }
  .main-area { margin-left: 220px; }
  .stats-grid { gap: 12px; }
  .stat-card { padding-right: 14px; padding-left: 14px; }
}

@media (max-width: 850px) {
  .sidebar { width: 72px; align-items: center; padding: 22px 10px 14px; }
  .brand { gap: 0; }
  .brand-name, .profile-copy, .status-dot, .nav-caption, .nav-link > span:not(.nav-icon), .sidebar-note, .logout-button:not(.logout-icon), .sidebar-version { display: none; }
  .profile-card { justify-content: center; margin: 34px 0 25px; padding: 7px; background: transparent; box-shadow: none; }
  .avatar { width: 39px; height: 39px; box-shadow: var(--shadow-small); }
  .primary-nav { width: 100%; justify-items: center; }
  .nav-link { width: 48px; height: 48px; justify-content: center; padding: 0; }
  .nav-icon { width: 20px; height: 20px; }
  .sidebar-bottom { display: flex; flex: 1; align-items: flex-end; }
  .logout-button { display: grid; width: 45px; height: 45px; place-items: center; padding: 0; border-radius: 14px; box-shadow: var(--shadow-small); }
  .logout-button .logout-icon { font-size: 17px; }
  .main-area { margin-left: 72px; padding-right: 24px; padding-left: 24px; }
  .dashboard-columns { grid-template-columns: 1fr; }
  .deck-panel { min-height: unset; }
  .rhythm-panel { min-height: 236px; }
}

@media (max-width: 620px) {
  .sidebar { width: 58px; padding-right: 5px; padding-left: 5px; }
  .brand-mark { width: 35px; height: 35px; }
  .main-area { margin-left: 58px; padding: 0 15px 21px; }
  .topbar { height: 65px; }
  .breadcrumb { font-size: 9px; }
  .topbar-actions { gap: 8px; }
  .date-pill { padding: 7px 8px; font-size: 8px; }
  .icon-button { width: 31px; height: 31px; }
  .top-avatar { width: 30px; height: 30px; }
  .dashboard-view { padding-top: 27px; }
  .welcome-row { align-items: flex-start; flex-direction: column; gap: 17px; margin-bottom: 20px; }
  .welcome-row h1, .page-heading-row h1 { font-size: 25px; letter-spacing: -1.2px; }
  .welcome-subtitle { font-size: 9px; }
  .start-button { width: 100%; min-height: 43px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { min-height: 116px; padding: 14px; border-radius: 16px; }
  .stat-value-row strong { font-size: 28px; }
  .stat-foot { font-size: 8px; }
  .dashboard-columns { gap: 12px; margin-top: 13px; }
  .panel { padding: 17px; border-radius: 19px; }
  .deck-panel, .rhythm-panel { min-height: unset; }
  .gentle-banner { align-items: flex-start; gap: 10px; padding: 13px; }
  .banner-symbol { flex-basis: 31px; width: 31px; height: 31px; }
  .banner-copy strong { font-size: 9px; }
  .banner-copy span { font-size: 8px; line-height: 1.5; }
  .banner-link { align-self: center; padding: 4px 0; font-size: 0; }
  .banner-link span { margin: 0; font-size: 16px; }
  .page-footer { margin-top: 21px; font-size: 7px; }
  .page-heading-row { align-items: flex-start; flex-direction: column; margin: 28px 0 19px; }
  .library-grid, .settings-grid { grid-template-columns: 1fr; gap: 13px; }
  .retention-panel { grid-row: auto; min-height: 0; }
  .setting-panel { min-height: 0; }
  .study-view { min-height: calc(100vh - 80px); padding-top: 13px; }
  .study-topline { grid-template-columns: auto 1fr; gap: 10px; }
  .study-progress-copy { align-items: flex-end; }
  .study-progress-track { display: none; }
  .study-stage { margin-top: 26px; }
  .review-card { min-height: 380px; border-radius: 21px; }
  .review-card-top, .review-card-bottom { padding: 15px; }
  .review-card-body { min-height: 300px; padding: 4px 12px; }
  .card-frame { min-height: 290px; }
  .card-key-hint { font-size: 7px; }
  .rating-buttons { gap: 7px; }
  .rating-button { min-height: 65px; border-radius: 13px; }
  .rating-button strong { font-size: 9px; }
  .rating-button small { font-size: 7px; }
  .rating-number { top: 5px; left: 7px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: 325px; padding: 25px 27px; }
  .login-message { margin-top: 48px; }
  .login-message .eyebrow { margin-bottom: 13px; }
  .login-message h1 { font-size: 34px; letter-spacing: -2px; }
  .login-message > p:last-of-type { margin-top: 10px; font-size: 10px; }
  .login-orbit { right: -53px; bottom: -124px; transform: scale(.74); }
  .login-foot { margin-top: 20px; font-size: 8px; }
  .login-form-section { min-height: auto; padding: 26px 18px 35px; }
  .login-card { width: min(370px, 100%); padding: 27px 24px 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
