[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%;
  /* The page itself never pulls to reload: 下拉更新 is the planner's (js/pull.js). */
  overscroll-behavior-y: none;
}

/* 下拉更新: the cat in the gap above the pulled planner (design: "margo. 標誌動畫"). */
.pull {
  position: fixed;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  overflow: hidden;
  pointer-events: none;
}
.pull[hidden] {
  display: none;
}
.pull__cat {
  flex: none;
  width: 96px;
  height: 68px;
  overflow: visible;
  color: var(--text);
}

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, 30px);
  line-height: 40px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.topbar__sub {
  font-size: 11px;
  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;
  /* Sideways swipes turn the page (js/planner.js); the slide stays inside. */
  touch-action: pan-y;
  overflow-x: clip;
}

.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);
}
/* The reminder's time before the title (designs Main, iPad-Day4): #6E6E73 / #8A8A8A on mono. */
.row__rmd {
  flex: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  line-height: 1;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: color-mix(in srgb, var(--text-2) 88%, transparent);
}
.row__rmd svg {
  display: block;
  flex: none;
}
.col .row__rmd,
.week .row__rmd {
  font-size: 12px;
}

/* 備註 after the title, 子事項 progress at the end (design: "margo. 網頁版"). */
.row__note {
  display: inline-flex;
  vertical-align: -1px;
  margin-left: 6px;
  color: var(--text-2);
}
.row__note svg {
  display: block;
}
.col .row__note svg,
.week .row__note svg {
  width: 12px;
  height: 12px;
}
.row__ring {
  flex: none;
  display: flex;
  color: var(--text);
}
.row.is-done .row__ring {
  color: var(--text-2);
}
.ring {
  display: block;
  flex: none;
}
.ring__track {
  stroke: color-mix(in srgb, currentColor 16%, transparent);
}
.row:hover {
  background: var(--hover);
}
.row.is-dragging {
  opacity: 0.35;
}
/* Lifting a row (design: iOS-Drag): a gray gap where it would land, and the
   row itself as a card under the pointer. */
.row.is-gap {
  background: var(--surface);
}
.row.is-gap > * {
  visibility: hidden;
}
.row.lifted {
  position: fixed;
  z-index: 80;
  margin: 0;
  pointer-events: none;
  border-radius: 12px;
  background: var(--sheet);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16), 0 3px 8px rgba(0, 0, 0, 0.1);
  transform: scale(1.03);
}
.row.lifted .row__body {
  border-bottom: 0;
}
.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);
}
/* Today: the number in the date color, no circle. The chosen day: a gray circle. */
.cell.is-today .cell__num {
  color: var(--accent);
  font-weight: 700;
}
.cell.is-sel .cell__num {
  background: var(--sel);
  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);
}

/* 頂部提示 (design: Toast-Spec, n_toast). In the top layer (popover), so above sheets and dialogs. */
.toast {
  --toast-bg: rgba(28, 28, 30, 0.80);
  --toast-ok: #34C759;
  --toast-err: #FF5F57;
  position: fixed;
  inset: auto;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  margin: 0;
  box-sizing: border-box;
  width: max-content;
  max-width: min(400px, calc(100vw - 32px));
  min-height: 44px;
  padding: 9px 18px;
  border: 0;
  border-radius: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: visible;
  background: var(--toast-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.10), inset 0 0.5px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 0.5px rgba(255, 255, 255, 0.10);
  color: #F5F5F7;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1px;
  line-height: 1.35;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  opacity: 0;
  transform: translate(-50%, -12px) scale(0.92);
  transition: opacity 300ms cubic-bezier(0.2, 0.9, 0.3, 1.15), transform 300ms cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
.toast.has-icon { padding-left: 12px; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.is-out { opacity: 0; transform: translate(-50%, -8px) scale(1); transition: opacity 200ms ease-in, transform 200ms ease-in; }
.toast.is-pulse { animation: toast-pulse 260ms ease-out; }
@keyframes toast-pulse { 40% { transform: translate(-50%, 0) scale(1.04); } }
.toast__icon { flex: none; display: flex; }
.toast__icon svg { width: 20px; height: 20px; }
.toast__text {
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: opacity 150ms;
}
.toast__text.is-swap { opacity: 0; }
[data-scheme=dark] .toast {
  --toast-bg: rgba(66, 66, 70, 0.72);
  --toast-ok: #30D158;
  --toast-err: #FF6961;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.50), 0 2px 6px rgba(0, 0, 0, 0.30), inset 0 0.5px 0 rgba(255, 255, 255, 0.20), inset 0 0 0 0.5px rgba(255, 255, 255, 0.14);
}
/* Desktop: smaller, 16 from the top of the window. */
@media (min-width: 601px) and (pointer: fine) {
  .toast { top: 16px; max-width: 380px; min-height: 38px; padding: 7px 16px; border-radius: 19px; gap: 7px; font-size: 14px; }
  .toast.has-icon { padding-left: 11px; }
  .toast__icon svg { width: 17px; height: 17px; }
}
@media (prefers-reduced-transparency: reduce) {
  .toast { --toast-bg: #1C1C1E; backdrop-filter: none; -webkit-backdrop-filter: none; }
  [data-scheme=dark] .toast { --toast-bg: #3A3A3C; }
}
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.is-on { transform: translate(-50%, 0); transition: opacity 200ms; }
  .toast.is-out { transform: translate(-50%, 0); transition: opacity 150ms; }
  .toast.is-pulse { animation: none; }
}

.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;
}

/* The edit sheet's title: long ones wrap and the field grows with them (user, 2026-11-22). */
.field--title {
  display: block;
  height: auto;
  min-height: 44px;
  padding: 11px 14px;
  line-height: 22px;
  resize: none;
  overflow: hidden;
  font: inherit;
  font-size: 17px;
  color: inherit;
}

/* 備註 and 子事項 in the edit sheet (design: "margo. 網頁版"). */
.field--notes {
  display: block;
  height: auto;
  min-height: 76px;
  padding: 11px 14px;
  line-height: 1.4;
  resize: vertical;
  font: inherit;
  font-size: 16px;
  color: inherit;
}
.sheet__label--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 14px;
}
.sheet__label--row .ring {
  color: var(--text);
}
.subs {
  display: flex;
  flex-direction: column;
}
.sub {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 6px 0 12px;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}
.sub + .sub {
  border-top: 0.5px solid var(--line);
}
.sub[draggable=true] {
  cursor: grab;
}
.sub__check {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--text-2);
  color: var(--bg);
}
.sub__check svg {
  width: 14px;
  height: 14px;
  visibility: hidden;
}
.sub.is-done .sub__check {
  background: var(--text);
  box-shadow: none;
}
.sub.is-done .sub__check svg {
  visibility: visible;
}
.sub__t {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: inherit;
  outline: none;
  padding: 0;
  display: flex;
  align-items: center;
}
.sub.is-done .sub__t {
  color: var(--text-2);
  text-decoration: line-through;
}
.sub__x {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
.sub:hover .sub__x,
.sub__x:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .sub__x { opacity: 1; }
}
.sub__plus {
  flex: none;
  width: 22px;
  display: flex;
  justify-content: center;
  color: var(--text-2);
}
.sub--add .sub__t::placeholder,
button.sub--add .sub__t {
  color: var(--text-2);
}
.sub__lock {
  flex: none;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.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 .cat, .gate__cat .cat { width: 88px; height: 55px; }
.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; }
/* 使用 Apple 登入: black with the white mark (white on black in dark mode), as Apple asks. */
.abtn--apple { background: #000000; color: #FFFFFF; border: 0; font-weight: 600; }
[data-scheme=dark] .abtn--apple { background: #FFFFFF; color: #000000; }
.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;
}

/* The device screens (seat decisions), in the sign-in pages' frame. */
.gate { padding-top: 72px; }
.gate__art { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 28px; }
.gate__tile { position: relative; width: 64px; height: 64px; border-radius: 18px; background: var(--surface); color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.gate__tile.is-filled { background: var(--text); color: var(--bg); }
.gate__swap { color: var(--text); display: flex; }
.gate__badge, .gate__count { position: absolute; display: flex; align-items: center; justify-content: center; border-radius: 50%; box-shadow: 0 0 0 3px var(--bg); }
.gate__badge { right: -6px; bottom: -6px; width: 26px; height: 26px; background: var(--text); color: var(--bg); }
.gate__count { right: -6px; top: -6px; width: 22px; height: 22px; background: var(--red); color: #FFFFFF; font-size: 12px; font-weight: 700; }
.gate__title { margin: 0 0 10px; font-size: 24px; font-weight: 700; text-align: center; }
.gate__body { text-align: center; color: var(--text-2); }
.gate__body b { color: var(--text); font-weight: 600; }
.gate__note { margin: 24px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--surface); font-size: 14px; line-height: 1.55; color: var(--text-2); }
.gate__note b { color: var(--text); font-weight: 600; }
.gate__swap.is-muted { color: color-mix(in srgb, var(--text-2) 45%, transparent); }
/* When the next switch may happen (design note n_devlimit). */
.gate__time { margin: 20px 0 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; display: flex; align-items: center; gap: 14px; }
.gate__timeicon { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--text); }
.gate__timetext { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-2); }
.gate__timetext b { font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gate__list { margin: 20px 0 4px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.gate__dev { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 16px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.gate__dev + .gate__dev { border-top: 1px solid var(--line); }
.gate__dev[aria-checked=true] { background: var(--surface); }
.gate__devicon { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.gate__dev[aria-checked=true] .gate__devicon { background: var(--bg); }
.gate__devtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gate__devname { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gate__devname i { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--accent); color: var(--bg); }
.gate__devsub { font-size: 13px; color: var(--text-2); }
.gate__mark { width: 22px; height: 22px; flex: none; box-sizing: border-box; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--text-2) 60%, transparent); }
.gate__dev[aria-checked=true] .gate__mark { border: 7px solid var(--text); }
.gate .auth__error, .gate__pro { margin-top: 14px; text-align: center; }
.gate__actions { margin-top: auto; padding-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.abtn--quiet { border: 0; background: transparent; color: var(--text-2); }
.gate__cat { color: var(--text); }

/* 提醒 in the edit sheet (design: iOS-Reminder): 提醒我, 日期, 時間, 通知方式. */
.rem .set__row { padding: 0 14px; }
.rem__value { position: relative; color: var(--text-2); font-size: 16px; cursor: pointer; }
.rem__value input { position: absolute; inset: 0; opacity: 0; width: 100%; border: 0; padding: 0; cursor: pointer; }
.rem__time { border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 16px; text-align: right; padding: 4px 0; cursor: pointer; }
.rem__time::-webkit-calendar-picker-indicator { display: none; }
.rem__channels { display: flex; gap: 10px; }
.rem__pill { flex: 1; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 15px; font-weight: 500; color: var(--text); background: var(--field); border: 1px solid color-mix(in srgb, var(--text-2) 45%, transparent); cursor: pointer; }
.rem__pill[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* 我的 › 帳號 (designs Android-Account / -DeleteAccount / -Reauth). */
.set__link { width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.set__link .set__email { flex: 0 1 auto; max-width: 55%; }
.set__chev { color: var(--text-2); font-size: 20px; line-height: 1; }
.acct__message { margin: 0 0 12px; color: var(--red); font-size: 14px; }
.acct__profile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 12px; background: var(--field); box-shadow: inset 0 0 0 0.5px var(--line); }
.acct__profile > span:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.acct__profile b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct__avatar { width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; }
.acct__avatar svg { width: 36px; height: 23px; }
.acct__muted { color: var(--text-2); font-size: 13px; }
.set__row > .acct__muted { font-size: 16px; }
.acct__row { gap: 14px; min-height: 56px; }
.acct__grow { flex: 1; min-width: 0; }
.acct__icon { width: 20px; display: flex; justify-content: center; color: var(--text); }
.acct__icon svg { width: 18px; height: 18px; }
.acct__pill { height: 30px; padding: 0 14px; border-radius: 15px; border: 1px solid var(--text-2); background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.acct__pill:disabled { opacity: 0.5; }
.acct__devicon { width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.acct__dev { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; }
.acct__devname { display: flex; align-items: center; gap: 6px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct__devname i { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--accent); color: var(--bg); }
.acct__label { display: flex; justify-content: space-between; }
.acct__note { margin: 6px 4px 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.acct__link { color: var(--accent); font-weight: 500; text-decoration: none; gap: 6px; justify-content: flex-start; }
.acct__pad { padding: 6px 14px 12px; }
.acct__upgrade { width: 100%; height: 44px; margin: 0; border-radius: 22px; font-size: 15px; }
.acct__card { display: block; width: 100%; min-height: 56px; margin-top: 16px; border: 0; border-radius: 12px; background: var(--field); box-shadow: inset 0 0 0 0.5px var(--line); color: var(--text); font: inherit; font-size: 16px; cursor: pointer; }
.acct__card + .acct__card { margin-top: 12px; }
.acct__card.is-danger { color: var(--red); }
.acct__intro { margin: 0 4px 16px; font-size: 15px; line-height: 1.55; }
.acct__point { display: flex; gap: 14px; padding: 14px 16px; }
.acct__point + .acct__point { border-top: 0.5px solid var(--line); }
.acct__point > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.acct__point b { font-size: 15px; }
.acct__point .acct__muted { font-size: 14px; line-height: 1.5; }
.acct__pointicon { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.acct__buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.acct__delete { background: var(--red); color: #FFFFFF; border: 0; font-weight: 600; }
.acct__delete:disabled { opacity: 0.4; }
.acct__dialog { width: min(360px, calc(100vw - 48px)); padding: 24px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.acct__dialog h2 { margin: 4px 0 0; font-size: 20px; }
.acct__dialog p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.acct__dialogicon { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.auth__notice { margin: 24px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface); font-size: 14px; line-height: 1.55; color: var(--text-2); }
.acct__row > span:first-child { flex: none; }
.acct__row > .acct__grow { flex: 1; }

/* The cat's animations (js/cat.js): the resting cat fills the box; jumps,
   the tail and sparkles draw outside it. */
svg.cat { display: block; overflow: visible; color: var(--text); }

/* 打招呼 over everything while the page starts, and once more after signing in. */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.35s ease-out;
}
.splash.is-gone { opacity: 0; pointer-events: none; }
.splash .cat { width: 240px; height: 189px; }

/* 設定's last line: the version. */
.set__version { margin: 16px 0 4px; text-align: center; font-size: 13px; color: var(--text-2); }

/* ── 圖片 (Pro; canvas note n_images, design "margo. 網頁版") ── */
.row__img {
  margin-left: 4px;
}
.imgs__count {
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.imgs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.imgs::-webkit-scrollbar {
  display: none;
}
.imgs__tile {
  position: relative;
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--line);
}
.imgs__open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.imgs__open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.imgs__x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.imgs__x svg {
  width: 10px;
  height: 10px;
}
/* Uploading: a thin spinning ring; failed: ! (click to try again). */
.imgs__badge {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 12px;
  box-sizing: border-box;
}
.imgs__badge.is-busy {
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  box-shadow: 0 0 0 30px rgba(0, 0, 0, 0.25);
  animation: imgs-spin 0.9s linear infinite;
  pointer-events: none;
}
.imgs__badge.is-failed {
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 0;
  border-radius: 14px;
  background: #E5484D;
  color: #fff;
  font: 700 15px/28px inherit;
  padding: 0;
  cursor: pointer;
}
@keyframes imgs-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .imgs__badge.is-busy { animation: none; }
}
.imgs__add {
  flex: none;
  width: 76px;
  height: 76px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1.5px dashed var(--line);
  background: var(--field);
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.imgs__add:focus-within,
.imgs__add:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.imgs__hint {
  margin: 6px 4px 0;
  font-size: 12px;
  color: var(--text-2);
}
.viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
}
.viewer__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 56px;
  padding: env(safe-area-inset-top) 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(rgba(0, 0, 0, 0.5), transparent);
}
.viewer__btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewer__btn svg {
  width: 16px;
  height: 16px;
}
.viewer__count {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.viewer__stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 0;
}
.viewer__stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.viewer__nav {
  position: absolute;
  top: 50%;
  margin-top: -24px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewer__nav--l {
  left: 16px;
}
.viewer__nav--r {
  right: 16px;
}
@media (hover: none) {
  .viewer__nav {
    display: none;
  }
}
.viewer__ask {
  position: absolute;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-radius: 16px;
  background: #fff;
  color: #171717;
  font-size: 15px;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.viewer__ask button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: #F0F0F0;
  color: #171717;
  font: inherit;
  font-weight: 500;
}
.viewer__ask .is-danger {
  background: #E5484D;
  color: #fff;
}

/* 日期／時間選擇器 (design note n_picker; Web-EditPicker*). */
.pickbtn { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--pick-field, #FFFFFF); color: var(--text); box-shadow: 0 0 0 0.5px var(--pick-ring, rgba(0, 0, 0, 0.18)), 0 1px 1px rgba(0, 0, 0, 0.06); display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; flex: none; }
.pickbtn__i { display: flex; color: var(--text-2); }
.pickbtn.is-open { box-shadow: 0 0 0 1px var(--ink), 0 0 0 4px color-mix(in srgb, var(--ink) 14%, transparent); }
.pickbtn:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--ink), 0 0 0 4px color-mix(in srgb, var(--ink) 14%, transparent); }
[data-scheme=dark] { --pick-field: rgba(255, 255, 255, 0.08); --pick-ring: rgba(255, 255, 255, 0.16); --pick-bg: color-mix(in srgb, var(--sheet) 86%, #FFFFFF); }
.pick { position: fixed; inset: auto; margin: 0; padding: 0; border: 0; overflow: visible; border-radius: 14px; background: var(--pick-bg, #FFFFFF); color: var(--text); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 12px 32px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08); font-size: 13px; }
.pick--date { width: 272px; }
.pick--time { width: 236px; }
.pick__arrow { position: absolute; top: -6px; left: var(--arrow-x, 42px); width: 12px; height: 12px; background: var(--pick-bg, #FFFFFF); transform: rotate(45deg); box-shadow: -0.5px -0.5px 0 0 rgba(0, 0, 0, 0.12); border-radius: 2px 0 0 0; }
.pick.is-up .pick__arrow { top: auto; bottom: -6px; box-shadow: 0.5px 0.5px 0 0 rgba(0, 0, 0, 0.12); border-radius: 0 0 2px 0; }
.pick__in { position: relative; padding: 12px 12px 10px; }
.pick--time .pick__in { padding: 12px; }
.pick button { font: inherit; color: inherit; border: 0; background: transparent; cursor: pointer; }
.pick__head { display: flex; align-items: center; gap: 2px; padding: 0 2px 8px 6px; }
.pick__head b { flex: 1; font-size: 14px; font-weight: 700; }
.pick__nav { width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: var(--text-2) !important; }
.pick__nav:hover, .pick__chip:hover, .pick__opt:hover { background: var(--hover); }
.pick__today { height: 26px; padding: 0 6px; font-size: 12px !important; font-weight: 500; color: var(--accent) !important; }
.pick__wk { display: grid; grid-template-columns: repeat(7, 1fr); padding-bottom: 4px; }
.pick__wk span { text-align: center; font-size: 11px; color: var(--text-2); }
.pick__row { display: grid; grid-template-columns: repeat(7, 1fr); }
.pick__day { height: 34px; display: flex; align-items: center; padding: 0; }
.pick__day span { width: 32px; height: 32px; margin: 0 auto; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.pick__day:hover span { background: var(--hover); }
.pick__day.is-other span, .pick__day[aria-disabled=true] span { color: var(--pick-off, #B0B0B5); }
[data-scheme=dark] .pick { --pick-off: #5C5C61; }
.pick__day[aria-disabled=true] { cursor: default; }
.pick__day[aria-disabled=true]:hover span { background: transparent; }
.pick__day.is-today span { background: var(--accent); color: var(--bg); font-weight: 600; }
.pick__day.is-sel span { background: var(--ink); color: var(--on-ink); font-weight: 600; }
.pick__day:focus-visible { outline: none; }
.pick__day:focus-visible span { box-shadow: inset 0 0 0 1.5px var(--text-2); background: color-mix(in srgb, var(--text) 5%, transparent); }
.pick__day.is-today:focus-visible span, .pick__day.is-sel:focus-visible span { box-shadow: 0 0 0 2px var(--pick-bg, #FFFFFF), 0 0 0 3.5px var(--text-2); }
.pick__quick { display: flex; gap: 6px; padding: 10px 2px 2px; margin-top: 6px; border-top: 0.5px solid var(--line); }
.pick__chip { height: 26px; padding: 0 10px; border-radius: 13px; background: color-mix(in srgb, var(--text) 6%, transparent) !important; font-size: 12px !important; display: flex; align-items: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pick__chip:disabled { opacity: 0.4; cursor: default; }
.pick__big { display: flex; align-items: baseline; justify-content: center; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 2px 0 10px; }
.pick__seg { padding: 0 4px !important; border-radius: 5px; font-size: 26px !important; font-weight: 600 !important; line-height: 1.25; }
.pick__seg.is-on { background: var(--accent) !important; color: var(--bg) !important; }
.pick__seg:focus-visible { outline: none; }
.pick__gap { width: 6px; }
.pick__label { font-size: 11px; color: var(--text-2); padding: 0 2px 6px; }
.pick__commons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pick__commons .pick__chip { height: 28px; border-radius: 8px; justify-content: center; padding: 0 4px; }
.pick__cols { display: flex; gap: 4px; margin-top: 12px; padding-top: 6px; border-top: 0.5px solid var(--line); }
.pick__col { flex: 1; height: 166px; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 2px; padding: 4px 0; -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); }
.pick__col::-webkit-scrollbar { display: none; }
.pick__opt { flex: none; height: 30px; margin: 0 4px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13px !important; font-variant-numeric: tabular-nums; }
.pick__opt[aria-selected=true] { background: var(--ink) !important; color: var(--on-ink) !important; font-weight: 600; }

/* 設定 page (design note n_websettings; Web-Settings*, Web-SettingsMobile*).
   Gray page, white cards; in dark mode the other way round (cards lighter). */
.sp { --sp-page: var(--surface); --sp-card: var(--bg); --sp-side: color-mix(in srgb, var(--surface) 94%, var(--text)); position: fixed; inset: 0; z-index: 40; background: var(--sp-page); color: var(--text); display: flex; flex-direction: column; overflow: hidden; }
[data-scheme=dark] .sp { --sp-page: var(--bg); --sp-card: var(--surface); --sp-side: color-mix(in srgb, var(--bg) 70%, var(--surface)); }
html.has-sp body { overflow: hidden; }
.sp button, .sp a { font: inherit; color: inherit; }
.sp button { border: 0; background: none; cursor: pointer; text-align: left; }
.sp a { text-decoration: none; }
.sp__top { flex: none; height: 56px; padding: 0 20px; display: flex; align-items: center; gap: 14px; border-bottom: 0.5px solid var(--line); background: color-mix(in srgb, var(--sp-page) 86%, transparent); }
.sp__logo { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; }
.sp__logo svg { width: 30px; height: 19px; }
.sp__flex { flex: 1; }
.sp__home { height: 32px; padding: 0 12px !important; border-radius: 16px; display: flex; align-items: center; gap: 6px; font-size: 14px !important; font-weight: 500; background: color-mix(in srgb, var(--text) 6%, transparent) !important; }
.sp__home svg { width: 16px; height: 16px; }
.sp__body { flex: 1; min-height: 0; display: flex; }
.sp__side { width: 280px; flex: none; padding: 20px 14px; box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; background: var(--sp-side); border-right: 0.5px solid var(--line); overflow-y: auto; }
.sp__side h1 { margin: 0; padding: 0 8px; font-size: 26px; font-weight: 700; }
.sp__procard { width: 100%; border-radius: 14px; padding: 14px !important; background: #171717 !important; color: #FFFFFF !important; display: flex; align-items: center; gap: 12px; }
[data-scheme=dark] .sp__procard { background: #2C2C2E !important; }
.sp__procard.is-pro { background: linear-gradient(135deg, #FFFFFF, #EEF2FC) !important; color: #171717 !important; box-shadow: inset 0 0 0 1px #C9D5F5; }
[data-scheme=dark] .sp__procard.is-pro { background: var(--sp-card) !important; color: var(--text) !important; box-shadow: inset 0 0 0 1px color-mix(in srgb, #4C68D6 50%, transparent); }
.sp__procard[aria-current=true] { box-shadow: 0 0 0 3px var(--sp-side), 0 0 0 5px var(--ink); }
.sp__protile { width: 36px; height: 36px; flex: none; border-radius: 10px; background: rgba(127, 127, 127, 0.22); display: flex; align-items: center; justify-content: center; }
.sp__procard.is-pro .sp__protile { background: linear-gradient(135deg, #3B5BDB, #1E3A8A); color: #FFFFFF; }
.sp__procard .sp__lbl b { font-size: 15px; }
.sp__procard .sp__lbl span { font-size: 12px; opacity: 0.7; }
.sp__who { display: flex; align-items: center; gap: 10px; padding: 2px 8px; }
.sp__avatar { width: var(--s, 32px); height: var(--s, 32px); flex: none; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: flex; align-items: center; justify-content: center; }
.sp__avatar svg { width: 66%; height: 42%; }
.sp__who b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp__nav { display: flex; flex-direction: column; gap: 2px; }
.sp__nav button { width: 100%; height: 42px; border-radius: 10px; padding: 0 12px !important; display: flex; align-items: center; gap: 12px; font-size: 15px !important; font-weight: 500; }
.sp__nav button:hover { background: var(--hover) !important; }
.sp__nav button[aria-current=true] { background: var(--ink) !important; color: var(--on-ink) !important; }
.sp__main { flex: 1; min-width: 0; overflow-y: auto; padding: 28px 48px 40px; box-sizing: border-box; display: flex; flex-direction: column; gap: 20px; align-items: center; }
.sp__main > h2, .sp__main > .sp__pane, .sp__main > .sp__crumb { width: 100%; max-width: 640px; }
.sp__main.is-wide > h2, .sp__main.is-wide > .sp__pane { max-width: 980px; }
.sp__main > h2 { margin: 0; font-size: 24px; font-weight: 700; }
.sp__crumb { display: flex; align-items: center; gap: 4px; font-size: 14px !important; color: var(--text-2) !important; margin-bottom: -12px; }
.sp__pane { display: flex; flex-direction: column; gap: 24px; }
.sp__sec { display: flex; flex-direction: column; gap: 8px; }
.sp__sec h3 { margin: 0; padding: 0 16px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.sp__group { border-radius: 12px; background: var(--sp-card); box-shadow: 0 0 0 0.5px var(--line); overflow: hidden; }
.sp__note { margin: 0; padding: 0 16px; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.sp__row { width: 100%; min-height: 52px; padding: 10px 16px 10px 0 !important; margin-left: 16px; box-sizing: border-box; display: flex; align-items: center; gap: 12px; font-size: 15px; }
.sp__group > .sp__row { width: calc(100% - 16px); }
.sp__row + .sp__row { border-top: 0.5px solid var(--line); }
.sp__link:hover { background: var(--hover) !important; }
.sp__link.is-danger .sp__lbl > span:first-child { color: var(--red); }
.sp__lbl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sp__sub { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.sp__val { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.sp__chev { flex: none; color: color-mix(in srgb, var(--text-2) 60%, transparent); }
.sp__ext { flex: none; color: var(--text-2); }
.sp__sel { height: 34px; padding: 0 10px 0 12px !important; border-radius: 8px; background: color-mix(in srgb, var(--text) 6%, transparent) !important; display: inline-flex; align-items: center; gap: 8px; font-size: 14px !important; white-space: nowrap; flex: none; max-width: 60%; }
.sp__sel span { overflow: hidden; text-overflow: ellipsis; }
.sp__sel svg { flex: none; color: var(--text-2); }
.sp__sel[aria-expanded=true] { box-shadow: 0 0 0 1px var(--ink), 0 0 0 4px color-mix(in srgb, var(--ink) 14%, transparent); }
.sp__switch { position: relative; width: 44px; height: 26px; flex: none; border-radius: 13px; background: color-mix(in srgb, var(--text) 16%, transparent) !important; transition: background 0.2s; }
.sp__switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 10px; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.sp__switch[aria-checked=true] { background: var(--ink) !important; }
[data-scheme=dark] .sp__switch[aria-checked=true] { background: var(--accent) !important; }
.sp__switch[aria-checked=true]::after { transform: translateX(18px); }
.sp__pill { height: 30px; padding: 0 14px !important; border-radius: 15px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text-2) 55%, transparent); font-size: 14px !important; font-weight: 600; white-space: nowrap; flex: none; display: inline-flex; align-items: center; cursor: pointer; }
.sp__mi { width: 22px; flex: none; display: flex; justify-content: center; }
.sp__mi svg { width: 18px; height: 18px; }
.sp__msg { margin: 0; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); font-size: 14px; }
.sp__profile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 12px; background: var(--sp-card); box-shadow: 0 0 0 0.5px var(--line); }
.sp__profile .sp__avatar { --s: 52px; }
.sp__profile b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp__seg { display: flex; padding: 2px; border-radius: 9px; background: color-mix(in srgb, var(--text) 7%, transparent); max-width: 420px; }
.sp__seg button { flex: 1; height: 32px; border-radius: 7px; font-size: 14px !important; font-weight: 500; text-align: center !important; }
.sp__seg button[aria-checked=true] { background: var(--sp-card) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px var(--line); font-weight: 600; }
.sp__themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 16px; }
.sp__theme { display: flex; flex-direction: column; gap: 8px; }
.sp__prev { display: flex; flex-direction: column; gap: 5px; height: 112px; padding: 12px; box-sizing: border-box; border-radius: 14px; background: var(--tb); box-shadow: inset 0 0 0 1px var(--tl); }
.sp__theme[aria-checked=true] .sp__prev { box-shadow: 0 0 0 2px var(--sp-page), 0 0 0 4px var(--ink); }
.sp__prev b { color: var(--ta); font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.sp__prev i { display: flex; align-items: center; gap: 8px; height: 16px; border-bottom: 1px solid var(--tl); }
.sp__prev s { width: 6px; height: 6px; border-radius: 3px; flex: none; }
.sp__prev u { height: 4px; border-radius: 2px; background: var(--tt); opacity: 0.8; }
.sp__tname { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 0 2px; }
.sp__tname em { font-style: normal; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 5px; background: var(--ink); color: var(--on-ink); }
.sp__point { display: flex; gap: 14px; padding: 14px 16px; }
.sp__point + .sp__point { border-top: 0.5px solid var(--line); }
.sp__pointicon { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--sp-page); display: flex; align-items: center; justify-content: center; }
.sp__point b { font-size: 15px; }
.sp__intro { margin: 0; padding: 0 4px; font-size: 15px; line-height: 1.6; }
.sp__buttons { display: flex; gap: 10px; }
.sp__btn { height: 44px; padding: 0 20px !important; border-radius: 12px; font-size: 15px !important; font-weight: 600; text-align: center !important; }
.sp__btn.is-danger { background: var(--red) !important; color: #FFFFFF !important; }
.sp__btn.is-primary { background: var(--ink) !important; color: var(--on-ink) !important; }
.sp__btn.is-primary:disabled { opacity: 0.4; cursor: default; }
.sp__btn.is-quiet { background: color-mix(in srgb, var(--text) 6%, transparent) !important; }
.sp__text { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--sp-card); box-shadow: 0 0 0 0.5px var(--line); color: var(--text); font: inherit; font-size: 15px; line-height: 1.5; resize: vertical; }
.sp__brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; }
.sp__brand svg { width: 84px; height: 53px; }
.sp__brand b { font-size: 20px; margin-top: 6px; }
.sp__brand span { font-size: 13px; color: var(--text-2); }
/* Pro: the slides on the left, how to upgrade on the right. */
.sp__propane { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.sp__slides { width: 390px; flex: none; display: flex; flex-direction: column; }
.sp__viewport { width: 390px; overflow: hidden; padding: 0 !important; cursor: pointer; }
.sp__trackwrap { transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.slides__track { display: flex; width: 3120px; color: #171717; }
.sp__dots { display: flex; justify-content: center; gap: 2px; padding-top: 8px; }
.sp__dots button { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; padding: 0 !important; }
.sp__dots span { width: 6px; height: 6px; border-radius: 3px; background: #C7C7C7; transition: width 250ms, background 250ms; }
.sp__dots [aria-selected=true] span { width: 20px; background: var(--ink); }
.sp__pro { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 14px; }
.sp__protext { display: flex; flex-direction: column; gap: 6px; }
.sp__protext b { font-size: 20px; }
.sp__protext span { font-size: 14px; line-height: 1.6; color: var(--text-2); }
.sp__stores { display: flex; gap: 10px; }
.sp__store { flex: 1; height: 48px; border-radius: 12px; background: #171717; color: #FFFFFF !important; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.sp__store span { font-size: 11px; opacity: 0.7; }
.sp__store b { font-size: 15px; }
.sp__qr { border-radius: 12px; background: var(--sp-card); box-shadow: 0 0 0 0.5px var(--line); padding: 14px 16px; display: flex; align-items: center; gap: 12px; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.sp__qrcode { width: 72px; height: 72px; flex: none; border-radius: 8px; background: #FFFFFF; box-shadow: 0 0 0 1px var(--line); display: flex; }
.sp__recheck { font-size: 13px; color: var(--text-2); }
.sp__recheck button { color: var(--text) !important; font-weight: 600; text-decoration: underline; padding: 0 0 0 4px !important; }
.sp__proyou { display: flex; align-items: center; gap: 12px; }
.sp__proyou .sp__protile { width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: var(--on-ink); }
.sp__proyou b { font-size: 20px; }
.sp__box { margin: 0; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--text) 6%, transparent); font-size: 13px; line-height: 1.6; color: var(--text-2); }
.sp__dlg .alert-scrim { z-index: 60; }
.sp__dlg .alert { z-index: 61; }
/* The phone layout (< 720): a list, each pane its own page. */
.sp__m { flex: 1; overflow-y: auto; padding: calc(env(safe-area-inset-top) + 10px) 0 40px; }
.sp__mback { display: flex; align-items: center; gap: 6px; padding: 6px 16px 0 !important; font-size: 16px !important; }
.sp__m h1 { margin: 0; padding: 8px 16px 14px; font-size: 32px; font-weight: 700; }
.sp__mcol { padding: 0 16px; display: flex; flex-direction: column; gap: 22px; }
.sp__m .sp__procard { padding: 16px !important; }
.sp__m .sp__procard .sp__protile { width: 40px; height: 40px; border-radius: 11px; }
.sp__m .sp__procard .sp__lbl b { font-size: 16px; }
.sp__m .sp__procard .sp__lbl span { font-size: 13px; }
.sp__m .sp__group > .sp__who { padding: 14px 16px; }
.sp__m .sp__who b { font-size: 16px; }
.sp__m .sp__row { font-size: 16px; }
.sp__tile { width: 30px; height: 30px; flex: none; border-radius: 8px; background: color-mix(in srgb, var(--text) 6%, transparent); display: flex; align-items: center; justify-content: center; }
.sp__foot { margin: 0; text-align: center; font-size: 12px; color: var(--text-2); }
.sp__m .sp__qr { display: none; }
.sp__m .sp__themes { grid-template-columns: repeat(2, 1fr); }
.sp__m .sp__slides, .sp__m .sp__viewport { width: 100%; }
.sp__m .sp__viewport { max-width: 390px; margin: 0 auto; }
/* The choice list (openListbox), like the date / time popovers. */
.pick--list { min-width: 200px; max-width: 320px; }
.pick--list .pick__in { padding: 6px; }
.pick__list { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.pick__item { min-height: 34px; padding: 0 10px !important; border-radius: 8px; display: flex; align-items: center; gap: 10px; font-size: 14px !important; text-align: left; }
.pick__item span { flex: 1; }
.pick__item:hover, .pick__item:focus-visible { background: var(--hover) !important; outline: none; }
.pick__item[aria-selected=true] { font-weight: 600; }

/* 已連結的 AI with none yet (design: iOS-AccountAINone): a sentence and 了解怎麼連結. */
.sp__row--text { align-items: flex-start; }
.sp__row--text .sp__lbl { gap: 6px; line-height: 1.45; }
.sp__inline { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; min-height: 32px; font-weight: 600; color: var(--accent); text-decoration: none; }
.sp__inline .sp__ext { width: 12px; height: 12px; }
