:root {
  color-scheme: light;
  --ink: #1a2b2b;
  --muted: #647676;
  --line: rgba(31, 69, 69, 0.13);
  --soft-line: rgba(31, 69, 69, 0.08);
  --glass: rgba(247, 252, 252, 0.84);
  --native-glass: rgba(246,252,251,.48);
  --paper: rgba(255, 255, 255, 0.65);
  --teal: #1d7773;
  --teal-dark: #125b58;
  --mint: #d9efeb;
  --highlight-bg: rgba(217,239,235,.38);
  --accent-rgb: 29,119,115;
  --coral: #e56b56;
  --blue: #5b7fa3;
  --sand: #b68a57;
  --shadow: 0 24px 80px rgba(23, 52, 52, 0.2);
  --font-body: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Apple Color Emoji", sans-serif;
  --font-display: "Daydream Brush", "Kaiti SC", "STKaiti", serif;
  font-family: var(--font-body);
}



* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  color: var(--ink);
  background: #dfe9e8;
  overflow: hidden;
}

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

.desktop-stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background-color: #dbe7e6;
  background-image:
    linear-gradient(rgba(255,255,255,.38) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.34) 1px, transparent 1px);
  background-size: 72px 72px;
}

.desktop-stage::before,
.desktop-stage::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.68);
  background: rgba(255,255,255,.18);
  box-shadow: 0 18px 48px rgba(43, 77, 75, .08);
  backdrop-filter: blur(8px);
}

.desktop-stage::before {
  width: 36vw;
  height: 28vh;
  left: 8vw;
  top: 17vh;
}

.desktop-stage::after {
  width: 29vw;
  height: 21vh;
  left: 22vw;
  bottom: 12vh;
}

.ambient-copy {
  position: absolute;
  left: clamp(32px, 7vw, 104px);
  top: clamp(38px, 9vh, 100px);
  z-index: 1;
  color: rgba(23, 63, 61, .48);
}

.ambient-copy span {
  display: block;
  margin-bottom: 12px;
  font-size: .72rem;
  letter-spacing: .22em;
}

.ambient-copy strong {
  font-family: ui-serif, "Songti SC", STSong, serif;
  font-size: clamp(1.9rem, 4vw, 4.4rem);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -.04em;
}

.hot-edge {
  position: fixed;
  z-index: 10;
  right: 0;
  top: 34%;
  width: 36px;
  min-height: 142px;
  border: 1px solid rgba(255,255,255,.72);
  border-right: 0;
  border-radius: 16px 0 0 16px;
  background: rgba(246,252,251,.8);
  box-shadow: -8px 12px 30px rgba(36,75,72,.14);
  backdrop-filter: blur(20px);
  cursor: pointer;
  color: var(--teal-dark);
  transition: opacity .2s ease, transform .2s ease;
}

.hot-edge span {
  display: block;
  margin: auto;
  writing-mode: vertical-rl;
  letter-spacing: .24em;
  font-size: .8rem;
}

.hot-edge b {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  margin: 11px auto 0;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: .7rem;
}

.todo-shell {
  position: fixed;
  z-index: 20;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(920px, calc(100vw - 48px));
  transform: translateX(calc(100% + 30px));
  transition: transform .38s cubic-bezier(.2,.8,.2,1);
}

.todo-shell.is-open { transform: translateX(0); }

html.is-native-shell,
html.is-native-shell body,
body.is-native-shell {
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

html.is-native-shell *,
body.is-native-shell * {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html.is-native-shell ::-webkit-scrollbar,
body.is-native-shell ::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

html.is-native-shell .desktop-stage,
body.is-native-shell .desktop-stage {
  display: block !important;
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  background-image: none !important;
}

html.is-native-shell .desktop-stage::before,
html.is-native-shell .desktop-stage::after,
body.is-native-shell .desktop-stage::before,
body.is-native-shell .desktop-stage::after,
html.is-native-shell .ambient-copy,
html.is-native-shell #hotEdge,
html.is-native-shell .hot-edge,
body.is-native-shell .ambient-copy,
body.is-native-shell #hotEdge,
body.is-native-shell .hot-edge {
  display: none !important;
}

html.is-native-shell .todo-shell,
body.is-native-shell .todo-shell {
  position: fixed !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 100 !important;
  box-sizing: border-box !important;
  border: none !important;
}

/* The native window owns the outer shadow and rounded clipping. Its page
   fills the content bounds in both full and compact mode. */
html.is-native-shell .shell-inner,
body.is-native-shell .shell-inner {
  width: 100%;
  height: 100%;
  border: 0 !important;
  box-shadow: none !important;
}

html.is-native-shell .workspace,
body.is-native-shell .workspace {
  min-height: 0;
}

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


.shell-inner {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 26px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px) saturate(118%);
  -webkit-backdrop-filter: blur(30px) saturate(118%);
}

.app-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 26px 18px;
  border-bottom: 1px solid var(--soft-line);
}

.appearance-panel {
  position: absolute;
  z-index: 50;
  top: 65px;
  right: 20px;
  width: min(310px, calc(100vw - 40px));
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb, 29, 119, 115), 0.35) transparent;
  padding: 17px;
  padding-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 18px 48px rgba(23,52,52,.22);
}
.appearance-panel::-webkit-scrollbar {
  width: 5px;
  display: block;
}
.appearance-panel::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb, 29, 119, 115), 0.3);
  border-radius: 10px;
}
.appearance-panel::-webkit-scrollbar-track {
  background: transparent;
}

html.is-native-shell .appearance-panel,
body.is-native-shell .appearance-panel {
  scrollbar-width: thin !important;
}
html.is-native-shell .appearance-panel::-webkit-scrollbar,
body.is-native-shell .appearance-panel::-webkit-scrollbar {
  display: block !important;
  width: 5px !important;
  background: transparent !important;
}
html.is-native-shell .appearance-panel::-webkit-scrollbar-thumb,
body.is-native-shell .appearance-panel::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb, 29, 119, 115), 0.3) !important;
  border-radius: 10px !important;
}
.appearance-panel[hidden] { display: none; }
.appearance-panel h2 { margin: 0 0 13px; font-size: .95rem; }
.appearance-label { display: block; margin: 12px 0 7px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.appearance-label output { float: right; color: var(--teal-dark); }
.theme-options-v2 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.theme-card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-size: .71rem;
  color: var(--ink);
  transition: all .14s ease;
}
.theme-card-btn:hover { border-color: var(--teal); transform: translateY(-1px); }
.theme-card-btn[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--mint);
  color: var(--teal-dark);
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(var(--accent-rgb), .16);
}
.theme-swatches { display: flex; gap: 2px; }
.theme-swatches span { width: 6px; height: 16px; border-radius: 2px; }

.version-switch-banner {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(var(--accent-rgb), .08);
  border: 1px dashed rgba(var(--accent-rgb), .3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.version-switch-banner span { font-size: .77rem; font-weight: 680; color: var(--teal-dark); }
.version-switch-btn {
  font-size: .73rem;
  color: var(--teal);
  text-decoration: none;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 7px;
  background: white;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.version-switch-btn:hover { background: var(--teal); color: white; }
.custom-color-row { display: flex; gap: 6px; margin-top: 7px; }
.custom-color-row button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 35px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; font-size: .73rem; }
#customColorButton { flex: 1; }
#customColorButton[aria-pressed="true"] { border-color: var(--teal); background: var(--mint); color: var(--teal-dark); }
#customColorSwatch { flex: none; width: 17px; height: 17px; border-radius: 50%; background: #1d7773; border: 1px solid rgba(0,0,0,.13); }
#customColorHex { margin-left: auto; color: var(--muted); font-size: .67rem; }
#eyedropperButton { flex: none; }
#opacitySlider { width: 100%; accent-color: var(--teal); cursor: pointer; }
#edgeLabelInput { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; outline-color: var(--teal); background: white; }
#edgeLabelInput[aria-invalid="true"] { border-color: #bb3c48; }
.appearance-hint { margin: 6px 0 0; color: var(--muted); font-size: .69rem; }
.auto-height-option { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: .77rem; cursor: pointer; }
.auto-height-option input { accent-color: var(--teal); }
.edge-label-row { display: flex; gap: 7px; }
.edge-label-row #edgeLabelInput { min-width: 0; }
.edge-label-save { flex: none; padding: 0 12px; border: 0; border-radius: 9px; background: var(--teal); color: white; cursor: pointer; font-weight: 600; }
.edge-label-save:hover { background: var(--teal-dark); }
.appearance-error { min-height: 1em; margin: 6px 0 0; color: #bb3c48; font-size: .69rem; }

.brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.brand > div { min-width: 0; }

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: white;
  background: var(--teal);
  font-size: 1.25rem;
  box-shadow: 0 8px 20px rgba(var(--accent-rgb),.22);
}

.brand h1 { margin: 0; font-size: 1.18rem; letter-spacing: -.02em; overflow-wrap: anywhere; line-height: 1.22; }
.brand p { margin: 3px 0 0; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 9px; flex: none; }

.focus-count {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: .76rem;
  font-weight: 650;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: 1.05rem;
}

.icon-button:hover,
.icon-button[aria-pressed="true"] { background: white; color: var(--teal); }
.mode-button { width: auto; min-width: 49px; padding: 0 8px; font-size: .73rem; font-weight: 650; white-space: nowrap; }

.top-nav {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 26px;
}

.view-tabs,
.category-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-tabs {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.38);
}

.view-tab,
.category-pill {
  border: 0;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.view-tab {
  padding: 7px 15px;
  border-radius: 8px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 620;
}

.view-tab.is-active {
  background: white;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(35,67,65,.08);
}

.category-pill {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .78rem;
}

.category-pill:hover,
.category-pill.is-active { background: rgba(var(--accent-rgb),.1); color: var(--teal-dark); }

.quick-add {
  margin: 0 26px 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.7);
  box-shadow: 0 9px 28px rgba(36,75,72,.08);
}

.quick-add:focus-within { border-color: rgba(var(--accent-rgb),.42); box-shadow: 0 10px 30px rgba(var(--accent-rgb),.12); }

.quick-add-main { display: flex; align-items: center; gap: 10px; padding: 11px 12px 9px 15px; }
.add-symbol { color: var(--teal); font-size: 1.35rem; }
.task-input-wrap { position: relative; flex: 1; min-width: 0; }

#taskTitle {
  width: 100%;
  min-height: 35px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: .98rem;
}

#taskTitle::placeholder { color: #8b9a99; }

.add-button {
  min-width: 82px;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--teal);
  cursor: pointer;
  font-size: .84rem;
  font-weight: 680;
}

.add-button:hover { background: var(--teal-dark); }

.suggestions {
  display: none;
  position: absolute;
  z-index: 40;
  top: 39px;
  left: -30px;
  right: -82px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 38px rgba(35,64,63,.16);
}

.suggestions.is-visible { display: block; }

.suggestion {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font-size: .84rem;
}

.suggestion:hover,
.suggestion.is-active { background: var(--mint); color: var(--teal-dark); }

.quick-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 7px 12px 10px 45px;
  border-top: 1px solid var(--soft-line);
}

.compact-field {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 29px;
  padding: 0 8px;
  border-right: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: .74rem;
}

.compact-field:last-child { border-right: 0; }

.compact-field input,
.compact-field select {
  max-width: 126px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: .76rem;
}

.repeat-field { display: none; }
.repeat-field.is-visible { display: flex; }
.reminder-detail { display: none; flex-wrap: wrap; gap: 4px; }
.reminder-detail.is-visible { display: flex; }
.custom-lead { display: none; }
.custom-lead.is-visible { display: flex; }
.mic-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), .08);
  color: var(--teal-dark);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all .16s ease;
}
.mic-button:hover { background: var(--mint); color: var(--teal); transform: scale(1.05); }
.mic-button.is-listening {
  background: #ff4757;
  color: white;
  animation: pulseMic 1.2s infinite;
}
@keyframes pulseMic {
  0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

/* 智能添加预览卡片 (规格§7.3 创建前必须预览确认) */
.smart-preview-card {
  margin: 0 12px 10px;
  padding: 12px 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.12);
  backdrop-filter: blur(14px);
  animation: previewPop .18s cubic-bezier(.16, 1, .3, 1);
}
.smart-preview-card[hidden] { display: none; }

@keyframes previewPop {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.preview-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.preview-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.preview-kind-badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  background: var(--mint);
  color: var(--teal-dark);
}
.preview-title-text {
  font-size: .94rem;
  font-weight: 650;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-dismiss-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: .82rem;
}
.preview-dismiss-btn:hover { background: rgba(0,0,0,.06); color: var(--ink); }

.preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: .72rem;
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
}
.preview-chip.is-planned { border-color: rgba(var(--accent-rgb), .35); color: var(--teal-dark); font-weight: 600; }
.preview-chip.is-deadline { border-color: rgba(229, 91, 75, .35); color: #c43828; font-weight: 600; }
.preview-chip.is-category { background: rgba(var(--accent-rgb), .06); }

.preview-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.preview-confirm-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(var(--accent-rgb), .22);
  transition: all .14s ease;
}
.preview-confirm-btn:hover { background: var(--teal-dark); transform: translateY(-1px); }
.preview-toggle-options {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: .75rem;
  cursor: pointer;
}
.preview-toggle-options:hover { background: rgba(255,255,255,.6); color: var(--ink); }

.quick-options[hidden] { display: none; }
.kind-deduction-field { margin-left: auto; border-right: 0; }

.task-kind-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .67rem;
  font-weight: 650;
  background: rgba(var(--accent-rgb), .12);
  color: var(--teal-dark);
  margin-right: 4px;
}
.task-overdue-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .67rem;
  font-weight: 750;
  background: rgba(229, 91, 75, .15);
  color: #c43828;
  margin-right: 4px;
}

.workspace { min-height: 0; overflow: auto; padding: 0 24px 20px; scrollbar-width: none; -ms-overflow-style: none; }
.workspace::-webkit-scrollbar { display: none; width: 0; height: 0; }
.view-panel { display: none; }
.view-panel.is-active { display: block; }

.day-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "overdue today" "tomorrow dayafter";
  gap: 10px;
}
.day-column.is-overdue { grid-area: overdue; }
.day-column.is-today { grid-area: today; }
.day-column.is-tomorrow { grid-area: tomorrow; }
.day-column.is-day-after { grid-area: dayafter; }

.day-column {
  min-height: 310px;
  padding: 13px;
  border-left: 1px solid var(--line);
  background: rgba(255,255,255,.26);
}

.day-column:first-child { border-left: 0; }
.day-column.is-today { background: var(--highlight-bg); }

.day-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 50px;
  margin-bottom: 11px;
}

.day-name { display: block; margin-bottom: 4px; font-size: .88rem; font-weight: 720; }
.day-date { font-size: .74rem; color: var(--muted); }

.day-badge {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb),.1);
  color: var(--teal-dark);
  font-size: .7rem;
  font-weight: 700;
}

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

.task-row {
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 10px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(255,255,255,.7);
  transition: transform .16s ease, border-color .16s ease, opacity .16s ease;
}

.task-row:hover { transform: translateY(-1px); border-color: var(--line); }
.task-row.is-done { opacity: .52; }
.task-row.is-done .task-title { text-decoration: line-through; }

.check-button {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  padding: 0;
  margin-top: 1px;
  border: 1.5px solid #8ca5a3;
  border-radius: 6px;
  background: transparent;
  color: white;
  cursor: pointer;
  font-size: .7rem;
}

.is-done .check-button { border-color: var(--teal); background: var(--teal); }
.task-copy { min-width: 0; }
.task-title { display: block; line-height: 1.35; font-size: .82rem; overflow-wrap: anywhere; }

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  color: var(--muted);
  font-size: .67rem;
}

.category-dot { width: 6px; height: 6px; margin-top: 3px; border-radius: 50%; background: var(--blue); }
.category-dot.life { background: var(--coral); }
.category-dot.personal { background: var(--sand); }

.delete-button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #9aabaa;
  cursor: pointer;
  opacity: 0;
}

.task-actions { display: flex; align-items: center; gap: 2px; }
.reminder-button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: rgba(var(--accent-rgb),.08);
  color: var(--teal);
  cursor: pointer;
  font-size: .85rem;
}
.reminder-button.is-off { background: transparent; color: #a4b1b0; }
.reminder-button:hover { background: rgba(var(--accent-rgb),.16); }

.task-row:hover .delete-button,
.delete-button:focus { opacity: 1; }
.delete-button:hover { background: rgba(229,107,86,.1); color: var(--coral); }
.done-actions { margin: 12px 0; }
.danger-button {
  border: 1px solid rgba(229,107,86,.4);
  background: transparent;
  color: var(--coral, #e56b56);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}
.danger-button:hover { background: rgba(229,107,86,.1); }
.danger-button:disabled { opacity: .4; cursor: default; }

.empty-state {
  padding: 24px 5px;
  color: #8a9998;
  text-align: center;
  font-size: .75rem;
  line-height: 1.5;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.overview-column {
  min-height: 390px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.42);
}

.long-column { background: var(--highlight-bg); }
.column-heading { display: flex; align-items: center; justify-content: space-between; }
.eyebrow { display: block; margin-bottom: 4px; color: var(--teal); font-size: .62rem; letter-spacing: .16em; }
.column-heading h2 { margin: 0; font-size: 1rem; }
.column-count { display: grid; place-items: center; min-width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: .76rem; }
.column-note { margin: 8px 0 15px; color: var(--muted); font-size: .74rem; }
.overview-list { display: grid; gap: 8px; }
.overview-list .task-row { grid-template-columns: 21px minmax(0, 1fr) auto; padding: 11px; }

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 26px;
  border-top: 1px solid var(--soft-line);
  color: #7b8d8c;
  font-size: .68rem;
}

.app-footer button { border: 0; background: transparent; color: var(--teal); cursor: pointer; font-size: inherit; }
.app-footer button.is-muted { color: var(--coral); }
kbd { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-right: 3px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.55); font-family: inherit; font-size: .64rem; }

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 18px);
  padding: 10px 15px;
  border-radius: 11px;
  background: #173c3a;
  color: white;
  font-size: .8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-undo-button {
  margin-left: 10px;
  padding: 3px 9px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 6px;
  background: rgba(255,255,255,.2);
  color: white;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 500;
  transition: background .15s ease;
}
.toast-undo-button:hover, .toast-undo-button:active { background: rgba(255,255,255,.36); }
#saveState.is-error { color: var(--coral, #e56b56); font-weight: 500; }
/* --- 白日梦 V2 Phase 3: 拖拽与目标反馈规范 (§8.2) --- */
.task-row {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.task-row:active {
  cursor: grabbing;
}
.task-row.is-dragging {
  opacity: 0.35;
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.day-column {
  transition: background-color .2s ease, outline-color .2s ease, transform .2s ease;
}
.day-column.is-drop-target {
  background: var(--mint) !important;
  outline: 2px dashed var(--teal) !important;
  outline-offset: -3px;
  border-radius: 12px;
}
.day-column.is-drop-forbidden {
  background: rgba(229, 107, 86, 0.12) !important;
  outline: 2px dashed var(--coral, #e56b56) !important;
  outline-offset: -3px;
}

/* 今天页折叠展开控制条 (§8.2) */
.days-view-header {
  display: flex;
  justify-content: flex-end;
  padding: 4px 6px 10px;
}
.days-expand-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.7);
  color: var(--teal-dark);
  font-size: .76rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
}
.days-expand-toggle:hover {
  background: rgba(255,255,255,0.95);
  border-color: var(--teal);
}

/* 任务页搜索与快捷入口 (§8.3) */
.tasks-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.tasks-search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.tasks-search-icon {
  position: absolute;
  left: 11px;
  font-size: .8rem;
  pointer-events: none;
  opacity: 0.6;
}
.tasks-search-wrap input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.75);
  font-size: .82rem;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, background-color .2s;
}
.tasks-search-wrap input:focus {
  border-color: var(--teal);
  background: white;
}
.tasks-done-shortcut {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.6);
  color: var(--teal-dark);
  font-size: .78rem;
  cursor: pointer;
  white-space: nowrap;
}

/* 小组页规范 (§8.4, §10) */
.group-container {
  padding: 10px 4px;
}
.group-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}
.group-empty-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}
.group-empty-state h2 {
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.group-empty-state p {
  font-size: .84rem;
  color: var(--muted);
  max-width: 280px;
  margin-bottom: 24px;
  line-height: 1.4;
}
.group-entry-buttons {
  display: flex;
  gap: 12px;
}
.group-action-btn {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 14px;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
  border: 1px solid transparent;
}
.group-action-btn.primary {
  background: var(--teal);
  color: white;
}
.group-action-btn.secondary {
  background: rgba(255,255,255,0.8);
  color: var(--teal-dark);
  border-color: var(--line);
}

.group-tabs-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}
.group-tabs-scroll {
  min-width: 0;
  width: 100%;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.group-tabs-scroll::-webkit-scrollbar { display: none; }
.group-tab-pill {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.7);
  color: var(--muted);
  font-size: .8rem;
  cursor: pointer;
  white-space: nowrap;
}
.group-tab-pill.is-active {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
.group-existing-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 400px;
}
.group-existing-actions .group-action-btn {
  width: 100%;
  min-width: 0;
  font-size: 16px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .group-existing-actions { max-width: none; }
  .group-existing-actions .group-action-btn {
    padding-inline: 12px;
  }
}

/* ===== 小组协作专属排版设计 (白日梦规格 §8.4, §10) ===== */
.group-hero-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--soft-line);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.group-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.group-hero-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.group-hero-icon {
  font-size: 1.15rem;
}
.group-hero-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.group-tag {
  font-size: .7rem;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
}
.group-tag.role-badge {
  background: var(--mint);
  color: var(--teal-dark);
  font-weight: 600;
}
.group-tag.member-count-tag {
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted);
}

.group-actions-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--soft-line);
}
.group-code-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 980px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  cursor: pointer;
  user-select: none;
  transition: all .18s cubic-bezier(.2, .8, .2, 1);
}
.group-code-card:hover {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: var(--teal);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}
.code-card-label {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 500;
}
.code-card-val {
  font-family: -apple-system-monospaced, SFMono-Regular, ui-monospace, Menlo, Monaco, monospace;
  font-size: .88rem;
  font-weight: 700;
  color: var(--teal-dark);
  letter-spacing: 0.5px;
}
.code-copy-pill {
  font-size: .68rem;
  padding: 2px 8px;
  border-radius: 980px;
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  transition: background .15s ease;
}
.group-code-card:hover .code-copy-pill {
  background: var(--teal-dark);
}

.group-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}
.group-hero-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 980px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s cubic-bezier(.2, .8, .2, 1);
  white-space: nowrap;
}
.group-hero-action-btn.primary {
  background: var(--teal);
  color: #fff;
  border: 0;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.28);
}
.group-hero-action-btn.primary:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.38);
}
.group-hero-action-btn.secondary {
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.group-hero-action-btn.secondary:hover {
  background: #fff;
  border-color: var(--teal);
  color: var(--teal-dark);
}

.group-tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 8px;
}
.group-tasks-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.group-tasks-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink);
}
.group-tasks-subtitle {
  font-size: .7rem;
  color: var(--muted);
}
.group-tasks-count-badge {
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
}

.group-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.group-task-card {
  border: 1px solid var(--soft-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  transition: all .18s ease;
}
.group-task-card:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
.group-task-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.group-task-main {
  min-width: 0;
  flex: 1;
}
.group-task-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.group-task-meta {
  font-size: .72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.group-task-progress-badge {
  font-size: .74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--teal-dark);
  white-space: nowrap;
}
.group-task-expand-arrow {
  font-size: .7rem;
  color: var(--muted);
  transition: transform .2s ease;
}
.group-task-card.is-expanded .group-task-expand-arrow {
  transform: rotate(180deg);
}
.group-task-members-list {
  display: none;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--soft-line);
  background: rgba(255, 255, 255, 0.45);
}
.group-task-card.is-expanded .group-task-members-list {
  display: grid;
  gap: 8px;
}
.group-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--soft-line);
}
.group-member-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--ink);
}
.group-member-status-tag {
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 6px;
}
.group-member-status-tag.done {
  background: var(--mint);
  color: var(--teal-dark);
  font-weight: 600;
}
.group-member-status-tag.pending {
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
}
.group-member-checkbox {
  cursor: pointer;
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
}

.profile-themes-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 480px) {
  .profile-themes-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 常驻邀请码徽章与分享按钮 (§10.2) */
.group-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--mint);
  border: 1px dashed rgba(var(--accent-rgb), 0.45);
  color: var(--teal-dark);
  font-size: .74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s ease;
}
.group-code-badge:hover {
  background: white;
  border-color: var(--teal);
  transform: translateY(-1px);
}
.group-code-badge b {
  letter-spacing: .06em;
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.group-share-entry-btn {
  padding: 3px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--teal-dark);
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .16s ease;
}
.group-share-entry-btn:hover {
  background: white;
  border-color: var(--teal);
}
.preview-target-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--teal-dark);
}

/* 通用原生弹窗系统 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(18, 38, 38, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .18s ease;
}
.modal-backdrop[hidden] {
  display: none;
}
.modal-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  animation: modalScale .2s cubic-bezier(.16, 1, .3, 1);
}
@keyframes modalScale {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--soft-line);
}
.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}
.modal-close-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .9rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}
.modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal-field span {
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink);
}
.modal-field input {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  font-size: .86rem;
  color: var(--ink);
  outline: none;
  transition: border-color .16s ease;
}
.modal-field input:focus {
  border-color: var(--teal);
}
.modal-footer {
  padding: 12px 20px 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--soft-line);
}
.modal-btn {
  padding: 9px 18px;
  border-radius: 12px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s ease;
  border: 1px solid transparent;
}
.modal-btn.primary {
  background: var(--teal);
  color: white;
}
.modal-btn.primary:hover {
  background: var(--teal-dark);
}
.modal-btn.secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
}
.modal-btn.secondary:hover {
  background: rgba(0, 0, 0, 0.09);
  color: var(--ink);
}
.modal-error {
  font-size: .78rem;
  color: #c43828;
  margin: 0;
  background: rgba(229, 91, 75, 0.08);
  padding: 6px 10px;
  border-radius: 8px;
}
.modal-error[hidden] {
  display: none;
}

/* 分享邀请卡片专用 */
.share-code-box {
  background: var(--mint);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.share-code-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--teal-dark);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.share-code-val {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--teal-dark);
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.share-copy-btn {
  padding: 6px 16px;
  border-radius: 10px;
  background: var(--teal);
  color: white;
  border: 0;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s ease;
}
.share-copy-btn:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}
.share-copy-btn.secondary {
  background: white;
  color: var(--teal-dark);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.share-link-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.share-input-group {
  display: flex;
  gap: 8px;
}
.share-input-group input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .76rem;
  color: var(--muted);
  background: #f7faf9;
  outline: none;
}
.share-hint {
  font-size: .75rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

/* 我的页面 (§8.5) */
.profile-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 20px;
}
.profile-card {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--soft-line);
  backdrop-filter: blur(12px);
}
.profile-card.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--mint);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}
.profile-info h2 {
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 3px;
}
.profile-info p {
  font-size: .75rem;
  color: var(--muted);
}
.profile-section-title {
  font-size: .82rem;
  color: var(--teal-dark);
  letter-spacing: .04em;
  margin-bottom: 12px;
  font-weight: 600;
}
.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--soft-line);
}
.profile-row:last-child {
  border-bottom: 0;
}
.profile-row strong {
  display: block;
  font-size: .85rem;
  color: var(--ink);
  margin-bottom: 2px;
}
.profile-row p {
  font-size: .72rem;
  color: var(--muted);
}
.profile-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--teal-dark);
  font-size: .76rem;
  cursor: pointer;
}
.profile-link-arrow {
  color: var(--teal-dark);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 500;
}
.version-tag {
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--mint);
  color: var(--teal-dark);
}

/* 移动端底部 4-Tab 纯图标导航栏 (§8.1) */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 860px) {
  .todo-shell { top: 8px; right: 8px; bottom: 8px; width: calc(100vw - 16px); }
  html:not(.is-native-shell) .top-nav { align-items: flex-start; flex-direction: column; gap: 10px; }
  .day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-column.is-today { border-left: 0; }
}

@media (max-width: 650px) {
  .overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--glass);
  }
  .desktop-stage {
    min-height: 100vh;
    min-height: 100dvh;
    background: transparent;
  }
  .ambient-copy, .hot-edge { display: none; }
  .todo-shell {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    transform: none;
  }
  .shell-inner {
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  html:not(.is-native-shell) #windowModeButton,
  html:not(.is-native-shell) #pinButton,
  html:not(.is-native-shell) #hideButton {
    display: none !important;
  }
  .app-header {
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    padding-bottom: 14px;
    gap: 10px;
  }
  .brand {
    gap: 10px;
    min-width: 0;
  }
  .brand h1 {
    font-size: 1.15rem;
    line-height: 1.2;
  }
  .brand p {
    font-size: .76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-actions {
    gap: 8px;
    flex: none;
  }
  .focus-count {
    padding: 6px 10px;
    font-size: .74rem;
    white-space: nowrap;
  }
  .top-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 18px 10px !important;
  }
  
  /* 移动端智能输入框吸底固定在 4-Tab 导航上方 (§8.1) */
  html:not(.is-native-shell) .quick-add {
    margin: 0;
    position: sticky;
    bottom: calc(52px + env(safe-area-inset-bottom, 14px));
    z-index: 90;
    background: var(--glass);
    border-top: 1px solid var(--soft-line);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.03);
    padding: 10px 16px;
  }
  /* 在 overview/profile/done 下隐藏输入框 (§8.3)，小组页保留智能输入 (§10) */
  body[data-active-view="overview"] .quick-add,
  body[data-active-view="profile"] .quick-add,
  body[data-active-view="done"] .quick-add {
    display: none;
  }

  .workspace {
    flex: 1;
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 14px));
  }
  .category-tabs { max-width: 100%; overflow-x: auto; }
  .day-grid { grid-template-columns: 1fr; grid-template-areas: "overdue" "today" "tomorrow" "dayafter"; }
  .day-column { min-height: auto; border-left: 0; border-top: 1px solid var(--line); }
  .day-column:first-child { border-top: 0; }
  .quick-options { padding-left: 12px; }
  .smart-parse { width: 100%; margin-left: 0; }

  /* 移动端折叠模式：仅显示昨日未完与今天 (§8.2) */
  .day-grid.is-collapsed .day-column.is-tomorrow,
  .day-grid.is-collapsed .day-column.is-day-after {
    display: none;
  }

  /* 底部 footer 在移动端由 4-Tab 替代 */
  .app-footer {
    display: none;
  }

  /* 移动端 4-Tab 纯图标主导航 (§8.1) */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;
    padding-bottom: env(safe-area-inset-bottom, 14px);
    box-sizing: content-box;
    background: var(--glass);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    z-index: 100;
    align-items: center;
    justify-content: space-around;
  }
  .mobile-nav-btn {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    transition: all .2s ease;
    padding: 0;
  }
  .mobile-nav-btn svg {
    width: 24px;
    height: 24px;
    transition: transform .2s ease, stroke .2s ease;
  }
  .mobile-nav-btn.is-active {
    color: var(--teal-dark);
  }
  .mobile-nav-btn.is-active svg {
    transform: scale(1.12);
    stroke-width: 2.3;
  }
}

@media (pointer: coarse) {
  .todo-shell { transform: none; }
  .hot-edge { display: none; }
}

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

/* 邮箱验证码登录与旧数据认领区域 (施工指令 05) */
.account-section {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line, rgba(0, 0, 0, 0.08));
}
.account-logged-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--line, rgba(0, 0, 0, 0.08));
  border-radius: 12px;
  margin-bottom: 10px;
}
.account-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.account-legacy-import-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-top: 8px;
  border-top: 1px dashed var(--line, rgba(0, 0, 0, 0.08));
}
.account-legacy-import-btn {
  width: 100%;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid rgba(var(--accent-rgb, 29, 119, 115), 0.35);
  background: rgba(var(--accent-rgb, 29, 119, 115), 0.08);
  color: rgb(var(--accent-rgb, 29, 119, 115));
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.account-legacy-import-btn:hover {
  background: rgba(var(--accent-rgb, 29, 119, 115), 0.16);
  border-color: rgba(var(--accent-rgb, 29, 119, 115), 0.6);
}
.account-legacy-import-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.account-legacy-import-result {
  margin: 6px 0 0;
  font-size: 0.74rem;
  line-height: 1.4;
  color: #16a34a;
  text-align: center;
  word-break: break-all;
}
.account-legacy-import-result.is-error {
  color: #dc2626;
}
.account-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.account-user-meta strong {
  font-size: 0.88rem;
  color: var(--ink);
  word-break: break-all;
}
.account-user-name {
  font-size: 0.76rem;
  color: var(--muted, #6b7280);
}
.account-logout-btn {
  padding: 5px 12px;
  font-size: 0.78rem;
  border-radius: 8px;
  border: 1px solid rgba(229, 107, 86, 0.3);
  background: rgba(229, 107, 86, 0.08);
  color: #dc2626;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.account-logout-btn:hover {
  background: rgba(229, 107, 86, 0.16);
  border-color: #dc2626;
}
.claim-box {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed var(--line, rgba(0, 0, 0, 0.15));
  border-radius: 12px;
}
.claim-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.claim-warning {
  margin: 0 0 10px 0;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--muted, #64748b);
}
.claim-confirm-btn {
  width: 100%;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background: #dc2626;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease;
}
.claim-confirm-btn:hover {
  background: #b91c1c;
}
.claim-confirm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.claim-success-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  margin-top: 4px;
}

/* ====== 启动登录门 (施工指令 07) ====== */
.auth-gate-overlay {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background-color: var(--bg-surface, #485641);
  background-image:
    radial-gradient(circle at 50% 25%, rgba(95, 114, 86, 0.75) 0%, rgba(68, 82, 60, 0.98) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.025) 75%);
  background-size: 100% 100%, 6px 6px, 6px 6px;
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: inherit;
  box-sizing: border-box;
  animation: authGateFadeIn 0.25s ease-out;
}
.auth-gate-overlay[hidden] {
  display: none !important;
}
@keyframes authGateFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.auth-gate-card {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.auth-gate-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.auth-gate-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.auth-gate-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}
.auth-gate-desc {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
}

.auth-gate-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-gate-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
}
.auth-gate-field input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}
.auth-gate-field input:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.auth-gate-code-row {
  display: flex;
  gap: 8px;
}
.auth-gate-code-row input {
  flex: 1 1 auto;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.auth-gate-code-btn {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.auth-gate-code-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
}
.auth-gate-code-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-gate-login-btn {
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  background: #ffffff;
  color: #2b3824;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}
.auth-gate-login-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}
.auth-gate-login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-gate-error {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.18);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(220, 38, 38, 0.3);
  text-align: center;
  word-break: break-all;
}

.auth-gate-legacy-box {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.auth-gate-legacy-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.76rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s ease;
}
.auth-gate-legacy-toggle:hover {
  color: #ffffff;
  text-decoration: underline;
}
.auth-gate-legacy-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-gate-legacy-input-row {
  display: flex;
  gap: 8px;
}
.auth-gate-legacy-btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.auth-gate-legacy-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.28);
}

/* Forest schedule: surface and spacing establish hierarchy. */
.shell-inner { --forest-primary:#f7f8f3; --forest-secondary:rgba(247,248,243,.68); --forest-panel:rgba(255,255,255,.055); --forest-hover:rgba(255,255,255,.09); --forest-line:rgba(255,255,255,.10); color:var(--forest-primary)!important; background-color:#52654f!important; background-image:linear-gradient(155deg,#596c55,#465640)!important; background-size:100% 100%!important; border:1px solid var(--forest-line)!important; border-radius:22px!important; backdrop-filter:blur(24px)!important; -webkit-backdrop-filter:blur(24px)!important; box-shadow:0 18px 48px rgba(26,39,23,.20)!important; display:flex!important; flex-direction:column!important; overflow:hidden!important; }
.app-header { padding:22px 24px 20px; border-bottom:0; gap:16px; flex-shrink:0; flex-wrap:wrap; }
.brand { min-width:0; gap:12px; }
.brand > div { min-width:0; }
.brand-mark { background:#f7f8f3; color:#354632; width:38px; height:38px; border-radius:12px; box-shadow:none; }
#brandTitle { color:var(--forest-primary); font-size:1.2rem; line-height:1.2; }
#fullDate { color:var(--forest-secondary); font-size:.75rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.header-actions { gap:5px; margin-left:auto; flex:none; }
.header-actions .focus-count { color:var(--forest-primary); background:rgba(255,255,255,.10); padding:8px 12px; border:0; border-radius:10px; font-size:.79rem; white-space:nowrap; }
.header-actions .icon-button { width:30px; height:32px; min-width:30px; border:0; border-radius:8px; background:transparent; color:var(--forest-secondary); box-shadow:none; display:inline-grid; place-items:center; }
.header-actions .mode-button { width:auto; min-width:48px; padding:0 8px; font-size:.75rem; background:rgba(255,255,255,.04); }
.header-actions .icon-button:hover, .header-actions .icon-button[aria-pressed="true"] { color:var(--forest-primary); background:var(--forest-hover); }
.top-nav { display:flex!important; flex-direction:row!important; flex-wrap:wrap; align-items:center!important; justify-content:space-between!important; padding:0 24px 18px!important; gap:12px; flex-shrink:0; }
.view-tabs { border:0; padding:3px; background:rgba(255,255,255,.06); border-radius:11px; }
.view-tab { padding:7px 13px; color:var(--forest-secondary); font-size:.82rem; }
.view-tab.is-active { background:rgba(255,255,255,.14); color:var(--forest-primary); box-shadow:none; }
.view-tabs [data-view="done"] { display:none; }
.category-tabs { gap:2px; }
.category-pill { color:var(--forest-secondary); padding:7px 8px; border-radius:7px; font-size:.76rem; }
.category-pill.is-active, .category-pill:hover { color:var(--forest-primary); background:transparent; }
.category-pill.is-active { font-weight:650; }
.quick-add { margin:0 24px 20px!important; padding:16px 18px!important; border:0!important; border-radius:18px; background:rgba(255,255,255,.07)!important; box-shadow:none!important; position:relative!important; top:auto!important; bottom:auto!important; flex-shrink:0; max-height:min(430px,48vh); overflow-y:auto; scrollbar-width:thin; }
.quick-add:focus-within { background:rgba(255,255,255,.085)!important; }
.quick-add-main { gap:10px; padding:0 0 18px; }
.add-symbol { display:none; }
#taskTitle { min-height:40px; color:var(--forest-primary); font-size:.96rem; }
#taskTitle::placeholder { color:rgba(247,248,243,.48); }
.mic-button { flex:none; background:transparent; color:var(--forest-secondary); width:30px; }
.add-button { position:static; flex:none; min-width:40px; min-height:40px; width:40px; height:40px; padding:0; background:#f7f8f3; color:#354632; border-radius:12px; font-size:1.4rem; box-shadow:none; }
.add-button:hover { background:#fff; }
.quick-options { display:flex; flex-wrap:wrap; gap:8px; padding:0; border:0; }
.compact-field { display:inline-flex; min-height:32px; gap:6px; padding:4px 9px; background:rgba(255,255,255,.045); border:0; border-radius:8px; color:var(--forest-secondary); font-size:.74rem; }
.compact-field input, .compact-field select { color:var(--forest-primary); font-size:.76rem; color-scheme:dark; min-width:0; }
.compact-field input[type="date"] { width:112px; }
.compact-field input[type="time"] { width:82px; }
.compact-field select option { background:#465640; color:#f7f8f3; }
.quick-sublinks { display:flex; align-items:center; width:100%; gap:18px; margin-top:2px; }
.quick-sublink { border:0; background:transparent; color:var(--forest-secondary); padding:6px 0; font-size:.76rem; cursor:pointer; }
.quick-sublink:hover, .quick-sublink.is-active { color:var(--forest-primary); }
#toggleMoreBtn { margin-left:auto; }
.composer-details { display:flex; flex-wrap:wrap; gap:8px; width:100%; padding-top:12px; border-top:1px solid var(--forest-line); }
.composer-details[hidden] { display:none!important; }
.composer-details .repeat-field { display:inline-flex; }
.kind-deduction-field { margin-left:0; }
.kind-deduction-field b { color:var(--forest-primary)!important; font-weight:500; }
.reminder-detail.is-visible { display:flex; gap:8px; }
.workspace { flex:1 1 auto; min-height:0; padding:0 24px 20px; overflow-y:auto; }
.day-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-areas:"overdue today" "tomorrow dayafter"; gap:12px; border:0; }
.day-column { min-width:0; min-height:224px; padding:20px 18px; border:0!important; border-radius:14px; background:var(--forest-panel); box-shadow:none; }
.day-column.is-today { background:rgba(255,255,255,.085); }
.day-heading { gap:12px; min-height:44px; margin-bottom:18px; }
.day-name { color:var(--forest-primary); font-size:.92rem; font-weight:650; }
.day-date { color:var(--forest-secondary); font-size:.74rem; }
.day-badge { color:var(--forest-secondary); background:transparent; padding:2px 0; font-size:.74rem; font-weight:500; }
.task-list { gap:4px; }
.task-row { grid-template-columns:20px minmax(0,1fr) auto; column-gap:10px; padding:10px 0; margin:0; background:transparent; border:0; border-radius:8px; color:var(--forest-primary); align-items:start; }
.task-row:hover { transform:none; background:var(--forest-hover); }
.task-title { color:var(--forest-primary); font-size:.87rem; font-weight:550; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; }
.task-meta { display:flex; flex-wrap:nowrap; align-items:center; gap:4px; margin-top:5px; color:var(--forest-secondary); font-size:.69rem; min-width:0; }
.category-dot { flex:none; margin-top:0; }
.category-name { flex:none; }
.task-timing { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.task-kind-tag { flex:none; max-width:40%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.check-button { width:19px; height:19px; border-color:rgba(247,248,243,.48); border-radius:6px; }
.is-done .check-button { background:#e4ebdc; border-color:#e4ebdc; color:#354632; }
.task-actions { gap:0; position:relative; }
.reminder-button { background:transparent; }
.delete-button { width:20px; color:var(--forest-secondary); position:absolute; right:0; top:24px; }
.task-row:focus-within .delete-button { opacity:1; }
.empty-state.playful { display:flex; align-items:center; justify-content:center; min-height:105px; color:var(--forest-secondary); font-size:.83rem; }
.overview-column { background:var(--forest-panel); border:0; border-radius:14px; }
.overview-column h2, .column-heading h2 { color:var(--forest-primary); }
.column-note, .eyebrow { color:var(--forest-secondary); }
.app-footer { display:flex; flex-shrink:0; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:12px 24px; border-top:1px solid rgba(255,255,255,.065); color:var(--forest-secondary); background:transparent; font-size:.7rem; }
.app-footer > span:first-child { display:none; }
.app-footer button, .app-footer #saveState { color:var(--forest-secondary); background:transparent; border:0; padding:0; font-size:.7rem; }
.app-footer button:hover { color:var(--forest-primary); }
.mobile-bottom-nav { display:none!important; }
button:focus-visible, input:focus-visible, select:focus-visible { outline:2px solid #c5d8bb; outline-offset:3px; }
@media (max-width:680px) {
 .app-header { padding:18px 18px 16px; gap:12px; }
 .brand { flex:1 1 180px; }
 .top-nav { padding:0 18px 16px!important; }
 .quick-add { margin:0 18px 16px!important; padding:14px!important; }
 .workspace { padding:0 18px 16px; }
 .day-grid { grid-template-columns:minmax(0,1fr); grid-template-areas:"overdue" "today" "tomorrow" "dayafter"; gap:10px; }
 .day-column { min-height:172px; padding:16px; }
 .day-heading { margin-bottom:12px; }
 .empty-state.playful { min-height:68px; }
 .app-footer { padding:12px 18px; }
}
@media (max-width:380px) {
 .app-header { padding:16px 14px; }
 .header-actions { gap:3px; }
 .top-nav { padding-left:14px!important; padding-right:14px!important; }
 .quick-add { margin-left:14px!important; margin-right:14px!important; }
 .quick-options { gap:6px; }
 .workspace { padding-left:14px; padding-right:14px; }
 .app-footer #saveState { width:100%; }
}
@media (pointer:coarse) { .task-actions { padding-bottom:24px; } .delete-button { opacity:.7; } }

/* Keep all three common fields on one row in a 440px sidebar. */
.quick-options > .compact-field { padding:4px 7px; gap:4px; }
.quick-options > .compact-field input[type="date"] { width:100px; }
.quick-options > .compact-field input[type="time"] { width:72px; }
.quick-options > .compact-field select { max-width:70px; }
.smart-preview-card { margin:0 0 12px; border:0; background:rgba(255,255,255,.07); box-shadow:none; }
.preview-title-text { color:var(--forest-primary); }
.preview-kind-badge { color:var(--forest-primary); background:rgba(255,255,255,.09); font-weight:500; }
.preview-chip, .preview-chip.is-planned, .preview-chip.is-category { border:0; color:var(--forest-secondary); background:rgba(255,255,255,.045); font-weight:400; }
.preview-dismiss-btn, .preview-toggle-options { color:var(--forest-secondary); border:0; }
.preview-confirm-btn { color:#354632; background:#f7f8f3; box-shadow:none; }
.preview-confirm-btn:hover { color:#354632; background:#fff; }
.preview-actions { flex-wrap:wrap; }

/* Static paper fibers and fine grain: embedded, offline, no interaction layer. */
.shell-inner {
  --paper-grain: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22180%22%20height%3D%22180%22%3E%3Cfilter%20id%3D%22grain%22%20x%3D%220%22%20y%3D%220%22%20width%3D%22100%25%22%20height%3D%22100%25%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.78%22%20numOctaves%3D%223%22%20seed%3D%2217%22%20stitchTiles%3D%22stitch%22%2F%3E%3CfeColorMatrix%20type%3D%22saturate%22%20values%3D%220%22%2F%3E%3CfeComponentTransfer%3E%3CfeFuncA%20type%3D%22linear%22%20slope%3D%22.06%22%2F%3E%3C%2FfeComponentTransfer%3E%3C%2Ffilter%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20filter%3D%22url%28%23grain%29%22%2F%3E%3C%2Fsvg%3E");
  --paper-fibers: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22240%22%20height%3D%22240%22%3E%3Cfilter%20id%3D%22paper%22%20x%3D%220%22%20y%3D%220%22%20width%3D%22100%25%22%20height%3D%22100%25%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.32%20.36%22%20numOctaves%3D%223%22%20seed%3D%228%22%20stitchTiles%3D%22stitch%22%2F%3E%3CfeDiffuseLighting%20surfaceScale%3D%221.8%22%20diffuseConstant%3D%22.8%22%20lighting-color%3D%22white%22%3E%3CfeDistantLight%20azimuth%3D%2245%22%20elevation%3D%2255%22%2F%3E%3C%2FfeDiffuseLighting%3E%3CfeComponentTransfer%3E%3CfeFuncA%20type%3D%22linear%22%20slope%3D%22.08%22%2F%3E%3C%2FfeComponentTransfer%3E%3C%2Ffilter%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20filter%3D%22url%28%23paper%29%22%2F%3E%3C%2Fsvg%3E");
  background-image: var(--paper-grain), var(--paper-fibers), linear-gradient(155deg,#596c55,#465640) !important;
  background-size: 180px 180px, 240px 240px, 100% 100% !important;
  background-repeat: repeat, repeat, no-repeat;
  background-blend-mode: soft-light, soft-light, normal;
}
.day-column, .overview-column {
  background-image: var(--paper-grain);
  background-size: 180px 180px;
  background-blend-mode: soft-light;
}
.quick-add, .quick-add:focus-within {
  background-image: var(--paper-grain) !important;
  background-size: 180px 180px;
  background-blend-mode: soft-light;
}

/* Bounded two-level workspace; only the active list consumes remaining space. */
.todo-shell { max-height:min(740px,calc(100dvh - 32px)); }
.shell-inner { min-height:0; }
.workspace { min-height:100px; overscroll-behavior:contain; }
body.is-compact .todo-shell { max-height:min(620px,calc(100dvh - 24px)); }
body.is-compact .day-grid { grid-template-columns:minmax(0,1fr); grid-template-areas:"overdue" "today"; }
body.is-compact .is-tomorrow, body.is-compact .is-day-after { display:none; }
body.is-compact .brand-mark { width:30px; height:30px; }
body.is-compact .app-header { padding:14px 18px; gap:8px; }
body.is-compact .day-column { min-height:100px; padding:12px; }
body.is-compact .day-heading { min-height:32px; margin-bottom:8px; }
body.is-compact .task-kind-tag, body.is-compact .category-name { display:none; }
body.is-compact .view-tab { padding:5px 8px; font-size:.75rem; }
html.is-native-shell body:not(.is-compact) .day-grid { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-areas:"overdue today" "tomorrow dayafter"; }
.day-column { min-height:150px; }
.appearance-panel { position:absolute; z-index:30; top:calc(100% - 4px); left:18px; right:18px; max-height:calc(100dvh - 160px); background:#eff2e9; }
.day-grid { animation:reveal-workspace .2s ease-out; }
@keyframes reveal-workspace { from { opacity:.5; transform:translateY(4px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion:reduce) { .day-grid { animation:none; } }

.compact-field button { border:0; background:none; color:inherit; padding:0 3px; cursor:pointer; }
#taskPlannedTime { width:58px; }
#taskReminderOptions { position:absolute; z-index:35; right:0; top:100%; width:min(340px,calc(100vw - 50px)); padding:16px; background:#354432; color:#f7f8f3; border-radius:12px; box-shadow:0 14px 35px #0004; max-height:280px; overflow:auto; }
.quick-add { overflow:visible; }
.quick-add:has(#taskAdvancedOptions:not([hidden])) { max-height:240px; overflow-y:auto; }
.quick-add:has(#taskReminderOptions:not([hidden])) { overflow:visible; }
#taskReminderOptions small { font-size:.7rem; opacity:.7; }
#additionalLeads { width:100%; }
.lead-row { display:flex; align-items:center; gap:6px; margin:6px 0; }
.lead-row input, #recurrenceInterval, #reminderInterval { width:55px; }
#weekdays { display:flex; gap:4px; flex-wrap:wrap; }
#repeatField[hidden], #recurrenceOptions[hidden], #weekdays[hidden], #intervalReminderField[hidden], #extraCategories[hidden] { display:none!important; }
.extra-categories { padding:0 24px 12px; flex-wrap:wrap; }
.detail-dialog { color:#26352a; border:0; border-radius:16px; padding:24px; width:min(380px,calc(100vw - 50px)); max-height:80vh; box-shadow:0 20px 60px #0005; background:#f2eddf; }
.detail-dialog::backdrop { background:#16221d55; }
.detail-dialog h2 { margin:0 0 18px; font-size:1rem; }
.detail-dialog label { display:block; margin:10px 0; }
.detail-dialog input, .detail-dialog select { padding:8px; max-width:100%; }
.detail-dialog button { border:0; border-radius:6px; padding:8px; margin:5px; background:#dce3d7; color:#26352a; cursor:pointer; }
.detail-dialog form input[name="title"] { width:100%; }
.category-items > div { display:flex; align-items:center; }
.category-items [data-select-category] { flex:1; text-align:left; color:var(--category-color); }
.category-items input[type="color"] { width:35px; }
.time-wheels { display:flex; justify-content:space-around; }
.time-wheels input { width:90px; font-size:1.5rem; display:block; }

:root { --schedule-bg:linear-gradient(155deg,#596c55,#465640); --schedule-text:#f7f8f3; --schedule-muted:#c3cdbc; --schedule-panel:#ffffff0b; --schedule-hover:#ffffff16; }
:root[data-theme="custom"] { --schedule-bg:linear-gradient(155deg,var(--teal-dark),var(--teal-dark)); }
:root[data-theme="archive-soft"] { --schedule-bg:linear-gradient(135deg,#5a654e,#4d5945 55%,#626b54); --schedule-text:#f8ecdb; --schedule-muted:#d3ddce; --schedule-panel:#f8ecdb; --schedule-hover:#ece2d0; --archive-ink:#343e2e; --archive-meta:#65715e; --archive-tab:#c4d3d1; }
:root[data-theme="archive-dark"] { --schedule-bg:linear-gradient(135deg,#352623,#2d201e 55%,#3a2a27); --schedule-text:#e6d7c5; --schedule-muted:#b7a99b; --schedule-panel:#3c2e2a; --schedule-hover:#483b35; --archive-ink:#e6d7c5; --archive-meta:#b6aaa0; --archive-tab:#7579af; }
.shell-inner { --forest-primary:var(--schedule-text); --forest-secondary:var(--schedule-muted); --forest-panel:var(--schedule-panel); --forest-hover:var(--schedule-hover); background-image:var(--paper-grain),var(--paper-fibers),var(--schedule-bg)!important; }
:root[data-theme^="archive-"] .day-column { color:var(--archive-ink); background:var(--schedule-panel); border-radius:4px 12px 12px 12px; }
:root[data-theme^="archive-"] .day-column .task-title, :root[data-theme^="archive-"] .day-name { color:var(--archive-ink); }
:root[data-theme^="archive-"] .day-column .task-meta, :root[data-theme^="archive-"] .day-date, :root[data-theme^="archive-"] .day-badge { color:var(--archive-meta); }
:root[data-theme^="archive-"] .day-heading { position:relative; }
:root[data-theme^="archive-"] .day-name { display:inline-block; background:var(--archive-tab); color:#283933; padding:5px 14px; border-radius:10px 10px 0 0; margin-top:-5px; }
:root[data-theme="archive-dark"] .day-name { color:#eee4d8; }
:root[data-theme="archive-soft"] .check-button { border-color:#6b795f; }
:root[data-theme="archive-soft"] .is-done .check-button { background:#5a654e; color:#f8ecdb; }
:root[data-theme^="archive-"] .quick-add { background:rgba(255,255,255,.07)!important; background-image:none!important; }
:root[data-theme^="archive-"] .shell-inner { backdrop-filter:none!important; -webkit-backdrop-filter:none!important; }
.archive-skins { display:flex; gap:8px; margin:12px 0; }
.archive-skins .theme-card-btn { padding:10px; flex:1; }

body[data-edge-side="left"] .hot-edge { right:auto; left:0; }
body[data-edge-side="left"] .todo-shell { right:auto; left:16px; }
body.is-compact .task-row { padding:7px 0; }
#taskAdvancedOptions { position:absolute; z-index:34; top:100%; left:0; width:min(340px,calc(100vw - 50px)); max-height:min(280px,calc(100dvh - 370px)); overflow:auto; padding:16px; background:#354432; color:#f7f8f3; border-radius:12px; box-shadow:0 14px 35px #0004; }
.quick-add:has(#taskAdvancedOptions:not([hidden])), .quick-add:has(#taskReminderOptions:not([hidden])) { max-height:none; overflow:visible; }
#taskReminderOptions { max-height:min(280px,calc(100dvh - 370px)); }
.smart-preview-card { padding:8px 12px; }
.preview-chips { margin:4px 0; }

:root[data-theme^="archive-"] .day-column .empty-state, :root[data-theme^="archive-"] .day-column .delete-button { color:var(--archive-meta); }
.edit-weekdays { display:flex; gap:6px; flex-wrap:wrap; }
.edit-weekdays label { display:flex; align-items:center; }

body.is-compact #quickOptions > .compact-field > span { display:none; }
body.is-compact #quickOptions > .compact-field { padding:4px; gap:2px; }
body.is-compact #taskPlannedDate { width:85px; }
body.is-compact #taskPlannedTime { width:76px; }
body.is-compact #taskCategory { max-width:52px; }
.header-actions .icon-button[aria-pressed="true"] { background:var(--forest-hover)!important; color:var(--forest-primary)!important; }
html.is-native-shell .todo-shell, body.is-native-shell .todo-shell { min-height:0!important; }

.header-actions .icon-button:hover { background:rgba(255,255,255,.12)!important; color:var(--forest-primary)!important; }
:root { --category-none:#9ba590; }


/* The settings sheet follows the same paper palette as the task surface. */
:root[data-theme="archive-soft"] { color-scheme:light; --ink:#343e2e; --muted:#65715e; --teal:#5a654e; --teal-dark:#424e39; --mint:#e0e5d7; --line:#65715e30; --soft-line:#65715e18; --settings-surface:#f8ecdb; --settings-control:#fff8ec; }
:root[data-theme="archive-dark"] { color-scheme:dark; --ink:#e6d7c5; --muted:#b6aaa0; --teal:#abaedf; --teal-dark:#c6c8ed; --mint:#7579af35; --line:#e6d7c530; --soft-line:#e6d7c518; --settings-surface:#352824; --settings-control:#44352f; }
.appearance-panel { background-color:var(--settings-surface,#f8ecdb); color:var(--ink); background-image:var(--paper-grain),var(--paper-fibers); background-blend-mode:soft-light; }
.appearance-panel h2, .appearance-panel .appearance-label, .appearance-panel .appearance-hint { color:var(--ink); }
.appearance-panel input:not([type="range"]):not([type="checkbox"]), .appearance-panel select,
.appearance-panel button:not(.theme-card-btn), .profile-card { background-color:var(--settings-control,#fff8ec); color:var(--ink); border-color:var(--line); }
.appearance-panel input::placeholder { color:var(--muted); }
.appearance-panel #edgeLabelInput { background:var(--settings-control,#fff8ec); color:var(--ink); }
.theme-options-v2 { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.theme-card-btn { padding:12px; gap:8px; border:1px solid transparent; color:var(--ink); background:var(--settings-control,#fff8ec); border-radius:8px; text-align:left; align-items:stretch; box-shadow:none; }
.theme-card-btn[aria-pressed="true"] { border-color:var(--teal); background:var(--settings-control,#fff8ec); color:var(--ink); box-shadow:inset 0 0 0 1px var(--teal); }
.theme-card-btn strong { font-size:.85rem; }
.skin-description { font-size:.7rem; color:var(--muted); line-height:1.5; }
.folder-preview { position:relative; height:88px; overflow:hidden; border-radius:6px; background:#5a654e; background-image:var(--paper-grain); }
.folder-preview i { position:absolute; left:12px; right:0; bottom:-14px; height:80px; border-radius:14px 0 0 0; background-image:var(--paper-grain),var(--paper-fibers); }
.folder-preview i:before { content:""; position:absolute; top:-8px; left:0; width:42%; height:10px; border-radius:8px 8px 0 0; background:inherit; }
.folder-preview i:nth-child(1) { background-color:#f8ecdb; transform:translate(0,6px); }
.folder-preview i:nth-child(2) { background-color:#c4d3d1; transform:translate(16px,26px); }
.folder-preview i:nth-child(3) { background-color:#a25e40; transform:translate(32px,46px); }
.folder-preview i:nth-child(4) { background-color:#5a654e; transform:translate(48px,66px); }
.archive-preview-dark .folder-preview { background-color:#2d201e; }
.archive-preview-dark .folder-preview i:nth-child(1) { background-color:#e6d7c5; }
.archive-preview-dark .folder-preview i:nth-child(2) { background-color:#7c878b; }
.archive-preview-dark .folder-preview i:nth-child(3) { background-color:#7579af; }
.archive-preview-dark .folder-preview i:nth-child(4) { background-color:#2d201e; }
@media(max-width:380px) { .theme-card-btn { padding:9px; } .folder-preview { height:72px; } }

/* Paper labels need room around the lettering; dates sit on their own line. */
:root { font-family:var(--font-body); }
button, input, select, textarea { font-family:inherit; }
.brand-title, #brandTitle { letter-spacing:.05em; font-weight:600; }
.task-title { font-weight:500; line-height:1.65; }
.day-heading > div { display:flex; flex-direction:column; align-items:flex-start; gap:10px; min-width:0; }
:root[data-theme^="archive-"] .day-name { padding:9px 18px 10px; margin-top:0; line-height:1.5; letter-spacing:.04em; font-weight:600; }
.day-date { display:block; padding-left:3px; line-height:1.6; letter-spacing:.02em; font-weight:500; }
.day-heading { align-items:flex-start; margin-bottom:20px; }
.day-badge { padding-top:10px; }
body.is-compact .day-heading > div { gap:8px; }
body.is-compact .day-heading { margin-bottom:14px; }
body.is-compact .day-name { padding:7px 15px 8px; }
.appearance-panel, .theme-card-btn, .view-tab, .category-pill { font-weight:500; }

/* Offline brush face and scanned material surfaces; no live filter work. */
@font-face { font-family:"Daydream Brush"; src:url("./assets/fonts/MaShanZheng-Regular.ttf") format("truetype"); font-weight:400; font-style:normal; font-display:swap; }
:root { font-family:var(--font-body); }
:root { font-size:18px; }
:root[data-theme="archive-soft"] { --archive-material:url("./assets/textures/archive-paper-v2.jpg"); --material-wash:rgba(248,236,219,.78); }
:root[data-theme="archive-dark"] { --archive-material:url("./assets/textures/archive-linen-v2.jpg"); --material-wash:rgba(60,46,42,.80); }
:root[data-theme^="archive-"] .shell-inner {
  background-image:var(--archive-material),var(--schedule-bg)!important;
  background-size:cover,100% 100%!important;
  background-repeat:no-repeat!important;
  background-blend-mode:soft-light,normal!important;
}
:root[data-theme^="archive-"] .day-column {
  background-image:linear-gradient(var(--material-wash),var(--material-wash)),var(--archive-material);
  background-size:100% 100%,cover;
  background-repeat:no-repeat;
  background-blend-mode:normal,soft-light;
}
:root[data-theme^="archive-"] .appearance-panel {
  background-image:linear-gradient(var(--material-wash),var(--material-wash)),var(--archive-material);
  background-size:100% 100%,cover;
  background-blend-mode:normal,soft-light;
}
:root[data-theme^="archive-"] .quick-add { background-image:none!important; }
.folder-preview, .folder-preview i { background-image:url("./assets/textures/archive-paper-v2.jpg"); background-size:200px 200px; background-blend-mode:soft-light; }
.archive-preview-dark .folder-preview, .archive-preview-dark .folder-preview i { background-image:url("./assets/textures/archive-linen-v2.jpg"); }
.folder-preview i:before { background-blend-mode:soft-light; }
.brand-title, #brandTitle { font-weight:400; letter-spacing:.06em; }
:root[data-theme^="archive-"] .day-name { font-size:1.05rem; font-weight:400; letter-spacing:.06em; }
.task-title { font-size:.95rem; font-weight:400; letter-spacing:.025em; }
.view-tab, .category-pill, .mode-button, .appearance-panel h2, .theme-card-btn strong { font-weight:400; }
.day-date, .day-badge, .task-meta, .skin-description, .appearance-hint, .app-footer, #taskPlannedTime, .time-direct input {
  font-family:-apple-system,"PingFang SC",sans-serif;
  font-weight:400;
}

/* All four task-card corners use the same radius. */
:root[data-theme^="archive-"] .day-column, :root[data-theme^="archive-"] .overview-column { border-radius:14px; }
input[type="date"] { cursor:pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { display:none; }
.archive-calendar {
  position:fixed; z-index:1000; width:min(310px,calc(100vw - 20px)); padding:16px; border-radius:14px;
  background:var(--settings-surface,#f8ecdb); color:var(--ink,#343e2e);
  border:1px solid var(--line); box-shadow:0 12px 36px #0004;
  font-family:inherit; box-sizing:border-box;
}
.calendar-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.calendar-heading strong { font-weight:400; }
.archive-calendar button { background:none; color:inherit; border:0; border-radius:8px; min-height:32px; cursor:pointer; padding:4px; font:inherit; }
.archive-calendar button:hover { background:var(--mint); }
.archive-calendar button:focus-visible { outline:2px solid var(--teal); outline-offset:1px; }
.archive-calendar button:disabled { opacity:.3; cursor:default; }
.calendar-week, .calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); text-align:center; gap:3px; }
.calendar-week { font-size:.75rem; color:var(--muted); margin-bottom:7px; }
.calendar-grid button { font-family:-apple-system,sans-serif; font-size:.82rem; height:33px; }
.calendar-grid .is-other-month { opacity:.4; }
.calendar-grid .is-today { box-shadow:inset 0 0 0 1px var(--teal); }
.calendar-grid button[aria-pressed="true"] { background:var(--teal); color:var(--settings-surface); opacity:1; }
.calendar-actions { display:flex; justify-content:space-between; gap:10px; margin-top:12px; border-top:1px solid var(--line); padding-top:8px; }
.calendar-direct { display:grid; grid-template-columns:1fr auto; gap:6px; margin-top:12px; font-size:.7rem; }
.calendar-direct label { grid-column:1 / -1; color:var(--muted); }
.calendar-direct input { width:100%; min-width:0; border:1px solid var(--line); background:var(--settings-control,#fff8ec); color:var(--ink); border-radius:7px; padding:7px; font:14px -apple-system,sans-serif; box-sizing:border-box; }
.calendar-error { color:var(--coral); font:12px -apple-system,sans-serif; margin:6px 0 0; }

/* Song-style body text pairs with the brush headings; controls stay crisp at small sizes. */
.brand-title, #brandTitle, .day-name { font-family:var(--font-display); }
button, input, select, textarea, .appearance-panel, .task-meta, .day-date, .day-badge,
.column-note, .skin-description, .app-footer, .calendar-heading, .calendar-week,
.calendar-grid, .calendar-actions, .calendar-direct, .calendar-error { font-family:var(--font-ui); }
.task-title { font-family:var(--font-body); letter-spacing:.01em; }
.settings-group { border-top:1px solid var(--line); padding:4px 0; }
.settings-group > summary, .settings-subgroup > summary {
  cursor:pointer; padding:11px 2px; font-size:.85rem; font-weight:600; color:var(--ink);
}
.settings-group > summary:focus-visible, .settings-subgroup > summary:focus-visible {
  outline:2px solid var(--teal); outline-offset:2px; border-radius:5px;
}
.settings-group-body { padding:0 2px 12px; }
.settings-group-body > :first-child { margin-top:0; }
.edge-position-reset { width:100%; min-height:44px; margin-top:12px; padding:10px 12px; border:1px solid var(--line); border-radius:9px; background:transparent; color:var(--ink); font-size:16px; font-weight:500; cursor:pointer; }
.edge-position-reset:hover { background:rgba(var(--accent-rgb,29,119,115),.08); }
.settings-subgroup { margin-top:12px; }
.settings-subgroup > summary { color:var(--muted); font-size:.78rem; }
.settings-group .account-section { margin:0; padding:0; border:0; }
.settings-group .account-user-row { flex-wrap:wrap; gap:10px; }
.settings-group .account-user-meta { min-width:0; overflow-wrap:anywhere; }
.settings-group .account-user-meta strong { overflow-wrap:anywhere; }
.settings-group .edge-label-row input {
  flex:1; min-width:0; width:100%; padding:8px 10px; border:1px solid var(--line); border-radius:8px;
}
.settings-group .edge-label-save { min-height:36px; font-size:.8rem; }
.settings-group .custom-color-row, .settings-group .version-switch-banner { flex-wrap:wrap; }
.settings-group .version-switch-banner > div { flex:1 1 130px; }
.settings-group #customColorButton { min-width:0; }
.settings-group [hidden] { display:none; }
:root[data-theme^="archive-"] .overview-column,
:root[data-theme^="archive-"] #doneView,
:root[data-theme^="archive-"] .group-panel,
:root[data-theme^="archive-"] .profile-card {
  --forest-primary:var(--ink); --forest-secondary:var(--muted);
  color:var(--ink); background-color:var(--settings-surface);
}
:root[data-theme^="archive-"] .day-column { --forest-primary:var(--archive-ink); --forest-secondary:var(--archive-meta); }
.task-row.is-done { opacity:1; }
:root[data-theme^="archive-"] #doneView .task-title,
:root[data-theme^="archive-"] .overview-column .task-title { color:var(--ink)!important; }
:root[data-theme^="archive-"] #doneView .task-meta,
:root[data-theme^="archive-"] #doneView .column-note,
:root[data-theme^="archive-"] #doneView .eyebrow,
:root[data-theme^="archive-"] #doneView .empty-state { color:var(--muted)!important; opacity:1; }
:root[data-theme^="archive-"] #doneView .task-row.is-done .task-title { color:var(--muted)!important; text-decoration:line-through; }
:root[data-theme^="archive-"] .task-row.is-done .task-meta { opacity:1; }
.app-footer { position:relative; }
.notification-controls {
  position:absolute; z-index:80; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%);
  width:min(290px,calc(100vw - 44px)); padding:16px; border-radius:12px;
  background:var(--settings-surface,#f8ecdb); color:var(--ink); border:1px solid var(--line); box-shadow:0 10px 30px #0004;
  display:grid; gap:10px; box-sizing:border-box;
}
.notification-controls button { padding:10px!important; text-align:left; border-radius:8px!important; border:1px solid var(--line)!important; background:var(--settings-control)!important; color:var(--ink)!important; font-size:.85rem!important; }
.notification-controls button[aria-pressed="true"] { border-color:var(--teal)!important; }
.notification-controls p { margin:0; font-size:.72rem; line-height:1.6; color:var(--muted); }

:root[data-theme="archive-soft"] { --muted:#59664f; --archive-meta:#59664f; }
.task-meta, .column-note, .day-date, .day-badge, .appearance-hint, .skin-description, .app-footer, .app-footer button, .app-footer #saveState { font-size:.8rem; line-height:1.6; }
:root[data-theme^="archive-"] .group-card { --forest-primary:var(--ink); --forest-secondary:var(--muted); color:var(--ink); background-color:var(--settings-surface); }


#mobilePlannedDate { display:none; }
.dates-disclosure { display:none; }

/* Mobile web: keep the material palette, give the content the whole viewport.
   Scope to the web shell so narrow Mac windows retain their window controls. */
@media (max-width: 680px) {
  html:not(.is-native-shell) button { min-width:44px; min-height:44px; }
  html:not(.is-native-shell) .archive-calendar { width:min(364px,calc(100vw - 20px)); max-height:calc(100dvh - 20px); overflow-y:auto; }
  html:not(.is-native-shell) .calendar-grid button { height:44px; }
  html:not(.is-native-shell) .calendar-direct input { min-height:44px; font-size:16px; }
  html:not(.is-native-shell) .appearance-panel input:not([type="checkbox"]):not([type="color"]):not([type="range"]),
  html:not(.is-native-shell) .appearance-panel select,
  html:not(.is-native-shell) .detail-dialog input:not([type="checkbox"]),
  html:not(.is-native-shell) .detail-dialog select,
  html:not(.is-native-shell) summary { min-height:44px; font-size:16px; }
  html:not(.is-native-shell) #taskPlannedTime::placeholder { color:var(--forest-secondary); opacity:1; }

  html:not(.is-native-shell), html:not(.is-native-shell) body {
    height:auto; min-height:100vh; min-height:100dvh;
    width:100%; overflow-x:hidden; overflow-y:auto; overscroll-behavior-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  html:not(.is-native-shell) .desktop-stage { min-height:100vh; min-height:100dvh; padding:0; overflow:visible; }
  html:not(.is-native-shell) .desktop-stage::before,
  html:not(.is-native-shell) .desktop-stage::after { content:none; display:none; }
  html:not(.is-native-shell) .ambient-copy,
  html:not(.is-native-shell) .hot-edge { display:none; }
  html:not(.is-native-shell) .todo-shell {
    position:relative; inset:auto; width:100%; max-width:none;
    height:auto; min-height:100vh; min-height:100dvh; max-height:none; margin:0; transform:none;
  }
  html:not(.is-native-shell) .shell-inner {
    height:auto; min-height:100vh; min-height:100dvh;
    border:0!important; border-radius:0!important; box-shadow:none!important;
    overflow:visible!important;
    backdrop-filter:none!important; -webkit-backdrop-filter:none!important; filter:none;
    padding-left:env(safe-area-inset-left, 0px);
    padding-right:env(safe-area-inset-right, 0px);
  }
  html:not(.is-native-shell) .app-header {
    display:grid; grid-template-columns:minmax(0,1fr) 44px;
    gap:16px 12px; padding:calc(14px + env(safe-area-inset-top, 0px)) 18px 24px;
  }
  html:not(.is-native-shell) .brand { grid-column:1; gap:10px; }
  html:not(.is-native-shell) #brandTitle { font-size:20px; }
  html:not(.is-native-shell) #fullDate { font-size:14px; }
  html:not(.is-native-shell) .header-actions { display:contents; }
  html:not(.is-native-shell) .header-actions .focus-count {
    grid-column:1 / -1; grid-row:2; justify-self:start;
    padding:4px 10px; font-size:14px;
  }
  html:not(.is-native-shell) #appearanceButton { grid-column:2; grid-row:1; width:44px; height:44px; }
  html:not(.is-native-shell) #windowModeButton,
  html:not(.is-native-shell) #pinButton,
  html:not(.is-native-shell) #hideButton { display:none!important; }
  html:not(.is-native-shell) .top-nav {
    flex-direction:column!important; align-items:stretch!important;
    gap:16px; padding:0 18px 24px!important; min-width:0;
  }
  html:not(.is-native-shell) .view-tabs {
    display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%;
  }
  html:not(.is-native-shell) .view-tab { min-height:48px; font-size:16px; padding:8px; }
  html:not(.is-native-shell) .category-tabs {
    display:flex; flex-wrap:nowrap; max-width:100%; min-width:0;
    overflow-x:auto; gap:8px; scrollbar-width:none;
  }
  html:not(.is-native-shell) .category-pill { flex:none; min-height:44px; min-width:44px; font-size:16px; white-space:nowrap; }
  html:not(.is-native-shell) #moreCategoriesPill { display:none; }
  html:not(.is-native-shell) .quick-add {
    display:block; margin:0 18px 24px!important; padding:18px!important;
    backdrop-filter:none; -webkit-backdrop-filter:none; filter:none; z-index:auto;
    width:auto; max-height:none; overflow:visible;
  }
  html:not(.is-native-shell) .quick-add-main { gap:8px; padding:0 0 16px; }
  html:not(.is-native-shell) .task-input-wrap { min-width:0; flex:1; }
  html:not(.is-native-shell) #taskTitle { font-size:16px; min-height:44px; }
  html:not(.is-native-shell) .mic-button,
  html:not(.is-native-shell) .add-button { width:44px; height:44px; min-width:44px; min-height:44px; }
  html:not(.is-native-shell) .quick-options { gap:8px; align-items:center; padding:0; }
  html:not(.is-native-shell) .quick-options > .compact-field {
    min-height:44px; padding:0; gap:0; min-width:0;
  }
  html:not(.is-native-shell) .quick-options > .compact-field > span { display:none; }
  html:not(.is-native-shell) .quick-options > .compact-field input,
  html:not(.is-native-shell) .quick-options > .compact-field select { font-size:16px; min-height:44px; }
  html:not(.is-native-shell) #taskPlannedDate { display:none; }
  html:not(.is-native-shell) #mobilePlannedDate { display:block; border:0; background:transparent; padding:0 4px; font-size:16px; min-width:44px; min-height:44px; color:inherit; }
  html:not(.is-native-shell) #taskPlannedTime { width:58px; flex-shrink:0; }
  /* Reserve text and chevron separately; Safari's native select chrome consumes
     too much of a narrow field and clips the selected category. */
  html:not(.is-native-shell) #taskCategory {
    width:88px; min-width:88px; max-width:none; flex-shrink:0;
    appearance:none; -webkit-appearance:none;
    padding:0 28px 0 8px; line-height:1.45;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%23e6d7c5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 8px center; background-size:12px 8px;
  }
  html:not(.is-native-shell) #clearTaskDate,
  html:not(.is-native-shell) #manageCategories { display:none; }
  html:not(.is-native-shell) #timePickerButton { min-width:44px; min-height:44px; }
  html:not(.is-native-shell) .quick-sublinks { display:contents; }
  html:not(.is-native-shell) .quick-sublink { min-height:44px; font-size:14px; padding:4px; }
  html:not(.is-native-shell) #toggleDeadlineBtn,
  html:not(.is-native-shell) #toggleReminderBtn { display:none; }
  html:not(.is-native-shell) .quick-options:has(#toggleMoreBtn[aria-expanded="true"]) .quick-sublinks {
    display:flex; width:100%; gap:16px;
  }
  html:not(.is-native-shell) .quick-options:has(#toggleMoreBtn[aria-expanded="true"]) #toggleDeadlineBtn,
  html:not(.is-native-shell) .quick-options:has(#toggleMoreBtn[aria-expanded="true"]) #toggleReminderBtn { display:block; }
  html:not(.is-native-shell) .quick-options:has(#toggleMoreBtn[aria-expanded="true"]) #clearTaskDate,
  html:not(.is-native-shell) .quick-options:has(#toggleMoreBtn[aria-expanded="true"]) #manageCategories { display:block; min-width:44px; min-height:44px; }
  html:not(.is-native-shell) .composer-details { min-width:0; position:static!important; width:100%!important; max-height:none!important; overflow:visible!important; box-shadow:none!important; gap:16px; padding:16px 0 0!important; background:transparent!important; color:inherit!important; }
  html:not(.is-native-shell) .composer-details button { min-width:44px; min-height:44px; }
  html:not(.is-native-shell) .composer-details input,
  html:not(.is-native-shell) .composer-details select { font-size:16px; min-height:44px; max-width:100%; }
  html:not(.is-native-shell) .workspace { overflow:visible; overscroll-behavior:auto; flex:1 0 auto; padding:0 18px 24px; }
  html:not(.is-native-shell) .day-grid,
  html:not(.is-native-shell) body.is-compact .day-grid {
    grid-template-columns:minmax(0,1fr); grid-template-areas:none; gap:16px;
  }
  html:not(.is-native-shell) .day-column { grid-area:auto; min-height:0; padding:20px 18px; }
  html:not(.is-native-shell) .more-dates { display:grid; gap:16px; }
  html:not(.is-native-shell) .more-dates[hidden] { display:none; }
  html:not(.is-native-shell) .dates-disclosure:not([hidden]) { display:block; width:100%; min-height:44px; margin-top:16px; border:0; background:transparent; color:var(--forest-secondary); font-size:16px; }
  html:not(.is-native-shell) .is-extra-date .day-name:empty { display:none; }
  html:not(.is-native-shell) .day-heading { min-height:32px; align-items:center; margin-bottom:16px; gap:8px; }
  html:not(.is-native-shell) .day-heading > div { flex-direction:row; flex-wrap:wrap; align-items:center; gap:6px 10px; }
  html:not(.is-native-shell) .day-heading .day-name {
    white-space:nowrap; padding:2px 8px; margin:0; font-size:16px;
    line-height:1.5; letter-spacing:0; border-radius:6px;
  }
  html:not(.is-native-shell) .day-date { font-size:14px; padding:0; }
  html:not(.is-native-shell) .day-badge { flex:none; padding:0; font-size:14px; }
  html:not(.is-native-shell) .empty-state.playful { min-height:44px; font-size:14px; padding:8px 5px; }
  html:not(.is-native-shell) .task-row { grid-template-columns:44px minmax(0,1fr) 44px; gap:4px; }
  html:not(.is-native-shell) .task-title { font-size:16px; line-height:1.45; white-space:normal; overflow-wrap:anywhere; }
  html:not(.is-native-shell) .task-meta { flex-wrap:wrap; font-size:14px; }
  html:not(.is-native-shell) .check-button,
  html:not(.is-native-shell) .reminder-button,
  html:not(.is-native-shell) .delete-button { min-width:44px; min-height:44px; }
  html:not(.is-native-shell) .delete-button { position:static; opacity:.5; }
  html:not(.is-native-shell) .task-actions { display:flex; flex-direction:column; padding-bottom:0; }
  html:not(.is-native-shell) .task-list { gap:16px; }
  html:not(.is-native-shell) .task-timing { white-space:normal; overflow-wrap:anywhere; }
  html:not(.is-native-shell) body.is-compact .todo-shell { max-height:none; }
  html:not(.is-native-shell) .app-footer {
    display:flex; position:sticky; bottom:0; z-index:5; gap:8px 12px; padding:12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    background:#465640; background-image:var(--schedule-bg); backdrop-filter:none; -webkit-backdrop-filter:none;
  }
  html:not(.is-native-shell) .app-footer button { min-height:44px; font-size:14px; }
  html:not(.is-native-shell) #saveState { font-size:14px; }
  html:not(.is-native-shell) .appearance-panel { max-width:calc(100vw - 24px); max-height:80vh; max-height:80dvh; overflow:auto; }
  html:not(.is-native-shell) body.is-compact .day-column { display:block!important; }

  html:not(.is-native-shell) .check-button { position:relative; isolation:isolate; border:0!important; background:transparent!important; }
  html:not(.is-native-shell) .check-button::before { content:""; position:absolute; inset:11px; z-index:-1; border:1.5px solid var(--archive-meta, #6b795f); border-radius:6px; }
  html:not(.is-native-shell) .is-done .check-button::before { background:#5a654e; border-color:#5a654e; }
  html:not(.is-native-shell) .is-done .check-button { color:#f8ecdb; }
}

@media (max-width:379px) { html:not(.is-native-shell) .archive-calendar button { min-width:0; } }

/* Shared group management, with deletion kept behind an explicit confirmation. */
.group-header-actions { display:flex; align-items:center; gap:8px; }
.group-manage-menu { position:relative; flex-shrink:0; margin-left:auto; }
.group-manage-menu summary { display:grid; place-items:center; list-style:none; cursor:pointer; min-height:44px; padding:8px 12px; font:14px var(--font-ui); border:1px solid var(--line); border-radius:8px; background:var(--settings-control,#fff8ec); color:var(--ink); white-space:nowrap; }
.group-manage-menu summary::-webkit-details-marker { display:none; }
.group-manage-items { position:absolute; top:100%; right:0; z-index:15; min-width:140px; padding:6px; border-radius:10px; background:var(--settings-surface,#f8ecdb); box-shadow:0 8px 24px #0002; }
.group-manage-items button { width:100%; min-height:44px; border:0; background:transparent; color:var(--ink); font-size:16px; text-align:left; padding:8px 12px; }
.group-remove-dialog p { font-size:16px; line-height:1.5; }
.group-remove-dialog .keep-group-tasks { display:flex; align-items:center; gap:12px; min-height:44px; }
.keep-group-tasks input { width:22px; height:22px; flex:none; }
.group-remove-actions { display:flex; justify-content:flex-end; gap:12px; }
.group-remove-actions button { min-width:80px; min-height:44px; }
.mobile-summary { display:none; }
:root { --mobile-page-bg:#526049; }
:root[data-theme="archive-dark"] { --mobile-page-bg:#302320; }
:root[data-theme="custom"] { --mobile-page-bg:var(--teal-dark); }
@media (max-width:680px) {
  html:not(.is-native-shell), html:not(.is-native-shell) body { background:var(--mobile-page-bg); }
  html:not(.is-native-shell)[data-theme] .shell-inner { background-color:var(--mobile-page-bg)!important; background-image:none!important; }
  html:not(.is-native-shell) .app-header { position:sticky; top:0; z-index:40; padding:calc(env(safe-area-inset-top,0px) + 14px) 18px 12px; gap:0 12px; background:var(--mobile-page-bg); border:0; box-shadow:none; }
  html:not(.is-native-shell) .brand #fullDate,
  html:not(.is-native-shell) .header-actions .focus-count { display:none; }
  html:not(.is-native-shell) .mobile-summary { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:0 18px 24px; color:var(--forest-secondary); font:14px/1.45 var(--font-ui); }
  html:not(.is-native-shell) #brandTitle { font-size:22px; }
  html:not(.is-native-shell) .app-footer { background:var(--mobile-page-bg); }
  html:not(.is-native-shell) .group-header-info { min-width:0; }
  html:not(.is-native-shell) .group-name { overflow-wrap:anywhere; }
  html:not(.is-native-shell) .group-remove-dialog { width:min(380px,calc(100vw - 32px)); padding:20px; }
}

.group-hero-header { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-start; gap:12px; }
.group-hero-title-wrap { min-width:0; flex-wrap:wrap; }
.group-hero-title { overflow-wrap:anywhere; }
@media (max-width:680px) {
  html:not(.is-native-shell) { scroll-padding-top:calc(84px + env(safe-area-inset-top,0px)); scroll-padding-bottom:84px; }
  html:not(.is-native-shell) .group-chip { min-height:44px; }
}

@media (max-width:680px) {
  /* A second body scrollport breaks sticky headers in WebKit. The root owns
     page scrolling and horizontal clipping; body remains in normal flow. */
  html:not(.is-native-shell) body { overflow:visible; }
}

/* The current group renderer uses these controls; honor hidden state explicitly. */
#groupEmptyState[hidden], #groupActiveState[hidden], #groupPublishBtn[hidden] { display:none!important; }
.group-chip { display:inline-flex; flex:none; align-items:center; gap:8px; padding:8px 12px; border:1px solid var(--line); border-radius:12px; background:var(--settings-surface,#f8ecdb); color:var(--ink); font-size:16px; cursor:pointer; }
.group-chip.is-active { outline:2px solid var(--archive-tab,var(--teal)); outline-offset:-2px; }
.group-chip { max-width:100%; }
.group-chip-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.group-chip-role { flex:none; font-size:12px; opacity:.75; }
.group-actions-strip[hidden] { display:none!important; }
.group-task-card { background:var(--settings-surface,#f8ecdb); color:var(--ink); }
.group-task-main { display:grid; grid-template-columns:44px minmax(0,1fr); align-items:start; gap:10px; padding:18px; }
.group-task-content { min-width:0; }
.group-task-title { font-size:16px; line-height:1.45; overflow-wrap:anywhere; }
.group-task-title.is-done { text-decoration:line-through; color:var(--muted); }
.group-my-checkbox { width:44px; height:44px; border:0; background:transparent; color:var(--ink); cursor:pointer; }
.group-my-checkbox { position:relative; display:grid; place-items:center; }
.group-my-checkbox::before { content:""; position:absolute; inset:11px; border:1.5px solid var(--muted); border-radius:6px; }
.group-my-checkbox.is-checked { color:var(--teal-dark); }
.group-task-meta, .group-task-due { font-size:14px; line-height:1.45; color:var(--muted); }
.group-task-breakdown { padding:16px 18px; border-top:1px solid var(--line); }
.group-breakdown-row { display:flex; justify-content:space-between; align-items:center; gap:12px; min-height:44px; }
.breakdown-member-info { display:flex; align-items:center; gap:8px; min-width:0; flex:1; line-height:1.45; }
.breakdown-avatar { flex:none; }
.breakdown-name { min-width:0; overflow-wrap:anywhere; }
.breakdown-status-tag { flex:none; white-space:nowrap; }
.group-tasks-header, .group-empty-state h2 { color:var(--forest-primary); }
.group-tasks-title { color:inherit; }
.group-empty-state p, .group-tasks-subtitle { color:var(--forest-secondary); }
@media (max-width:680px) { html:not(.is-native-shell) .day-grid { animation:none; } }

#groupHeaderCodeBtn[hidden], #openShareModalBtn[hidden], #groupOccurrence[hidden] { display:none!important; }
#collabSyncStatus { color:var(--forest-secondary); font:14px/1.45 var(--font-ui); margin:0 0 16px; }
#groupOccurrence { display:flex; align-items:center; gap:12px; margin:16px 0; color:var(--forest-secondary); font:14px var(--font-ui); }
#groupOccurrence input { border:0; border-radius:8px; padding:8px; min-height:44px; max-width:180px; background:var(--settings-surface); color:var(--ink); font-size:16px; }
.shared-dialog,.viewport-bound {
  --dialog-safe-top:max(16px,env(safe-area-inset-top,0px));
  --dialog-safe-bottom:max(16px,env(safe-area-inset-bottom,0px));
  position:fixed; inset:auto; margin:0;
  left:calc(var(--dialog-vleft,0px) + var(--dialog-vwidth,100vw) / 2);
  top:calc(var(--dialog-vtop,0px) + (var(--dialog-vheight,100vh) + var(--dialog-safe-top) - var(--dialog-safe-bottom)) / 2);
  transform:translate(-50%,-50%);
  width:min(420px,calc(var(--dialog-vwidth,100vw) - 32px)); max-width:none;
  max-height:calc(var(--dialog-vheight,100vh) - var(--dialog-safe-top) - var(--dialog-safe-bottom));
  padding:20px; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch; touch-action:pan-y; line-height:1.45;
}
.shared-dialog form,.shared-dialog fieldset { min-width:0; min-inline-size:0; max-width:100%; }
.shared-dialog fieldset { margin:0 0 16px; padding:12px; border:1px solid #65715e50; border-radius:10px; }
.shared-dialog h2,.shared-dialog label,.shared-member-row span { min-width:0; overflow-wrap:anywhere; }
.group-manage-items { top:calc(100% + 8px); width:max-content; min-width:160px; max-width:calc(100vw - 24px); max-height:60vh; max-height:60dvh; overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
.group-manage-menu.opens-up .group-manage-items { top:auto; bottom:calc(100% + 8px); }
.shared-dialog input:not([type="checkbox"]), .shared-dialog select { min-height:44px; font-size:16px; width:100%; }
.shared-dialog button { min-height:44px; font-size:16px; }
.shared-dialog .shared-member-choice { display:flex; align-items:center; gap:12px; min-height:44px; line-height:1.45; }
.shared-member-choice input { flex:none; width:22px; height:22px; }
.shared-error { color:#9a3a27; min-height:1em; font:14px/1.45 var(--font-ui); }
.shared-member-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:12px 0; border-bottom:1px solid #65715e30; }
.shared-member-row span { flex:1 1 100px; }
.group-task-controls { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.group-task-controls button { border:1px solid var(--line); border-radius:8px; background:var(--settings-control,#fff8ec); color:var(--ink); min-height:44px; padding:8px 12px; font:14px var(--font-ui); white-space:nowrap; cursor:pointer; }
.group-task-controls .group-delete-task { margin-left:auto; background:transparent; color:var(--muted); }
.group-my-checkbox:disabled { opacity:.4; cursor:default; }

/* Entry dialogs keep actions visible while their body follows the keyboard viewport. */
.sheet-dialog { padding:0; border-radius:20px; background:transparent; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; display:block; animation:none; }
.sheet-dialog:not([open]),.sheet-dialog[hidden] { display:none; }
.sheet-dialog::backdrop { background:rgba(18,38,38,.45); }
.sheet-dialog .modal-card { background:var(--settings-surface,#f8ecdb); color:var(--ink); display:flex; flex-direction:column; max-width:none; max-height:inherit; min-width:0; overflow:visible; animation:none; }
.sheet-dialog .modal-header,.sheet-dialog .modal-footer { flex:none; }
.sheet-dialog .modal-header { gap:12px; }
.sheet-dialog .modal-header h3 { min-width:0; overflow-wrap:anywhere; line-height:1.45; }
.sheet-dialog .modal-close-btn { flex:none; min-width:44px; min-height:44px; margin:0; }
.sheet-dialog .modal-body { min-height:0; min-width:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
.sheet-dialog .modal-field { display:flex; margin:0; }
.sheet-dialog .modal-field span,.sheet-dialog .share-hint { font-size:14px; line-height:1.45; overflow-wrap:anywhere; }
.sheet-dialog input { min-width:0; max-width:100%; font-size:16px; min-height:44px; }
.sheet-dialog .modal-footer { flex-wrap:wrap; }
.sheet-dialog .modal-btn { margin:0; min-height:44px; font-size:16px; line-height:1.45; }
.sheet-dialog .share-input-group { min-width:0; flex-wrap:wrap; }
.sheet-dialog .share-input-group input { flex:1 1 140px; width:0; }
.sheet-dialog .share-copy-btn { flex:none; margin:0; font-size:16px; min-height:44px; }
.sheet-dialog .share-code-val { max-width:100%; overflow-wrap:anywhere; }

.sheet-dialog .modal-error { overflow-wrap:anywhere; }

.sheet-dialog .modal-body > * { flex-shrink:0; }

.sheet-dialog .modal-header h2 { margin:0; line-height:1.45; overflow-wrap:anywhere; }
.sheet-dialog .time-wheels { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.sheet-dialog .time-wheels input { width:100%; }
.sheet-dialog .edit-weekdays { display:flex; flex-wrap:wrap; gap:8px; }
.sheet-dialog .edit-weekdays label { display:flex; align-items:center; gap:6px; min-height:44px; }
.sheet-dialog input[type=checkbox] { width:22px; height:22px; flex:none; }
.sheet-dialog .category-items > div { min-width:0; gap:4px; }
.sheet-dialog .category-items [data-select-category] { min-width:0; overflow-wrap:anywhere; }
.sheet-dialog .category-items input[type=color] { width:44px; flex:none; }
.settings-dialog:not([open]),.settings-dialog[hidden] { display:none; }
.settings-dialog-header { position:sticky; top:-20px; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:12px; margin:-20px -20px 16px; padding:12px 16px; background:var(--settings-surface,#f8ecdb); border-bottom:1px solid var(--line); }
.settings-dialog-header h2 { margin:0; }
.settings-dialog button,.settings-dialog summary { min-height:44px; }
.settings-dialog input:not([type=checkbox]):not([type=range]):not([type=color]),.settings-dialog select { min-height:44px; min-width:0; font-size:16px; }
.settings-dialog-header button { min-width:60px; font-size:16px; border:1px solid var(--line); border-radius:8px; }
.archive-calendar.viewport-bound { width:min(420px,calc(var(--dialog-vwidth,100vw) - 24px)); padding:16px; }
.archive-calendar.viewport-bound button { min-height:44px; font-size:16px; }
.archive-calendar.viewport-bound .calendar-direct input { min-height:44px; font-size:16px; }
.archive-calendar .viewport-actions { position:sticky; bottom:-16px; z-index:1; margin-bottom:-16px; margin-left:-16px; margin-right:-16px; padding:10px 16px 16px; background:var(--settings-surface,#f8ecdb); }

html .archive-calendar.viewport-bound,html .appearance-panel.viewport-bound { max-height:calc(var(--dialog-vheight,100vh) - var(--dialog-safe-top) - var(--dialog-safe-bottom)); }

.sheet-dialog label:has(> input[type=checkbox]) { display:flex; align-items:center; gap:8px; min-height:44px; }

.settings-dialog input[type=range],.settings-dialog input[type=color] { min-height:44px; }
.sheet-dialog button { min-width:44px; }
.archive-calendar.viewport-bound :is(.calendar-heading,.calendar-actions,.calendar-direct) button { min-width:44px; }

/* Sakura wagashi: cream paper, cherry-blossom cards and matcha accents.
   Keep all geometry shared with the other archive skins, including dialogs. */
:root[data-theme="archive-sakura"] {
  color-scheme:light;
  --ink:#574c50; --muted:#6d5e64;
  --teal:#586b43; --teal-dark:#465737; --accent-rgb:88,107,67;
  --mint:#e4eadc; --highlight-bg:#e4eadc;
  --line:#d9cfd0; --soft-line:#e8dfe1;
  --glass:#faf6ed; --native-glass:rgba(250,246,237,.94); --paper:#fffdfa;
  --settings-surface:#faf6ed; --settings-control:#fffdfa;
  --schedule-bg:linear-gradient(#faf6ed,#faf6ed);
  --schedule-text:#574c50; --schedule-muted:#6d5e64;
  --schedule-panel:#f2e2e8; --schedule-hover:#e9d8df;
  --archive-ink:#574c50; --archive-meta:#6d5e64; --archive-tab:#dce4cf;
  --archive-material:url("./assets/textures/archive-paper-v2.jpg");
  --material-wash:rgba(242,226,232,.94);
  --mobile-page-bg:#faf6ed;
  --shadow:0 20px 60px rgba(87,76,80,.14);
}
.archive-preview-sakura .folder-preview { background-color:#faf6ed; }
.archive-preview-sakura .folder-preview i:nth-child(1) { background-color:#f2e2e8; }
.archive-preview-sakura .folder-preview i:nth-child(2) { background-color:#dce4cf; }
.archive-preview-sakura .folder-preview i:nth-child(3) { background-color:#98a878; }
.archive-preview-sakura .folder-preview i:nth-child(4) { background-color:#574c50; }
/* Cherry-pink page with soft white paper and graphite controls. */
:root[data-theme="archive-graphite"] {
  color-scheme:light;
  --ink:#443c41; --muted:#63555d;
  --teal:#62565e; --teal-dark:#4e434c; --accent-rgb:98,86,94;
  --mint:#f0dfe5; --highlight-bg:#f0dfe5;
  --line:#d7c0ca; --soft-line:#e9dbe0;
  --glass:#fdf8f8; --native-glass:rgba(253,248,248,.94); --paper:#fffafa;
  --settings-surface:#fdf8f8; --settings-control:#fffafa;
  --schedule-bg:linear-gradient(#e5cbd5,#e5cbd5);
  --schedule-text:#443c41; --schedule-muted:#63555d;
  --schedule-panel:#fdf8f8; --schedule-hover:#f0dfe5;
  --archive-ink:#443c41; --archive-meta:#63555d; --archive-tab:#f0dfe5;
  --archive-material:url("./assets/textures/archive-paper-v2.jpg");
  --material-wash:rgba(253,248,248,.94);
  --mobile-page-bg:#e5cbd5;
  --skin-tabs:#f0dfe5; --skin-onaccent:#fffafa;
  --shadow:0 20px 60px rgba(68,60,65,.14);
}
.archive-preview-graphite .folder-preview { background-color:#e5cbd5; }
.archive-preview-graphite .folder-preview i:nth-child(1) { background-color:#fdf8f8; }
.archive-preview-graphite .folder-preview i:nth-child(2) { background-color:#f0dfe5; }
.archive-preview-graphite .folder-preview i:nth-child(3) { background-color:#62565e; }
.archive-preview-graphite .folder-preview i:nth-child(4) { background-color:#443c41; }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .appearance-panel { background-image:none; }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .quick-add { background:var(--settings-control)!important; border:1px solid var(--line)!important; }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) #taskTitle::placeholder { color:var(--muted); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .view-tabs { background:var(--skin-tabs,#eae4dd); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .view-tab.is-active,
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .add-button { background:var(--teal); color:var(--skin-onaccent,#fffdfa); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .view-tab:hover:not(.is-active) { background:var(--mint); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .brand-mark { background:var(--archive-tab); color:var(--teal-dark); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .compact-field input,
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .compact-field select { color-scheme:light; }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .compact-field select option { background:var(--settings-control); color:var(--ink); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) :is(#taskAdvancedOptions,#taskReminderOptions) { background:var(--settings-surface); color:var(--ink); border:1px solid var(--line); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .check-button { border-color:var(--teal); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .is-done .check-button { background:var(--teal); border-color:var(--teal); color:var(--skin-onaccent,#fffdfa); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .day-name { color:var(--teal-dark); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .group-task-card { background:var(--schedule-panel); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .group-chip.is-active { outline-color:var(--teal); background:var(--mint); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .detail-dialog { background:var(--settings-surface); color:var(--ink); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .sheet-dialog { background:transparent; }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .detail-dialog button { background:var(--mint); color:var(--teal-dark); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) .detail-dialog .modal-btn.primary { background:var(--teal); color:var(--skin-onaccent,#fffdfa); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) :is(input[type=checkbox],input[type=range]) { accent-color:var(--teal); }
:root:is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) :is(button,input,select,textarea):focus-visible { outline-color:var(--teal); }
@media (max-width:680px) {
  html:not(.is-native-shell):is([data-theme="archive-sakura"],[data-theme="archive-graphite"]) #taskCategory {
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%23574c50' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

/* V1.3 uses the existing skin variables and translucent surfaces. */
#taskAdvancedOptions:not([hidden]) { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px; }
#taskAdvancedOptions > .compact-field { min-width:0;min-height:66px;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:6px;border-radius:12px;padding:8px 10px; }
#taskAdvancedOptions > .compact-field > span { font-size:12px;line-height:16px; }
#taskAdvancedOptions input,#taskAdvancedOptions select { width:100%;max-width:100%;min-width:0;min-height:30px;box-sizing:border-box; }
#taskAdvancedOptions .kind-deduction-field { grid-column:1;grid-row:2; }
#taskAdvancedOptions .field-reminder { grid-column:2;grid-row:2; }
#taskAdvancedOptions #repeatField,#recurrenceOptions,.deadline-auto-choice { grid-column:1 / -1; }
#taskAdvancedOptions .deadline-auto-choice { display:flex;gap:8px;align-items:center;font-size:12px; }
#taskAdvancedOptions .deadline-auto-choice input { width:16px;min-height:16px;flex:none; }
.expired-section {grid-column:1 / -1;order:-1;background:rgba(255,220,230,.65);border:2px solid #bd2455;color:#801a3b;}
.task-row.is-expired {border:1.5px solid #bd2455;background:rgba(255,232,238,.8);}
.task-overdue-tag {color:#9e1646;background:#ffe1ea;font-weight:800;padding:3px 6px;border-radius:6px;}
.task-row {position:relative;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;}
.task-row .delete-button {position:absolute;right:5px;top:3px;font:400 22px/1 var(--font-ui);width:26px;height:26px;color:var(--muted);background:transparent;border:0;}
.task-row .task-copy {padding-right:20px;min-width:0;}
.task-owner {display:block;font-size:11px;opacity:.8;}
.task-kind-tag {border-left:4px solid var(--group-tag,#ba6688);background:color-mix(in srgb,var(--group-tag,#ba6688) 15%,transparent);color:var(--ink);}
#groupTagFilter {max-width:100%;margin:0 0 12px;padding:8px;border-radius:10px;}
#publishAudiencePanel {padding:10px 0;max-width:100%;}
#publishAudiencePanel fieldset {display:flex;flex-wrap:wrap;gap:10px;}
#publishAudiencePanel [hidden] {display:none;}
.sort-ghost {position:fixed!important;z-index:10000;pointer-events:none;box-shadow:0 14px 35px #65213b55;opacity:.94;}
.sort-placeholder {opacity:.3;outline:2px dashed var(--pink,#ba6688);}
.sorting-tasks {cursor:grabbing;user-select:none;}
.shared-member-row {flex-wrap:wrap;gap:8px;}
.shared-member-row > div {min-width:0;max-width:100%;}
.shared-member-row select {max-width:100%;width:180px;}
#buildDetails,#buildUpdateStatus,#buildChangelog {overflow-wrap:anywhere;font-size:12px;}
@media(max-width:680px){#taskAdvancedOptions:not([hidden]) {width:100%;flex-basis:100%;} .expired-section {width:100%;box-sizing:border-box;}.task-meta {flex-wrap:wrap;}.group-task-controls {flex-wrap:wrap;}.shared-member-row {align-items:flex-start;} }
.shared-member-row > div {flex:1 1 140px;overflow-wrap:anywhere;}
.shared-member-row strong,.shared-member-row p {overflow-wrap:anywhere;white-space:normal;}
.task-row.is-expired .task-timing {white-space:normal;overflow:visible;}
#memberReminderInbox {max-width:100%;overflow-wrap:anywhere;margin-bottom:10px;}

.group-task-card {position:relative;}
.group-task-controls .group-delete-task {position:absolute;right:8px;top:8px;width:44px;height:44px;padding:0;border:0;background:transparent;color:var(--muted);font:400 24px/1 var(--font-ui);}
.group-task-card:has(.group-delete-task) .group-task-title-row {padding-right:50px;}
.group-task-card.is-expired {border:2px solid #bd2455;background:rgba(255,232,238,.9);}
#groupTagFilter,#publishAudiencePanel select {border:1px solid var(--line);background:var(--settings-surface,#fff8ec);color:var(--ink);font:inherit;border-radius:10px;padding:8px;min-height:44px;}

/* Screenshot follow-up: only render reminder detail when it has visible content. */
#taskReminderOptions:not(:has(.reminder-detail.is-visible)) {display:none!important;}
.quick-options,.quick-options :is(input,select,button,b),#publishAudiencePanel,#publishAudiencePanel :is(label,legend,select) {font:400 14px/1.45 var(--font-ui);}
#taskAdvancedOptions > .compact-field > span,#taskAdvancedOptions .deadline-auto-choice {font-size:14px;line-height:1.45;}
#publishAudiencePanel > label {display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
#publishAudiencePanel select {width:auto;max-width:100%;min-width:160px;}
.group-chip-role {display:inline-flex;align-items:center;gap:4px;}
.group-role-symbol {font-size:16px;line-height:1;color:var(--teal-dark);}
.settings-entry-list {display:grid;gap:8px;margin:12px 0;}
.settings-entry {display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;min-height:44px;padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:var(--settings-control,var(--mint));color:var(--ink);font:400 14px/1.45 var(--font-ui);text-align:left;cursor:pointer;}
.settings-entry:hover {background:var(--mint);}
.profile-detail-dialog {font:400 14px/1.6 var(--font-ui);}
.profile-detail-dialog h2 {font-size:18px;}
.profile-detail-dialog .nickname-field {display:flex;flex-direction:column;gap:10px;}
.profile-detail-dialog .nickname-field input {margin:0;}
.profile-detail-dialog h3 {font-size:14px;}
.profile-detail-dialog :is(input,button),.profile-detail-dialog :is(#buildDetails,#buildUpdateStatus,#buildChangelog) {font-size:14px;}
.profile-detail-actions {display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;}
.profile-detail-actions button {border:1px solid var(--line);border-radius:10px;padding:8px 16px;}
@media(max-width:680px) {
  .quick-options,.quick-options :is(input,select,button,b),#publishAudiencePanel,#publishAudiencePanel :is(label,legend,select),#taskAdvancedOptions > .compact-field > span,#taskAdvancedOptions .deadline-auto-choice,.settings-entry,.profile-detail-dialog,.profile-detail-dialog :is(input,button) {font-size:16px;}
}

/* Expanded categories and group tags share the original filter row. */
.top-nav {min-width:0;}
.top-nav > .view-tabs {flex-shrink:0;}
#categoryTabs {min-width:0;max-width:100%;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;}
#categoryTabs > .category-pill,#extraCategories .category-pill {flex:none;}
#extraCategories:not([hidden]),#groupFilterOptions {display:contents;}
#categoryTabs #moreCategoriesPill {display:block;position:sticky;right:0;flex:none;background:transparent;border-radius:8px;}
.group-filter-pill {display:inline-flex;align-items:center;gap:4px;}
.group-task-due.is-deadline {color:var(--ink);font-weight:600;white-space:normal;}
.group-icon-choices {display:flex;gap:8px;flex-wrap:wrap;margin:12px 0;}
.group-icon-choices button {min-width:44px;min-height:44px;border:1px solid var(--line);border-radius:10px;background:var(--settings-surface,var(--cream));font-size:24px;}
.group-chip-icon {font-size:1em;}

/* Menu height includes its padding so constrained scrollports cannot crop actions. */
.group-manage-items {box-sizing:border-box;}

.group-manage-items.is-menu-popover {position:fixed;inset:auto;margin:0;border:0;}
.group-manage-menu.opens-up .group-manage-items.is-menu-popover {bottom:auto;}

/* Product audit: readable task actions and reminder controls across window sizes. */
.task-edit-button {border:0;background:transparent;color:var(--muted);font:inherit;font-size:13px;padding:5px 7px;min-height:32px;border-radius:8px;cursor:pointer;}
.task-edit-button:hover {background:var(--highlight-bg);color:var(--ink);}
.task-title {white-space:normal;overflow-wrap:anywhere;line-height:1.5;}
.task-meta {flex-wrap:wrap;row-gap:3px;}
.task-timing {white-space:normal;overflow:visible;overflow-wrap:anywhere;}
.task-overdue-tag {display:block;font-size:14px;line-height:1.5;margin-bottom:3px;}
#taskReminderOptions .reminder-detail.is-visible {width:100%;flex-wrap:wrap;align-items:center;gap:10px;}
#additionalLeads {flex-basis:100%;display:grid;gap:8px;}
#additionalLeads:empty {display:none;}
#taskReminderOptions small {flex-basis:100%;color:var(--muted);font-size:12px;line-height:1.6;}
#taskReminderOptions .lead-row {display:flex;gap:6px;align-items:center;flex-wrap:wrap;}
#taskReminderOptions input[type=number] {width:64px;}
#taskReminderOptions button, #intervalReminderField {font:inherit;font-size:14px;}
#taskReminderOptions input, #taskReminderOptions select {min-height:36px;max-width:100%;}
#buildChangelog {padding-left:1.25em;line-height:1.7;}
#buildChangelog li + li {margin-top:8px;}
html body:not(.is-compact) .day-grid:has(>.expired-section) {grid-template-areas:"expired expired" "overdue today" "tomorrow dayafter";}
html body.is-compact .day-grid:has(>.expired-section) {grid-template-areas:"expired" "overdue" "today";}
.day-grid>.expired-section {grid-area:expired;}
@media(max-width:680px) {
  html:not(.is-native-shell) body:not(.is-compact) .day-grid:has(>.expired-section),
  html:not(.is-native-shell) body.is-compact .day-grid:has(>.expired-section) {grid-template-areas:none;}
  html:not(.is-native-shell) .day-grid>.expired-section {grid-area:auto;}
}
@media(max-width:680px) {
  .task-edit-button {min-height:44px;min-width:44px;}
  .task-meta .task-timing {flex-basis:100%;}
}

.task-row .task-actions {display:grid;grid-template-columns:repeat(2,32px);gap:2px;padding:0;max-width:none;}
.task-row .task-edit-button {grid-column:1/-1;grid-row:2;}
.task-row .delete-button {position:static;grid-column:2;grid-row:1;width:32px;height:32px;min-width:32px;min-height:32px;opacity:.65;}
.task-row .reminder-button {grid-column:1;grid-row:1;}
.task-row .check-button {transition:background-color .16s ease,color .16s ease,border-color .16s ease;}
.view-tab, .mobile-nav-btn, .category-pill {transition:background-color .16s ease,color .16s ease;}
button:focus-visible, summary:focus-visible {outline:2px solid var(--teal);outline-offset:3px;}
button:disabled {cursor:wait;}
button.group-my-checkbox:disabled {cursor:default;}
.shared-result {color:var(--teal-dark);line-height:1.6;}
.shared-result:empty {display:none;}
@keyframes audit-surface-enter {from {opacity:0;} to {opacity:1;}}
.sheet-dialog[open] .modal-card, .group-manage-menu[open] .group-manage-items {animation:audit-surface-enter .16s ease-out;}
@media(max-width:680px) {
  .task-row .task-actions {grid-template-columns:repeat(2,44px);}
  .task-row .delete-button {width:44px;height:44px;min-width:44px;min-height:44px;}
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after {animation:none!important;transition:none!important;scroll-behavior:auto!important;}
}
/* The desktop shell is at 100; action feedback must remain above it. */
.toast {z-index:110;background:var(--teal);color:var(--skin-onaccent,#fff);max-width:calc(100vw - 32px);box-sizing:border-box;}
.toast-undo-button {min-height:36px;}

@media(max-width:680px) {
  html:not(.is-native-shell) .task-row {grid-template-columns:44px minmax(0,1fr) auto;}
  html:not(.is-native-shell) .task-row .task-actions {display:grid;grid-template-columns:repeat(2,44px);padding:0;gap:2px;}
}
/* Leave the fixed footer reachable while an undo message is visible. */
.toast {bottom:calc(80px + env(safe-area-inset-bottom,0px));}
/* Transient feedback must not intercept the list underneath it; only Undo acts. */
.toast.is-visible {pointer-events:none;}
.toast.is-visible .toast-undo-button {pointer-events:auto;}

/* Missed plans stay distinct from explicit deadline violations. */
.past-planned-section {grid-column:1/-1;min-width:0;border:1px solid var(--line);}
.past-planned-hint,.deadline-expired-hint {font:400 13px/1.5 var(--font-ui);margin:-4px 0 12px;color:var(--muted);}
.task-plan-tag {display:block;font:600 14px/1.5 var(--font-ui);color:var(--ink);margin-bottom:3px;}
.past-planned-section .task-row {border-left:3px solid #ba9868;}
.day-grid>.past-planned-section {grid-area:pending;}
.day-grid:has(>.past-planned-section)>.is-overdue {display:none;}
html body:not(.is-compact) .day-grid:has(>.past-planned-section) {grid-template-areas:"pending pending" "today tomorrow" "dayafter dayafter";}
html body:not(.is-compact) .day-grid:has(>.past-planned-section):has(>.expired-section) {grid-template-areas:"expired expired" "pending pending" "today tomorrow" "dayafter dayafter";}
html body.is-compact .day-grid:has(>.past-planned-section) {grid-template-areas:"pending" "today";}
html body.is-compact .day-grid:has(>.past-planned-section):has(>.expired-section) {grid-template-areas:"expired" "pending" "today";}
@media(max-width:680px) {
  html:not(.is-native-shell) body .day-grid:has(>.past-planned-section),
  html:not(.is-native-shell) body .day-grid:has(>.past-planned-section):has(>.expired-section) {grid-template-areas:none;}
  html:not(.is-native-shell) .day-grid>.past-planned-section {grid-area:auto;}
}

/* Priority lists occupy only their count row until explicitly expanded. */
html body .day-grid>.priority-section {min-height:0;padding:0;align-self:start;}
.priority-summary {display:flex;align-items:center;gap:8px;min-height:48px;box-sizing:border-box;padding:10px 16px;cursor:pointer;list-style:none;font:inherit;}
.priority-summary::-webkit-details-marker {display:none;}
.priority-summary strong {min-width:0;font-size:14px;line-height:1.5;}
.priority-summary:focus-visible {outline:2px solid currentColor;outline-offset:-4px;border-radius:12px;}
.priority-count {margin-left:auto;font:600 14px/1.5 var(--font-ui);font-variant-numeric:tabular-nums;}
.priority-chevron {display:inline-block;flex:none;font:20px/1 var(--font-ui);transition:transform .16s ease;}
.priority-section[open]>.priority-summary .priority-chevron {transform:rotate(90deg);}
.priority-content {padding:8px 16px 16px;}
@media(prefers-reduced-motion:reduce) {.priority-chevron {transition:none;}}

/* A personal draft never displays the hidden group-recipient badge. */
.preview-target-badge[hidden],.field-error[hidden] {display:none!important;}

/* Form hierarchy and feedback share the existing skin tokens. */
.sheet-dialog input:not([type=checkbox]):not([type=color]),.sheet-dialog select,
.profile-detail-dialog input {box-sizing:border-box;border:1px solid var(--line);border-radius:10px;background:var(--settings-control,#fffafa);color:var(--ink);padding:10px 12px;font-family:var(--font-ui);}
.sheet-dialog :is(input,select):focus-visible,.profile-detail-dialog input:focus-visible {outline:2px solid var(--ink);outline-offset:2px;}
.sheet-dialog input[aria-invalid=true] {border-color:#a52d50;}
.field-error {margin:0 0 12px;color:var(--feedback-error,#962847);font:500 14px/1.5 var(--font-ui);}
.deadline-reminder-note {margin:8px 0 12px;padding:10px 12px;border-left:3px solid var(--line);border-radius:8px;background:var(--settings-control,#fffafa);font:400 13px/1.6 var(--font-ui);color:var(--muted);}
.custom-reminder-fields {min-width:0;margin:12px 0 0;padding:12px;border:1px solid var(--line);border-radius:12px;}
.custom-reminder-fields legend {padding:0 6px;font-size:13px;color:var(--muted);}
.edit-recurrence-options[hidden],.edit-weekdays[hidden],.custom-reminder-fields[hidden],.deadline-reminder-note[hidden],#clearTasksSearch[hidden],.search-status[hidden] {display:none!important;}
.tasks-search-wrap input {min-height:44px;padding-right:64px;}
#clearTasksSearch {position:absolute;right:4px;min-width:48px;min-height:36px;padding:4px 8px;border:0;border-radius:12px;background:transparent;color:var(--ink);font:500 13px/1.5 var(--font-ui);}
#tasksSearchInput::-webkit-search-cancel-button {display:none;}
.search-status {margin:0 0 14px;padding:10px 12px;border-radius:12px;background:var(--settings-control,#fffafa);font:400 14px/1.6 var(--font-ui);overflow-wrap:anywhere;}
.priority-section.expired-section>.priority-summary {border-left:3px solid #a72f53;border-radius:12px;}
.priority-section.past-planned-section>.priority-summary {border-left:3px solid #aa8655;border-radius:12px;}
.priority-count {min-width:24px;text-align:center;padding:1px 7px;border-radius:20px;background:var(--settings-control,#fffafa);box-sizing:border-box;}
.action-confirm-dialog h2 {font-size:18px;margin:0 0 12px;}
.action-confirm-dialog>p {line-height:1.7;margin:0 0 20px;overflow-wrap:anywhere;}
.action-confirm-dialog button {min-height:44px;}
.profile-detail-actions .is-danger {border-color:#a72f53;background:#a72f53;color:#fff;}
@media(max-width:680px){#clearTasksSearch {min-height:44px;right:0;} .tasks-search-wrap input {min-height:48px;} .field-error,.deadline-reminder-note {font-size:14px;}}

/* Brief feedback without moving the reading position or delaying dismissal. */
.action-confirm-dialog[open],.profile-detail-dialog[open] {animation:audit-surface-enter .16s ease-out;}
.profile-detail-actions button,#clearTasksSearch,.category-pill,.view-tab {transition:background-color .16s ease,border-color .16s ease,color .16s ease;}
:is(.sheet-dialog,.profile-detail-dialog,.action-confirm-dialog) button:active:not(:disabled) {filter:brightness(.94);}
button[aria-busy=true] {cursor:progress;opacity:.65;}
@media(prefers-reduced-motion:reduce){.action-confirm-dialog[open],.profile-detail-dialog[open] {animation:none;} .profile-detail-actions button,#clearTasksSearch,.category-pill,.view-tab {transition:none;}}

.deadline-reminder-note {grid-column:1/-1;}
.deadline-auto-choice[hidden] {display:none!important;}

:root[data-theme="archive-dark"] {--feedback-error:#f4afbf;}
.tasks-search-wrap input,.tasks-search-wrap input:focus {background:var(--settings-control,#fffafa);}
