:root {
  --ink: #24324a;
  --muted: #6b7280;
  --line: #dfe4ec;
  --surface: #ffffff;
  --canvas: #f7f8fb;
  --weekend: #fff8ef;
  --chinese: #e76f51;
  --chinese-soft: #fff1ec;
  --math: #457b9d;
  --math-soft: #edf6fb;
  --english: #6d5da8;
  --english-soft: #f3f0fb;
  --class: #b77b1d;
  --class-soft: #fff6dc;
  --daily: #567653;
  --daily-soft: #eef6ec;
  --success: #2f855a;
  --success-soft: #e9f7ef;
  --danger: #b64d45;
  --shadow: 0 14px 36px rgba(36, 50, 74, 0.09);
  --radius: 22px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(243, 166, 131, 0.16), transparent 24rem),
    radial-gradient(circle at 95% 5%, rgba(116, 185, 179, 0.16), transparent 26rem),
    var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body.has-modal {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(69, 123, 157, 0.35);
  outline-offset: 3px;
}

html:not(.keyboard-navigation) button:focus-visible,
html:not(.keyboard-navigation) input:focus-visible,
html:not(.keyboard-navigation) summary:focus-visible,
#app-main:focus {
  outline: none;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 28px max(40px, env(safe-area-inset-bottom));
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-avatar-button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: zoom-in;
}

.brand-avatar {
  display: block;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 3px solid white;
  border-radius: 50%;
  background: #e9edf2;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(36, 50, 74, 0.18);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.brand-avatar-button:hover .brand-avatar {
  transform: scale(1.055);
  box-shadow: 0 10px 24px rgba(36, 50, 74, 0.24);
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-edit-button {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(23px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(25px, 3.4vw, 38px);
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sync-status {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 12px rgba(36, 50, 74, 0.05);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #a8b0bd;
}

.sync-status.is-online .sync-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(47, 133, 90, 0.12);
}

.sync-status.is-syncing .sync-dot {
  background: #df9f32;
  animation: pulse 1s ease-in-out infinite;
}

.sync-status.is-offline .sync-dot {
  background: var(--danger);
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.primary-nav {
  position: sticky;
  top: max(10px, env(safe-area-inset-top));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  max-width: 560px;
  margin: 0 auto 26px;
  padding: 6px;
  border: 1px solid rgba(223, 228, 236, 0.9);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(36, 50, 74, 0.08);
  backdrop-filter: blur(18px);
}

.nav-button {
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.nav-button.is-active {
  background: var(--ink);
  color: white;
  box-shadow: 0 6px 14px rgba(36, 50, 74, 0.18);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: enter 180ms ease-out;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(5px); }
}

.hero-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  margin-bottom: 22px;
  padding: 30px 32px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 28px;
  background: linear-gradient(130deg, #fff8ef 0%, #ffffff 50%, #eef8f7 100%);
  box-shadow: var(--shadow);
}

.hero-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.progress-ring {
  --value: 0deg;
  display: grid;
  width: 112px;
  height: 112px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--success) var(--value), #e9edf2 0);
}

.progress-ring::before {
  content: "";
  grid-area: 1 / 1;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: white;
}

.progress-ring-content {
  z-index: 1;
  grid-area: 1 / 1;
  text-align: center;
}

.progress-ring strong {
  display: block;
  font-size: 25px;
}

.progress-ring span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.47fr);
  gap: 22px;
  align-items: start;
}

.section-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(36, 50, 74, 0.055);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 13px;
}

.section-header h3,
.section-header p {
  margin-bottom: 0;
}

.section-header p {
  color: var(--muted);
  font-size: 13px;
}

.task-list,
.class-list,
.overdue-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0 14px 14px;
  list-style: none;
}

.task-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 72px;
  padding: 11px 14px 11px 10px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.task-row:active {
  transform: scale(0.992);
}

.task-row.is-complete {
  border-color: #b9dfc8;
  background: var(--success-soft);
}

.task-row.is-complete .task-title {
  color: #567060;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.task-toggle {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid #cbd2dc;
  border-radius: 14px;
  background: white;
  color: transparent;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
}

.task-row.is-complete .task-toggle {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.task-toggle:disabled {
  opacity: 0.52;
  cursor: wait;
}

.task-copy {
  min-width: 0;
}

.task-title {
  margin-bottom: 3px;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.35;
}

.task-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.subject-chip {
  align-self: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.subject-chip.cn { background: var(--chinese-soft); color: var(--chinese); }
.subject-chip.math { background: var(--math-soft); color: var(--math); }
.subject-chip.en { background: var(--english-soft); color: var(--english); }
.subject-chip.wrap { background: #eff2f6; color: #617087; }

.class-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 15px;
  border: 1px solid #efdfac;
  border-radius: 16px;
  background: var(--class-soft);
}

.class-icon {
  font-size: 23px;
}

.class-row strong {
  display: block;
  margin-bottom: 2px;
  color: #7b5318;
}

.class-row span:last-child {
  color: #8b6b37;
  font-size: 13px;
}

.warning-note {
  margin: 0 14px 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff0ec;
  color: #99463f;
  font-size: 13px;
  line-height: 1.5;
}

.empty-state {
  padding: 30px 22px 34px;
  color: var(--muted);
  text-align: center;
}

.empty-state .emoji {
  display: block;
  margin-bottom: 8px;
  font-size: 32px;
}

.overdue-card {
  margin-top: 22px;
}

.overdue-card summary,
.group-card summary {
  cursor: pointer;
  list-style: none;
}

.overdue-card summary::-webkit-details-marker,
.group-card summary::-webkit-details-marker {
  display: none;
}

.overdue-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 16px 20px;
  font-weight: 800;
}

.count-badge {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #f0f2f6;
  color: var(--muted);
  font-size: 12px;
}

.calendar-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 2px 18px;
}

.calendar-toolbar h2,
.calendar-toolbar p {
  margin-bottom: 0;
}

.month-switcher {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.month-button {
  min-width: 72px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.month-button.is-active {
  background: var(--ink);
  color: white;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.7fr);
  gap: 22px;
  align-items: start;
}

.calendar-panel {
  overflow: hidden;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday {
  padding: 10px 2px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.weekday.is-weekend {
  color: var(--class);
}

.calendar-day {
  position: relative;
  display: grid;
  grid-template-rows: 27px auto;
  align-content: start;
  justify-items: start;
  min-height: 94px;
  margin: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  text-align: left;
  cursor: pointer;
}

.calendar-day.is-weekend {
  background: var(--weekend);
}

.calendar-day.is-selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.calendar-day.is-today .day-number {
  border-radius: 9px;
  background: var(--ink);
  color: white;
}

.calendar-day.is-empty {
  border-color: transparent;
  background: transparent;
  cursor: default;
}

.day-number {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
}

.day-count {
  display: grid;
  grid-template-rows: repeat(2, 1.35em);
  min-height: 2.7em;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.mini-progress {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf2;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.day-detail {
  position: sticky;
  top: 92px;
}

.day-detail-heading {
  padding: 22px 22px 12px;
}

.day-detail-heading h3 {
  margin-bottom: 4px;
  font-size: 22px;
}

.day-detail-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.tasks-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.tasks-toolbar h2,
.tasks-toolbar p {
  margin-bottom: 0;
}

.overall-progress {
  min-width: 180px;
  text-align: right;
}

.overall-progress strong {
  display: block;
  margin-bottom: 5px;
  font-size: 22px;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebf1;
}

.progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.subject-section {
  margin-bottom: 26px;
}

.subject-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 2px 11px;
  font-size: 18px;
}

.subject-heading::before {
  content: "";
  width: 8px;
  height: 24px;
  border-radius: 99px;
  background: var(--section-color, var(--ink));
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.group-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: 0 7px 20px rgba(36, 50, 74, 0.05);
}

.group-card.is-complete {
  border-color: #b9dfc8;
  background: linear-gradient(145deg, white, var(--success-soft));
}

.group-summary {
  min-height: 148px;
  padding: 19px;
}

.group-card.is-complete .group-summary {
  min-height: 126px;
}

.group-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.group-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--group-soft, #f0f2f6);
  font-size: 22px;
}

.group-count {
  font-size: 25px;
  font-weight: 850;
}

.group-title {
  margin: 16px 0 9px;
  font-size: 17px;
  font-weight: 800;
}

.group-status {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.group-card.is-complete .group-status {
  color: var(--success);
}

.group-occurrences {
  max-height: 390px;
  overflow: auto;
  padding: 0 10px 10px;
  border-top: 1px solid var(--line);
}

.group-occurrences .task-row {
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 61px;
  margin-top: 8px;
}

.group-occurrences .task-toggle {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 20px;
}

.baseline-note {
  margin: 10px 4px 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3f5f8;
  color: var(--muted);
  font-size: 12px;
}

.pin-gate {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(36, 50, 74, 0.48);
  backdrop-filter: blur(16px);
}

.pin-gate[hidden] {
  display: none;
}

.pin-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: white;
  box-shadow: 0 28px 80px rgba(36, 50, 74, 0.3);
}

.pin-emoji {
  margin-bottom: 16px;
  font-size: 38px;
}

.pin-card h2 {
  margin-bottom: 8px;
  font-size: 29px;
}

.pin-card > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.pin-card label {
  display: block;
  margin: 22px 0 8px;
  font-size: 13px;
  font-weight: 800;
}

.pin-card input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid #cbd2dc;
  border-radius: 14px;
  background: #fbfcfd;
  font-size: 21px;
  letter-spacing: 0.12em;
}

.pin-card .pin-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
}

.form-error {
  min-height: 20px;
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.modal-overlay,
.avatar-lightbox {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(36, 50, 74, 0.48);
  backdrop-filter: blur(16px);
}

.modal-overlay[hidden],
.avatar-lightbox[hidden],
.toast[hidden] {
  display: none;
}

.profile-settings-card {
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background: white;
  box-shadow: 0 28px 80px rgba(36, 50, 74, 0.3);
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.modal-heading h2 {
  margin-bottom: 0;
  font-size: 28px;
}

.icon-button,
.lightbox-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.profile-photo-picker {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin: 24px 0 20px;
  padding: 14px;
  border: 1px dashed #b9c2cf;
  border-radius: 18px;
  background: #f8fafc;
  color: var(--math);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.profile-photo-picker img {
  width: 82px;
  height: 82px;
  border: 3px solid white;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 7px 18px rgba(36, 50, 74, 0.16);
}

.profile-name-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.profile-name-field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #cbd2dc;
  border-radius: 13px;
  background: #fbfcfd;
  color: var(--ink);
  font-size: 18px;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
}

.action-spacer {
  flex: 1;
}

.primary-action,
.secondary-action {
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.primary-action {
  border: 0;
  background: var(--ink);
  color: white;
}

.secondary-action {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
}

.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.avatar-lightbox {
  z-index: 190;
  cursor: zoom-out;
}

.avatar-lightbox img {
  max-width: min(760px, calc(100vw - 90px));
  max-height: calc(100vh - 90px);
  border: 5px solid rgba(255, 255, 255, 0.94);
  border-radius: 28px;
  background: white;
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(15, 24, 38, 0.48);
}

.lightbox-close {
  position: absolute;
  top: 26px;
  right: 28px;
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(20, 29, 43, 0.7);
  color: white;
}

.toast {
  position: fixed;
  z-index: 120;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 17px;
  border-radius: 13px;
  background: var(--ink);
  box-shadow: 0 12px 30px rgba(36, 50, 74, 0.25);
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 180ms ease;
}

.celebration-overlay.is-visible {
  opacity: 1;
}

.celebration-card {
  z-index: 2;
  display: grid;
  gap: 8px;
  min-width: min(430px, calc(100vw - 44px));
  padding: 28px 34px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(36, 50, 74, 0.24);
  text-align: center;
  backdrop-filter: blur(18px);
  animation: celebration-pop 460ms cubic-bezier(0.2, 0.9, 0.25, 1.25) both;
}

.celebration-card strong {
  color: var(--ink);
  font-size: clamp(24px, 4vw, 38px);
}

.celebration-card span {
  color: var(--success);
  font-size: 16px;
  font-weight: 800;
}

.celebration-confetti {
  position: absolute;
  top: -22px;
  left: var(--x);
  width: 10px;
  height: 18px;
  border-radius: 3px;
  background: var(--color);
  opacity: 0;
  animation: confetti-fall var(--duration) var(--delay) cubic-bezier(0.12, 0.7, 0.35, 1) forwards;
}

.celebration-confetti:nth-child(3n) {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.celebration-confetti:nth-child(4n) {
  width: 8px;
  height: 22px;
}

@keyframes celebration-pop {
  0% { opacity: 0; transform: scale(0.72) translateY(18px); }
  65% { opacity: 1; transform: scale(1.05) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes confetti-fall {
  0% { opacity: 1; transform: translate3d(0, -5vh, 0) rotate(0deg); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift), 108vh, 0) rotate(var(--rotation)); }
}

@media (max-width: 900px) {
  .app-shell { padding-right: 20px; padding-left: 20px; }
  .content-grid,
  .calendar-layout { grid-template-columns: 1fr; }
  .day-detail { position: static; }
  .calendar-day { min-height: 85px; }
}

@media (max-width: 680px) {
  .app-header { align-items: flex-start; }
  .brand-avatar { width: 44px; height: 44px; }
  .brand-title-row { align-items: flex-start; flex-direction: column; gap: 7px; }
  .profile-edit-button { min-height: 27px; }
  .sync-status { padding: 10px; }
  #sync-label { display: none; }
  .primary-nav { top: max(10px, env(safe-area-inset-top)); bottom: auto; gap: 4px; padding: 4px; }
  .nav-button { min-width: 0; padding: 9px 5px; font-size: 13px; }
  .hero-card { grid-template-columns: 1fr; padding: 24px; }
  .progress-ring { width: 96px; height: 96px; }
  .progress-ring::before { width: 72px; height: 72px; }
  .calendar-toolbar,
  .tasks-toolbar { align-items: flex-start; flex-direction: column; }
  .overall-progress { width: 100%; text-align: left; }
  .calendar-panel { padding: 7px; }
  .weekday { font-size: 10px; }
  .calendar-day { grid-template-rows: 22px auto; min-height: 76px; margin: 2px; padding: 7px; border-radius: 11px; }
  .day-number { width: 22px; height: 22px; font-size: 12px; }
  .day-count { margin-top: 4px; font-size: 9px; line-height: 1.2; }
  .mini-progress { right: 6px; bottom: 6px; left: 6px; }
  .group-grid { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 46px minmax(0, 1fr); }
  .task-row > .subject-chip { display: none; }
  .profile-actions { align-items: stretch; flex-direction: column; }
  .action-spacer { display: none; }
}

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

  .celebration-confetti {
    display: none;
  }
}
