*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
/* Layout: one full-screen dotted canvas under a slim top bar; bubbles float on it, sheets and drawers slide over it. */
:root {
  --bg: #e7ecf1;
  --dot: #c3ccd7;
  --surface: #f8fafc;
  --line: #ccd5df;
  --fg: #18212c;
  --muted: #5a6878;
  --accent: #2b5bc4;
  --cool: #7f95b0;
  --hot: #e8661f;
  --overdue: #c61f33;
  --on-hot: #1a1108;
  --shadow: 0 10px 30px -12px rgba(24, 33, 44, 0.35);
  --ok: #2e8b62;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b;
    --dot: #222b37;
    --surface: #18202a;
    --line: #2b3644;
    --fg: #e5ebf2;
    --muted: #8e9bac;
    --accent: #8eaef2;
    --cool: #5d7696;
    --hot: #ff8a3d;
    --overdue: #ff4f61;
    --on-hot: #1b0e05;
    --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
    --ok: #4cc08a;
    color-scheme: dark;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f141b;
  --dot: #222b37;
  --surface: #18202a;
  --line: #2b3644;
  --fg: #e5ebf2;
  --muted: #8e9bac;
  --accent: #8eaef2;
  --cool: #5d7696;
  --hot: #ff8a3d;
  --overdue: #ff4f61;
  --on-hot: #1b0e05;
  --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  --ok: #4cc08a;
  color-scheme: dark;
}

html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
.bubble:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
}
/* Opened from the home screen, iOS can size the page as if Safari's bottom bar were still there,
   leaving an empty strip at the bottom. 100vh is the full screen there; in Safari itself 100% stays
   right, as it ends above the address bar. */
@media (display-mode: standalone) {
  html,
  body,
  .app {
    height: 100vh;
  }
}

/* Top bar */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px))
    10px calc(16px + env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: relative;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 22px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand h1 {
  min-width: 0;
}
.brand-btn {
  border: 0;
  background: transparent;
  padding: 2px 4px 2px 0;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  display: inline-flex;
  align-items: baseline;
  max-width: 100%;
  min-width: 0;
  border-radius: 8px;
}
.brand-btn #brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.brand-btn .dot-hot {
  color: var(--hot);
}
.brand-btn svg {
  width: 16px;
  height: 16px;
  margin-left: 4px;
  align-self: center;
  color: var(--muted);
  flex-shrink: 0;
}
.brand-btn:hover svg {
  color: var(--fg);
}
.summary {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.bar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 600;
  font-size: 14px;
}
.btn:hover {
  border-color: var(--muted);
}
.btn.primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
/* Deleting the account: red outline, and solid red for the final step */
.btn.danger {
  color: var(--overdue);
  border-color: color-mix(in srgb, var(--overdue) 45%, var(--line));
}
.btn.danger.solid {
  background: var(--overdue);
  color: #fff;
  border-color: var(--overdue);
}
.btn.danger:disabled {
  opacity: 0.45;
  cursor: default;
}
/* Manage subscription, when Plus has to be cancelled first: on its own line, apart from the text */
#delete-msg .btn {
  display: block;
  margin-top: 10px;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn.icon-only {
  padding: 7px 10px;
  position: relative;
}
.sync-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--muted);
}
.sync-dot[data-s="synced"] {
  background: var(--ok);
}
.sync-dot[data-s="syncing"],
.sync-dot[data-s="offline"] {
  background: var(--hot);
}
.sync-dot[data-s="error"] {
  background: var(--overdue);
}
/* Invitations to a shared canvas are waiting (see showInviteBadge in store.js) */
#btn-sync.invited::before,
#btn-canvas.invited::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
#btn-sync.invited::before {
  position: absolute;
  top: 3px;
  left: 3px;
  border: 2px solid var(--surface);
}
#btn-canvas.invited::after {
  align-self: center;
  margin-left: 4px;
  flex-shrink: 0;
}
.sync-dot[data-s="local"],
.sync-dot[data-s="signedout"],
.sync-dot[data-s="free"] {
  display: none;
}
.acct-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  margin: 0;
  font-size: 14px;
  color: var(--overdue);
}
.msg.good {
  color: var(--ok);
}
.msg.info {
  color: var(--fg);
}

/* Canvas */
/* The visible area; the canvas inside grows downward and scrolls when bubbles don't fit. */
.stage-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.scroller {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
}
.stage {
  position: relative;
  width: 100%;
  min-height: 100%;
  touch-action: pan-y;
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.4px);
  background-size: 24px 24px;
  background-position: 12px 12px;
  user-select: none;
  -webkit-user-select: none;
}
.glabel {
  position: absolute;
  left: 16px;
  z-index: 0;
  pointer-events: none;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 6px;
}
.glabel.late {
  color: var(--overdue);
}
.tidy-btn {
  position: absolute;
  right: 16px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  box-shadow: var(--shadow);
}
.more {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-size: 13px;
  padding: 5px 12px;
  box-shadow: var(--shadow);
}
.more.below {
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
}
.more.above {
  top: 10px;
}
/* "more below" moves up to leave room for the canvas dots and the name shown above them */
.stage-wrap.has-dots .more.below {
  bottom: calc(126px + env(safe-area-inset-bottom, 0px));
}
.stage-wrap.has-dots.dots-inline .more.below {
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
}

/* Canvas dots: one per canvas, like the pages of the iPhone home screen. Each dot's button fills
   its slot (--slot wide, 44px tall), so they're easy to hit; the pill behind them is smaller. */
.pager {
  position: absolute;
  left: 50%;
  bottom: calc(50px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 3;
}
.dots-inline .pager {
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.pager-dots {
  --slot: 18px;
  position: relative;
  isolation: isolate;
  display: flex;
  padding: 0 7px;
  touch-action: none;
}
.pager-dots::before {
  content: "";
  position: absolute;
  inset: 11px 0;
  z-index: -1;
  border-radius: 11px;
  background: color-mix(in oklch, var(--bg) 85%, transparent);
}
.pager-dots button {
  width: var(--slot);
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.pager-dots button::before {
  content: "";
  width: min(7px, calc(var(--slot) - 5px));
  aspect-ratio: 1;
  border-radius: 50%;
  background: color-mix(in oklch, var(--muted) 45%, transparent);
  transition: background 0.2s;
}
.pager-dots button[aria-selected="true"]::before {
  background: var(--fg);
}
.pager-dots button:focus-visible {
  outline: none;
}
.pager-dots button:focus-visible::before {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.pager-name {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  max-width: 70vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg);
  background: color-mix(in oklch, var(--bg) 85%, transparent);
  padding: 4px 10px;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.pager-name.show {
  opacity: 1;
  transition-duration: 0.1s;
}

.bubble {
  --c: color-mix(in oklch, var(--hot) var(--mix, 0%), var(--cool));
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(
      circle at 32% 28%,
      color-mix(in oklch, var(--c) var(--fill-hi, 30%), transparent),
      transparent 62%
    ),
    color-mix(in oklch, var(--c) var(--fill, 20%), var(--bg));
  border: 1.5px solid color-mix(in oklch, var(--c) var(--edge, 50%), transparent);
  color: var(--fg);
  cursor: grab;
  touch-action: none;
  transition:
    transform 0.28s cubic-bezier(0.3, 1.3, 0.5, 1),
    width 0.2s ease,
    height 0.2s ease,
    background 0.4s;
  will-change: transform;
}
.bubble.dragging,
.bubble.resizing {
  transition: none;
  cursor: grabbing;
  z-index: 5 !important;
}
.bubble.hot {
  color: var(--on-hot);
}
.bubble.overdue {
  --c: var(--overdue);
}
.bubble.someday {
  border-style: dashed;
}
.bubble.selected {
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 5px var(--accent),
    var(--shadow);
  z-index: 4;
}
.bubble.soon::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--c);
  opacity: 0;
  animation: ripple 2.4s ease-out infinite;
  pointer-events: none;
}
.bubble.overdue::after {
  animation-duration: 1.6s;
}
@keyframes ripple {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.32);
    opacity: 0;
  }
}
.bubble.flash {
  animation: flash 0.9s ease 2;
}
@keyframes flash {
  50% {
    box-shadow: 0 0 0 10px color-mix(in oklch, var(--accent) 35%, transparent);
  }
}

.inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25em;
  padding: 0 8%;
  max-width: 100%;
  pointer-events: none;
}
.name {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.due {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
  text-wrap: balance; /* wraps only in small bubbles when the label doesn't fit (longer in some languages) */
}

/* Draft bubble with input */
.draft {
  position: absolute;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
  z-index: 8;
  animation: grow 0.22s cubic-bezier(0.3, 1.4, 0.5, 1);
}
@keyframes grow {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
}
.draft form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 78%;
}
.draft input {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid var(--line);
  background: transparent;
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 16px;
  text-align: center;
  padding: 4px 0;
  outline: none;
}
.draft input:focus {
  border-bottom-color: var(--accent);
}
.draft button {
  border: 0;
  background: var(--accent);
  color: var(--surface);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
}

/* Resize handle and selection toolbar */
.handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
  cursor: nwse-resize;
  z-index: 6;
  touch-action: none;
  display: grid;
  place-items: center;
}
.handle::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
}
.handle svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
}
.toolbar {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 7;
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.toolbar button {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.toolbar button:hover {
  background: color-mix(in oklch, var(--fg) 8%, transparent);
}
.toolbar button svg {
  width: 15px;
  height: 15px;
}
.toolbar .done {
  color: var(--accent);
}
/* not enough room for the labels: icons only (each button keeps its aria-label) */
.toolbar.compact button > span {
  display: none;
}
/* Later: the dates to snooze to, wrapping onto a second line when the screen is narrow */
.toolbar.later {
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  max-width: calc(100% - 16px);
  border-radius: 22px;
}
.toolbar.later button {
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
  padding: 6px 11px;
}
.toolbar.later small {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  text-transform: uppercase;
}
.toolbar.later .back {
  color: var(--muted);
}

/* the date field, when the sheet opens for Pick a date… */
.field.flash .date-row {
  border-radius: 12px;
  animation: flash 0.9s ease 2;
}

.coach {
  position: absolute;
  z-index: 7;
  left: 0;
  top: 0;
  pointer-events: none;
  background: var(--fg);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

/* Empty state */
.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: 16px;
}
.empty-card {
  text-align: center;
  max-width: 34ch;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-ring {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 2px dashed var(--cool);
  display: grid;
  place-items: center;
  color: var(--muted);
  margin-bottom: 6px;
}
.empty-ring svg {
  width: 28px;
  height: 28px;
}
.empty h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 26px;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.empty .btn {
  pointer-events: auto;
  margin-top: 6px;
}
.loading {
  color: var(--muted);
  font-size: 14px;
}

/* Legend */
.legend {
  position: absolute;
  left: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: color-mix(in oklch, var(--bg) 85%, transparent);
  padding: 6px 10px;
  border-radius: 10px;
}
.legend .scale {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend .ramp {
  width: 72px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--cool), var(--hot) 80%, var(--overdue));
}
.legend .sizes {
  display: flex;
  align-items: center;
  gap: 4px;
}
.legend .sizes i {
  display: inline-block;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
}

/* The web app, closed during the iPhone-only beta (js/closed.js): over the app, under sheets and
   toasts, so the new-password sheet from an email link still opens on top. */
.closed {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px
    calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
}
.closed-card {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.closed-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.closed-card p {
  margin: 0;
  line-height: 1.5;
}
.closed-card a.btn {
  text-decoration: none;
}

/* Bottom sheet for due date and editing */
.scrim {
  position: fixed;
  inset: 0;
  background: color-mix(in oklch, var(--fg) 25%, transparent);
  z-index: 30;
}
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 31;
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow);
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* taller than the screen (the signed-in account panel on a phone): scroll inside the sheet,
     and stop below the status bar so the title and close button stay reachable */
  max-height: calc(100vh - 12px - env(safe-area-inset-top, 0px));
  max-height: calc(100dvh - 12px - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: rise 0.22s ease-out;
}
@keyframes rise {
  from {
    transform: translate(-50%, 30px);
    opacity: 0;
  }
}
.sheet h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 20px;
  letter-spacing: -0.01em;
}
/* Title with an x to close; stays at the top while a tall sheet scrolls */
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: -18px;
  z-index: 1;
  margin: -18px -16px -6px;
  padding: 18px 16px 6px;
  background: var(--surface);
}
.sheet-head .icon-btn {
  margin-right: -6px;
  color: var(--muted);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label,
.field .lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.field input[type="text"],
.field input[type="date"],
.field input[type="email"],
.field input[type="password"] {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  min-width: 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}
.chip small {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}
.chip:hover {
  border-color: var(--muted);
}
.chip.on {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 14%, var(--surface));
}
.date-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.date-row input {
  flex: 1 1 160px;
}
.lbl em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.chip:disabled,
.field input:disabled {
  opacity: 0.45;
  cursor: default;
}
.date-row input[type="time"] {
  flex: 1 1 110px;
}
.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
/* Links to the legal pages on the website, which sits one folder above the app */
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-right: auto;
  align-self: center;
  font-size: 13px;
}
.legal-links a,
.legal-note a {
  color: var(--muted);
}
.legal-links a:hover,
.legal-note a:hover {
  color: var(--fg);
}
.legal-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
/* Accepting the terms when creating an account */
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex: none;
  accent-color: var(--accent);
}
.check a {
  color: inherit;
}
.link-btn {
  align-self: flex-start;
  border: 0;
  background: none;
  padding: 2px 0;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover {
  color: var(--fg);
}
/* Delete account: a quiet red link at the bottom of Sync & backup, apart from the rest */
.acct-delete {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.link-btn.danger,
.link-btn.danger:hover {
  color: var(--overdue);
}

/* Upcoming drawer */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 100%);
  z-index: 31;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: slide 0.22s ease-out;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@keyframes slide {
  from {
    transform: translateX(30px);
    opacity: 0;
  }
}
.drawer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.drawer h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 20px;
}
.drawer ol {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}
.drawer li button {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px;
  border-radius: 10px;
}
.drawer li button:hover {
  background: var(--bg);
}
.drawer .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c);
  border: 1.5px solid var(--c);
}
.drawer .dot.someday {
  background: transparent;
  border-style: dashed;
  border-color: var(--cool);
}
.drawer .t {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.drawer .d {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.drawer .d.late {
  color: var(--overdue);
}
.drawer .group {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 14px 10px 4px;
}
.drawer .none {
  color: var(--muted);
  padding: 16px 10px;
}
.drawer footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.drawer footer .btn {
  flex-shrink: 0;
}
.note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
/* Sync & backup, signed in: room under "Signed in as" and under its buttons */
.acct-signed-in {
  margin-bottom: 10px;
}
/* and under a message there, such as what signing out does (the panel has no gap of its own) */
#acct-body > .msg {
  margin-bottom: 10px;
}
.field textarea {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  min-height: 120px;
  resize: vertical;
  min-width: 0;
}
.icon-btn {
  border: 0;
  background: transparent;
  padding: 6px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.icon-btn:hover {
  background: var(--bg);
}
.clist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 50vh;
  overflow-y: auto;
}
.clist li {
  display: flex;
  align-items: center;
  gap: 2px;
}
.clist .pick {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
}
.clist .pick:hover {
  background: var(--bg);
}
.clist .pick.on {
  background: color-mix(in oklch, var(--accent) 14%, var(--surface));
}
.clist .cn {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clist .ct {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.clist .co,
.clist .who {
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clist .who {
  flex: 1;
  font-size: 14px;
  color: var(--fg);
  padding: 8px 12px;
}
.invites {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.invites li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.clist small {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  flex-shrink: 0;
}
.clist .icon-btn svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  background: var(--fg);
  color: var(--bg);
  border-radius: 12px;
  padding: 10px 10px 10px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  font-size: 14px;
  animation: rise2 0.2s ease-out;
}
@keyframes rise2 {
  from {
    transform: translate(-50%, 12px);
    opacity: 0;
  }
}
.toast span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toast button {
  border: 0;
  background: transparent;
  color: var(--hot);
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
}

/* Pop effect */
.pop {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9;
  animation: pop 0.32s ease-out forwards;
}
@keyframes pop {
  to {
    transform: scale(1.35);
    opacity: 0;
  }
}
.spark {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9;
  animation: spark 0.5s ease-out forwards;
}
@keyframes spark {
  to {
    transform: translate(var(--dx), var(--dy)) scale(0.2);
    opacity: 0;
  }
}
.shrink {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9;
  animation: shrink 0.25s ease-in forwards;
}
@keyframes shrink {
  to {
    transform: scale(0.2);
    opacity: 0;
  }
}

@media (max-width: 560px) {
  .summary {
    display: none;
  }
  .btn .lbl-long {
    display: none;
  }
  .legend .sizes {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .bubble.soon::after {
    display: none;
  }
}
