:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --ink: #172033;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e6eaf0;
  --accent: #3157d5;
  --accent-dark: #2444ad;
  --accent-soft: #edf1ff;
  --success: #178c62;
  --success-soft: #e9f7f1;
  --amber: #b76413;
  --amber-soft: #fff4df;
  --danger: #c53b45;
  --shadow: 0 16px 45px rgba(31, 42, 68, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --sidebar: 238px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 8%, rgba(49, 87, 213, 0.08), transparent 24rem),
    var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }

button { color: inherit; }

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(49, 87, 213, 0.22);
  outline-offset: 2px;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 26px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  width: 38px;
  height: 38px;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 8px;
  border-radius: 12px;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(49, 87, 213, 0.24);
}

.brand-mark span {
  width: 5px;
  border-radius: 4px;
  background: #fff;
}

.brand-mark span:nth-child(1) { height: 10px; opacity: .7; }
.brand-mark span:nth-child(2) { height: 19px; }
.brand-mark span:nth-child(3) { height: 14px; opacity: .84; }

.brand-copy { display: grid; }
.brand-copy strong { font-size: 16px; letter-spacing: .01em; }
.brand-copy small { color: var(--muted); font-size: 13px; }

.desktop-nav { display: grid; gap: 5px; }

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-item:hover { background: var(--surface-soft); color: var(--ink); }
.nav-item:active { transform: scale(.985); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-item svg, .mobile-nav-item svg, .icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 0;
  border-top: 1px solid var(--line);
}

.profile > span:last-child { display: grid; }
.profile strong { font-size: 14px; }
.profile small { font-size: 13px; color: var(--success); }

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #202b45;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

main {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: 26px 36px 48px;
}

.topbar {
  max-width: 1240px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow, .section-kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .035em;
}

.topbar h1 { margin: 0; font-size: clamp(1.65rem, 2vw, 2.1rem); line-height: 1.2; }

.top-actions { display: flex; align-items: center; gap: 10px; }

.icon-button {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  cursor: pointer;
}

.icon-button:hover { border-color: #cdd5e2; }
.icon-button.small { width: 36px; height: 36px; border-radius: 11px; }

.notification-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--danger);
}

.primary-button, .secondary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.primary-button { background: var(--accent); color: white; box-shadow: 0 8px 18px rgba(49, 87, 213, .2); }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
.secondary-button { border-color: var(--line); background: var(--surface); }

.prototype-note {
  max-width: 1240px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.prototype-note span {
  padding: 3px 8px;
  border-radius: 99px;
  background: #e8ecf6;
  color: #49536a;
  font-weight: 700;
}

.page-view { display: none; max-width: 1240px; margin: 0 auto; }
.page-view.active { display: block; animation: page-in .24s ease; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.today-overview {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 32px 38px;
  border: 1px solid #dfe5f5;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(115deg, rgba(255,255,255,.98), rgba(247,249,255,.94)),
    var(--surface);
  box-shadow: var(--shadow);
}

.today-overview::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  right: -75px;
  top: -120px;
  border: 38px solid rgba(49, 87, 213, .06);
  border-radius: 50%;
}

.today-overview h2 { max-width: 580px; margin: 4px 0 8px; font-size: clamp(1.6rem, 3vw, 2.55rem); line-height: 1.18; letter-spacing: -.03em; }
.today-overview p:last-child { max-width: 580px; margin: 0; color: var(--muted); }

.progress-cluster { z-index: 1; display: flex; align-items: center; gap: 18px; flex-shrink: 0; }

.progress-ring {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--progress) * 1%), #e7ebf4 0);
  transition: background .3s ease;
}

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

.progress-ring span { z-index: 1; grid-area: 1 / 1; display: grid; text-align: center; }
.progress-ring strong { font-size: 22px; line-height: 1.2; }
.progress-ring small { color: var(--muted); font-size: 12px; }
.progress-copy { display: grid; }
.progress-copy strong { font-size: 19px; }
.progress-copy span { color: var(--muted); font-size: 14px; }

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 16px 0;
}

.metric-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.9);
}

.metric-card div { display: grid; }
.metric-card strong { font-size: 20px; line-height: 1.2; }
.metric-card span:not(.metric-icon) { color: var(--muted); font-size: 13px; }
.metric-card small { grid-column: 2; color: var(--faint); font-size: 12px; margin-top: -8px; }

.metric-icon {
  grid-row: 1 / 3;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  font-weight: 800;
}
.metric-icon.blue { color: var(--accent); background: var(--accent-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.green { color: var(--success); background: var(--success-soft); }

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, .85fr);
  gap: 16px;
}

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.94);
}

.focus-panel, .schedule-panel, .habits-panel { padding: 24px; }
.right-column { display: grid; gap: 16px; align-content: start; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head.compact { margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 20px; }

.text-button, .more-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.more-button { color: var(--faint); letter-spacing: 2px; }
.task-list { display: grid; }

.task-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  min-height: 76px;
  padding: 14px 4px;
  border-top: 1px solid var(--line);
}

.task-item:first-child { border-top: 0; }
.task-check {
  width: 24px;
  height: 24px;
  border: 1.5px solid #b8c0ce;
  border-radius: 8px;
  background: #fff;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.task-item.completed .task-check { border-color: var(--success); background: var(--success); }
.task-item.completed .task-copy strong { color: var(--faint); text-decoration: line-through; }
.task-copy { min-width: 0; display: grid; gap: 7px; }
.task-copy > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.tag { padding: 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.tag.lavender { color: #7454b8; background: #f2edff; }
.tag.blue-tag { color: var(--accent); background: var(--accent-soft); }
.tag.mint { color: #167b68; background: #e8f7f3; }

.priority-pill { padding: 5px 9px; border-radius: 99px; font-size: 12px; white-space: nowrap; }
.priority-pill.q1 { color: #ad2d38; background: #ffeaec; }
.priority-pill.q2 { color: #4b5db5; background: #edf0ff; }

.add-row-button {
  width: 100%;
  min-height: 44px;
  margin-top: 7px;
  border: 1px dashed #ccd4e1;
  border-radius: 12px;
  background: #fbfcfe;
  color: var(--muted);
  cursor: pointer;
}
.add-row-button:hover { border-color: var(--accent); color: var(--accent); }

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li {
  display: grid;
  grid-template-columns: 48px 10px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 11px 0;
}
.timeline time { color: var(--muted); font-size: 13px; }
.timeline-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; box-shadow: 0 0 0 4px currentColor; color: rgba(49,87,213,.12); background: var(--accent); }
.timeline-dot.cyan { color: rgba(12,166,171,.13); background: #0ca6ab; }
.timeline-dot.amber-dot { color: rgba(217,130,38,.14); background: #d98226; }
.timeline li div { display: grid; }
.timeline strong { font-size: 14px; }
.timeline small { color: var(--muted); font-size: 12px; }

.subtle-count { color: var(--muted); font-size: 13px; }
.habit-row { display: flex; flex-wrap: wrap; gap: 8px; }
.habit-chip {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.habit-chip span { display: inline-grid; width: 16px; height: 16px; margin-right: 5px; place-items: center; border: 1px solid #cbd2de; border-radius: 5px; }
.habit-chip.done { border-color: #cceadd; background: var(--success-soft); color: var(--success); }
.habit-chip.done span { border-color: var(--success); background: var(--success); color: #fff; }

.placeholder-view { min-height: 65vh; align-content: center; }
.placeholder-card { max-width: 480px; margin: 60px auto; padding: 48px; text-align: center; }
.placeholder-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 18px; place-items: center; border-radius: 18px; background: var(--accent-soft); color: var(--accent); font-size: 28px; }
.placeholder-card h2 { margin: 0 0 8px; }
.placeholder-card p { margin: 0 0 22px; color: var(--muted); }

.quick-dialog {
  width: min(520px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(24, 32, 51, .24);
}
.quick-dialog::backdrop { background: rgba(21, 29, 48, .38); backdrop-filter: blur(4px); }
.quick-dialog form { padding: 25px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.dialog-head h2 { margin: 0; font-size: 22px; }
.field { display: grid; gap: 7px; margin-top: 15px; color: var(--muted); font-size: 14px; font-weight: 650; }
.field input, .field select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.toast {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  background: #1e293f;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: .22s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.mobile-nav { display: none; }

.page-toolbar {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-description { margin: 0; color: var(--muted); }

.segmented-control, .view-switch, .record-filters {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.8);
}

.segmented-control button, .view-switch button, .record-filters button {
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.segmented-control button.active, .view-switch button.active, .record-filters button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(31,42,68,.08);
  font-weight: 700;
}

.segmented-control button span { margin-left: 4px; color: var(--accent); }
.toolbar-actions { display: flex; gap: 8px; }
.filter-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.compact-button { min-height: 40px; padding-inline: 14px; font-size: 14px; }

.task-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
}

.task-stats > div { display: grid; padding: 17px 20px; background: rgba(255,255,255,.94); }
.task-stats strong { font-size: 22px; }
.task-stats span { color: var(--muted); font-size: 13px; }
.danger-text { color: var(--danger) !important; }

.task-workspace { padding: 24px; }
.search-field {
  display: flex;
  width: 220px;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}
.search-field svg { width: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.table-head, .master-task-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(140px, 1.15fr) minmax(105px, .8fr) minmax(125px, .9fr) 90px;
  align-items: center;
  gap: 15px;
}
.table-head {
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}
.master-task-row {
  width: 100%;
  min-height: 72px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.master-task-row:hover { background: #fafbfe; }
.master-task-row > span { min-width: 0; color: var(--muted); font-size: 13px; }
.task-name { display: flex; align-items: center; gap: 11px; }
.task-name > span { min-width: 0; display: grid; }
.task-name strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.task-name small { color: var(--muted); font-size: 12px; }
.fake-check { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border: 1.5px solid #b8c0ce; border-radius: 7px; color: #fff; font-style: normal; }
.fake-check.checked { border-color: var(--success); background: var(--success); }
.completed-row .task-name strong { color: var(--faint); text-decoration: line-through; }
.status-pill { display: inline-flex; min-height: 27px; align-items: center; padding: 0 9px; border-radius: 99px; font-size: 12px; white-space: nowrap; }
.status-pill.doing { color: var(--accent); background: var(--accent-soft); }
.status-pill.todo, .status-pill.neutral-status { color: #59657a; background: #f0f2f6; }
.status-pill.done-status, .status-pill.positive-status { color: var(--success); background: var(--success-soft); }
.status-pill.urgent-status { color: var(--danger); background: #ffeaec; }
.priority-pill.q3 { color: var(--amber); background: var(--amber-soft); }

.quadrant-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.quadrant-card { min-height: 260px; padding: 20px; border: 1px solid var(--line); border-top: 4px solid; border-radius: var(--radius-lg); background: rgba(255,255,255,.94); }
.quadrant-card.q-one { border-top-color: #d95863; }
.quadrant-card.q-two { border-top-color: #6177db; }
.quadrant-card.q-three { border-top-color: #d98a35; }
.quadrant-card.q-four { border-top-color: #98a2b3; }
.quadrant-card header { display: flex; align-items: start; justify-content: space-between; margin-bottom: 16px; }
.quadrant-card header span { color: var(--muted); font-size: 12px; }
.quadrant-card header h2 { margin: 2px 0 0; font-size: 18px; }
.quadrant-card header > strong { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; background: var(--surface-soft); font-size: 14px; }
.quadrant-task { width: 100%; display: grid; gap: 3px; margin: 7px 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; cursor: pointer; }
.quadrant-task:hover { border-color: #c8d1e2; box-shadow: 0 6px 16px rgba(31,42,68,.06); }
.quadrant-task strong { font-size: 14px; }
.quadrant-task small { color: var(--muted); font-size: 12px; }

.calendar-surface { overflow: hidden; padding: 24px; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.calendar-header h2 { margin: 0; font-size: 22px; }
.calendar-actions { display: flex; gap: 8px; }
.arrow-buttons { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.arrow-buttons button { width: 40px; border: 0; border-left: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.arrow-buttons button:first-child { border-left: 0; }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekday-row span { padding: 10px; color: var(--muted); text-align: center; font-size: 13px; }
.calendar-grid { overflow: hidden; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 12px; }
.calendar-day { position: relative; min-height: 112px; display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; }
.calendar-day:hover { background: #fafbff; }
.calendar-day > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; font-size: 13px; }
.calendar-day.outside > span { color: #b8bec9; }
.calendar-day.selected { background: #f6f8ff; box-shadow: inset 0 0 0 2px var(--accent); }
.calendar-day.selected > span { background: var(--accent); color: white; font-weight: 700; }
.calendar-event { overflow: hidden; padding: 4px 6px; border-radius: 6px; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-style: normal; }
.calendar-event.blue-event { color: #3556c4; background: #ebefff; }
.calendar-event.red-event { color: #a8323c; background: #ffeaec; }
.calendar-event.green-event { color: #167b61; background: #e8f7f1; }
.calendar-event.purple-event { color: #7251aa; background: #f2edff; }
.calendar-event.amber-event { color: #a85d15; background: #fff2dc; }
.event-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.event-dot.green-event { background: var(--success); }

.plan-panel { display: none; }
.plan-panel.active { display: block; animation: page-in .2s ease; }
.goal-hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 30px 34px; background: linear-gradient(120deg, #fff 35%, #f0f4ff); }
.year-chip { display: inline-flex; padding: 5px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.goal-heading h2 { max-width: 670px; margin: 12px 0 8px; font-size: clamp(1.6rem, 2.8vw, 2.25rem); line-height: 1.22; }
.goal-heading > p { max-width: 620px; margin: 0; color: var(--muted); }
.goal-stats { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; color: var(--muted); font-size: 13px; }
.goal-stats strong { color: var(--ink); font-size: 17px; }
.large-progress { display: grid; justify-items: center; gap: 10px; flex: 0 0 auto; }
.goal-ring { width: 128px; height: 128px; }
.goal-ring::before { width: 96px; height: 96px; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .8fr); gap: 16px; margin-top: 16px; }
.plan-chain, .week-focus, .planning-board { padding: 24px; }
.chain-node { display: grid; grid-template-columns: auto minmax(0,1fr) 120px; align-items: center; gap: 13px; }
.chain-node > div:nth-child(2) { display: grid; }
.chain-node strong { font-size: 14px; }
.chain-node small { color: var(--muted); font-size: 12px; }
.node-marker { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; font-size: 13px; font-weight: 800; }
.year-node { color: #fff; background: #293653; }
.month-node { color: var(--accent); background: var(--accent-soft); }
.week-node { color: #167b68; background: #e8f7f3; }
.day-node { color: #a55b18; background: #fff1dc; }
.chain-link { height: 18px; margin-left: 18px; border-left: 1px dashed #c8d0de; }
.current-node { padding: 10px; border-radius: 14px; background: var(--surface-soft); }
.mini-progress { overflow: hidden; height: 7px; border-radius: 99px; background: #e9edf5; }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.green-progress i { background: var(--success); }
.amber-progress i { background: #d98226; }
.plain-percent { font-size: 22px; color: var(--accent); }
.result-row { display: flex; align-items: center; gap: 11px; padding: 14px 2px; border-top: 1px solid var(--line); }
.result-row > span { display: grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; border: 1.5px solid #b8c0ce; border-radius: 7px; font-size: 12px; }
.result-row div { display: grid; }
.result-row strong { font-size: 14px; }
.result-row small { color: var(--muted); font-size: 12px; }
.done-result > span { border-color: var(--success); background: var(--success); color: white; }
.done-result strong { color: var(--faint); text-decoration: line-through; }
.outcome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.outcome-grid article { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-soft); }
.outcome-number { color: var(--accent); font-size: 13px; font-weight: 800; }
.outcome-grid h3 { margin: 12px 0 5px; font-size: 17px; }
.outcome-grid p { min-height: 44px; margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.week-board { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 8px; overflow-x: auto; }
.week-board article { min-height: 240px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.week-board article > span { color: var(--muted); font-size: 13px; }
.week-board article > strong { display: block; margin: 4px 0 7px; }
.week-board article p { padding: 7px 8px; border-radius: 8px; background: #fff; font-size: 12px; }
.week-board .today-column { border-color: #bcc8f7; background: #f2f5ff; }
.day-bar { display: block; height: 4px; border-radius: 99px; background: #e3e7ef; }
.day-bar::after { content: ""; display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); }
.day-bar.full::after { width: 100%; }
.day-bar.almost::after { width: 67%; }
.day-bar.current::after { width: 60%; }
.project-grid, .course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 16px; padding: 24px; }
.project-card h2 { margin: 0 0 5px; font-size: 19px; }
.project-card p:not(.section-kicker) { margin: 0; color: var(--muted); font-size: 14px; }
.project-card > strong { font-size: 20px; }
.project-card .mini-progress { grid-column: 1 / -1; }
.project-symbol { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; font-size: 14px; font-weight: 800; }
.indigo-bg { color: var(--accent); background: var(--accent-soft); }
.green-bg { color: var(--success); background: var(--success-soft); }
.amber-bg { color: var(--amber); background: var(--amber-soft); }

.course-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 23px; }
.course-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 15px; font-weight: 800; }
.math-icon { color: var(--accent); background: var(--accent-soft); }
.english-icon { color: #7752b0; background: #f1ebff; }
.design-icon { color: var(--success); background: var(--success-soft); }
.course-card h2 { margin: 0; font-size: 19px; }
.course-card > .status-pill { position: absolute; top: 22px; right: 22px; }
.course-next { grid-column: 1 / -1; display: grid; padding: 15px; border-radius: 13px; background: var(--surface-soft); }
.course-next small, .course-next span { color: var(--muted); font-size: 12px; }
.course-next strong { margin: 3px 0; font-size: 14px; }
.course-card .add-row-button { grid-column: 1 / -1; }

.habit-summary-grid { display: grid; grid-template-columns: 1.7fr .65fr .65fr; gap: 16px; margin-bottom: 16px; }
.habit-summary-main { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px; }
.habit-summary-main h2 { margin: 3px 0 5px; font-size: 24px; }
.habit-summary-main p:last-child { margin: 0; color: var(--muted); }
.habit-ring { width: 100px; height: 100px; }
.habit-ring::before { width: 74px; height: 74px; }
.small-stat { display: grid; align-content: center; padding: 22px; }
.small-stat span, .small-stat small { color: var(--muted); font-size: 13px; }
.small-stat strong { margin: 4px 0; font-size: 24px; }
.habit-matrix-card { padding: 24px; overflow-x: auto; }
.habit-matrix { min-width: 760px; }
.matrix-head, .matrix-row { display: grid; grid-template-columns: minmax(170px, 1.5fr) repeat(7, 54px) 80px; align-items: center; gap: 8px; min-height: 54px; border-top: 1px solid var(--line); }
.matrix-head { border: 0; color: var(--muted); font-size: 12px; text-align: center; }
.matrix-head span:first-child { text-align: left; }
.matrix-row strong { font-size: 14px; }
.matrix-row > span:last-child { color: var(--muted); text-align: center; font-size: 13px; }
.mark { width: 30px; height: 30px; margin: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: white; cursor: pointer; }
.mark.done { border-color: var(--success); background: var(--success); }
.mark.current { border-color: var(--accent); box-shadow: inset 0 0 0 2px white; background: var(--accent-soft); }

.record-layout { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.4fr); gap: 16px; }
.record-list-panel, .record-editor { padding: 24px; }
.record-filters { overflow-x: auto; margin-bottom: 12px; }
.record-filters button { flex: 1; padding-inline: 8px; }
.record-item { width: 100%; display: grid; gap: 4px; padding: 15px 12px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.record-item.active { border-radius: 13px; background: var(--accent-soft); }
.record-item strong { font-size: 14px; }
.record-item small, .record-item p { margin: 0; color: var(--muted); font-size: 12px; }
.record-item p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-type { justify-self: start; padding: 3px 7px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.review-type { color: var(--accent); background: var(--accent-soft); }
.idea-type { color: var(--amber); background: var(--amber-soft); }
.diary-type { color: var(--success); background: var(--success-soft); }
.record-editor-head { display: flex; align-items: start; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.record-editor-head h2 { margin: 11px 0 3px; font-size: 24px; }
.record-editor-head p { margin: 0; color: var(--muted); font-size: 13px; }
.reflection-question { display: grid; gap: 7px; margin-top: 20px; }
.reflection-question label { font-size: 14px; font-weight: 750; }
.reflection-question textarea, .sheet-section textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  line-height: 1.65;
}
.reflection-question textarea:focus, .sheet-section textarea:focus { outline: 3px solid rgba(49,87,213,.14); border-color: #aebcf3; }
.editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.editor-actions > span { color: var(--muted); font-size: 12px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.data-card { min-height: 160px; display: grid; align-content: center; padding: 23px; }
.data-card h2 { margin: 4px 0 3px; font-size: 28px; }
.data-card > span, .data-card div > span { color: var(--muted); font-size: 13px; }
.data-card .text-button { justify-self: start; margin-top: 14px; padding: 0; }
.today-data { grid-template-columns: 1fr auto; align-items: center; }
.data-ring { width: 92px; height: 92px; }
.data-ring::before { width: 68px; height: 68px; }
.mini-progress.wide { margin-top: 20px; }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr); gap: 16px; }
.chart-card { padding: 24px; }
.line-chart { position: relative; min-height: 270px; padding: 4px 0 0 44px; }
.chart-guides { position: absolute; inset: 3px auto 34px 0; display: flex; flex-direction: column; justify-content: space-between; color: var(--faint); font-size: 11px; }
.line-chart::before { content: ""; position: absolute; inset: 6px 0 36px 44px; background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), var(--line) 25%); }
.line-chart svg { position: relative; z-index: 1; width: 100%; overflow: visible; }
.chart-area { fill: url(#lineFill); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.chart-points circle { fill: #fff; stroke: var(--accent); stroke-width: 3; }
.chart-points .current-point { fill: var(--accent); stroke: #fff; stroke-width: 4; }
.chart-labels { display: flex; justify-content: space-between; padding-top: 3px; color: var(--muted); font-size: 12px; }
.donut-wrap { display: grid; justify-items: center; gap: 24px; padding-top: 7px; }
.donut { display: grid; width: 154px; height: 154px; place-items: center; border-radius: 50%; background: conic-gradient(#d95863 0 25%, #6177db 25% 62.5%, #d98a35 62.5% 87.5%, #aab1bd 87.5%); }
.donut::before { content: ""; grid-area: 1 / 1; width: 104px; height: 104px; border-radius: 50%; background: white; }
.donut span { z-index: 1; grid-area: 1 / 1; display: grid; text-align: center; }
.donut strong { font-size: 26px; }
.donut small { color: var(--muted); font-size: 12px; }
.legend { width: 100%; display: grid; gap: 5px; }
.legend button { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 7px 4px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.legend button span { color: var(--muted); font-size: 13px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; }
.legend-dot.red { background: #d95863; }
.legend-dot.blue { background: #6177db; }
.legend-dot.amber { background: #d98a35; }
.legend-dot.gray { background: #aab1bd; }
.goal-progress-list { margin-top: 16px; padding: 24px; }
.progress-list-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto minmax(140px,.45fr); align-items: center; gap: 14px; padding: 13px 2px; border-top: 1px solid var(--line); }
.progress-list-row > div:nth-child(2) { display: grid; }
.progress-list-row small { color: var(--muted); font-size: 12px; }

.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; }
.settings-menu { display: grid; align-content: start; gap: 4px; }
.settings-menu button { min-height: 44px; padding: 0 13px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.settings-menu button.active { background: var(--surface); color: var(--accent); box-shadow: 0 5px 18px rgba(31,42,68,.06); font-weight: 700; }
.settings-card { padding: 26px; }
.settings-section { padding: 4px 0 28px; border-bottom: 1px solid var(--line); }
.settings-section + .settings-section { padding-top: 26px; }
.settings-section:last-child { border-bottom: 0; padding-bottom: 4px; }
.settings-section h2 { margin: 0 0 16px; font-size: 20px; }
.profile-setting { display: flex; align-items: center; gap: 13px; }
.profile-setting > div { display: grid; margin-right: auto; }
.profile-setting span:not(.avatar) { color: var(--muted); font-size: 13px; }
.large-avatar { width: 46px; height: 46px; }
.setting-row { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); }
.setting-row > div { display: grid; }
.setting-row strong { font-size: 14px; }
.setting-row span { color: var(--muted); font-size: 13px; }
.switch-input { appearance: none; width: 44px; height: 25px; flex: 0 0 auto; padding: 3px; border-radius: 99px; background: #cbd2dd; cursor: pointer; transition: .2s; }
.switch-input::before { content: ""; display: block; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(31,42,68,.2); transition: .2s; }
.switch-input:checked { background: var(--accent); }
.switch-input:checked::before { transform: translateX(19px); }
.routine-settings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.routine-settings label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.routine-settings input, .routine-settings select { min-height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); color: var(--ink); }

.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.more-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--line); text-align: left; cursor: pointer; }
.more-card > div { display: grid; }
.more-card small { color: var(--muted); font-size: 12px; }
.more-card b { color: var(--faint); }
.more-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: var(--accent); background: var(--accent-soft); font-weight: 800; }
.purple-more { color: #7752b0; background: #f1ebff; }
.green-more { color: var(--success); background: var(--success-soft); }
.amber-more { color: var(--amber); background: var(--amber-soft); }
.gray-more { color: #59657a; background: #edf0f4; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(21,29,48,.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.detail-sheet, .notification-sheet {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 60;
  width: min(460px, 100vw);
  overflow-y: auto;
  padding: 25px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -20px 0 60px rgba(31,42,68,.14);
  transform: translateX(105%);
  transition: transform .25s ease;
}
.detail-sheet.open, .notification-sheet.open { transform: translateX(0); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 25px; }
.sheet-head h2 { margin: 0; font-size: 22px; }
.sheet-check-title { display: flex; align-items: flex-start; gap: 12px; font-size: 21px; font-weight: 800; line-height: 1.35; }
.sheet-check-title input { width: 23px; height: 23px; margin-top: 3px; accent-color: var(--success); }
.recommendation-box { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; margin: 22px 0; padding: 14px; border: 1px solid #dbe2fb; border-radius: 13px; background: #f4f6ff; }
.recommendation-box .recommend-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--accent); color: white; }
.recommendation-box p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.recommendation-box button { align-self: start; border: 0; background: transparent; color: var(--accent); font-size: 13px; cursor: pointer; }
.sheet-fields { border-top: 1px solid var(--line); }
.sheet-field { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.sheet-field span { color: var(--muted); font-size: 13px; }
.sheet-field strong { font-size: 14px; font-weight: 650; }
.sheet-section { margin-top: 25px; }
.sheet-section h3 { margin: 0 0 10px; font-size: 16px; }
.reminder-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 11px; background: var(--surface-soft); font-size: 13px; }
.reminder-row + .reminder-row { margin-top: 7px; }
.reminder-row small { color: var(--muted); }
.sheet-footer { position: sticky; bottom: -25px; display: flex; justify-content: flex-end; gap: 9px; margin: 28px -25px -25px; padding: 16px 25px; border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.notification-list { display: grid; gap: 8px; margin-bottom: 18px; }
.notification-item { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.notification-item.unread { border-color: #dbe2fb; background: #f5f7ff; }
.notification-item > div { display: grid; gap: 3px; }
.notification-item strong { font-size: 14px; }
.notification-item p { margin: 0; color: var(--muted); font-size: 13px; }
.notification-item small { color: var(--faint); font-size: 12px; }
.notification-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; font-weight: 800; }
.notification-icon.warning { color: var(--amber); background: var(--amber-soft); }
.notification-icon.info { color: var(--accent); background: var(--accent-soft); }
.notification-icon.success { color: var(--success); background: var(--success-soft); }

@media (max-width: 980px) {
  :root { --sidebar: 206px; }
  main { padding-inline: 24px; }
  .today-grid { grid-template-columns: 1fr; }
  .right-column { grid-template-columns: 1fr 1fr; }
  .metric-card small { display: none; }
  .table-head, .master-task-row { grid-template-columns: minmax(220px, 1.8fr) minmax(125px, 1fr) 100px 120px; }
  .table-head > *:last-child, .master-task-row > *:last-child { display: none; }
  .plan-grid, .chart-grid { grid-template-columns: 1fr; }
  .project-grid, .course-grid { grid-template-columns: repeat(2, 1fr); }
  .habit-summary-grid { grid-template-columns: 1.4fr .7fr; }
  .habit-summary-main { grid-row: 1 / 3; }
  .record-layout { grid-template-columns: minmax(245px, .65fr) minmax(0, 1.2fr); }
}

@media (max-width: 760px) {
  body { background: #f7f8fb; }
  .sidebar { display: none; }
  main { margin-left: 0; padding: 18px 16px 96px; }
  .topbar { margin-bottom: 12px; }
  .topbar h1 { font-size: 1.55rem; }
  .top-actions .primary-button { width: 44px; padding: 0; font-size: 0; }
  .top-actions .primary-button span { font-size: 24px; }
  .prototype-note { margin-bottom: 12px; }
  .page-toolbar { align-items: stretch; flex-direction: column; }
  .page-description { font-size: 14px; }
  .segmented-control { overflow-x: auto; }
  .segmented-control button { flex: 0 0 auto; }
  .toolbar-actions { justify-content: space-between; }
  .view-switch { margin-left: auto; }
  .today-overview { min-height: auto; padding: 23px; border-radius: 20px; }
  .today-overview h2 { font-size: 1.72rem; }
  .today-overview p:last-child { font-size: 14px; }
  .progress-cluster { align-self: flex-start; }
  .progress-ring { width: 88px; height: 88px; }
  .progress-ring::before { width: 68px; height: 68px; }
  .progress-ring strong { font-size: 18px; }
  .progress-ring small, .progress-copy { display: none; }
  .metric-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .metric-card { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 8px; padding: 13px; }
  .metric-card .metric-icon { width: 30px; height: 30px; }
  .metric-card strong { font-size: 17px; }
  .metric-card span:not(.metric-icon) { font-size: 12px; line-height: 1.3; }
  .right-column { grid-template-columns: 1fr; }
  .focus-panel, .schedule-panel, .habits-panel { padding: 19px; }
  .task-item { grid-template-columns: auto minmax(0, 1fr) auto; padding: 14px 0; }
  .priority-pill { grid-column: 2; justify-self: start; }
  .more-button { grid-column: 3; grid-row: 1 / 3; }
  .task-meta span:last-child { display: none; }
  .task-stats { grid-template-columns: repeat(2, 1fr); }
  .task-workspace { padding: 18px; }
  .task-workspace .section-head { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .table-head { display: none; }
  .master-task-list { display: grid; gap: 8px; }
  .master-task-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
  }
  .master-task-row > span { display: block !important; }
  .master-task-row > span:first-child { grid-column: 1 / -1; }
  .master-task-row > span:nth-child(2) { grid-column: 1; }
  .master-task-row > span:nth-child(3) { grid-column: 2; grid-row: 2; text-align: right; }
  .master-task-row > span:nth-child(4) { grid-column: 1; }
  .master-task-row > span:nth-child(5) { grid-column: 2; text-align: right; }
  .quadrant-layout { grid-template-columns: 1fr; }
  .calendar-surface { overflow-x: auto; padding: 18px; }
  .calendar-header, .weekday-row, .calendar-grid { min-width: 680px; }
  .calendar-day { min-height: 96px; }
  .goal-hero { align-items: flex-start; padding: 23px; }
  .goal-stats { gap: 10px; }
  .goal-ring { width: 98px; height: 98px; }
  .goal-ring::before { width: 73px; height: 73px; }
  .goal-ring .progress-ring strong { font-size: 18px; }
  .plan-chain, .week-focus, .planning-board { padding: 19px; }
  .chain-node { grid-template-columns: auto minmax(0,1fr); }
  .chain-node .mini-progress { grid-column: 2; width: 100%; }
  .current-node .text-button { grid-column: 2; justify-self: start; padding: 0; }
  .outcome-grid { grid-template-columns: 1fr; }
  .outcome-grid p { min-height: auto; }
  .week-board { grid-template-columns: repeat(7, 145px); }
  .project-grid, .course-grid { grid-template-columns: 1fr; }
  .habit-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .habit-summary-main { grid-column: 1 / -1; grid-row: auto; }
  .habit-matrix-card { padding: 18px; }
  .record-layout { grid-template-columns: 1fr; }
  .record-list-panel, .record-editor { padding: 18px; }
  .record-list-panel .record-item:not(.active) { display: none; }
  .record-editor-head h2 { font-size: 21px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid .today-data { grid-column: 1 / -1; }
  .chart-card, .goal-progress-list { padding: 18px; }
  .progress-list-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .progress-list-row .mini-progress { grid-column: 2 / -1; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-menu { display: flex; overflow-x: auto; }
  .settings-menu button { flex: 0 0 auto; }
  .settings-card { padding: 20px; }
  .routine-settings { grid-template-columns: 1fr; }
  .more-grid { grid-template-columns: 1fr; }
  .detail-sheet, .notification-sheet { width: 100vw; border-left: 0; }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(18px);
  }
  .mobile-nav-item {
    min-height: 52px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
  }
  .mobile-nav-item svg { width: 21px; height: 21px; }
  .mobile-nav-item.active { color: var(--accent); font-weight: 700; }
  .quick-dialog { margin: auto auto 0; border-radius: 22px 22px 0 0; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .toast { right: 16px; bottom: 82px; }
}

@media (max-width: 470px) {
  .today-overview { align-items: flex-start; }
  .today-overview p:last-child { display: none; }
  .progress-ring { width: 78px; height: 78px; }
  .progress-ring::before { width: 60px; height: 60px; }
  .metric-icon { display: none !important; }
  .metric-card { min-height: 84px; justify-content: center; }
  .metric-card strong { font-size: 16px; }
  .goal-hero { flex-direction: column; }
  .large-progress { width: 100%; grid-template-columns: auto 1fr; align-items: center; justify-items: start; }
  .habit-summary-main { align-items: flex-start; }
  .habit-summary-main p:last-child { font-size: 13px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .today-data { grid-column: auto; }
  .line-chart { min-height: 220px; padding-left: 36px; }
  .progress-list-row { grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; }
  .record-editor { border-radius: 18px; }
  .reflection-question textarea { min-height: 90px; }
  .course-card > .status-pill { position: static; grid-column: 1 / -1; justify-self: start; }
  .sheet-field { grid-template-columns: 90px 1fr; }
}

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