[data-theme=mono] {
  --bg: #FFFFFF;
  --surface: #F5F5F5;
  --text: #171717;
  --text-2: #5F5F5F;
  --line: #E6E6E6;
  --accent: #1E3A8A;
  --ink: #171717;
  --on-ink: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.62);
  --dock-bg: rgba(245, 245, 245, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --sheet: #FFFFFF;
  --field: #FFFFFF;
  --hover: rgba(0, 0, 0, 0.035);
  --sel: rgba(0, 0, 0, 0.06);
  color-scheme: light;
}

[data-theme=mono][data-scheme=dark] {
  --bg: #0E0E0F;
  --surface: #1C1C1E;
  --text: #F2F2F2;
  --text-2: #9A9A9F;
  --line: #2C2C2E;
  --accent: #93B4FF;
  --ink: #F2F2F2;
  --on-ink: #0E0E0F;
  --glass: rgba(40, 40, 44, 0.62);
  --dock-bg: rgba(38, 38, 38, 0.85);
  --glass-edge: rgba(255, 255, 255, 0.10);
  --sheet: #1C1C1E;
  --field: rgba(255, 255, 255, 0.06);
  --hover: rgba(255, 255, 255, 0.05);
  --sel: rgba(255, 255, 255, 0.09);
  color-scheme: dark;
}

[data-theme=paper] {
  --bg: #FAF7F0;
  --surface: #F1ECE1;
  --text: #2B2620;
  --text-2: #6B6153;
  --line: #E6DFD0;
  --accent: #A84A22;
  --ink: #2B2620;
  --on-ink: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.62);
  --dock-bg: rgba(245, 245, 245, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --sheet: #FAF7F0;
  --field: #FFFFFF;
  --hover: rgba(0, 0, 0, 0.035);
  --sel: rgba(0, 0, 0, 0.06);
  color-scheme: light;
}

[data-theme=paper][data-scheme=dark] {
  --bg: #1A1714;
  --surface: #25211C;
  --text: #EFE8DC;
  --text-2: #A89E8E;
  --line: #332D26;
  --accent: #E38A62;
  --ink: #EFE8DC;
  --on-ink: #0E0E0F;
  --glass: rgba(40, 40, 44, 0.62);
  --dock-bg: rgba(38, 38, 38, 0.85);
  --glass-edge: rgba(255, 255, 255, 0.10);
  --sheet: #25211C;
  --field: rgba(255, 255, 255, 0.06);
  --hover: rgba(255, 255, 255, 0.05);
  --sel: rgba(255, 255, 255, 0.09);
  color-scheme: dark;
}

[data-theme=mist] {
  --bg: #F4F7FA;
  --surface: #E9EFF5;
  --text: #1B2733;
  --text-2: #566577;
  --line: #DCE4EC;
  --accent: #2A6699;
  --ink: #1B2733;
  --on-ink: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.62);
  --dock-bg: rgba(245, 245, 245, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --sheet: #F4F7FA;
  --field: #FFFFFF;
  --hover: rgba(0, 0, 0, 0.035);
  --sel: rgba(0, 0, 0, 0.06);
  color-scheme: light;
}

[data-theme=mist][data-scheme=dark] {
  --bg: #0F1419;
  --surface: #18212A;
  --text: #E6EDF3;
  --text-2: #8FA0B2;
  --line: #243140;
  --accent: #7DB3E3;
  --ink: #E6EDF3;
  --on-ink: #0E0E0F;
  --glass: rgba(40, 40, 44, 0.62);
  --dock-bg: rgba(38, 38, 38, 0.85);
  --glass-edge: rgba(255, 255, 255, 0.10);
  --sheet: #18212A;
  --field: rgba(255, 255, 255, 0.06);
  --hover: rgba(255, 255, 255, 0.05);
  --sel: rgba(255, 255, 255, 0.09);
  color-scheme: dark;
}

[data-theme=sage] {
  --bg: #F5F7F2;
  --surface: #EAEFE5;
  --text: #1F2A22;
  --text-2: #5A6A5D;
  --line: #DDE4D8;
  --accent: #467050;
  --ink: #1F2A22;
  --on-ink: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.62);
  --dock-bg: rgba(245, 245, 245, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --sheet: #F5F7F2;
  --field: #FFFFFF;
  --hover: rgba(0, 0, 0, 0.035);
  --sel: rgba(0, 0, 0, 0.06);
  color-scheme: light;
}

[data-theme=sage][data-scheme=dark] {
  --bg: #10140F;
  --surface: #1A2119;
  --text: #E7EEE6;
  --text-2: #94A596;
  --line: #263024;
  --accent: #8DC29A;
  --ink: #E7EEE6;
  --on-ink: #0E0E0F;
  --glass: rgba(40, 40, 44, 0.62);
  --dock-bg: rgba(38, 38, 38, 0.85);
  --glass-edge: rgba(255, 255, 255, 0.10);
  --sheet: #1A2119;
  --field: rgba(255, 255, 255, 0.06);
  --hover: rgba(255, 255, 255, 0.05);
  --sel: rgba(255, 255, 255, 0.09);
  color-scheme: dark;
}

[data-theme=dusk] {
  --bg: #F7F5FA;
  --surface: #EEEAF4;
  --text: #251F33;
  --text-2: #625A73;
  --line: #E4DEEE;
  --accent: #5F4596;
  --ink: #251F33;
  --on-ink: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.62);
  --dock-bg: rgba(245, 245, 245, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --sheet: #F7F5FA;
  --field: #FFFFFF;
  --hover: rgba(0, 0, 0, 0.035);
  --sel: rgba(0, 0, 0, 0.06);
  color-scheme: light;
}

[data-theme=dusk][data-scheme=dark] {
  --bg: #13111A;
  --surface: #1E1A28;
  --text: #ECE8F4;
  --text-2: #A39BB5;
  --line: #2C2639;
  --accent: #B39BEA;
  --ink: #ECE8F4;
  --on-ink: #0E0E0F;
  --glass: rgba(40, 40, 44, 0.62);
  --dock-bg: rgba(38, 38, 38, 0.85);
  --glass-edge: rgba(255, 255, 255, 0.10);
  --sheet: #1E1A28;
  --field: rgba(255, 255, 255, 0.06);
  --hover: rgba(255, 255, 255, 0.05);
  --sel: rgba(255, 255, 255, 0.09);
  color-scheme: dark;
}

[data-theme=rose] {
  --bg: #FBF6F6;
  --surface: #F4EBEC;
  --text: #2E2224;
  --text-2: #705F62;
  --line: #EEDFE1;
  --accent: #A8435A;
  --ink: #2E2224;
  --on-ink: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.62);
  --dock-bg: rgba(245, 245, 245, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --sheet: #FBF6F6;
  --field: #FFFFFF;
  --hover: rgba(0, 0, 0, 0.035);
  --sel: rgba(0, 0, 0, 0.06);
  color-scheme: light;
}

[data-theme=rose][data-scheme=dark] {
  --bg: #171112;
  --surface: #241B1D;
  --text: #F3E9EA;
  --text-2: #B09A9E;
  --line: #35282B;
  --accent: #EB8EA3;
  --ink: #F3E9EA;
  --on-ink: #0E0E0F;
  --glass: rgba(40, 40, 44, 0.62);
  --dock-bg: rgba(38, 38, 38, 0.85);
  --glass-edge: rgba(255, 255, 255, 0.10);
  --sheet: #241B1D;
  --field: rgba(255, 255, 255, 0.06);
  --hover: rgba(255, 255, 255, 0.05);
  --sel: rgba(255, 255, 255, 0.09);
  color-scheme: dark;
}

:root {
  --red: #D93036;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dock-space: 112px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

body.is-resizing, body.is-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
.app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: max(20px, env(safe-area-inset-top)) 16px 10px 20px;
}
.topbar__title {
  margin: 0;
  font-size: clamp(24px, 7.4vw, 32px);
  line-height: 40px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.topbar__sub {
  font-size: 15px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
@media (max-width: 420px) {
  .topbar {
    gap: 8px;
    padding-right: 8px;
  }
  .topbar__nav {
    gap: 0;
  }
}
.topbar.is-today .topbar__title, .topbar.is-today .topbar__sub {
  color: var(--accent);
}
.topbar__spacer {
  flex: 1;
}
.topbar__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  align-self: center;
}

.iconbtn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.iconbtn:hover {
  background: var(--hover);
  color: var(--text);
}

.todaybtn {
  height: 32px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.todaybtn:hover {
  color: var(--text);
}

.stage {
  flex: 1;
  min-height: 0;
  position: relative;
  outline: none;
}

.row {
  --gutter: 20px;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-left: var(--gutter);
  background: var(--bg);
  touch-action: pan-y;
}
.row__body {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 var(--gutter) 0 -22px;
  padding: 0 0 0 22px;
  border-bottom: 0.5px solid var(--line);
}
.row__text {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  line-height: 1.35;
  padding: 14px 0;
  overflow-wrap: anywhere;
  cursor: default;
}
.row.is-done .row__text {
  color: var(--text-2);
  text-decoration: line-through;
}
.row__rep {
  flex: none;
  color: var(--text-2);
}
.row:hover {
  background: var(--hover);
}
.row.is-dragging {
  opacity: 0.35;
}
.row.is-drop-before::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: -1px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
  z-index: 2;
}
.row.is-swiping {
  transition: none;
}

.dot {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 15px -5px 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c, transparent);
  box-shadow: inset 0 0 0 1.5px var(--ring, transparent);
}
.is-done .dot::after {
  opacity: 0.35;
}
.dot:hover::after {
  transform: scale(1.35);
  transition: transform 120ms;
}

.blank {
  height: 52px;
  margin: 0 20px;
  border-bottom: 0.5px solid var(--line);
  cursor: text;
}
.blank:hover {
  background: linear-gradient(90deg, var(--hover), transparent 80%);
}

.adder {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  border-bottom: 0.5px solid var(--line);
  margin: 0 20px;
}
.adder input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 17px;
  padding: 14px 0;
  color: var(--text);
}
.adder .dot {
  margin-top: 0;
  align-self: center;
}

.list {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: var(--dock-space);
  overscroll-behavior: contain;
}

.cols {
  height: 100%;
  display: flex;
  padding: 0 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
}

.col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.col + .col {
  box-shadow: inset 0.5px 0 0 var(--line);
}
.col.is-today {
  background: color-mix(in srgb, var(--text) 2.5%, transparent);
}
.col__head {
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  cursor: default;
  overflow: hidden;
  white-space: nowrap;
}
.col__grip {
  position: absolute;
  left: -6px;
  top: 0;
  bottom: 0;
  width: 12px;
  z-index: 6;
  cursor: col-resize;
  touch-action: none;
}
.col__grip::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 150ms;
}
.col__grip:hover::after, .col__grip.is-active::after, .col__grip:focus-visible::after {
  opacity: 1;
}
.col__grip:focus-visible {
  outline: none;
}
.col__num {
  width: 34px;
  height: 34px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
}
.col.is-today .col__num {
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 700;
}
.col__wd {
  font-size: 14px;
  color: var(--text-2);
}
.col__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 var(--dock-space);
}
.col .row {
  --gutter: 12px;
  background: transparent;
}
.col .row:hover {
  background: var(--hover);
}
.col .row__body {
  min-height: 0;
}
.col .row__text {
  font-size: 15px;
  padding: 10px 0;
}
.col .dot {
  margin-top: 11px;
}
.col .adder {
  margin: 0 12px;
  min-height: 44px;
}
.col .adder input {
  font-size: 15px;
  padding: 10px 0;
}
.col .adder .dot {
  margin-top: 0;
}
.col .col__fill {
  min-height: 120px;
  height: 100%;
  cursor: text;
}
.col .blank {
  height: 44px;
  margin: 0 12px;
}

.cols.is-wide .col__head {
  border-bottom: 1px solid transparent;
}

.cols.is-wide .col.is-today .col__head {
  border-bottom-color: var(--ink);
}

.week {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: var(--dock-space);
}

.day-sec {
  padding-top: 14px;
}
.day-sec__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 2px 13px;
}
.day-sec__num {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  border-radius: 17px;
}
.day-sec.is-today .day-sec__num {
  background: var(--ink);
  color: var(--on-ink);
}
.day-sec__wd {
  font-size: 15px;
  color: var(--text-2);
}
.day-sec .blank {
  height: 44px;
}

.month {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.month.is-side {
  flex-direction: row;
}

.month__cal {
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 0 4px;
}

.month.is-full .month__cal {
  flex: 1;
  min-height: 0;
  padding: 0 12px var(--dock-space);
}

.month.is-side .month__cal {
  width: 520px;
  padding: 0 12px;
  border-right: 0.5px solid var(--line);
}

.wdrow {
  display: flex;
  height: 26px;
  align-items: center;
}
.wdrow span {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

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

.month.is-full .grid {
  flex: 1;
  grid-auto-rows: 1fr;
}

.cell {
  min-width: 0;
  border: 0;
  border-top: 0.5px solid var(--line);
  background: transparent;
  padding: 4px 2px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  overflow: hidden;
  cursor: pointer;
  border-radius: 0;
  height: 60px;
}
.cell:hover {
  background: var(--hover);
}
.cell__num {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.cell.is-out .cell__num {
  color: color-mix(in srgb, var(--text-2) 60%, transparent);
}
.cell.is-today .cell__num {
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 700;
}
.cell.is-sel:not(.is-today) .cell__num {
  box-shadow: inset 0 0 0 1.5px var(--ink);
  font-weight: 700;
}
.cell__dots {
  display: flex;
  gap: 3px;
  height: 5px;
}
.cell__dots span {
  width: 5px;
  height: 5px;
  border-radius: 3px;
}
.cell__chips {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cell__chip {
  display: block;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.cell__chip.is-done {
  color: var(--text-2);
  text-decoration: line-through;
}
.cell__more {
  font-size: 11px;
  color: var(--text-2);
  text-align: left;
  padding-left: 4px;
}

.month.is-full .cell {
  height: auto;
  min-height: 0;
}

.month.is-full.is-roomy .cell__chip {
  height: 20px;
  line-height: 20px;
  font-size: 12px;
  padding: 0 6px;
}

.month__toggle {
  align-self: center;
  width: 64px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 0.5px solid var(--line);
  width: 100%;
}
.month__toggle svg {
  transition: transform 280ms var(--ease);
}

.month.is-full .month__toggle svg {
  transform: rotate(180deg);
}

.month__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: var(--dock-space);
}

.month__listhead {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 20px 4px;
}
.month__listhead h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}
.month__listhead span {
  font-size: 14px;
  color: var(--text-2);
}
.month__listhead.is-today h2, .month__listhead.is-today span {
  color: var(--accent);
}

.month.is-side .month__listhead {
  padding: 18px 24px 6px 28px;
}
.month.is-side .month__listhead h2 {
  font-size: 24px;
  font-weight: 700;
}

.dock {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(30px, env(safe-area-inset-bottom));
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 20;
}
.dock__views, .dock__me {
  pointer-events: auto;
}
.dock__views {
  display: flex;
  gap: 2px;
  padding: 5px;
  height: 56px;
  border-radius: 28px;
  background: var(--dock-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 0.5px solid var(--glass-edge);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08), inset 0 1px 1px var(--glass-edge);
}
.dock__btn {
  min-width: 66px;
  padding: 0 14px;
  height: 46px;
  border: 0;
  border-radius: 23px;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}
.dock__btn[aria-pressed=true] {
  color: var(--text);
  font-weight: 600;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.dock__me {
  width: 56px;
  height: 56px;
  border-radius: 28px;
  border: 0.5px solid var(--glass-edge);
  background: var(--dock-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 60;
  pointer-events: none;
  transform: translate(-50%, -140%);
  opacity: 0;
  padding: 10px 18px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 500;
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  color: var(--on-ink);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: transform 320ms var(--ease), opacity 200ms;
}
.toast.is-on {
  transform: translate(-50%, 0);
  opacity: 1;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.28);
  animation: fade 160ms;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes rise {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}
@keyframes pop {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
}
.sheet {
  position: fixed;
  z-index: 50;
  background: var(--sheet);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(100% - 48px);
  border-radius: 14px 14px 0 0;
  animation: rise 240ms var(--ease);
}
@media (min-width: 600px) {
  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: 460px;
    max-height: min(760px, 100% - 64px);
    transform: translate(-50%, -50%);
    border-radius: 16px;
    animation: pop 180ms var(--ease);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.15);
  }
}
.sheet__bar {
  flex: none;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  border-bottom: 0.5px solid var(--line);
}
.sheet__title {
  font-size: 17px;
  font-weight: 600;
}
.sheet__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sheet__body > * {
  flex-shrink: 0;
}
.sheet__label {
  font-size: 13px;
  color: var(--text-2);
  padding: 12px 0 2px 14px;
}

.textbtn {
  height: 40px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-size: 17px;
  color: var(--text);
  border-radius: 8px;
}
.textbtn--strong {
  font-weight: 600;
}
.textbtn:hover {
  background: var(--hover);
}

.field {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--field);
  padding: 0 14px;
  font-size: 17px;
  outline: none;
  box-shadow: inset 0 0 0 0.5px var(--line);
}
.field:focus {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.card {
  border-radius: 10px;
  background: var(--field);
  box-shadow: inset 0 0 0 0.5px var(--line);
  overflow: hidden;
}

.swatches {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
}

.swatch {
  width: 40px;
  height: 40px;
  border: 0;
  padding: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.swatch span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c);
  display: block;
}
.swatch--none span {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--text-2);
}
.swatch[aria-pressed=true] span {
  box-shadow: 0 0 0 2px var(--field), 0 0 0 4px var(--text);
}
.swatch--none[aria-pressed=true] span {
  box-shadow: inset 0 0 0 1.5px var(--text-2), 0 0 0 2px var(--field), 0 0 0 4px var(--text);
}
.swatch--custom span {
  background: conic-gradient(#E5484D, #F2A33A, #E8D44D, #6CC24A, #3B82F6, #6D4ACF, #E5484D);
}
.swatch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.opt {
  width: 100%;
  height: 42px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 16px;
  text-align: left;
}
.opt + .opt {
  border-top: 0.5px solid var(--line);
}
.opt:hover {
  background: var(--hover);
}
.opt svg {
  visibility: hidden;
}
.opt[aria-checked=true] svg {
  visibility: visible;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--text) 7%, transparent);
}
.seg button {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
}
.seg button[aria-pressed=true] {
  background: var(--field);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
  font-weight: 600;
}

.endrow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 6px 0 14px;
  font-size: 16px;
}
.endrow > span {
  flex: 1;
}
.endrow input[type=date] {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 16px;
  color: var(--accent);
}

.actions {
  display: flex;
  gap: 10px;
  padding-top: 14px;
}
.actions button {
  flex: 1;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--field);
  box-shadow: inset 0 0 0 0.5px var(--line);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.actions .is-danger {
  color: var(--red);
}

.set__group {
  border-radius: 12px;
  background: var(--field);
  box-shadow: inset 0 0 0 0.5px var(--line);
  overflow: hidden;
}
.set__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  font-size: 16px;
}
.set__row + .set__row {
  border-top: 0.5px solid var(--line);
}
.set__row > span:first-child {
  flex: 1;
}

.set__row select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline-offset: 2px;
  background: transparent;
  color: var(--text-2);
  font-size: 16px;
  text-align: right;
  text-align-last: right;
  cursor: pointer;
  padding: 6px 22px 6px 6px;
  border-radius: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' viewBox='0 0 10 16' fill='none' stroke='%238A8A8F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6l3-3 3 3'/%3E%3Cpath d='M2 10l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 10px 16px;
}
.set__row select:hover {
  background-color: var(--hover);
}
.set__row select option {
  color: initial;
}

.switch {
  width: 51px;
  height: 31px;
  border: 0;
  padding: 0;
  border-radius: 16px;
  background: color-mix(in srgb, var(--text) 14%, transparent);
  position: relative;
  flex: none;
  transition: background 200ms;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 220ms var(--ease);
}
.switch[aria-checked=true] {
  background: var(--ink);
}
.switch[aria-checked=true]::after {
  transform: translateX(20px);
  background: var(--on-ink);
}

.themes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
}

.themechip {
  border: 0;
  border-radius: 12px;
  padding: 10px;
  background: var(--tb);
  color: var(--tt);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.themechip b {
  font-size: 13px;
  font-weight: 600;
}
.themechip i {
  display: flex;
  gap: 4px;
}
.themechip i span {
  width: 12px;
  height: 12px;
  border-radius: 6px;
}
.themechip[aria-pressed=true] {
  box-shadow: inset 0 0 0 2px var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 2px;
  font-size: 13px;
  color: var(--text-2);
}
.brand svg {
  flex: none;
}

.kbd {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-2);
}
.kbd kbd {
  font-family: inherit;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  justify-self: start;
}

.alert {
  position: fixed;
  z-index: 55;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  border-radius: 14px;
  overflow: hidden;
  text-align: center;
  animation: pop 160ms var(--ease);
  background: color-mix(in srgb, var(--sheet) 94%, transparent);
  backdrop-filter: blur(30px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}
.alert__text {
  padding: 19px 16px 16px;
}
.alert__text h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}
.alert__text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}
.alert__btns {
  display: flex;
  flex-direction: column;
  border-top: 0.5px solid var(--line);
}
.alert__btns.is-row {
  flex-direction: row;
}
.alert__btns.is-row button + button {
  border-left: 0.5px solid var(--line);
  border-top: 0;
}
.alert__btns button {
  height: 46px;
  border: 0;
  background: transparent;
  font-size: 17px;
  color: var(--text);
  flex: 1;
}
.alert__btns button + button {
  border-top: 0.5px solid var(--line);
}
.alert__btns button:hover {
  background: var(--hover);
}
.alert__btns button.is-danger {
  color: var(--red);
}
.alert__btns button.is-strong {
  font-weight: 600;
}

.menu {
  position: fixed;
  z-index: 70;
  min-width: 180px;
  padding: 5px 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--sheet) 92%, transparent);
  backdrop-filter: blur(24px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.2);
  animation: pop 100ms;
}
.menu button {
  display: flex;
  width: calc(100% - 10px);
  margin: 0 5px;
  height: 24px;
  align-items: center;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 13px;
  text-align: left;
}
.menu button span {
  flex: 1;
}
.menu button kbd {
  font-family: inherit;
  color: var(--text-2);
  font-size: 12px;
}
.menu button:hover, .menu button:focus-visible {
  background: #2F6BE0;
  color: #FFFFFF;
  outline: none;
}
.menu button:hover kbd, .menu button:focus-visible kbd {
  color: #FFFFFF;
}
.menu button.is-danger {
  color: var(--red);
}
.menu button.is-danger:hover {
  color: #FFFFFF;
}
.menu hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 5px 14px;
}

.ghost {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--sheet);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18), 0 3px 8px rgba(0, 0, 0, 0.1);
  transform: rotate(-1.5deg) scale(1.03);
  font-size: 15px;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 260px;
}

/* ───────── Signed-out pages (design: iOS-Login, iOS-SignUp, iOS-ForgotPassword, iOS-VerifyEmail) ───────── */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; background: var(--bg); color: var(--text); }
.auth[hidden] { display: none; }
.auth__page { width: 100%; max-width: 420px; padding: 96px 24px 40px; box-sizing: border-box; display: flex; flex-direction: column; }
.auth__brand { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.auth__brand svg { color: var(--text); }
.auth__brand h1 { margin: 4px 0 0; font-size: 34px; font-weight: 700; letter-spacing: -0.5px; }
.auth__brand p { margin: 0; font-size: 15px; color: var(--text-2); }
.auth__form { padding-top: 36px; display: flex; flex-direction: column; gap: 12px; }
.auth__form form { display: flex; flex-direction: column; gap: 12px; }
.auth__form h2 { margin: 0; font-size: 22px; font-weight: 700; }
.auth__text { margin: 0; font-size: 16px; line-height: 1.55; }
.auth__note, .auth__hint { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.auth__hint { margin-top: -4px; padding: 0 4px; }
.auth__error { margin: 0; font-size: 14px; color: #CD262B; }
.auth__done { margin: 0; font-size: 14px; color: var(--text-2); }
.auth__or { display: flex; align-items: center; gap: 12px; margin: 8px 0; font-size: 13px; color: var(--text-2); }
.auth__or span { flex: 1; height: 0.5px; background: var(--line); }
.afield { height: 52px; border-radius: 14px; background: var(--surface); border: 0; padding: 0 16px; font: inherit; font-size: 17px; color: var(--text); width: 100%; box-sizing: border-box; outline: none; }
.afield:focus-visible { box-shadow: 0 0 0 2px var(--text); }
.afield::placeholder { color: var(--text-2); }
.abtn { height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 17px; font-weight: 500; box-sizing: border-box; background: var(--bg); color: var(--text); border: 1px solid var(--line); cursor: pointer; }
.abtn--primary { background: var(--ink); color: var(--on-ink); border: 0; font-weight: 600; margin-top: 4px; }
.abtn:disabled { opacity: 0.55; cursor: default; }
.abtn.is-busy { opacity: 0.7; }
.auth__links { display: flex; justify-content: space-between; padding: 4px 4px 0; font-size: 15px; }
.auth__links--center { justify-content: center; }
.auth__links a { padding: 6px 0; color: var(--text-2); text-decoration: none; }
.auth__links a.is-strong { color: var(--accent); font-weight: 600; }
.auth__terms { margin: auto 0 0; padding: 32px 8px 0; text-align: center; font-size: 12px; line-height: 1.6; color: var(--text-2); }
.auth__terms a { color: var(--text-2); }

/* Pro features on the web: a lock where the apps show one; no purchase here. */
.dock__btn .lock {
  margin-left: 3px;
  vertical-align: -1px;
  opacity: 0.7;
}
.themechip b .lock {
  margin-left: 4px;
  vertical-align: -1px;
  opacity: 0.7;
}
.propill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  padding: 2px 7px 2px 6px;
  border-radius: 99px;
  background: var(--text);
  color: var(--bg);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  vertical-align: 1px;
}
.propill .lock {
  width: 9px;
  height: 9px;
}
.swatch.is-locked .lock {
  position: absolute;
  right: 2px;
  bottom: 2px;
  padding: 2px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  width: 14px;
  height: 14px;
}
.procard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--field);
  box-shadow: inset 0 0 0 0.5px var(--line);
  color: var(--text-2);
  text-align: left;
  font-size: 14px;
}
.procard b {
  color: var(--text);
  font-size: 16px;
}

/* 帳號 in 我的: the signed-in email and 登出. */
.set__email {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.set__danger {
  flex: 1;
  border: 0;
  padding: 0;
  min-height: 46px;
  background: transparent;
  color: var(--red);
  font-size: 16px;
  text-align: left;
}

/* An alert over an open sheet (the Pro note): its own dimming, above the sheet. */
.alert-scrim {
  position: fixed;
  inset: 0;
  z-index: 52;
  background: rgba(0, 0, 0, 0.28);
  animation: fade 160ms;
}
