:root {
  color-scheme: light;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  --ink: #15182a;
  --muted: #777e91;
  --muted-2: #a7adbb;
  --line: #e8ebf2;
  --blue: #2b59f0;
  --blue-deep: #173ec6;
  --blue-soft: #eef3ff;
  --surface: #ffffff;
  --surface-soft: #f7f8fc;
  --shadow: 0 24px 80px rgba(38, 48, 83, 0.12);
  --radius-xl: 30px;
  --radius-lg: 23px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: #f1f4f9;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(43, 89, 240, 0.28);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  width: 34rem;
  height: 34rem;
  left: -12rem;
  top: -13rem;
  background: rgba(117, 153, 255, 0.25);
}

.ambient-two {
  width: 28rem;
  height: 28rem;
  right: -11rem;
  bottom: -10rem;
  background: rgba(143, 211, 231, 0.23);
}

.app-shell {
  width: min(1480px, calc(100vw - 48px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  display: grid;
  grid-template-columns: 250px minmax(520px, 1fr) 300px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(24px);
}

.side-panel,
.day-panel {
  padding: 34px 26px;
  background: rgba(248, 249, 253, 0.84);
}

.side-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(43, 89, 240, 0.27);
}

.brand-mark svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-add,
.primary-add {
  border: 0;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #3d6cff);
  box-shadow: 0 12px 24px rgba(43, 89, 240, 0.23);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.quick-add:hover,
.primary-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(43, 89, 240, 0.3);
}

.quick-add {
  width: 100%;
  min-height: 48px;
  margin: 38px 0 28px;
  padding: 0 13px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 15px;
  font-weight: 650;
}

.quick-add > span,
.primary-add > span {
  font-size: 1.3rem;
  line-height: 1;
}

kbd {
  margin-left: auto;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.12);
  font: 600 0.72rem/1.2 inherit;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-item {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 180ms ease;
}

.nav-item:hover {
  color: var(--ink);
  background: #f0f2f8;
}

.nav-item.active {
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 650;
}

.nav-icon {
  width: 22px;
  height: 22px;
}

.nav-icon svg,
.icon-button svg,
.mobile-dock svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-badge {
  min-width: 24px;
  height: 24px;
  margin-left: auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
  font-size: 0.76rem;
}

.focus-card {
  margin-top: auto;
  padding: 19px;
  border: 1px solid #e5e9f3;
  border-radius: var(--radius-md);
  background: #fff;
}

.focus-card-top {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

.focus-orbit {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1px solid #cdd7ff;
  border-radius: 50%;
}

.focus-orbit i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.focus-card strong {
  display: inline-block;
  margin-top: 15px;
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.focus-unit {
  color: var(--muted);
  font-size: 0.82rem;
}

.focus-track {
  height: 6px;
  margin: 14px 0 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf0f6;
}

.focus-track i {
  display: block;
  width: 65%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #7f9cff);
  transition: width 350ms ease;
}

.focus-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.5;
}

.profile-row {
  margin-top: 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #27304d;
  background: linear-gradient(145deg, #dfe8ff, #c8d7ff);
  font-size: 0.85rem;
  font-weight: 700;
}

.profile-row strong,
.profile-row small {
  display: block;
}

.profile-row strong {
  font-size: 0.83rem;
}

.profile-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
}

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

.sync-status {
  width: fit-content;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #71809c;
  font-size: 0.64rem;
  line-height: 1;
}

.sync-status i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.sync-status b {
  font-weight: 650;
}

.sync-status.is-synced {
  color: #258a69;
}

.sync-status.is-syncing {
  color: var(--blue);
}

.sync-status.is-syncing i {
  animation: sync-pulse 1.2s ease-in-out infinite;
}

.sync-status.is-offline {
  color: #c27b1c;
}

.mobile-account {
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes sync-pulse {
  50% { opacity: 0.25; transform: scale(0.72); }
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 9px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 160ms ease;
}

.icon-button:hover {
  color: var(--ink);
  background: #eef1f7;
}

.icon-button.soft {
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.main-panel {
  min-width: 0;
  padding: 38px 42px 48px;
}

.mobile-header {
  display: none;
}

.date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

.date-line {
  display: flex;
  align-items: center;
  gap: 13px;
}

.date-line h1 {
  margin: 0;
  font-size: clamp(2.25rem, 4.2vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.065em;
}

.today-pill {
  padding: 6px 11px;
  border: 0;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

.today-pill:not(.is-today) {
  color: var(--muted);
  background: var(--surface-soft);
}

.date-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-add {
  min-height: 42px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 13px;
  font-size: 0.88rem;
  font-weight: 650;
}

.desktop-add {
  margin-left: 5px;
}

.rhythm-card {
  position: relative;
  min-height: 184px;
  margin: 30px 0 20px;
  padding: 30px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  overflow: hidden;
  border-radius: 25px;
  color: #fff;
  background:
    radial-gradient(circle at 78% 15%, rgba(166, 203, 255, 0.44), transparent 28%),
    linear-gradient(135deg, #18367f 0%, #244bc5 54%, #5389fb 100%);
  box-shadow: 0 20px 42px rgba(32, 71, 178, 0.24);
}

.rhythm-card::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  bottom: -160px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.045), 0 0 0 60px rgba(255, 255, 255, 0.025);
}

.rhythm-grid {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(90deg, #000, transparent 65%);
}

.rhythm-copy,
.rhythm-metric {
  position: relative;
  z-index: 1;
}

.card-label {
  font-size: 0.72rem;
  font-weight: 680;
  letter-spacing: 0.16em;
  opacity: 0.7;
}

.rhythm-copy h2 {
  max-width: 430px;
  margin: 14px 0 8px;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.rhythm-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.83rem;
}

.rhythm-metric {
  flex: 0 0 auto;
  text-align: center;
}

.metric-ring,
.progress-orbit {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(currentColor var(--progress), rgba(255, 255, 255, 0.17) 0);
}

.metric-ring {
  width: 94px;
  height: 94px;
  position: relative;
  color: #fff;
}

.metric-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: #3262d9;
}

.metric-ring span {
  position: relative;
  z-index: 1;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.metric-ring small {
  font-size: 0.7rem;
  opacity: 0.7;
}

.rhythm-metric p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.7rem;
}

.week-card {
  padding: 23px 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading.compact {
  align-items: center;
}

.section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 0.64rem;
  font-weight: 760;
  letter-spacing: 0.16em;
}

.section-heading h2,
.side-section-title h2,
.dialog-header h2 {
  margin: 0;
  font-size: 1.04rem;
  letter-spacing: -0.025em;
}

.week-nav {
  display: flex;
  gap: 2px;
}

.week-strip {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.day-chip {
  min-width: 0;
  padding: 10px 4px 9px;
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 160ms ease;
}

.day-chip:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.day-chip strong {
  font-size: 1rem;
}

.day-chip span {
  font-size: 0.68rem;
}

.day-chip i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
}

.day-chip.has-items i {
  background: var(--blue);
}

.day-chip.active {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(43, 89, 240, 0.25);
}

.day-chip.active i {
  background: #fff;
}

.schedule-section {
  margin-top: 28px;
}

.schedule-heading h2 span {
  margin-left: 5px;
  color: var(--muted-2);
  font-size: 0.82rem;
  font-weight: 500;
}

.filter-tabs {
  padding: 4px;
  display: flex;
  gap: 2px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.filter-tabs button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 0.76rem;
  cursor: pointer;
}

.filter-tabs button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 3px 10px rgba(30, 41, 70, 0.08);
  font-weight: 650;
}

.schedule-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.task-item {
  position: relative;
  min-height: 76px;
  padding: 13px 14px 13px 17px;
  display: grid;
  grid-template-columns: 64px 4px 1fr auto;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.task-item:hover {
  transform: translateY(-1px);
  border-color: #dbe2f3;
  box-shadow: 0 10px 25px rgba(34, 44, 75, 0.07);
}

.task-time {
  display: grid;
  gap: 3px;
}

.task-time strong {
  font-size: 0.96rem;
}

.task-time span {
  color: var(--muted);
  font-size: 0.68rem;
}

.task-accent {
  align-self: stretch;
  border-radius: 99px;
  background: var(--task-color, var(--blue));
}

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

.task-copy h3 {
  margin: 0 0 6px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-copy p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.69rem;
}

.category-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--task-color, var(--blue));
}

.task-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.complete-button {
  width: 29px;
  height: 29px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1.5px solid #cbd2e1;
  border-radius: 9px;
  color: #fff;
  background: #fff;
  cursor: pointer;
  transition: 160ms ease;
}

.complete-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.complete-button:hover {
  border-color: var(--blue);
}

.delete-button {
  width: 29px;
  height: 29px;
  padding: 7px;
  border: 0;
  border-radius: 9px;
  color: var(--muted-2);
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition: 160ms ease;
}

.delete-button svg {
  width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-item:hover .delete-button,
.delete-button:focus-visible {
  opacity: 1;
}

.delete-button:hover {
  color: #d54558;
  background: #fff1f3;
}

.task-item.done {
  background: #fafbfc;
}

.task-item.done .complete-button {
  border-color: var(--blue);
  background: var(--blue);
}

.task-item.done .task-copy h3 {
  color: var(--muted);
  text-decoration: line-through;
}

.task-item.done .task-accent {
  opacity: 0.32;
}

.empty-state {
  min-height: 170px;
  padding: 28px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed #dbe0eb;
  border-radius: 18px;
  background: linear-gradient(145deg, #fbfcff, #f7f9fd);
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  font-size: 0.95rem;
}

.empty-state span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.empty-state button {
  margin-top: 16px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.day-panel {
  border-left: 1px solid var(--line);
}

.panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.day-progress {
  margin-top: 34px;
  padding-bottom: 30px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.progress-orbit {
  width: 118px;
  height: 118px;
  position: relative;
  margin: 0 auto;
  color: var(--blue);
  background: conic-gradient(var(--blue) var(--progress), #e8ecf5 0);
  transition: background 250ms ease;
}

.progress-orbit::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: #f9faff;
}

.progress-orbit div {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.progress-orbit strong {
  font-size: 2rem;
  letter-spacing: -0.06em;
}

.progress-orbit span {
  color: var(--muted-2);
  font-size: 0.85rem;
}

.day-progress h2 {
  margin: 18px 0 6px;
  font-size: 1.04rem;
}

.day-progress p {
  margin: 0 auto;
  max-width: 190px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
}

.next-up {
  margin-top: 28px;
}

.side-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.side-section-title span {
  color: var(--muted);
  font-size: 0.72rem;
}

#nextList {
  margin-top: 15px;
  display: grid;
  gap: 4px;
}

.next-item {
  padding: 11px 6px;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  border-bottom: 1px solid #eef0f5;
}

.next-item > span {
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 700;
}

.next-item strong,
.next-item small {
  display: block;
}

.next-item strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.64rem;
}

.side-empty {
  padding: 20px 4px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

.quote-card {
  position: relative;
  margin: 34px 0 0;
  padding: 21px 20px;
  overflow: hidden;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #252b3f, #171b2b);
}

.quote-card > span {
  position: absolute;
  right: 14px;
  top: -20px;
  color: rgba(255, 255, 255, 0.08);
  font: 7rem/1 Georgia, serif;
}

.quote-card p {
  position: relative;
  margin: 0 0 14px;
  font-size: 0.8rem;
  line-height: 1.65;
}

.quote-card cite {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.64rem;
  font-style: normal;
  letter-spacing: 0.08em;
}

.mobile-dock {
  display: none;
}

.task-dialog {
  width: min(520px, calc(100vw - 30px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 30px 90px rgba(14, 22, 49, 0.25);
}

.task-dialog::backdrop {
  background: rgba(18, 25, 47, 0.4);
  backdrop-filter: blur(7px);
}

.task-dialog[open] {
  animation: dialog-in 220ms ease-out;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.task-dialog form {
  padding: 28px;
}

.dialog-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-header h2 {
  font-size: 1.3rem;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-grid + .field-grid,
.full-field + .field-grid {
  margin-top: 15px;
}

.field span {
  color: #535a6e;
  font-size: 0.75rem;
  font-weight: 620;
}

.field input,
.field select {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #e2e5ed;
  border-radius: 12px;
  color: var(--ink);
  background: #f8f9fc;
  font-size: 0.84rem;
}

.field input:focus,
.field select:focus {
  border-color: #9cb2ff;
  background: #fff;
  outline: 3px solid rgba(43, 89, 240, 0.12);
}

.dialog-actions {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.text-button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.text-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 28px;
  padding: 11px 17px;
  border-radius: 12px;
  color: #fff;
  background: #1e2435;
  box-shadow: 0 12px 35px rgba(20, 27, 46, 0.25);
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 200ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.migration-banner {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: 28px;
  width: min(680px, calc(100vw - 36px));
  padding: 16px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #dce4f7;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 60px rgba(29, 42, 77, 0.2);
  backdrop-filter: blur(20px);
  transform: translateX(-50%);
}

.migration-banner[hidden] {
  display: none;
}

.migration-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 1.15rem;
}

.migration-banner strong {
  display: block;
  font-size: 0.88rem;
}

.migration-banner p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.migration-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px minmax(500px, 1fr);
  }

  .day-panel {
    display: none;
  }
}

@media (max-width: 850px) {
  body {
    background: #fff;
  }

  .ambient,
  .side-panel {
    display: none;
  }

  .app-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    display: block;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .main-panel {
    padding: 24px 22px 112px;
  }

  .mobile-header {
    margin-bottom: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .avatar-button {
    border: 0;
  }

  .mobile-account .sync-status {
    margin: 0;
  }

  .desktop-add {
    display: none;
  }

  .mobile-dock {
    position: fixed;
    z-index: 6;
    left: 14px;
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    height: 72px;
    padding: 8px 12px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 45px rgba(31, 39, 65, 0.18);
    backdrop-filter: blur(18px);
  }

  .mobile-dock button {
    height: 54px;
    padding: 6px 0;
    display: grid;
    place-items: center;
    gap: 3px;
    border: 0;
    color: var(--muted);
    background: transparent;
    font-size: 0.61rem;
  }

  .mobile-dock button.active {
    color: var(--blue);
  }

  .mobile-dock svg {
    width: 20px;
    height: 20px;
  }

  .mobile-dock .dock-add {
    width: 52px;
    height: 52px;
    margin: -26px auto 0;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: #fff;
    background: var(--blue);
    box-shadow: 0 10px 25px rgba(43, 89, 240, 0.32);
    font-size: 1.7rem;
  }
}

@media (max-width: 580px) {
  .main-panel {
    padding-inline: 17px;
  }

  .date-header {
    align-items: flex-end;
    gap: 14px;
  }

  .date-line h1 {
    font-size: 2.5rem;
  }

  .date-actions {
    padding-bottom: 3px;
  }

  .date-actions .icon-button {
    width: 34px;
    height: 34px;
  }

  .rhythm-card {
    min-height: 160px;
    margin-top: 24px;
    padding: 24px 22px;
  }

  .rhythm-copy h2 {
    max-width: 240px;
    margin-top: 10px;
    font-size: 1.2rem;
    line-height: 1.35;
  }

  .rhythm-copy p {
    max-width: 230px;
    line-height: 1.5;
  }

  .metric-ring {
    width: 76px;
    height: 76px;
  }

  .metric-ring span {
    font-size: 1.4rem;
  }

  .week-card {
    padding: 20px 15px 16px;
  }

  .week-strip {
    gap: 2px;
  }

  .day-chip {
    border-radius: 12px;
  }

  .schedule-heading {
    align-items: flex-start;
    gap: 14px;
  }

  .filter-tabs button {
    padding: 0 9px;
  }

  .task-item {
    grid-template-columns: 48px 3px 1fr auto;
    gap: 10px;
    padding-left: 13px;
  }

  .delete-button {
    display: none;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .task-dialog form {
    padding: 23px 20px;
  }

  .migration-banner {
    bottom: max(98px, calc(env(safe-area-inset-bottom) + 86px));
    padding: 15px;
    grid-template-columns: auto 1fr;
  }

  .migration-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 390px) {
  .today-pill {
    display: none;
  }

  .date-line h1 {
    font-size: 2.22rem;
  }

  .rhythm-metric {
    display: none;
  }

  .filter-tabs button {
    padding: 0 7px;
    font-size: 0.7rem;
  }
}

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