:root {
  --primary: #ff8a2a;
  --primary-strong: #d85f12;
  --primary-soft: #fff0df;
  --accent: #ff7a8a;
  --mint: #55c7a5;
  --mint-soft: #e8f8f2;
  --sky: #7fc7ef;
  --sun: #ffd36e;
  --lilac: #b9a7ff;
  --danger: #d95b68;
  --bg: #fff7f1;
  --surface: #ffffff;
  --surface-soft: #fffaf5;
  --text-strong: #211b29;
  --text: #332c3d;
  --text-muted: #8c8291;
  --text-soft: #aaa1ad;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 560;
  --border: #f2dfd1;
  --shadow: 0 14px 34px rgba(214, 124, 76, 0.12);
  --modal-shadow: 0 24px 60px rgba(92, 54, 36, 0.22);
  --page-glow: rgba(255, 210, 170, 0.38);
  --page-start: #fff9f3;
  --page-end: #ffffff;
  --primary-gradient: linear-gradient(135deg, var(--accent), var(--primary));
  --primary-shadow: rgba(255, 138, 42, 0.2);
  --selection-bg: linear-gradient(180deg, rgba(255, 240, 223, 0.92), rgba(255, 248, 241, 0.78));
  --selection-soft: rgba(255, 250, 245, 0.9);
  --control-bg: var(--surface-soft);
  --priority-high-accent: #ff6f52;
  --priority-high-bg: linear-gradient(90deg, rgba(255, 111, 82, 0.14), var(--surface) 48%);
  --priority-high-pill-bg: #ffe3dd;
  --priority-high-pill-text: #a94232;
  --priority-medium-accent: #ffb23f;
  --priority-medium-bg: linear-gradient(90deg, rgba(255, 178, 63, 0.15), var(--surface) 48%);
  --priority-medium-pill-bg: #fff0c8;
  --priority-medium-pill-text: #7a5710;
  --priority-low-accent: #64b5f6;
  --priority-low-bg: linear-gradient(90deg, rgba(100, 181, 246, 0.13), var(--surface) 48%);
  --priority-low-pill-bg: #e7f4ff;
  --priority-low-pill-text: #276f9f;
  --priority-none-accent: #b9a7ff;
  --priority-none-bg: linear-gradient(90deg, rgba(185, 167, 255, 0.12), var(--surface) 48%);
  --priority-none-pill-bg: #f0ebff;
  --priority-none-pill-text: #6652b6;
  --radius: 8px;
}

[data-palette="sky"] {
  --primary: #4aa3ff;
  --primary-strong: #1f6fb8;
  --primary-soft: #eaf5ff;
  --accent: #78c6ff;
  --mint: #62c7d9;
  --mint-soft: #e8f8fb;
  --bg: #f3f9ff;
  --surface-soft: #f7fbff;
  --border: #d8e9f7;
  --shadow: 0 14px 34px rgba(74, 139, 202, 0.12);
  --modal-shadow: 0 24px 60px rgba(48, 103, 150, 0.2);
  --page-glow: rgba(150, 210, 255, 0.34);
  --page-start: #f3f9ff;
  --page-end: #ffffff;
  --primary-shadow: rgba(74, 163, 255, 0.2);
  --selection-bg: linear-gradient(180deg, rgba(234, 245, 255, 0.95), rgba(248, 252, 255, 0.78));
  --selection-soft: rgba(246, 251, 255, 0.92);
  --control-bg: #f7fbff;
  --priority-medium-accent: #7391f2;
  --priority-medium-bg: linear-gradient(90deg, rgba(115, 145, 242, 0.12), var(--surface) 48%);
  --priority-medium-pill-bg: #e9efff;
  --priority-medium-pill-text: #3d58a7;
}

[data-palette="mint"] {
  --primary: #42b883;
  --primary-strong: #1f7d5a;
  --primary-soft: #e8f8f1;
  --accent: #78d9af;
  --mint: #42b883;
  --mint-soft: #e3f7ee;
  --bg: #f3fbf6;
  --surface-soft: #f7fdf9;
  --border: #d7ebdf;
  --shadow: 0 14px 34px rgba(66, 160, 120, 0.12);
  --modal-shadow: 0 24px 60px rgba(54, 125, 92, 0.2);
  --page-glow: rgba(160, 232, 198, 0.34);
  --page-start: #f3fbf6;
  --page-end: #ffffff;
  --primary-shadow: rgba(66, 184, 131, 0.2);
  --selection-bg: linear-gradient(180deg, rgba(232, 248, 241, 0.95), rgba(248, 255, 251, 0.78));
  --selection-soft: rgba(247, 253, 249, 0.92);
  --control-bg: #f7fdf9;
  --priority-medium-accent: #55a7c8;
  --priority-medium-bg: linear-gradient(90deg, rgba(85, 167, 200, 0.12), var(--surface) 48%);
  --priority-medium-pill-bg: #e3f4f9;
  --priority-medium-pill-text: #286f86;
}

[data-theme="dark"] {
  --bg: #21161b;
  --surface: #2a1d23;
  --surface-soft: #35252b;
  --text: #fff7f1;
  --text-strong: #fffaf5;
  --text-muted: #cbbcc5;
  --text-soft: #9e9099;
  --border: #4a3339;
  --primary-soft: #4a2c1c;
  --mint-soft: #1d3c35;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  --modal-shadow: 0 24px 60px rgba(0, 0, 0, 0.44);
  --page-glow: rgba(255, 138, 42, 0.16);
  --page-start: #21161b;
  --page-end: #171116;
  --selection-bg: linear-gradient(180deg, rgba(74, 44, 28, 0.8), rgba(53, 37, 43, 0.8));
  --selection-soft: rgba(53, 37, 43, 0.9);
  --control-bg: var(--surface-soft);
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, var(--page-glow), transparent 30%),
    linear-gradient(180deg, var(--page-start) 0%, var(--bg) 42%, var(--page-end) 100%);
  font-family: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: var(--weight-regular);
  line-height: 1.5;
  padding-bottom: calc(82px + env(safe-area-inset-bottom));
}

body.quick-editor-open {
  position: fixed;
  inset-inline: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

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

button {
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 8%, var(--border));
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--primary-gradient);
  color: #fff;
  font-weight: var(--weight-semibold);
  box-shadow: 0 8px 20px var(--primary-shadow);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: var(--weight-semibold);
  transition: color 200ms ease;
}

body[data-view="today"] .brand strong {
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

body[data-view="today"] .brand-mark {
  width: 36px;
  height: 36px;
}

body[data-view="today"] .brand {
  gap: 10px;
}

.brand small {
  max-width: 58vw;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--primary-soft));
  cursor: pointer;
}

.app-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.today-section {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin-bottom: 20px;
}

.today-section .section-label {
  margin: 0 0 10px 2px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: none;
}

.today-section .stack-list {
  margin-top: 0;
  gap: 10px;
}

.today-section .habit-grid {
  margin-top: 0;
}

.today-section .journal-form {
  margin-top: 0;
}

.today-section .journal-form textarea {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  transition: border-color 200ms ease;
}

.today-section .journal-form textarea:focus {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.today-section .task-row {
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(90, 58, 36, 0.06);
  overflow: hidden;
}

.today-section .task-row::before {
  width: 3px;
  border-radius: 0 3px 3px 0;
}

.today-section .task-content {
  min-height: 58px;
  padding: 11px 12px 11px 14px;
  background-color: var(--surface);
}

.today-section .task-row.priority-none .task-content {
  background-color: color-mix(in srgb, var(--primary) 3%, var(--surface));
}

@supports (background-color: color-mix(in srgb, red 10%, white)) {
  .today-section .task-row.priority-high .task-content { background-color: color-mix(in srgb, var(--coral, #FF6F52) 8%, var(--surface)); }
  .today-section .task-row.priority-medium .task-content { background-color: color-mix(in srgb, var(--sun, #FFB23F) 10%, var(--surface)); }
  .today-section .task-row.priority-low .task-content { background-color: color-mix(in srgb, var(--sky, #64B5F6) 8%, var(--surface)); }
}

.today-section .task-row.is-completed .task-content {
  background-color: var(--surface-soft) !important;
  opacity: 0.7;
}

.today-section .task-row.is-completed::before {
  opacity: 0.4;
}

.today-section .task-check {
  width: 22px;
  height: 22px;
}

.today-section .task-title {
  font-size: 15px;
  line-height: 1.5;
}

.today-section .task-meta {
  font-size: 12px;
}

.today-section .habit-card {
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(90, 58, 36, 0.06);
  background: color-mix(in srgb, var(--lilac, #B9A7FF) 6%, var(--surface));
  padding: 11px 12px 11px 14px;
}

.today-section .habit-card::before {
  width: 3px;
  border-radius: 0 3px 3px 0;
}

.today-section .habit-check {
  width: 22px;
  height: 22px;
}

.today-section .habit-name {
  font-size: 15px;
  line-height: 1.5;
}

.task-section .stack-list {
  gap: 10px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 12px;
}

.section-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--text-strong);
  font-weight: var(--weight-semibold);
}

.section-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: var(--weight-medium);
}

.mode-pill,
.muted-pill,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.mode-pill {
  background: var(--mint-soft);
  color: #247d67;
}

.muted-pill {
  background: var(--surface-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.count-badge {
  min-width: 32px;
  background: var(--surface-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.panel,
.calendar-card {
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  padding: 14px;
}

#view-today .panel.today-section {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin-bottom: 20px;
  border-radius: 0;
}

.panel h2 {
  margin: 0;
  font-size: 16px;
  color: var(--text-strong);
  font-weight: var(--weight-medium);
}

.panel p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.panel-head,
.setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.setting-row > div {
  flex: 1;
  min-width: 0;
}

.setting-toggle {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.setting-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.setting-toggle-track {
  display: block;
  width: 48px;
  height: 28px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  transition: background 200ms ease;
}

.setting-toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 200ms ease;
}

.setting-toggle input[type="checkbox"]:checked + .setting-toggle-track {
  background: var(--primary);
}

.setting-toggle input[type="checkbox"]:checked + .setting-toggle-track::after {
  transform: translateX(20px);
}

.setting-toggle input[type="checkbox"]:focus-visible + .setting-toggle-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.stack-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.date-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.task-row {
  --task-accent: var(--primary);
  --task-pill-bg: var(--primary-soft);
  --task-pill-text: var(--primary-strong);
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--task-accent) 28%, var(--border));
  border-radius: var(--radius);
  touch-action: pan-y;
  isolation: isolate;
}

.task-row::before {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 3;
  width: 4px;
  background: var(--task-accent);
  content: "";
}

.task-row[data-item-type] {
  cursor: pointer;
}

.task-row[data-item-type]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.task-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 10px 10px 10px 14px;
  background-color: var(--surface);
  background-image: none;
  transition: margin 180ms ease;
}

.task-row.priority-high { --task-accent: var(--priority-high-accent); --task-pill-bg: var(--priority-high-pill-bg); --task-pill-text: var(--priority-high-pill-text); }
.task-row.priority-medium { --task-accent: var(--priority-medium-accent); --task-pill-bg: var(--priority-medium-pill-bg); --task-pill-text: var(--priority-medium-pill-text); }
.task-row.priority-low { --task-accent: var(--priority-low-accent); --task-pill-bg: var(--priority-low-pill-bg); --task-pill-text: var(--priority-low-pill-text); }
.task-row.priority-none { --task-accent: var(--priority-none-accent); --task-pill-bg: var(--priority-none-pill-bg); --task-pill-text: var(--priority-none-pill-text); }

.task-row.priority-high .task-content { background-color: #FFF0EB; background-image: none; }
.task-row.priority-medium .task-content { background-color: #FFF6E5; background-image: none; }
.task-row.priority-low .task-content { background-color: #E8F4FD; background-image: none; }
.task-row.priority-none .task-content { background-color: var(--surface); background-image: none; }
@supports (background-color: color-mix(in srgb, red 10%, white)) {
  .task-row.priority-high .task-content { background-color: color-mix(in srgb, var(--coral, #FF6F52) 12%, var(--surface)); }
  .task-row.priority-medium .task-content { background-color: color-mix(in srgb, var(--sun, #FFB23F) 14%, var(--surface)); }
  .task-row.priority-low .task-content { background-color: color-mix(in srgb, var(--sky, #64B5F6) 12%, var(--surface)); }
}
.task-row.is-overdue-row .task-content { background-color: #FCEEF0 !important; background-image: none !important; }
@supports (background-color: color-mix(in srgb, red 10%, white)) {
  .task-row.is-overdue-row .task-content { background-color: color-mix(in srgb, var(--danger) 10%, var(--surface)) !important; }
}
.task-row.is-overdue-row { --task-accent: var(--danger); }
.task-row.is-completed .task-content { background-color: var(--surface); background-image: none; }

.task-row.notification-highlight {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 42%, transparent);
}

.task-row.actions-open .task-content {
  margin-right: 104px;
  margin-left: -104px;
}

.task-row.actions-open .task-swipe-actions {
  visibility: visible;
}

@media (hover: hover) and (pointer: fine) {
  .task-row.has-swipe-actions:hover .task-content,
  .task-row.has-swipe-actions:focus-within .task-content {
    margin-right: 104px;
    margin-left: -104px;
  }
  .task-row.has-swipe-actions:hover .task-swipe-actions,
  .task-row.has-swipe-actions:focus-within .task-swipe-actions {
    visibility: visible;
  }
}

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

.task-swipe-actions {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 104px;
  visibility: hidden;
}

.swipe-action {
  min-width: 0;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.swipe-action.edit {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.swipe-action.delete {
  background: #ffe7e9;
  color: #b84a55;
}

.swipe-action.restore {
  background: var(--mint-soft);
  color: #247d67;
}

.swipe-action.skip {
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text-muted);
}

.priority-high {
  --task-accent: var(--priority-high-accent);
  --task-bg: var(--priority-high-bg);
  --task-pill-bg: var(--priority-high-pill-bg);
  --task-pill-text: var(--priority-high-pill-text);
}

.priority-medium {
  --task-accent: var(--priority-medium-accent);
  --task-bg: var(--priority-medium-bg);
  --task-pill-bg: var(--priority-medium-pill-bg);
  --task-pill-text: var(--priority-medium-pill-text);
}

.priority-low {
  --task-accent: var(--priority-low-accent);
  --task-bg: var(--priority-low-bg);
  --task-pill-bg: var(--priority-low-pill-bg);
  --task-pill-text: var(--priority-low-pill-text);
}

.priority-none {
  --task-accent: var(--priority-none-accent);
  --task-bg: var(--priority-none-bg);
  --task-pill-bg: var(--priority-none-pill-bg);
  --task-pill-text: var(--priority-none-pill-text);
}

.task-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--mint);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.task-check.small {
  width: 22px;
  height: 22px;
}

.task-check.task-check-done {
  background: var(--mint-soft);
  border-color: var(--mint);
  color: #247d67;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: var(--weight-bold);
  padding: 0;
}

.task-check.task-check-done span {
  line-height: 1;
}

.task-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  color: var(--text-strong);
  font-weight: var(--weight-medium);
  line-height: 1.35;
}

.task-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: var(--weight-regular);
}

.type-tag {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  line-height: 1.4;
}

.type-tag.task-tag {
  background: rgba(110, 142, 251, 0.12);
  color: var(--primary-strong);
}

.type-tag.habit-tag {
  background: rgba(176, 136, 232, 0.12);
  color: #6b3fa0;
}

.habit-check.habit-check-high { border-color: var(--priority-high); }
.habit-check.habit-check-medium { border-color: var(--priority-medium); }
.habit-check.habit-check-low { border-color: var(--priority-low); }
.habit-check.habit-check-none { border-color: var(--priority-none); }

.habit-check-done-high { background: rgba(255,111,82,0.18) !important; color: #c74530 !important; }
.habit-check-done-medium { background: rgba(255,178,63,0.18) !important; color: #b07a10 !important; }
.habit-check-done-low { background: rgba(100,181,246,0.18) !important; color: #2b7ec0 !important; }
.habit-check-done-none { background: rgba(176,136,232,0.18) !important; color: #6b3fa0 !important; }

.task-row.is-overdue-row {
  --task-accent: var(--danger);
  --task-bg: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.task-row.is-overdue-row .task-title { color: var(--danger); }
.task-row.is-overdue-row .task-meta { color: var(--danger); }

.task-row.is-completed .task-title,
.date-row.is-completed .task-title {
  color: var(--text-muted);
  text-decoration: line-through;
}

.task-row.is-completed,
.date-row.is-completed {
  opacity: 0.62;
}

.habit-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.habit-card {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--lilac) 28%, var(--border));
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(185, 167, 255, 0.10), var(--surface) 48%);
}

.habit-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 2;
  width: 4px;
  background: var(--lilac);
  content: "";
  border-radius: var(--radius) 0 0 var(--radius);
}

.habit-card.is-done {
  opacity: 0.62;
}

.habit-card.is-done .habit-title {
  color: var(--text-muted);
  text-decoration: line-through;
}

.habit-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--lilac);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: var(--weight-semibold);
}

.habit-check.checked {
  background: var(--mint);
  border-color: var(--mint);
}

.habit-main {
  min-width: 0;
}

.habit-title {
  overflow-wrap: anywhere;
  font-size: 14px;
  color: var(--text-strong);
  font-weight: var(--weight-medium);
  line-height: 1.35;
}

.habit-meta {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.habit-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.habit-btn {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: var(--weight-medium);
}

.habit-btn.check {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 6px 14px var(--primary-shadow);
}

.habit-btn.check.done,
.habit-btn.skip.done {
  opacity: 0.5;
  cursor: default;
}

.habit-btn.skip {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(6, 12, 20, 0.42);
  backdrop-filter: blur(4px);
}

.picker-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 165;
  padding: 0;
  background: var(--surface);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -12px 40px var(--modal-shadow);
  overflow: hidden;
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.picker-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: var(--weight-medium);
  color: var(--text-strong);
}

.picker-btn {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
}

.picker-btn.primary {
  color: var(--primary-strong);
  font-weight: var(--weight-medium);
}

.picker-body {
  padding: 16px 18px;
}

.picker-wheels-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  height: 200px;
}

.picker-wheels-row.three-cols {
  gap: 0;
}

.picker-colon {
  font-size: 24px;
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  padding: 0 4px;
  z-index: 2;
}

.picker-wheel {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: grab;
}

.picker-wheel:active {
  cursor: grabbing;
}

.picker-wheel-highlight {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  background: var(--primary-soft);
  border-radius: var(--radius);
  pointer-events: none;
  z-index: 1;
}

.picker-wheel-list {
  position: relative;
  z-index: 2;
  text-align: center;
}

.picker-wheel-item {
  height: 40px;
  line-height: 40px;
  font-size: 18px;
  color: var(--text-muted);
  transition: color 150ms ease, transform 150ms ease, opacity 150ms ease;
  opacity: 0.5;
}

.picker-wheel-item.selected {
  color: var(--text-strong);
  font-weight: var(--weight-medium);
  opacity: 1;
  transform: scale(1.05);
}

.picker-toggles {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.picker-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  gap: 12px;
  min-height: 44px;
  padding: 0 4px;
}

.picker-toggle span {
  font-size: 15px;
  color: var(--text);
}

.picker-toggle input[type="checkbox"] {
  width: 48px;
  min-height: 28px;
  height: 28px;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border: 0;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 200ms ease;
}

.picker-toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 200ms ease;
}

.picker-toggle input[type="checkbox"]:checked {
  background: var(--primary);
}

.picker-toggle input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.picker-footer-hint {
  text-align: center;
  padding: 10px 18px 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.picker-footer-hint.is-warning {
  color: var(--danger);
}

.calendar-picker-sheet .cal-picker-body {
  padding: 12px 18px 18px;
}

.cal-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 12px;
}

.cal-nav-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-strong);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease;
}

.cal-nav-btn:hover,
.cal-nav-btn:active {
  background: var(--selection-soft);
}

.cal-month-label {
  font-size: 16px;
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
}

.cal-weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: var(--weight-medium);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.cal-weekday-row span {
  padding: 6px 0;
}

.cal-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.cal-day-cell.outside {
  color: color-mix(in srgb, var(--text-muted) 50%, transparent);
}

.cal-day-cell.today {
  color: var(--primary-strong);
  font-weight: var(--weight-semibold);
}

.cal-day-cell.today:not(.selected) {
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.cal-day-cell.selected {
  background: var(--primary);
  color: #fff;
  font-weight: var(--weight-semibold);
  box-shadow: none;
}

.cal-day-cell:active {
  background: var(--selection-soft);
}

.cal-day-cell.selected:active {
  background: var(--primary-strong);
}

.cal-picker-footer {
  display: flex;
  justify-content: center;
  padding-top: 14px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.cal-today-btn {
  min-height: 36px;
  padding: 6px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background 150ms ease;
}

.cal-today-btn:hover,
.cal-today-btn:active {
  background: var(--selection-soft);
}

.date-choice.has-date {
  position: relative;
}

.date-choice.has-date::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: var(--primary);
}

@media (min-width: 540px) {
  .picker-sheet {
    left: 50%;
    right: auto;
    bottom: 50%;
    width: min(420px, calc(100% - 32px));
    transform: translate(-50%, 50%);
    border-radius: 16px;
  }
}

.journal-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

textarea,
input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: var(--weight-regular);
}

textarea::placeholder,
input::placeholder {
  color: var(--text-soft);
  font-weight: var(--weight-regular);
}

textarea:focus,
input:focus,
select:focus,
.select-trigger:focus-visible,
.date-choice:focus-visible,
.list-filter:focus-visible,
.btn:focus-visible,
.icon-button:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 58%, var(--border));
  outline: 2px solid color-mix(in srgb, var(--primary) 64%, transparent);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

textarea {
  resize: vertical;
}

.btn {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: var(--weight-medium);
  flex-shrink: 0;
}

.btn.primary {
  background: var(--primary-gradient);
  color: #fff;
  font-weight: var(--weight-semibold);
  box-shadow: 0 10px 22px var(--primary-shadow);
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.segmented-actions,
.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.calendar-label {
  margin: 0;
  font-size: 22px;
  color: var(--text-strong);
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
}

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

.weekday-row {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: var(--weight-medium);
  text-align: left;
  margin-bottom: 0;
  padding: 0 4px;
}

.weekday-row span {
  padding: 8px 0;
}

.day-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 140px;
  padding: 6px 5px 7px;
  border: 0;
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: transform 0.15s ease, background 0.2s ease;
}

.day-cell:hover {
  transform: scale(0.97);
  background: var(--surface-soft);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.task-actions .btn {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
}

.day-cell.outside {
  opacity: 0.35;
}

.empty-month-cell {
  pointer-events: none;
  background: transparent;
}

.day-cell.selected {
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px var(--primary);
}

.day-cell.today {
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--surface) 44px);
}

.day-cell.selected.today {
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px var(--primary);
}

.day-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
  height: auto;
  line-height: 1;
}

.day-date {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  max-width: 100%;
  min-width: 0;
}

.day-number {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  font-weight: var(--weight-semibold);
  font-size: 13px;
  line-height: 1;
  border-radius: 999px;
}

.day-lunar {
  min-width: 0;
  color: color-mix(in srgb, var(--text-muted) 80%, transparent);
  font-size: 9px;
  font-weight: 400;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 1px;
}

.day-cell.today .day-number,
.day-cell.selected .day-number {
  min-width: 24px;
  height: 24px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 8px var(--primary-shadow);
}

.calendar-strips {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-content: start;
  min-height: 0;
  flex: 1;
  margin-top: 1px;
  overflow: hidden;
}

.calendar-strip,
.calendar-more {
  display: block;
  min-width: 0;
  padding: 3px 7px;
  overflow: hidden;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-strip.has-time {
  display: flex;
  align-items: center;
  gap: 3px;
}

.calendar-strip-time {
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.calendar-strip-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .calendar-strip.has-time {
    gap: 1px;
    padding-right: 3px;
  }

  .calendar-strip-time {
    flex-shrink: 0;
    font-size: 9px;
  }
}

.calendar-strip.is-done {
  opacity: 0.45;
  text-decoration: line-through;
}

.calendar-strip.peach { background: rgba(255, 210, 180, 0.45); color: #9c5020; }
.calendar-strip.coral { background: rgba(255, 175, 185, 0.42); color: #b04055; }
.calendar-strip.apricot { background: rgba(255, 195, 140, 0.45); color: #925010; }
.calendar-strip.butter { background: rgba(255, 230, 150, 0.5); color: #8a6000; }
.calendar-strip.mint { background: rgba(160, 225, 200, 0.4); color: #206b50; }
.calendar-strip.sky { background: rgba(170, 215, 240, 0.4); color: #256590; }
.calendar-strip.lilac { background: rgba(205, 185, 235, 0.42); color: #654d88; }
.calendar-strip.rose { background: rgba(255, 180, 195, 0.42); color: #b84868; }
.calendar-strip.blush { background: rgba(255, 200, 210, 0.45); color: #a8425c; }
.calendar-strip.sand { background: rgba(240, 220, 190, 0.5); color: #806030; }
.calendar-strip.primary { background: rgba(255, 138, 42, 0.2); color: var(--primary-strong); }
.calendar-strip.has-item-tone {
  background: color-mix(in srgb, var(--item-tone) 34%, var(--surface));
  color: var(--text);
}

.task-row.task-tone-peach .task-content { background-color: rgba(255, 212, 185, 0.38) !important; background-image: none !important; }
.task-row.task-tone-coral .task-content { background-color: rgba(255, 182, 192, 0.32) !important; background-image: none !important; }
.task-row.task-tone-apricot .task-content { background-color: rgba(255, 200, 145, 0.35) !important; background-image: none !important; }
.task-row.task-tone-butter .task-content { background-color: rgba(255, 235, 165, 0.4) !important; background-image: none !important; }
.task-row.task-tone-mint .task-content { background-color: rgba(175, 235, 210, 0.32) !important; background-image: none !important; }
.task-row.task-tone-sky .task-content { background-color: rgba(180, 220, 245, 0.32) !important; background-image: none !important; }
.task-row.task-tone-lilac .task-content { background-color: rgba(215, 195, 245, 0.32) !important; background-image: none !important; }
.task-row.task-tone-rose .task-content { background-color: rgba(255, 190, 210, 0.34) !important; background-image: none !important; }
.task-row.task-tone-blush .task-content { background-color: rgba(255, 210, 220, 0.38) !important; background-image: none !important; }
.task-row.task-tone-sand .task-content { background-color: rgba(245, 225, 195, 0.42) !important; background-image: none !important; }

.task-row.is-completed.task-tone-peach .task-content,
.task-row.is-completed.task-tone-coral .task-content,
.task-row.is-completed.task-tone-apricot .task-content,
.task-row.is-completed.task-tone-butter .task-content,
.task-row.is-completed.task-tone-mint .task-content,
.task-row.is-completed.task-tone-sky .task-content,
.task-row.is-completed.task-tone-lilac .task-content,
.task-row.is-completed.task-tone-rose .task-content,
.task-row.is-completed.task-tone-blush .task-content,
.task-row.is-completed.task-tone-sand .task-content {
  background-color: var(--surface) !important;
  background-image: none !important;
}

.task-row.is-overdue-row.task-tone-peach .task-content,
.task-row.is-overdue-row.task-tone-coral .task-content,
.task-row.is-overdue-row.task-tone-apricot .task-content,
.task-row.is-overdue-row.task-tone-butter .task-content,
.task-row.is-overdue-row.task-tone-mint .task-content,
.task-row.is-overdue-row.task-tone-sky .task-content,
.task-row.is-overdue-row.task-tone-lilac .task-content,
.task-row.is-overdue-row.task-tone-rose .task-content,
.task-row.is-overdue-row.task-tone-blush .task-content,
.task-row.is-overdue-row.task-tone-sand .task-content {
  background-color: #FCEEF0 !important;
  background-image: none !important;
}
@supports (background-color: color-mix(in srgb, red 10%, white)) {
  .task-row.is-overdue-row.task-tone-peach .task-content,
  .task-row.is-overdue-row.task-tone-coral .task-content,
  .task-row.is-overdue-row.task-tone-apricot .task-content,
  .task-row.is-overdue-row.task-tone-butter .task-content,
  .task-row.is-overdue-row.task-tone-mint .task-content,
  .task-row.is-overdue-row.task-tone-sky .task-content,
  .task-row.is-overdue-row.task-tone-lilac .task-content,
  .task-row.is-overdue-row.task-tone-rose .task-content,
  .task-row.is-overdue-row.task-tone-blush .task-content,
  .task-row.is-overdue-row.task-tone-sand .task-content {
    background-color: color-mix(in srgb, var(--danger) 10%, var(--surface)) !important;
  }
}

.task-row.has-item-tone .task-content {
  background-color: var(--item-tone) !important;
  background-image: none !important;
}

.task-row.has-item-tone::before {
  background: var(--item-tone);
}

.task-row.is-completed.has-item-tone:not(.habit-row) .task-content {
  background-color: var(--surface) !important;
}

.task-row.is-overdue-row.has-item-tone .task-content {
  background-color: #FCEEF0 !important;
}

.task-row.is-overdue-row.has-item-tone::before {
  background: var(--danger);
}

@supports (background-color: color-mix(in srgb, red 10%, white)) {
  .task-row.has-item-tone .task-content {
    background-color: color-mix(in srgb, var(--item-tone) 52%, var(--surface)) !important;
  }

  .task-row.has-item-tone::before {
    background: color-mix(in srgb, var(--item-tone) 82%, var(--text-muted));
  }

  .task-row.is-overdue-row.has-item-tone .task-content {
    background-color: color-mix(in srgb, var(--danger) 10%, var(--surface)) !important;
  }
}

.calendar-more {
  color: var(--text-muted);
  background: transparent;
  font-weight: normal;
  font-size: 10px;
  padding: 1px 5px;
  border: none;
}

.date-detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 130;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.date-detail-modal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 15vh;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  z-index: 140;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
}

@media (min-width: 640px) {
  .date-detail-modal {
    top: auto;
    left: 50%;
    bottom: 5vh;
    transform: translateX(-50%);
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    border-radius: 24px;
    animation-name: modalFadeIn;
  }
  @keyframes modalFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
  }
}

.date-detail-head {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--divider);
  gap: 12px;
}

.date-detail-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-soft);
  font-size: 24px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.date-detail-head > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.date-detail-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.date-detail-head p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.date-detail-add {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-shadow);
  transition: transform 0.15s ease;
}

.date-detail-add:hover {
  transform: scale(1.05);
}

.date-detail-add:active {
  transform: scale(0.95);
}

.date-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 24px;
  -webkit-overflow-scrolling: touch;
}

#view-calendar #date-detail-panel {
  display: none;
}

#view-calendar {
  display: none;
  flex-direction: column;
  min-height: 100%;
}

#view-calendar.active {
  display: flex;
}

#view-calendar .calendar-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#view-calendar .calendar-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#view-calendar .calendar-grid {
  flex: 1;
}

.month-today {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary-strong);
  cursor: pointer;
  font-weight: var(--weight-semibold);
}

.calendar-toggle {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: var(--weight-medium);
}

.calendar-card.is-collapsed .calendar-body {
  display: none;
}

.date-task-row {
  margin-bottom: 0;
}

.date-task-row .task-content {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  min-height: 54px;
  padding: 9px 10px 9px 14px;
}

.date-habit-row {
  margin-bottom: 0;
  --task-accent: #b088e8;
  --task-pill-bg: color-mix(in srgb, #b088e8 12%, transparent);
  --task-pill-text: #6b3fa0;
}

.today-habit-row {
  --task-accent: #b088e8;
  --task-pill-bg: color-mix(in srgb, #b088e8 12%, transparent);
  --task-pill-text: #6b3fa0;
}

.date-habit-row .task-content,
.today-habit-row .task-content {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  min-height: 54px;
  padding: 9px 10px 9px 14px;
  background-color: color-mix(in srgb, #b088e8 4%, var(--surface));
  background-image: none;
}

.habit-check.small {
  width: 24px;
  height: 24px;
  border: 2px solid #b088e8;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  color: transparent;
  font-size: 12px;
  font-weight: var(--weight-bold);
  transition: all 160ms ease;
}

.habit-check.small:hover {
  background: color-mix(in srgb, #b088e8 15%, transparent);
}

.habit-done-icon {
  background: color-mix(in srgb, #b088e8 18%, transparent);
  color: #6b3fa0;
}

.habit-skip-icon {
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text-muted);
  font-size: 14px;
}

.habit-tag {
  background: color-mix(in srgb, #b088e8 12%, transparent);
  color: #6b3fa0;
  font-size: 11px;
}

.date-habit-row.is-done {
  opacity: 0.68;
}

.date-habit-row.is-done .task-title {
  color: var(--text-muted);
  text-decoration: line-through;
}

.date-habit-row.is-skipped {
  opacity: 0.6;
}

.date-habit-row.is-skipped .task-title {
  color: var(--text-muted);
}

.date-note-row .task-content {
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 54px;
  padding: 9px 10px 9px 14px;
}

.date-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: var(--weight-semibold);
}

.habit-icon {
  background: var(--mint-soft);
  color: #247d67;
}

.journal-icon {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.done-icon {
  background: var(--mint-soft);
  color: #247d67;
}

.search-input {
  background: var(--surface);
  margin-bottom: 0;
}

.list-columns,
.settings-list {
  display: grid;
  gap: 14px;
  align-items: start;
}

.list-panel {
  overflow: visible;
  position: relative;
  margin: 0 0 12px;
  padding: 0;
}

.list-search-row {
  padding: 10px 12px 8px;
  min-width: 0;
}

.search-input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 16px 0 40px;
  font-size: 14px;
  background: var(--surface-soft, #fffaf5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238c8291' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 10-1.397 1.398h-.001l3.85 3.85a1 1 0 001.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 110-10 5 5 0 010 10z'/%3E%3C/svg%3E") 14px center no-repeat;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

.search-input::placeholder { color: var(--text-soft, #aaa1ad); }

.list-tab-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 12px 8px;
  position: relative;
}

.list-tab-scroll-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.list-tab-scroll-wrap::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 24px;
  background: linear-gradient(to right, rgba(255,255,255,0), #fff 80%);
  pointer-events: none;
  z-index: 3;
}

.list-tab-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-right: 4px;
}

.list-tab-scroll::-webkit-scrollbar { display: none; }

.list-tab {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: var(--weight-medium, 500);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 160ms ease;
  white-space: nowrap;
  font-family: inherit;
}

.list-tab.active {
  background: linear-gradient(135deg, var(--primary-soft), #fff8f1);
  border-color: var(--primary);
  color: var(--primary-strong);
  font-weight: var(--weight-semibold, 560);
}

.list-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: var(--weight-semibold, 560);
  background: rgba(0,0,0,0.05);
  color: var(--text-muted);
}

.list-tab.active .list-tab-count {
  background: var(--primary);
  color: #fff;
}

.list-tab-overdue .list-tab-count {
  background: var(--danger, #d95b68);
  color: #fff;
}

.list-tab-overdue.active {
  border-color: var(--danger, #d95b68);
  color: var(--danger, #d95b68);
  background: rgba(217,91,104,0.08);
}

.list-filter-dropdown {
  position: relative;
  flex-shrink: 0;
  margin-left: 4px;
}

.list-filter-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  font-weight: var(--weight-medium, 500);
  font-family: inherit;
  flex-shrink: 0;
}

.list-filter-btn.active {
  border-color: var(--primary);
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.list-filter-arrow {
  font-size: 10px;
  transition: transform 200ms;
}

.list-filter-dropdown.open .list-filter-arrow { transform: rotate(180deg); }

.list-filter-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 100px;
  z-index: 50;
  overflow: hidden;
}

.list-filter-menu[hidden] { display: none; }

.list-filter-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-weight: var(--weight-medium, 500);
  font-family: inherit;
}

.list-filter-option:active { background: var(--surface-soft, #fffaf5); }

.list-filter-option.selected {
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-weight: var(--weight-semibold, 560);
}

.list-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.list-container {
  overflow: hidden;
}

.list-date-group-header {
  padding: 10px 16px 6px;
  font-size: 12px;
  font-weight: var(--weight-semibold, 560);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.list-date-group-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 8px;
}
.list-date-group-header.today { color: var(--primary-strong); }
.list-date-group-header.overdue { color: var(--danger, #d95b68); }

.list-task-list {
  display: grid;
  gap: 8px;
  padding: 0;
}

.list-swipe-row.is-overdue .list-task-title {
  color: var(--danger, #d95b68);
}
.list-swipe-row.is-overdue .list-task-meta {
  color: var(--danger, #d95b68);
}

/* Swipeable rows for list view */
.list-swipe-row {
  position: relative;
  overflow: hidden;
}

.list-swipe-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  position: relative;
  z-index: 2;
  transition: transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
  border-bottom: 1px solid rgba(242,223,209,0.6);
  touch-action: pan-y;
}

.list-swipe-row:last-child .list-swipe-content { border-bottom: none; }
.list-swipe-content:active { background: var(--surface-soft, #fffaf5); }
.list-swipe-row.list-open .list-swipe-content { transform: translateX(-120px); }

.list-swipe-actions {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  display: flex;
  z-index: 1;
}

.list-swipe-btn {
  width: 60px;
  border: none;
  font-size: 13px;
  font-weight: var(--weight-medium, 500);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: inherit;
}

.list-swipe-btn svg { width: 18px; height: 18px; fill: currentColor; }
.list-swipe-btn.list-edit { background: #7fc7ef; }
.list-swipe-btn.list-delete { background: var(--danger, #d95b68); }
.list-swipe-btn.list-skip { background: var(--text-soft, #aaa1ad); }
.list-swipe-btn.list-restore { background: var(--mint, #55c7a5); }
.list-swipe-btn.list-purge { background: #888; }

.list-task-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 160ms;
  background: var(--surface);
  padding: 0;
}

.list-task-check.checked {
  background: var(--mint, #55c7a5);
  border-color: var(--mint, #55c7a5);
}

.list-task-check.checked::after {
  content: '';
  width: 8px; height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.list-task-check.habit-check-btn {
  border-color: #b088e8;
}

.list-task-check.habit-done-check {
  background: color-mix(in srgb, #b088e8 80%, #fff);
  border-color: color-mix(in srgb, #b088e8 80%, #fff);
  color: #fff;
}

.list-task-check.habit-done-check::after {
  content: '';
  width: 8px; height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.list-task-check.habit-skipped-check {
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  border-color: color-mix(in srgb, var(--text-muted) 25%, transparent);
  color: var(--text-muted);
  font-size: 12px;
}

.list-priority-marker {
  width: 22px; height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.list-priority-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.priority-high .list-priority-dot { background: var(--priority-high, #ff6f52); }
.priority-medium .list-priority-dot { background: var(--priority-medium, #ffb23f); }
.priority-low .list-priority-dot { background: var(--priority-low, #64b5f6); }
.priority-none .list-priority-dot { background: var(--priority-none, #b9a7ff); }

.list-repeat-icon { width: 18px; height: 18px; color: var(--priority-medium, #ffb23f); }
.priority-high .list-repeat-icon { color: var(--priority-high, #ff6f52); }
.priority-medium .list-repeat-icon { color: var(--priority-medium, #ffb23f); }
.priority-low .list-repeat-icon { color: var(--priority-low, #64b5f6); }
.priority-none .list-repeat-icon { color: var(--priority-none, #b9a7ff); }

.list-task-body { flex: 1; min-width: 0; }
.list-task-title-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.list-task-title {
  font-size: 15px;
  font-weight: var(--weight-medium, 500);
  color: var(--text-strong);
}

.list-swipe-content.completed .list-task-title {
  color: var(--text-soft, #aaa1ad);
  text-decoration: line-through;
}

.list-task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.list-meta-tag {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.list-date-tag.overdue { color: var(--danger, #d95b68); font-weight: var(--weight-semibold, 560); }
.list-date-tag.today { color: var(--primary-strong); font-weight: var(--weight-semibold, 560); }

.list-streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: #c97a10;
  font-weight: var(--weight-semibold, 560);
  background: rgba(255,211,110,0.2);
  padding: 1px 6px;
  border-radius: 6px;
}

.list-empty-hint {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-soft, #aaa1ad);
  font-size: 14px;
}

.list-load-more {
  padding: 16px;
  text-align: center;
}

.list-load-more-btn {
  padding: 10px 32px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: var(--weight-medium, 500);
  cursor: pointer;
  transition: all 160ms;
  font-family: inherit;
}

.list-load-more-btn:active {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.list-load-more-btn[hidden] { display: none; }

.settings-card {
  display: grid;
  gap: 12px;
}

.theme-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.theme-preset {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: var(--weight-medium);
}

.theme-preset strong {
  font-size: 12px;
}

.theme-preset.active {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  background: var(--primary-soft);
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 20%, transparent);
}

.theme-swatch {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 10px rgba(90, 58, 36, 0.12);
}

.theme-swatch.orange { background: linear-gradient(135deg, #ff7a8a, #ff8a2a); }
.theme-swatch.sky { background: linear-gradient(135deg, #78c6ff, #4aa3ff); }
.theme-swatch.mint { background: linear-gradient(135deg, #78d9af, #42b883); }
.theme-swatch.dark { background: linear-gradient(135deg, #3a2b33, #161116); }

.data-settings-card {
  gap: 10px;
}

.data-setting-list {
  display: grid;
  gap: 8px;
}

.preference-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.preference-item {
  align-items: center;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.preference-item h3 {
  margin: 0;
  font-size: 14px;
  color: var(--text-strong);
  font-weight: var(--weight-medium);
}

.preference-item p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.data-setting-item {
  align-items: center;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.data-setting-item h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: var(--weight-medium);
  line-height: 1.35;
}

.data-setting-item p {
  margin: 3px 0 0;
  max-width: 32rem;
  font-size: 12px;
}

.data-setting-item .btn {
  flex: 0 0 auto;
  min-width: 72px;
}

.data-setting-item.danger {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  background: color-mix(in srgb, var(--surface) 86%, #ffe8ec);
}

.data-setting-item.danger h3 {
  color: var(--danger);
}

.feedback-setting {
  align-items: center;
}

.feedback-email-text {
  color: var(--primary-strong);
  cursor: pointer;
  overflow-wrap: anywhere;
  font-weight: var(--weight-medium);
}

.feedback-mail-btn {
  white-space: nowrap;
}

.compact-panel {
  padding: 13px;
}

.compact-panel .stack-list {
  margin-top: 8px;
}

.actions-panel .button-row {
  margin-top: 14px;
}

.deleted-panel {
  border-style: dashed;
}

.fine-print,
.empty-state {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.empty-state {
  margin: 0;
}

.list-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px 32px;
  position: relative;
}

.list-empty-state::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 10%, transparent) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.empty-icon {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: var(--primary-strong);
  animation: emptyIconFloat 3s ease-in-out infinite;
}

.empty-icon svg {
  width: 72px;
  height: 72px;
}

@keyframes emptyIconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.empty-tip {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: var(--weight-semibold);
  color: var(--text);
  letter-spacing: -0.01em;
}

.empty-encouragement {
  position: relative;
  z-index: 1;
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 280px;
}

.empty-journal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 300px;
  padding: 20px;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 10%, var(--border));
  border-radius: 16px;
  text-align: left;
}

.empty-journal-quote {
  display: block;
  font-size: 32px;
  line-height: 1;
  color: var(--primary-soft);
  font-family: Georgia, serif;
  margin-bottom: -8px;
}

.empty-journal-text {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  font-style: italic;
}

.empty-journal-caption {
  display: block;
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid color-mix(in srgb, var(--primary) 6%, var(--border));
}

.nav-item {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: var(--weight-medium);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
  font-size: 11px;
  font-family: inherit;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.nav-item.active .nav-icon {
  transform: translateY(-1px) scale(1.08);
  stroke-width: 2.2;
}

.nav-item:active {
  transform: scale(0.96);
}

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 35;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 16px 32px var(--primary-shadow);
  cursor: pointer;
  font-size: 28px;
  transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.fab:active {
  transform: scale(0.94);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 145;
  background: rgba(6, 12, 20, 0.42);
  backdrop-filter: blur(4px);
}

.quick-sheet {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 150;
  width: min(540px, calc(100% - 32px));
  max-height: min(90vh, 680px);
  transform: translate(-50%, -50%);
  overflow: auto;
  padding: 14px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 28%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--modal-shadow);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sheet-head h2 {
  margin: 2px 0 0;
  color: var(--text-strong);
  font-size: 24px;
  font-weight: var(--weight-semibold);
  line-height: 1.15;
}

#quick-form {
  display: grid;
  gap: 10px;
}

#quick-form label,
.quick-field {
  display: grid;
  gap: 6px;
}

#quick-form label,
.field-label {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: var(--weight-medium);
}

.compact-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.custom-select {
  position: relative;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.select-trigger strong,
.select-trigger small {
  display: block;
}

.select-trigger strong {
  font-size: 14px;
  color: var(--text-strong);
  font-weight: var(--weight-medium);
  line-height: 1.2;
}

.select-trigger small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.2;
}

.select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 70;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--modal-shadow);
}

.select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: var(--weight-medium);
  text-align: left;
}

.select-option span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: var(--weight-regular);
  white-space: nowrap;
}

.select-option.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.tone-menu .select-option::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  margin-right: 8px;
}
.tone-menu .select-option.tone-peach::before { background: rgba(255, 210, 180, 0.6); }
.tone-menu .select-option.tone-coral::before { background: rgba(255, 175, 185, 0.58); }
.tone-menu .select-option.tone-apricot::before { background: rgba(255, 195, 140, 0.6); }
.tone-menu .select-option.tone-butter::before { background: rgba(255, 230, 150, 0.65); }
.tone-menu .select-option.tone-mint::before { background: rgba(160, 225, 200, 0.55); }
.tone-menu .select-option.tone-sky::before { background: rgba(170, 215, 240, 0.55); }
.tone-menu .select-option.tone-lilac::before { background: rgba(205, 185, 235, 0.58); }
.tone-menu .select-option.tone-rose::before { background: rgba(255, 180, 195, 0.58); }
.tone-menu .select-option.tone-blush::before { background: rgba(255, 200, 210, 0.6); }
.tone-menu .select-option.tone-sand::before { background: rgba(240, 220, 190, 0.65); }

.date-choice-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.date-choice-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.date-choice {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--text);
  cursor: pointer;
  font-weight: var(--weight-medium);
}

.chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.choice-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: var(--weight-medium);
}

.choice-chip.active {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.field-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.time-input-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.time-display-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.time-display-btn:hover,
.time-display-btn:active {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: var(--selection-soft);
}

.time-display-btn.has-value {
  color: var(--text-strong);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

.time-display-icon {
  font-size: 18px;
  color: var(--text-muted);
}

.time-display-btn.has-value .time-display-icon {
  color: var(--primary-strong);
}

.more-settings {
  display: grid;
  gap: 8px;
}

.more-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: var(--weight-medium);
  list-style: none;
}

.more-settings summary::-webkit-details-marker {
  display: none;
}

.more-settings summary::after {
  color: var(--text-muted);
  content: "⌄";
}

.more-settings[open] summary::after {
  content: "⌃";
}

.more-settings summary span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: var(--weight-regular);
}

.more-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.date-choice.active {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.date-picker-label {
  display: none !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.quick-field.is-custom-date .date-picker-label {
  display: grid !important;
}

.date-picker-label input {
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: right;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  top: calc(74px + env(safe-area-inset-top));
  z-index: 60;
  width: max-content;
  max-width: calc(100% - 40px);
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft) 90%, #fff);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: var(--weight-medium);
  text-align: center;
  box-shadow: 0 10px 24px var(--primary-shadow);
}

[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  body {
    padding-bottom: 128px;
  }

  .app-shell {
    padding: 10px 8px 132px;
  }

  .bottom-nav {
    left: 50%;
    right: auto;
    bottom: 18px;
    width: min(520px, calc(100% - 36px));
    transform: translateX(-50%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 8px;
  }
}

@media (min-width: 920px) {
  .list-columns,
  .settings-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fab {
    right: calc(50% - 470px);
    bottom: 100px;
  }
}

@media (max-width: 640px) {
  #view-calendar,
  #view-calendar .app-shell {
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
    max-width: 100%;
  }

  #view-calendar .calendar-card {
    margin: 0;
    border-radius: 0;
    border: 0;
    padding: 8px 2px;
    box-shadow: none;
  }

  #view-calendar .calendar-toolbar {
    display: none;
  }

  #view-calendar .calendar-body {
    padding-top: 0;
  }

  #view-calendar .weekday-row,
  #view-calendar .calendar-grid {
    gap: 2px;
  }

  #view-calendar .weekday-row {
    padding: 0 1px;
  }

  #view-calendar .weekday-row span {
    padding: 6px 0;
    font-size: 11px;
  }

  #view-calendar .day-cell {
    min-height: 88px;
    padding: 3px 2px 4px;
    gap: 1px;
    border-radius: 6px;
  }

  #view-calendar .day-number {
    font-size: 11px;
    min-width: 16px;
    height: 16px;
  }

  #view-calendar .day-lunar {
    font-size: 9px;
  }

  #view-calendar .calendar-strip,
  #view-calendar .calendar-more {
    padding: 2px 3px;
    font-size: 10px;
    line-height: 1.35;
    border-radius: 3px;
  }

  body[data-view="calendar"] .app-header {
    padding-left: 8px;
    padding-right: 8px;
  }

  body[data-view="calendar"] .brand small {
    display: none;
  }

  body[data-view="calendar"] .brand strong {
    font-size: 19px;
  }

  body[data-view="calendar"] .header-calendar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
  }

  #view-today .panel,
  #view-list .panel,
  #view-profile .panel {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 10px 8px;
  }

  #view-today .today-section {
    padding: 0;
    border: none;
    margin-bottom: 16px;
  }

  #view-today .today-section .task-row,
  #view-today .today-section .habit-card {
    border-radius: 12px;
  }

  #view-list .list-panel {
    padding: 0;
    margin-top: 0;
  }

  #view-today .today-section .section-label {
    margin-left: 2px;
    margin-bottom: 8px;
  }

  .list-date-group-header {
    padding: 10px 8px 6px;
  }
}

@media (min-width: 641px) {
  .header-calendar-nav {
    display: none;
  }
}

.header-calendar-nav {
  display: none;
}

.header-calendar-nav button {
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  font-weight: var(--weight-semibold);
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.header-calendar-nav button:active {
  background: var(--surface-soft);
}

.header-calendar-nav .header-today-btn {
  color: var(--primary-strong);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

@media (max-width: 430px) {
  .brand small {
    max-width: 48vw;
  }

  .section-head h1 {
    font-size: 22px;
  }

  .app-shell {
    padding: 8px 6px 94px;
  }

  body[data-view="today"] .brand strong {
    font-size: 18px;
  }

  body[data-view="today"] .brand small {
    max-width: 60vw;
  }

  .calendar-card {
    padding: 10px 8px;
  }

  .calendar-toolbar {
    align-items: center;
  }

  .segmented-actions {
    gap: 6px;
  }

  .icon-button,
  .month-today,
  .calendar-toggle {
    min-width: 36px;
    min-height: 36px;
  }

  .calendar-toggle {
    padding-inline: 8px;
  }

  .day-cell {
    min-height: 115px;
    padding: 5px 4px 6px;
    gap: 2px;
  }

  .day-head {
    height: auto;
  }

  .day-date {
    gap: 1px;
  }

  .day-cell.today .day-number,
  .day-cell.selected .day-number {
    min-width: 22px;
    height: 22px;
    font-size: 12px;
  }

  .day-number {
    font-size: 12px;
    min-width: 18px;
    height: 18px;
  }

  .day-lunar {
    font-size: 8px;
  }

  .calendar-strip,
  .calendar-more {
    padding: 2px 5px;
    padding-left: 8px;
    font-size: 10px;
    line-height: 1.3;
    border-radius: 4px;
    border-left-width: 2px;
  }

  .calendar-strips {
    gap: 2px;
  }

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

  .list-filter-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-preset-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .theme-preset {
    min-height: 40px;
    padding: 5px 6px;
    gap: 5px;
  }

  .theme-swatch {
    width: 18px;
    height: 18px;
  }

  .theme-preset strong {
    font-size: 11px;
  }

  .preference-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
  }

  .preference-item {
    align-items: center;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    border-radius: var(--radius);
    background: var(--surface-soft);
  }

  .preference-item h3 {
    margin: 0;
    font-size: 14px;
    color: var(--text-strong);
    font-weight: var(--weight-medium);
  }

  .preference-item p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
  }

  .data-setting-item {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .data-setting-item .btn {
    width: 100%;
  }

  .task-row,
  .date-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .task-row {
    display: block;
  }

  .task-content {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 60px;
    padding: 9px 9px 9px 13px;
  }

  .task-swipe-actions {
    width: 96px;
  }

  .task-row.actions-open .task-content {
    margin-right: 96px;
    margin-left: -96px;
  }

  .date-row .type-tag {
    grid-column: 2;
    justify-self: start;
  }

  .task-content .type-tag {
    grid-column: 3;
    grid-row: 1 / span 2;
    justify-self: end;
    align-self: center;
  }

  .date-task-row .type-tag,
  .list-task-row .type-tag {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
  }

  .quick-sheet {
    width: calc(100% - 20px);
    max-height: min(88vh, 740px);
    padding: 12px;
    border-radius: 16px;
  }

  .compact-form-grid {
    grid-template-columns: 1fr;
  }

  .date-choice-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .date-choice-row::-webkit-scrollbar {
    display: none;
  }

  .date-choice {
    flex: 0 0 auto;
    min-width: 64px;
    min-height: 34px;
    font-size: 12px;
  }

  .date-choice-row.three .date-choice {
    flex: 1 1 0;
    min-width: 0;
  }

  .more-settings-grid {
    grid-template-columns: 1fr;
  }

  .date-picker-label {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 8px 10px;
  }

  .date-picker-label input {
    width: 100%;
    text-align: left;
  }

  .notification-setting-row .setting-actions {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }
}

.setting-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.notification-setting-row .mode-pill {
  min-width: 72px;
  text-align: center;
}

.notification-setting-row .btn {
  min-width: 72px;
}

.notification-setting-row .notification-disable-button {
  min-width: auto;
  padding-inline: 10px;
  color: var(--text-muted);
}

.notification-status-granted {
  background: var(--mint-soft);
  color: #247d67;
}

.notification-status-default {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.notification-status-denied {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
}

.notification-status-disabled,
.notification-status-permission-required {
  background: var(--surface-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.notification-status-syncing,
.notification-status-subscribing {
  background: color-mix(in srgb, var(--sky) 16%, var(--surface));
  color: color-mix(in srgb, var(--sky) 72%, var(--text));
  border: 1px solid color-mix(in srgb, var(--sky) 34%, var(--border));
}

.notification-status-pending {
  background: color-mix(in srgb, var(--sun) 18%, var(--surface));
  color: color-mix(in srgb, var(--sun) 55%, var(--text));
  border: 1px solid color-mix(in srgb, var(--sun) 38%, var(--border));
}

.notification-status-error,
.notification-status-permission-denied,
.notification-status-reauthorization-required {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border));
}

.notification-status-unsupported {
  background: var(--surface-soft);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.quick-sheet-v2 {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 150;
  width: 100%;
  max-width: none;
  max-height: 92vh;
  transform: none;
  overflow: hidden;
  padding: 0;
  background: var(--surface);
  border: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(40, 30, 20, 0.15);
}

.quick-sheet-v2[data-surface="keyboard"] {
  max-height: 180px;
}

.quick-sheet-v2[data-surface="keyboard"] .quick-form-v2 {
  padding-bottom: 0;
}

.quick-sheet-v2[data-surface="date"] {
  height: calc(var(--quick-viewport-height, 100vh) - 4px);
  max-height: calc(var(--quick-viewport-height, 100vh) - 4px);
}

.quick-form-v2 {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: env(safe-area-inset-bottom);
  transition: opacity 200ms ease, transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.quick-sheet-v2[data-surface="date"] .quick-form-v2 {
  height: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}

.quick-sheet-v2.is-full .quick-form-v2 {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.quick-primary-panel {
  display: flex;
  flex-direction: column;
}

.quick-primary-panel[hidden] {
  display: none;
}

.quick-inputs {
  padding: 8px 16px 2px;
}

.quick-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.quick-title-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: var(--weight-medium);
  line-height: 1.3;
  padding: 4px 0;
  caret-color: var(--primary);
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 0;
  box-shadow: none;
}

.quick-title-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  -webkit-box-shadow: none;
}

.quick-title-input::placeholder {
  color: var(--text-soft);
  font-weight: var(--weight-regular);
}

.quick-notes-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.25;
  padding: 2px 0;
  resize: none;
  min-height: 20px;
  max-height: 24px;
  overflow: hidden;
  font-family: inherit;
  caret-color: var(--primary);
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 0;
  box-shadow: none;
}

.quick-notes-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  -webkit-box-shadow: none;
}

.quick-notes-input::placeholder {
  color: var(--text-soft);
}

.quick-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 12px 2px;
}

.quick-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.quick-tools::-webkit-scrollbar {
  display: none;
}

.quick-tool-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 180ms ease, color 180ms ease, transform 160ms ease;
  position: relative;
}

.quick-tool-btn:active {
  transform: scale(0.92);
}

.quick-tool-btn:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.quick-tool-btn.is-active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.quick-tool-btn.is-open {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
}

/* 激活状态的小圆点指示器 */
.quick-tool-dot {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

.quick-tool-btn[data-tool="date"].is-active .quick-tool-dot { background: var(--primary); }
.quick-tool-btn[data-tool="priority"].is-active .quick-tool-dot { background: var(--priority-dot-color, #ff6f52); }
.quick-tool-btn[data-tool="area"].is-active .quick-tool-dot { background: var(--area-dot-color, var(--primary)); }
.quick-tool-btn[data-tool="tone"].is-active .quick-tool-dot { background: var(--tone-dot-color, #ff6f52); }

.quick-tool-btn.quick-tool-more {
  color: var(--text-soft);
}

.quick-send-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 6px 16px var(--primary-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  margin-left: 8px;
}

.quick-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--primary-shadow);
}

.quick-send-btn:active {
  transform: scale(0.94);
}

.quick-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.quick-extra-panel {
  border-top: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
  padding: 0;
  background: var(--surface);
  animation: quickExtraFade 200ms ease;
  max-height: min(74vh, calc(var(--quick-viewport-height, 100vh) - 226px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.quick-sheet-v2[data-surface="date"] .quick-extra-panel {
  display: block;
  flex: 1;
  max-height: none;
  overflow-y: auto;
}

.quick-summary {
  min-height: 18px;
  padding: 0 16px 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-date-child-panel {
  min-height: 330px;
  background: var(--surface);
}

.quick-date-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid var(--border);
}

.quick-date-tabs button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
}

.quick-date-tabs button[aria-selected="true"] {
  color: var(--primary);
  box-shadow: inset 0 -2px var(--primary);
  font-weight: var(--weight-semibold);
}

.quick-date-settings {
  margin-top: 10px;
  border-top: 1px solid var(--border);
}

.quick-date-settings button {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-strong);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.quick-date-settings strong {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: var(--weight-medium);
}

.quick-date-session-error {
  min-height: 20px;
  margin: 0;
  padding: 0 16px 4px;
  color: var(--danger);
  font-size: 13px;
}

.quick-date-footer {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.quick-date-footer button {
  min-height: 52px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
}

.quick-date-footer [data-date-confirm] {
  color: var(--primary);
  font-weight: var(--weight-semibold);
  border-left: 1px solid var(--border);
}

.quick-date-child-head {
  min-height: 52px;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.quick-date-child-head button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  cursor: pointer;
}

.quick-date-child-content { padding: 8px 0 16px; }
.quick-date-child-content .picker-wheels-row { padding: 12px 16px; }
.quick-time-mode-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px 16px; }
.quick-time-mode-options button { min-height: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text-muted); font: inherit; cursor: pointer; }
.quick-time-mode-options button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); font-weight: var(--weight-semibold); }
.quick-date-all-day { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 8px 16px; color: var(--text-strong); }
.quick-date-all-day input { width: 20px; height: 20px; accent-color: var(--primary); }
.quick-date-choice-list { display: grid; gap: 2px; padding: 0 8px; }
.quick-date-choice-list .quick-area-item { min-height: 44px; border-radius: 12px; }
.quick-date-child-error { min-height: 20px; margin: 0; padding: 0 16px 12px; color: var(--danger); font-size: 13px; }

@keyframes quickExtraFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 整合日期时间面板 ===== */
.quick-datetime-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.quick-datetime-calendar {
  padding: 6px 16px 4px;
}

.quick-datetime-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.quick-datetime-month {
  font-size: 15px;
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
}

.quick-datetime-nav {
  display: flex;
  gap: 4px;
}

.quick-datetime-nav button {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-datetime-nav button:active {
  background: var(--surface-soft);
}

.quick-datetime-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: var(--weight-medium);
  padding-bottom: 0;
}

.quick-datetime-weekdays span {
  padding: 2px 0;
}

.quick-datetime-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.quick-datetime-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, color 150ms ease;
}

.quick-datetime-day.outside {
  color: color-mix(in srgb, var(--text-muted) 40%, transparent);
}

.quick-datetime-day.today {
  color: var(--primary-strong);
  font-weight: var(--weight-semibold);
}

.quick-datetime-day.today:not(.selected) {
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.quick-datetime-day.selected {
  background: var(--primary);
  color: #fff;
  font-weight: var(--weight-semibold);
}

.quick-datetime-day:active {
  background: var(--surface-soft);
}

.quick-datetime-day.selected:active {
  background: var(--primary-strong);
}

.quick-datetime-quick {
  display: flex;
  gap: 6px;
  padding: 8px 16px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-datetime-quick::-webkit-scrollbar { display: none; }

.quick-datetime-quick-btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
}

.quick-datetime-quick-btn.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.quick-pending-confirmation {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.quick-pending-confirmation strong {
  font-size: 17px;
  color: var(--text-strong);
}

.quick-pending-confirmation p {
  margin: 0;
  color: var(--text-muted);
}

.quick-pending-confirmation > div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.quick-pending-confirmation button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.quick-pending-confirmation [data-pending-confirm] {
  color: #fff;
  border-color: transparent;
  background: var(--primary-gradient);
}

.quick-datetime-options {
  display: flex;
  gap: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
  margin-top: 8px;
}

.quick-datetime-opt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 150ms ease, color 150ms ease;
}

.quick-datetime-opt:active {
  background: var(--surface-soft);
}

.quick-datetime-opt.is-active {
  color: var(--primary);
}

.quick-datetime-opt svg {
  width: 22px;
  height: 22px;
}

.quick-datetime-opt-label {
  font-weight: var(--weight-medium);
}

/* ===== 四象限优先级选择器 ===== */
.quick-priority-panel {
  padding: 12px;
}

.quick-priority-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-priority-quad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 12px;
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: all 160ms ease;
  min-height: 100px;
}

.quick-priority-quad.is-selected {
  border-color: var(--quad-color);
  background: color-mix(in srgb, var(--quad-color) 10%, var(--surface));
  transform: scale(0.98);
}

.quick-priority-quad:active {
  transform: scale(0.96);
}

.quick-priority-roman {
  font-size: 24px;
  font-weight: var(--weight-semibold);
  color: var(--quad-color);
  font-style: italic;
}

.quick-priority-label {
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--text-strong);
  text-align: center;
}

.quick-priority-desc {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.quick-priority-quad.q1 { --quad-color: #ff5252; background: color-mix(in srgb, #ff5252 6%, var(--surface)); }
.quick-priority-quad.q2 { --quad-color: #448aff; background: color-mix(in srgb, #448aff 6%, var(--surface)); }
.quick-priority-quad.q3 { --quad-color: #ff9800; background: color-mix(in srgb, #ff9800 6%, var(--surface)); }
.quick-priority-quad.q4 { --quad-color: #9e9e9e; background: color-mix(in srgb, #9e9e9e 4%, var(--surface)); }

/* ===== 项目/归属选择列表 ===== */
.quick-area-panel {
  padding: 8px 0;
}

.quick-area-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
  transition: background 150ms ease;
}

.quick-area-item:active {
  background: var(--surface-soft);
}

.quick-area-item.is-selected {
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.quick-area-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.quick-area-info {
  flex: 1;
  text-align: left;
}

.quick-area-name {
  font-size: 15px;
  font-weight: var(--weight-medium);
  color: var(--text-strong);
}

.quick-area-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-area-item.is-selected .quick-area-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-size: 12px;
}

/* ===== 扩展色板（25+柔和色） ===== */
.quick-tone-panel {
  padding: 12px 16px;
}

.quick-tone-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.quick-tone-swatch {
  aspect-ratio: 1;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease;
  position: relative;
}

.quick-tone-swatch:hover {
  transform: scale(1.1);
}

.quick-tone-swatch.is-selected {
  border-color: var(--text-strong);
  transform: scale(1.1);
}

.quick-tone-swatch.is-selected::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,0.6);
  font-size: 12px;
  font-weight: bold;
}

.quick-tone-none {
  background: var(--surface);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
}

.quick-tone-none.is-selected {
  border-style: solid;
  border-color: var(--text-strong);
}

/* ===== 全屏详细编辑页 ===== */
.quick-full-panel {
  position: fixed;
  inset: 0;
  z-index: 170;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: quickFullSlideIn 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}

@keyframes quickFullSlideIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.quick-full-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.quick-full-back {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.quick-full-back:active {
  background: var(--surface-soft);
}

.quick-full-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
}

.quick-full-more {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  letter-spacing: 1px;
  cursor: pointer;
}

.quick-full-more:active {
  background: var(--surface-soft);
}

.quick-full-menu {
  position: absolute;
  top: calc(62px + env(safe-area-inset-top));
  right: 12px;
  z-index: 2;
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quick-full-delete {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--danger);
  text-align: left;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.quick-full-delete:active,
.quick-full-delete:focus-visible {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.quick-full-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.quick-full-body > .quick-datetime-panel,
.quick-full-body > .quick-date-child-panel {
  margin: -16px;
  min-height: 100%;
}

.quick-full-body > .quick-priority-panel,
.quick-full-body > .quick-area-panel,
.quick-full-body > .quick-tone-panel {
  padding-top: 0;
}

.quick-full-section {
  margin-bottom: 20px;
}

.quick-full-bottom-actions {
  padding: 8px 0 calc(20px + env(safe-area-inset-bottom));
}

.quick-full-complete {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 16px;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  box-shadow: 0 6px 16px var(--primary-shadow);
}

.quick-full-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: var(--weight-medium);
  padding-left: 4px;
}

.quick-full-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-strong);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 150ms ease;
}

.quick-full-input:focus {
  border-color: var(--primary);
}

.quick-full-textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.quick-full-textarea:focus {
  border-color: var(--primary);
}

.quick-full-value {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  transition: border-color 150ms ease;
}

.quick-full-value:active {
  background: var(--surface-soft);
}

.quick-full-value .qv-arrow {
  color: var(--text-muted);
  font-size: 18px;
}

.quick-full-value.is-empty {
  color: var(--text-muted);
}

.quick-full-value-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-full-color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
  .quick-extra-panel,
  .quick-full-panel,
  .quick-form-v2 {
    animation: none;
    transition: none;
  }
}

@media (max-width: 640px) {
  .quick-sheet-v2 {
    border-radius: 20px 20px 0 0;
  }

  .quick-title-input {
    font-size: 17px;
  }

  .quick-notes-input {
    font-size: 15px;
  }

  .quick-tool-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }

  .quick-send-btn {
    width: 44px;
    height: 44px;
  }

  .quick-priority-grid {
    gap: 6px;
  }

  .quick-priority-quad {
    padding: 14px 10px;
    min-height: 90px;
  }

  .quick-tone-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
  }

  .quick-full-body {
    padding: 12px;
  }
}
