/* ============ Liquid glass theme · Capricorn: midnight sky, stone and gold ============ */
/* (.wcard[data-wtheme] gives the widget studio's preview its own theme) */
:root, .wcard[data-wtheme="light"] {
  --bg: #ece8df;
  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.66);
  --glass-inset: rgba(255, 255, 255, 0.35);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-edge: rgba(255, 255, 255, 0.95);
  --glass-shade: rgba(30, 30, 50, 0.08);
  --hover: rgba(255, 255, 255, 0.5);
  --active: rgba(255, 255, 255, 0.78);
  --line: rgba(30, 32, 50, 0.09);
  --text: #161a2b;
  --muted: #5f6070;
  --faint: #a29f98;
  --accent: #a87414;
  --accent-2: #d7a443;
  --accent-soft: rgba(184, 132, 30, 0.15);
  --on-accent: #1c1606;
  --menu-bg: #f7f4ee;
  --night: linear-gradient(135deg, #1f2a52, #0a0f22);
  --p1: #e5383b;
  --p2: #f08a00;
  --p3: #2f6bff;
  --p4: #9a9db2;
  --green: #14a44d;
  --deadline: #a23cf0;
  --shadow: 0 20px 60px rgba(30, 40, 90, 0.18), 0 2px 10px rgba(30, 40, 90, 0.06);
  --blur: blur(28px) saturate(180%);
  --radius: 22px;
  --b1: #b7cdb0; --b2: #a8bcd8; --b3: #cfc6e2; --b4: #ecd29c;
  color-scheme: light;
}

:root[data-theme="dark"], .wcard[data-wtheme="dark"] {
  --bg: #060914;
  --glass: rgba(22, 28, 52, 0.45);
  --glass-strong: rgba(26, 32, 60, 0.78);
  --glass-inset: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-edge: rgba(255, 255, 255, 0.28);
  --glass-shade: rgba(0, 0, 0, 0.3);
  --hover: rgba(255, 255, 255, 0.07);
  --active: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.07);
  --text: #eef0f8;
  --muted: #a2a8c2;
  --faint: #646a88;
  --accent: #e6b85c;
  --accent-2: #f6dc96;
  --accent-soft: rgba(230, 184, 92, 0.17);
  --menu-bg: #161b33;
  --p1: #ff6b6b;
  --p2: #ffa632;
  --p3: #6b9bff;
  --p4: #6b6f88;
  --green: #3ddc84;
  --deadline: #c784ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.3);
  --b1: #22337a; --b2: #0f5363; --b3: #46246b; --b4: #6e5420;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { background: var(--bg); }
/* iOS 26 home-screen app bug (WebKit 301108): with viewport-fit=cover and the see-through status bar,
   a page no taller than the screen gets a viewport that stops short by the status bar's height, and
   fixed layers end there too, leaving a strip of bare background at the bottom. A page a touch taller
   than that gets the full screen, and then 100lvh caps it at exactly the screen so nothing scrolls. */
@media (display-mode: standalone) {
  html { min-height: min(100lvh, calc(100% + env(safe-area-inset-top))); }
}
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }
kbd {
  font-family: inherit; font-size: 11px; color: var(--muted); background: var(--glass-inset);
  border: 1px solid var(--glass-border); border-radius: 6px; padding: 1px 6px; margin-left: auto; white-space: nowrap;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::selection { background: var(--accent-soft); }

/* Hover looks are wrapped in (hover: hover): on phones a tap would leave them stuck on until you tap elsewhere. */

/* ---------- ambient backdrop ---------- */
.backdrop { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.75; animation: drift 28s ease-in-out infinite alternate; }
:root[data-theme="dark"] .blob { opacity: 0.45; }
.b1 { width: 46vw; height: 46vw; background: var(--b1); top: -12vw; left: -8vw; }
.b2 { width: 42vw; height: 42vw; background: var(--b2); bottom: -14vw; right: -6vw; animation-delay: -7s; }
.b3 { width: 34vw; height: 34vw; background: var(--b3); top: 30%; left: 38%; animation-delay: -14s; }
.b4 { width: 26vw; height: 26vw; background: var(--b4); bottom: 4%; left: 6%; animation-delay: -20s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, 4vh) scale(1.12); }
  100% { transform: translate(-4vw, -3vh) scale(0.94); }
}
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }

/* ---------- glass primitive ---------- */
.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-edge), inset 0 -1px 0 var(--glass-shade);
}
/* Specular rim: a light sheen that sits on the top-left edge of every glass panel. */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(135deg, var(--glass-edge), transparent 35%, transparent 70%, var(--glass-border));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.glass-inset {
  background: var(--glass-inset); border: 1px solid var(--glass-border); border-radius: 16px;
  box-shadow: inset 0 1px 0 var(--glass-edge);
}

/* ---------- connect ---------- */
.connect { position: relative; z-index: 1; min-height: 100%; display: grid; place-items: center; padding: 16px; }
.connect-card { width: 100%; max-width: 410px; padding: 34px; text-align: center; border-radius: 28px; }
.connect-card form { display: grid; gap: 10px; margin-top: 12px; }
.connect-tabs { display: flex; justify-content: center; margin: 14px auto 6px; width: fit-content; }
.connect-links { display: flex; justify-content: center; gap: 16px; }
.connect-links .link-btn { font: inherit; }
/* The account dialog and the recovery code */
.account-card p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.account-card .error { min-height: 0; color: var(--danger, #e5484d); }
.account-card .error:empty { display: none; }
.modal-card.account-card { max-height: 80dvh; overflow-y: auto; }
/* The rim and gloss are drawn at the card's first size and would scroll away with the content. */
.modal-card.account-card::before, .modal-card.account-card::after { display: none; }
.ask-choices { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.ask-choices legend { padding: 0 0 6px; font-size: 13px; font-weight: 600; }
.ask-choices label { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.35; cursor: pointer; }
.ask-card .ask-choices input { width: auto; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.ask-choices small { display: block; font-size: 12px; color: var(--muted); }
.field.account-setting { grid-template-columns: auto 1fr; margin-top: 4px; white-space: nowrap; }
.passkey-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.passkey-row span { min-width: 0; overflow-wrap: anywhere; }
.passkey-row small { display: block; font-size: 12px; color: var(--muted); }
.account-actions { display: grid; gap: 8px; }
.account-actions .btn { width: 100%; justify-content: center; }
.recovery-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; letter-spacing: .04em; text-align: center; padding: 12px; border-radius: 12px; background: var(--glass-inset); border: 1px solid var(--glass-border); user-select: all; overflow-wrap: anywhere; }
.connect-card input, .ask-card input, .field input, .field select, .comment-form input {
  padding: 10px 12px; border: 1px solid var(--glass-border); border-radius: 12px; background: var(--glass-inset); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.connect-card input:focus, .ask-card input:focus, .field input:focus, .field select:focus, .comment-form input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.hint { font-size: 12px; color: var(--muted); margin-top: 16px; }
.error { color: var(--p1); min-height: 1em; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 18px 0 4px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--glass-border); border-radius: 999px; padding: 8px 16px; font-weight: 600;
  background: var(--glass-inset); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: inset 0 1px 0 var(--glass-edge); transition: transform .12s, background .15s, box-shadow .15s; color: var(--text);
}
@media (hover: hover) { .btn:hover { background: var(--hover); } }
.btn:active { transform: scale(0.97); }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); border-color: transparent;
  box-shadow: 0 6px 18px var(--accent-soft), inset 0 1px 0 rgba(255,255,255,.4);
}
@media (hover: hover) { .btn.primary:hover { filter: brightness(1.06); } }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
@media (hover: hover) { .btn.ghost:hover { background: var(--hover); } }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
select.btn { appearance: none; padding-right: 14px; cursor: pointer; }
/* Native dropdown lists can't be see-through, so give them a solid themed background
   (otherwise Windows shows light text on a white list in dark mode). */
select { color-scheme: inherit; }
select option, select optgroup { background-color: var(--menu-bg); color: var(--text); }
.icon-btn {
  border: 0; background: transparent; border-radius: 10px; width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--muted); font-size: 15px; text-decoration: none; transition: background .15s;
}
@media (hover: hover) { .icon-btn:hover { background: var(--hover); color: var(--text); } }
.icon-btn.sm { width: 22px; height: 22px; font-size: 13px; border-radius: 7px; }
.link-btn { border: 0; background: none; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
@media (hover: hover) { .link-btn:hover { color: var(--text); background: var(--hover); } }
.seg { display: inline-flex; background: var(--glass-inset); border: 1px solid var(--glass-border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; color: var(--muted); font-size: 12.5px; font-weight: 500; transition: all .15s; }
.seg button.on { background: var(--glass-strong); color: var(--text); box-shadow: 0 2px 8px var(--glass-shade), inset 0 1px 0 var(--glass-edge); }

/* ---------- layout ---------- */
.app { position: relative; z-index: 1; display: flex; gap: 14px; height: 100vh; padding: 14px; overflow: hidden; }
.sidebar {
  width: 272px; flex-shrink: 0; padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
/* The views, projects and labels scroll between the fixed header and the timer; the list fades at its edges. */
.sidebar-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; position: relative;
  display: flex; flex-direction: column; gap: 3px; margin: 0 -12px; padding: 4px 12px 12px; scrollbar-width: none;
  mask-image: linear-gradient(transparent, #000 6px, #000 calc(100% - 14px), transparent);
}
.sidebar-scroll::-webkit-scrollbar { display: none; }
.sidebar-scroll > :not(.nav-pill) { position: relative; z-index: 1; }
.sidebar-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 0 6px 10px; }
/* The buttons always fit (the desktop app adds a fourth); the name gives way first. */
.head-icons { display: flex; flex: none; }
.head-icons .icon-btn { width: 29px; }
.sidebar-head .brand { flex: 1 1 auto; min-width: 0; gap: 7px; }
/* The name and the FREE tag sit side by side, and the tag drops under the name when there isn't room. */
.brand-name { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; column-gap: 3px; row-gap: 2px; min-width: 0; }
.brand-name .plan-tag { margin-left: 0; }
.brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 9px; letter-spacing: -0.01em; }
.brand.big { font-size: 26px; justify-content: center; margin-bottom: 6px; }
.brand .logo {
  width: 26px; height: 26px; border-radius: 9px; color: #f0cd7c; display: grid; place-items: center; font-size: 14px;
  background: var(--night); box-shadow: 0 4px 14px rgba(10, 15, 34, .35), inset 0 1px 0 rgba(246, 220, 150, .25), inset 0 0 0 1px rgba(233, 196, 106, .18);
}
.brand.big .logo { width: 40px; height: 40px; font-size: 21px; border-radius: 13px; }
/* Plan: a raised + on Capri+, a small spaced-out FREE tag on Free. */
.plus-mark {
  display: inline-block; margin-left: 1px; transform: translateY(-.3em); font-size: .85em; font-weight: 800;
  /* its own fill: the wordmark's gradient text doesn't reach a raised inline-block */
  background: linear-gradient(135deg, var(--plus-1), var(--plus-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* Capri+'s own colour, apart from the gold: the + and the badges on Capri+ features. */
:root { --plus-1: #6d4dff; --plus-2: #0fa3b8; }
:root[data-theme="dark"] { --plus-1: #9b85ff; --plus-2: #3fd8e8; }
:root[data-theme="capri"] { --plus-1: #39ff88; --plus-2: #2ee6d0; }
:root[data-theme="capri"] .plus-mark { filter: drop-shadow(0 0 4px rgba(57, 255, 136, .6)); }
.plus-chip {
  display: inline-flex; align-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; line-height: 1;
  padding: 2px 5px; border-radius: 6px; margin-left: 6px; color: #fff; flex: none; vertical-align: middle;
  background: linear-gradient(135deg, var(--plus-1), var(--plus-2));
}
:root[data-theme="capri"] .plus-chip { color: #04120a; }
.plus-gate {
  max-width: 420px; margin: 48px auto; padding: 26px 24px; text-align: center; border-radius: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.plus-gate h3 { margin: 0; font-size: 18px; }
.plus-actions { flex-wrap: wrap; }
.plus-actions [data-ask-cancel] { margin-right: auto; }
.plus-gate p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.plus-gate .plus-big { font-size: 30px; font-weight: 800; background: linear-gradient(135deg, var(--plus-1), var(--plus-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan-tag {
  font-family: "Chakra Petch", Inter, sans-serif; font-size: 8.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  line-height: 1; padding: 2px 3px 2px 4px; border-radius: 5px; margin-left: -2px; align-self: center; flex: none;
  color: var(--muted); border: 1px solid var(--glass-border); background: var(--glass-inset);
}
.wordmark {
  font-weight: 750; letter-spacing: -0.02em;
  background: linear-gradient(110deg, var(--text) 30%, var(--accent) 65%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.add-task-btn, .search-btn {
  display: flex; align-items: center; gap: 9px; border: 0; background: none; text-align: left;
  padding: 8px 10px; border-radius: 12px; color: var(--text); transition: background .15s;
}
.add-task-btn { font-weight: 600; color: var(--accent); }
.plus-badge {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
@media (hover: hover) { .add-task-btn:hover, .search-btn:hover { background: var(--hover); } }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group { margin-top: 14px; }
.nav-title {
  display: flex; justify-content: space-between; align-items: center; padding: 4px 10px;
  font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px;
  border: 1px solid transparent; background: none; text-align: left; width: 100%; color: var(--text); transition: background .15s;
}
@media (hover: hover) { .nav-item:hover { background: var(--hover); } }
.nav-item.active { background: var(--active); border-color: var(--glass-border); box-shadow: 0 2px 10px var(--glass-shade), inset 0 1px 0 var(--glass-edge); font-weight: 600; }
.nav-item.drop-hover { background: var(--accent-soft); border-color: var(--accent); }
.nav-item .ico { width: 18px; text-align: center; flex-shrink: 0; }
.nav-item .dot { width: 9px; height: 9px; border-radius: 50%; margin: 0 4px; flex-shrink: 0; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent); }
.nav-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-item .count.alert { color: #fff; background: var(--p1); padding: 0 7px; border-radius: 999px; font-weight: 600; }
/* The bottom of the sidebar: who's signed in (opens Account), then Sync and Sign out as icons. */
.sidebar-foot {
  flex-shrink: 0; margin-top: 10px; padding: 6px; display: flex; align-items: center; gap: 2px;
  border-radius: 16px; background: var(--glass-inset); border: 1px solid var(--glass-border);
}
.me {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px;
  border: 0; background: none; border-radius: 11px; color: var(--text); text-align: left; cursor: pointer; transition: background .15s;
}
@media (hover: hover) { .me:hover { background: var(--hover); } }
.me-avatar {
  position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; letter-spacing: 0;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 8px var(--glass-shade);
}
.me.is-plus .me-avatar, .me-avatar.plus { background: linear-gradient(135deg, var(--plus-1), var(--plus-2)); }
:root[data-theme="capri"] .me.is-plus .me-avatar, :root[data-theme="capri"] .me-avatar.plus { color: #04120a; }
/* A newer app is out: a dot on the picture, and the line under the name says so. */
.me.has-update .me-avatar::after {
  content: ""; position: absolute; top: -1px; right: -1px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--p1); box-shadow: 0 0 0 2px var(--menu-bg);
}
.me-text { min-width: 0; display: grid; line-height: 1.2; }
.me-text b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me.has-update .me-text small { color: var(--p1); font-weight: 600; }
.foot-btn { width: 32px; height: 32px; border-radius: 10px; }
.foot-btn .ic { width: 16px; height: 16px; }
#disconnect-btn:hover { color: var(--p1); background: color-mix(in srgb, var(--p1) 12%, transparent); }

/* The Account dialog: a header, then grouped rows. */
.modal-card.account-card { max-width: 440px; gap: 14px; }
.acct-head { display: flex; align-items: center; gap: 12px; }
.me-avatar.lg { width: 46px; height: 46px; font-size: 19px; }
.acct-who { flex: 1; min-width: 0; }
.acct-who h3 { margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-card .acct-who p { font-size: 12.5px; }
.acct-pill {
  flex: none; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 4px 9px; border-radius: 999px;
  color: var(--muted); background: var(--glass-inset); border: 1px solid var(--glass-border);
}
.acct-pill.plus { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--plus-1), var(--plus-2)); }
:root[data-theme="capri"] .acct-pill.plus { color: #04120a; }
.acct-section { display: grid; gap: 6px; }
.acct-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-left: 4px; }
.acct-group { border-radius: 14px; background: var(--glass-inset); border: 1px solid var(--glass-border); overflow: hidden; }
.acct-row {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 0; background: none;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .15s;
}
.acct-row + .acct-row { border-top: 1px solid var(--glass-border); }
@media (hover: hover) { .acct-row:not(.static):hover { background: var(--hover); } }
.acct-row:focus-visible { outline: none; background: var(--hover); box-shadow: inset 0 0 0 2px var(--accent-soft); }
.acct-row.static { cursor: default; }
.acct-row.wrap { flex-wrap: wrap; }
.acct-row.wrap .accent-swatches { flex-basis: 100%; padding-left: 39px; }
.acct-ic {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  color: var(--accent); background: var(--accent-soft);
}
.acct-ic .ic { width: 15px; height: 15px; }
.acct-row.plus .acct-ic { color: #fff; background: linear-gradient(135deg, var(--plus-1), var(--plus-2)); }
.acct-row.update .acct-ic { color: #fff; background: var(--p1); }
.acct-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.acct-txt b { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; }
.acct-txt small { font-size: 12px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.acct-go { flex: none; font-size: 12.5px; color: var(--muted); }
.acct-row.update .acct-go { color: var(--p1); font-weight: 600; }
.acct-chev { flex: none; width: 14px; height: 14px; color: var(--muted); opacity: .6; margin-left: -6px; }
.acct-warn { color: var(--p1); font-weight: 600; }
.acct-ok { color: var(--green); font-weight: 600; }
.acct-row .dd-btn { flex: none; width: auto; max-width: 48%; }
.bug-row { align-items: flex-start; }
.bug-box { flex: 1; min-width: 0; display: grid; gap: 8px; }
.bug-box textarea {
  width: 100%; min-height: 72px; max-height: 220px; resize: vertical; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); font-size: 13.5px; line-height: 1.4; outline: none;
}
.bug-box textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bug-box textarea:disabled { opacity: .6; }
.bug-actions { display: flex; align-items: center; gap: 10px; }
.bug-actions small { flex: 1; font-size: 12px; line-height: 1.35; color: var(--muted); }
.bug-actions small.acct-ok { color: var(--green); }
.bug-actions small.acct-warn { color: var(--p1); }
.bug-actions .btn { flex: none; padding: 7px 16px; }
.bug-actions .btn:disabled { opacity: .5; cursor: default; }
.ask-card .acct-row select {
  width: auto; max-width: 45%;
  flex: none; padding: 7px 10px; border: 1px solid var(--glass-border); border-radius: 10px; background: var(--glass-inset); color: var(--text); font: inherit; font-size: 12.5px;
}
.acct-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 2px; }
.btn.acct-signout { color: var(--p1); gap: 6px; }
.btn.acct-signout .ic { width: 15px; height: 15px; }
@media (hover: hover) { .btn.acct-signout:hover { background: color-mix(in srgb, var(--p1) 12%, transparent); border-color: color-mix(in srgb, var(--p1) 35%, transparent); } }
@media (max-width: 480px) { .acct-go { display: none; } }

/* focus timer */
.timer { margin-top: 8px; flex-shrink: 0; padding: 12px 14px; display: grid; gap: 6px; }
.timer-top { display: flex; justify-content: space-between; align-items: baseline; }
.timer-mode { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.timer.running .timer-mode { color: var(--accent); }
.timer.break .timer-mode { color: var(--green); }
.timer-time { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.timer-task { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-btns { display: flex; gap: 4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.main-head { display: flex; align-items: center; gap: 14px; padding: 22px 32px 14px; }
.main-head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.title-wrap { flex: 1; min-width: 0; }
#view-sub { font-size: 13px; margin-top: 2px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.menu-btn { display: none; }
/* Offline, or changes made offline still waiting to send. */
.net-pill { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; border: 1px solid var(--glass-border); background: var(--glass-inset);
  color: inherit; border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.net-pill .ic { width: 14px; height: 14px; opacity: .75; }
.net-pill.busy .ic { animation: net-spin 1s linear infinite; }
@keyframes net-spin { to { transform: rotate(360deg); } }
@media (max-width: 520px) { .net-pill span { display: none; } }
/* Today's progress: one segment per task due today, filled as they're done. */
.day-progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; max-width: 420px; }
.dp-track { flex: 1; display: flex; gap: 3px; height: 6px; min-width: 60px; }
.dp-seg { flex: 1; border-radius: 99px; background: var(--line); transition: background .4s ease; }
.dp-seg.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.dp-track.solid { background: var(--line); border-radius: 99px; overflow: hidden; }
.dp-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s ease; }
.dp-text { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dp-text b { color: var(--text); font-weight: 650; }
.day-progress.all .dp-text b { color: var(--green); }

/* ---- Schedule ---- */
.sched { display: grid; gap: 10px; padding-top: 4px; }
.sched-add { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 16px; border-radius: 18px; }
.sched-add .btn { flex-shrink: 0; align-self: center; }
#sched-input { flex: 1; border: 0; background: none; outline: none; resize: none; font: inherit; font-size: 15px; line-height: 1.5; padding: 5px 0; color: var(--text); max-height: 220px; -webkit-user-select: text; user-select: text; }
.sched-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.sched-preview:empty { display: none; }
.sp { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: var(--glass-inset); border: 1px solid var(--glass-border); }
.sp .ic { width: 13px; height: 13px; }
.sp.ok { color: var(--muted); } .sp.ok b { color: var(--text); font-weight: 600; } .sp.ok .ic { color: var(--accent); }
.sp.bad { color: var(--p1); }
.sched-sum { padding: 0 4px; }
.sched-scroll { max-height: max(320px, calc(100dvh - 380px)); overflow-y: auto; overscroll-behavior: contain; padding: 10px 4px 10px 0; border-radius: 16px;
  mask-image: linear-gradient(transparent, #000 10px, #000 calc(100% - 14px), transparent); }
.sched-grid { position: relative; cursor: copy; }
.sched-hour { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.sched-hour span { position: absolute; left: 0; top: -8px; width: 48px; font-size: 11px; color: var(--muted); background: transparent; font-variant-numeric: tabular-nums; }
.sblock {
  position: absolute; border-radius: 12px; padding: 6px 10px; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--accent) 16%, var(--glass-strong)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-left: 4px solid var(--accent); box-shadow: 0 2px 10px var(--glass-shade); transition: transform .15s, opacity .2s;
}
@media (hover: hover) { .sblock:hover { transform: translateX(2px); } }
.sb-title { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.sb-title .ic { width: 13px; height: 13px; flex-shrink: 0; }
.sb-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.sblock.short { display: flex; align-items: center; gap: 8px; padding-top: 2px; padding-bottom: 2px; }
.sblock.short .sb-time { flex-shrink: 1; }
.sblock.now { background: color-mix(in srgb, var(--accent) 28%, var(--glass-strong)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent), 0 6px 20px var(--accent-soft); }
.sblock.past { opacity: .5; }
.sblock.done { opacity: .5; border-left-color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--glass-strong)); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.sblock.done .sb-title { text-decoration: line-through; }
.sblock.menu-on { outline: 2px solid var(--accent); outline-offset: 2px; }
.sched-now { position: absolute; left: 48px; right: 0; height: 2px; background: var(--p1); z-index: 2; pointer-events: none; border-radius: 2px; }
.sched-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--p1); }
.sched-empty { text-align: center; font-size: 13px; padding: 0 0 24px 56px; }
.sched-days .ic { width: 14px; height: 14px; }
.sched-banner { color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.sched-banner b { font-weight: 650; margin: 0 2px; color: var(--text); }
.sched-banner.now { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
/* One sentence that wraps as a whole on narrow screens, instead of each piece squeezing into its own column. */
.sched-banner .sb-text { flex: 1; min-width: 0; }
.sched-banner .sb-go { white-space: nowrap; }
.sched-banner .ic { flex-shrink: 0; }
:root[data-theme="capri"] .sblock.now { box-shadow: 0 0 0 2px rgba(255, 46, 92, .5), 0 0 18px rgba(255, 46, 92, .45); }

/* schedule tabs, the right-now card and the schedule editor */
.sched-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.stab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--glass-border); background: var(--glass-inset); font-weight: 600; font-size: 13px; color: var(--text); }
.stab .ic { width: 14px; height: 14px; }
.stab-days { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.stab.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.stab.on .stab-days { color: inherit; opacity: .8; }
.stab.add { color: var(--accent); border-style: dashed; background: transparent; }
@media (hover: hover) { .stab:not(.on):hover { background: var(--hover); } }
.stab { transition: background .25s, border-color .25s, color .25s; }
.stab.on.gliding { background: var(--glass-inset); border-color: var(--glass-border); color: var(--text); transition: none; }
.stab-glide { position: fixed; z-index: 30; pointer-events: none; box-sizing: border-box; border-radius: 99px; background: var(--accent-soft); border: 1px solid var(--accent); }
.sched-hero { padding: 18px 20px; border-radius: 22px; display: grid; gap: 6px; }
.sh-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sh-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sched-hero.now .sh-label { color: var(--accent); }
.sh-from { font-size: 12px; color: var(--muted); }
.sh-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.sh-left { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sh-left b { color: var(--text); font-size: 17px; font-weight: 700; }
.sched-hero.now .sh-left b { color: var(--accent); }
.sh-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 4px 0 2px; }
.sh-bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1s linear; }
.sh-next { font-size: 13px; color: var(--muted); }
.sh-next b { color: var(--text); font-weight: 600; }
.sched-using { padding: 0 4px; }
.sched-using a { color: var(--accent); font-weight: 600; text-decoration: none; }
.sblock.oneoff { border-left-style: dashed; }
.tpl-head { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: center; padding: 14px 16px; border-radius: 20px; }
.tpl-name { border: 0; background: none; outline: none; font: inherit; font-size: 20px; font-weight: 700; color: var(--text); min-width: 0; padding: 2px 0; }
.tpl-name:focus { box-shadow: 0 2px 0 var(--accent); }
.tpl-days { display: flex; gap: 5px; grid-column: 1 / -1; flex-wrap: wrap; }
.tday { position: relative; width: 42px; height: 36px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--glass-inset); font-weight: 650; font-size: 13px; color: var(--muted); }
.tday.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent, #fff); border-color: transparent; box-shadow: 0 3px 10px var(--accent-soft); }
.tday i { position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: .6; }
.tpl-meta { grid-column: 1; }
.tpl-head .danger { grid-column: 2; grid-row: 1; }
@media (max-width: 760px) { .sh-title { font-size: 21px; } .tday { width: 38px; } }
:root[data-theme="capri"] .sh-bar > span { box-shadow: 0 0 8px rgba(255, 46, 92, .6); }

/* ---- Focus view ---- */
.focus-card { padding: 22px 24px; border-radius: 24px; margin: 6px auto 22px; display: grid; gap: 14px; }
.fc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fc-mode { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.focus-card.running .fc-mode { color: var(--accent); }
.focus-card.break .fc-mode { color: var(--green); }
.fc-sessions { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.fc-sessions i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.fc-task { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; overflow-wrap: anywhere; }
.fc-task.empty-pick { color: var(--muted); font-weight: 500; font-size: 16px; }
.fc-task-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.fc-clock { display: flex; align-items: center; gap: 16px; }
.fc-time { font-size: 46px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1; }
.fc-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.fc-bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1s linear; }
.focus-card.break .fc-bar > span { background: var(--green); }
.fc-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.fc-btns .btn .ic { width: 15px; height: 15px; }
.task .focus-pick { flex-shrink: 0; align-self: center; }
.task.focus-row .task-actions { display: none; } /* the Focus button takes their place */
.task .focus-pick .ic { width: 13px; height: 13px; }
@media (max-width: 760px) { .fc-time { font-size: 38px; } .focus-card { padding: 18px; } }
.view { flex: 1; overflow-y: auto; padding: 4px 32px 100px; }
.view > * { max-width: 860px; margin-left: auto; margin-right: auto; }
.view.wide > * { max-width: none; }

/* ---------- task list ---------- */
.group { margin-bottom: 22px; border-radius: 16px; transition: background .15s, box-shadow .15s; }
.group.drop-hover { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.group-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; margin-bottom: 4px;
  font-weight: 700; font-size: 14px; position: sticky; top: 4px; z-index: 2; cursor: default;
  border: 1px solid var(--glass-border); border-radius: 14px;
  background: var(--glass-strong); box-shadow: 0 4px 14px var(--glass-shade), inset 0 1px 0 var(--glass-edge);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.group-head .caret { border: 0; background: none; color: var(--muted); width: 18px; padding: 0; transition: transform .2s; font-size: 10px; }
.group.collapsed .caret { transform: rotate(-90deg); }
.group.collapsed .group-body { display: none; }
.group-head .muted { font-weight: 500; font-size: 12px; }
.group-head.overdue { color: var(--p1); }
.group-head.deadline { color: var(--deadline); }
.task {
  display: flex; gap: 12px; align-items: flex-start; padding: 11px 10px; margin: 3px 0;
  cursor: pointer; border-radius: 14px; position: relative; border: 1px solid transparent; transition: background .15s, border-color .15s, box-shadow .15s;
}
@media (hover: hover) { .task:hover { background: var(--hover); border-color: var(--glass-border); } }
.task.selected { background: var(--active); border-color: var(--glass-border); box-shadow: 0 4px 16px var(--glass-shade), inset 0 1px 0 var(--glass-edge); }
.task.picked { background: var(--accent-soft); border-color: var(--accent); }
.task.dragging { opacity: 0.4; }
.task.done-anim { animation: done .45s ease forwards; }
@keyframes done { 50% { opacity: .6; transform: scale(.98); } 100% { opacity: 0; transform: translateX(24px); } }
.check {
  width: 20px; height: 20px; border-radius: 50%; border: 1.8px solid var(--p4); background: transparent;
  flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; color: transparent; font-size: 11px; padding: 0; transition: all .15s;
}
.check.p1 { border-color: var(--p1); background: color-mix(in srgb, var(--p1) 14%, transparent); }
.check.p2 { border-color: var(--p2); background: color-mix(in srgb, var(--p2) 14%, transparent); }
.check.p3 { border-color: var(--p3); background: color-mix(in srgb, var(--p3) 14%, transparent); }
@media (hover: hover) { .check:hover { color: var(--muted); transform: scale(1.1); } }
.check.p1:hover { color: var(--p1); } .check.p2:hover { color: var(--p2); } .check.p3:hover { color: var(--p3); }
.check.checked { background: var(--green); border-color: var(--green); color: #fff; }
.task-body { flex: 1; min-width: 0; }
.task-content { line-height: 1.4; word-wrap: break-word; font-weight: 500; }
.task-content code { background: var(--glass-inset); padding: 0 4px; border-radius: 5px; font-size: 12.5px; }
.task-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 5px; font-size: 12px; color: var(--muted); align-items: center; }
.meta .due { display: inline-flex; gap: 4px; align-items: center; }
.meta .due.overdue { color: var(--p1); }
.meta .due.today { color: var(--green); }
.meta .due.tomorrow { color: var(--p2); }
.dl {
  display: inline-flex; gap: 4px; align-items: center; padding: 1px 8px; border-radius: 999px; font-weight: 600; font-size: 11.5px;
  color: var(--deadline); background: color-mix(in srgb, var(--deadline) 13%, transparent);
}
.dl.soon { color: var(--p2); background: color-mix(in srgb, var(--p2) 15%, transparent); }
.dl.urgent, .dl.overdue { color: #fff; background: var(--p1); }
.warn { color: var(--p1); font-weight: 600; }
.meta .label { --lc: var(--muted); color: color-mix(in srgb, var(--lc) 80%, var(--text)); background: color-mix(in srgb, var(--lc) 13%, transparent);
  padding: 0 7px; border-radius: 99px; font-weight: 550; }
.meta .proj { margin-left: auto; display: inline-flex; gap: 5px; align-items: center; }
.meta .proj .dot { width: 7px; height: 7px; border-radius: 50%; }
.task-actions {
  position: absolute; right: 8px; top: 8px; display: flex; gap: 2px; opacity: 0; pointer-events: none; transition: opacity .12s;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 10px; padding: 2px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 4px 14px var(--glass-shade);
}
@media (hover: hover) { .task:hover .task-actions { opacity: 1; pointer-events: auto; } }
.task-actions .icon-btn { width: 28px; height: 26px; font-size: 13px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 44px; margin-bottom: 10px; }
.inline-add {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; color: var(--muted); border: 0;
  background: none; width: 100%; text-align: left; border-radius: 12px;
}
@media (hover: hover) { .inline-add:hover { color: var(--accent); background: var(--hover); } }
.inline-add .plus { color: var(--accent); font-size: 16px; width: 20px; text-align: center; }
.banner {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; margin-bottom: 16px; cursor: pointer;
  background: color-mix(in srgb, var(--deadline) 12%, transparent); border: 1px solid color-mix(in srgb, var(--deadline) 30%, transparent);
  color: var(--deadline); font-weight: 600; font-size: 13px;
}

/* ---------- board ---------- */
/* The view scrolls both ways rather than the board having its own sideways scroller: WebKit draws a
   hazy band over a scroller nested inside the glass panel. */
.view.board-view { overflow-x: hidden; }
.board { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 20px; }
.board > .column { width: var(--lane-w, 290px); }
.lane { display: flex; flex-direction: column; gap: 14px; flex: 0 0 var(--lane-w, 290px); min-width: 0; }
.column { box-shadow: 0 6px 18px var(--glass-shade), inset 0 1px 0 var(--glass-edge); }
.column { width: 100%; flex-shrink: 0; padding: 10px; display: flex; flex-direction: column; transition: outline-color .15s, background-color .15s; outline: 2px dashed transparent; outline-offset: -2px; }
.column .group-head, :root[data-theme] .board .column .group-head { position: static; border: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; padding: 12px 10px 10px; }
.column .group-head.today { color: var(--accent); }
.group-head.menu-on:is([data-section], [data-move]) { color: var(--accent); }
.board .group-head[data-move] { cursor: grab; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.board { position: relative; }
.column.col-source { opacity: .45; transition: opacity .15s; }
.col-tag { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px;
  font-weight: 700; font-size: 13px; color: var(--text); background: var(--glass-strong); border: 1px solid var(--accent);
  box-shadow: 0 14px 34px var(--glass-shade); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.col-tag svg { width: 15px; height: 15px; color: var(--accent); }
.col-tag.no-drop { border-color: var(--glass-border); }
.col-marker { position: fixed; z-index: 89; pointer-events: none; border-radius: 4px; background: var(--accent); box-shadow: 0 0 12px var(--accent); opacity: 0; transition: opacity .12s, left .1s, top .1s; }
.col-marker.on { opacity: 1; }
.arrange-list { position: relative; display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; padding: 2px; }
.arrange-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--glass-inset); border: 1px solid var(--glass-border);
  cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; font-weight: 600; font-size: 14px; }
.arrange-row .grip { color: var(--muted); letter-spacing: -2px; }
.arrange-row.lifted { position: relative; z-index: 2; cursor: grabbing; border-color: var(--accent); box-shadow: 0 10px 24px var(--glass-shade); background: var(--glass-strong); }
body.col-sorting, body.col-sorting * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.column .group-head.p1 { color: var(--p1); }
.column .group-head.p2 { color: var(--p2); }
.column .group-head.p3 { color: var(--p3); }
.column .task { background: var(--glass-strong); border-color: var(--glass-border); box-shadow: 0 2px 8px var(--glass-shade), inset 0 1px 0 var(--glass-edge); margin-bottom: 8px; }
.column.drop-target { outline-color: var(--accent); background-color: var(--accent-soft); }
.column.no-drop .col-body { min-height: 0; }
.col-body { min-height: 40px; }
.col-empty { border: 1px dashed var(--glass-border); border-radius: 12px; padding: 14px; text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.add-col { justify-content: center; align-items: center; flex-direction: row; gap: 6px; min-height: 64px; border: 1px dashed var(--glass-border); border-radius: 18px; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
@media (hover: hover) { .add-col:hover { color: var(--accent); border-color: var(--accent); } }
/* A card picked up with a long press follows the finger. */
.card-ghost { position: fixed; z-index: 80; margin: 0; pointer-events: none; box-shadow: 0 18px 40px var(--glass-shade); background: var(--glass-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); transition: none; }
#view.carrying { overflow: hidden; }
@media (hover: none) {
  /* Or iOS starts selecting the text under a held finger, and that ends the drag. */
  .task { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
}

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px 18px; border-radius: 18px; }
.stat .num { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.stat .lbl { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.alert .num { color: var(--p1); }
.stat.dl-stat .num { color: var(--deadline); }
.card { padding: 18px 20px; margin-bottom: 16px; border-radius: 20px; }
.card h3 { margin: 0 0 12px; font-size: 14px; }
.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 130px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 38px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-radius: 8px 8px 3px 3px; min-height: 3px; box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.bar-col .v, .bar-col .d { font-size: 11px; color: var(--muted); }
.proj-rows { display: grid; gap: 9px; }
.proj-row { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
.proj-row .track { height: 8px; background: var(--glass-inset); border-radius: 4px; overflow: hidden; }
.proj-row .fill { height: 100%; border-radius: 4px; }
.proj-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- sketches ---------- */
.sketch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.sketch { padding: 8px; border-radius: 18px; cursor: pointer; transition: transform .15s; }
@media (hover: hover) { .sketch:hover { transform: translateY(-2px); } }
.sketch img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fffdf8; border-radius: 12px; display: block; }
.sketch img, .thumb img { filter: var(--sketch-filter, none); }
.sketch .note-paper {
  aspect-ratio: 4 / 3; background: var(--paper); color: var(--text); border: 1px solid var(--glass-border); border-radius: 12px; padding: 12px 14px; overflow: hidden;
  font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  mask-image: linear-gradient(#000 70%, transparent);
}
.sketch .note-paper:empty::before { content: 'Empty note'; color: var(--muted); font-style: italic; }
.sketch.menu-on { outline: 2px solid var(--accent); outline-offset: 2px; }
.sketch-grid .new-pair { display: grid; gap: 14px; }
.sketch-grid .new-pair .sketch.new { min-height: 0; }
.thumb.text { display: grid; place-items: center; background: var(--paper); color: var(--accent); }
.thumb.text .ic { width: 18px; height: 18px; }
.sketch .s-title { font-weight: 600; font-size: 13px; padding: 8px 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sketch .s-sub { font-size: 11.5px; color: var(--muted); padding: 2px 4px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sketch.new { display: grid; place-items: center; min-height: 200px; color: var(--accent); font-weight: 600; border: 2px dashed var(--glass-border); background: transparent; box-shadow: none; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { width: 92px; height: 70px; border-radius: 10px; overflow: hidden; border: 1px solid var(--glass-border); background: #fffdf8; cursor: pointer; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.add { background: var(--glass-inset); color: var(--accent); font-size: 20px; display: grid; place-items: center; }

/* ---------- detail drawer ---------- */
.detail {
  width: 430px; flex-shrink: 0; overflow-y: auto; padding: 18px 22px 40px; display: flex; flex-direction: column; gap: 14px;
  animation: slide-in .22s ease;
}
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } }
/* When everything doesn't fit (a short window), the drawer scrolls instead of squashing its parts:
   left to shrink, the description box went down to a sliver. */
.detail > * { flex-shrink: 0; }
.detail textarea.desc { min-height: 84px; max-height: 50vh; overflow-y: auto; field-sizing: content; resize: vertical; } /* grows with its text where supported */
.detail-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; gap: 8px; }
.detail-top > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-title { display: flex; gap: 10px; align-items: flex-start; }
.detail-title textarea, .detail textarea.desc {
  width: 100%; border: 1px solid transparent; background: none; resize: none; border-radius: 10px; padding: 4px 8px; outline: none;
}
.detail-title textarea { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.detail-title textarea:focus, .detail textarea.desc:focus { border-color: var(--glass-border); background: var(--glass-inset); }
.date-block { padding: 12px; display: grid; gap: 8px; }
.date-block.deadline-block { border-color: color-mix(in srgb, var(--deadline) 35%, var(--glass-border)); }
.date-block .bh { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.deadline-block .bh { color: var(--deadline); }
.date-block .bh .countdown { margin-left: auto; text-transform: none; letter-spacing: 0; }
.date-row { display: flex; gap: 6px; }
.date-row input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--glass-border); border-radius: 10px; background: var(--glass-inset); outline: none; }
.date-row input[type="date"] { flex: 0 0 140px; }
.date-row input:focus { border-color: var(--accent); }
.quick-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.qchip {
  border: 1px solid var(--glass-border); background: var(--glass-inset); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--muted);
}
@media (hover: hover) { .qchip:hover { color: var(--text); background: var(--hover); } }
.field { display: grid; grid-template-columns: 80px 1fr; gap: 10px; align-items: center; font-size: 13px; }
.field > span { color: var(--muted); }
.field input, .field select { width: 100%; }
.prio-pick { display: flex; gap: 6px; }
.prio-pick button { flex: 1; border: 1px solid var(--glass-border); background: var(--glass-inset); border-radius: 10px; padding: 6px 0; font-weight: 700; font-size: 12px; transition: all .15s; }
.prio-pick button.on { border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--glass-border); background: var(--glass-inset); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.section-title { font-weight: 650; font-size: 13px; margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.subtask-list .task { padding: 7px 6px; }
.comments { display: grid; gap: 8px; }
.comment { background: var(--glass-inset); border: 1px solid var(--glass-border); border-radius: 12px; padding: 8px 11px; font-size: 13px; white-space: pre-wrap; }
.comment .when { color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.comment-form { display: flex; gap: 6px; }
.comment-form input { flex: 1; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.danger { color: var(--p1) !important; }

/* ---------- modals ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(10, 12, 30, 0.25); display: flex; justify-content: center;
  align-items: flex-start; padding: 12vh 16px 16px; z-index: 50; animation: fade .15s ease;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
@keyframes fade { from { opacity: 0; } }
.modal-card { width: 100%; max-width: 640px; overflow: hidden; border-radius: 26px; background: var(--glass-strong); animation: rise .2s ease; }
@keyframes rise { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.ask-card { max-width: 400px; padding: 18px; display: grid; gap: 12px; }
.ask-card h3 { margin: 0; font-size: 16px; }
.ask-card input { width: 100%; }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; }
.quick-card { padding: 16px 18px; display: grid; gap: 8px; }
.quick-card input, .quick-card textarea { border: 0; background: none; outline: none; resize: none; }
/* The title is the headline, on its own underlined row; the description is a quieter note beneath it. */
.qi-wrap { position: relative; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
/* !important beats the phones' 16px input floor, which would shrink the input but not its highlight mirror. */
.qi-wrap input, .qi-mirror { font-size: 22px !important; font-weight: 700; padding: 3px 0; margin: 0; width: 100%; letter-spacing: normal; line-height: 1.4; }
.qi-wrap input { position: relative; z-index: 1; background: transparent; }
.qi-mirror { position: absolute; inset: 0; white-space: pre; overflow: hidden; color: transparent; pointer-events: none; }
.qi-mirror mark { color: transparent; border-radius: 6px; box-shadow: 0 0 0 2px var(--mk); background: var(--mk); }
.hl-date { --mk: color-mix(in srgb, var(--green) 24%, transparent); }
.hl-proj { --mk: color-mix(in srgb, var(--p3) 22%, transparent); }
.hl-label { --mk: color-mix(in srgb, var(--accent) 20%, transparent); }
.hl-prio { --mk: color-mix(in srgb, var(--p2) 24%, transparent); }
.hl-dl { --mk: color-mix(in srgb, var(--deadline) 24%, transparent); }
.quick-preview .chip.datec { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.chip-x { border: 0; background: none; color: inherit; padding: 0; margin-left: 2px; display: grid; place-items: center; opacity: .7; }
@media (hover: hover) { .chip-x:hover { opacity: 1; } }
.chip-x .ic { width: 12px; height: 12px; }
.quick-card textarea { color: var(--muted); font-size: 13.5px; line-height: 1.5; padding: 2px 0; }
.quick-dates { display: flex; gap: 8px; flex-wrap: wrap; }
.date-pill {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--glass-border); background: var(--glass-inset);
  border-radius: 999px; padding: 3px 4px 3px 12px; font-size: 12.5px; color: var(--muted); font-weight: 500; cursor: pointer;
}
.date-pill.deadline { color: var(--deadline); }
.date-pill input { border: 0 !important; background: none; font-size: 12.5px; padding: 3px 6px; outline: none; color: var(--text); }
.quick-preview { display: flex; flex-wrap: wrap; gap: 6px; min-height: 4px; }
.quick-preview .chip { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 500; }
.quick-preview .chip.dlc { background: color-mix(in srgb, var(--deadline) 15%, transparent); color: var(--deadline); }
.quick-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; gap: 10px; flex-wrap: wrap; }
.palette-card input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 18px 20px; font-size: 17px; background: none; outline: none; }
/* The card stops where the screen does, keyboard included (--vvh), and only its list scrolls. */
.palette-card { display: flex; flex-direction: column; max-height: calc(var(--vvh, 100dvh) - 12vh - 16px); }
.palette-card input { flex: none; }
.palette-results { flex: 1 1 auto; min-height: 0; max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 8px; }
.pal-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.pal-item.on { background: var(--active); box-shadow: inset 0 1px 0 var(--glass-edge); }
.pal-item .kind { font-size: 11px; color: var(--muted); margin-left: auto; text-transform: uppercase; letter-spacing: .04em; }
.pal-head { font-size: 11px; color: var(--muted); padding: 8px 12px 4px; text-transform: uppercase; letter-spacing: .06em; }
.help-card { padding: 22px 26px; max-width: 520px; }
.help-card h3 { margin: 0 0 14px; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; align-items: center; font-size: 13px; }
.help-grid kbd { margin: 0; justify-self: start; }
.help-global { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.help-global h4 { margin: 0 0 8px; font-size: 13px; }
.gs-row { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 12px; align-items: center; padding: 6px 0; font-size: 13px; }
.gs-keys { font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--glass-border); background: var(--glass-inset); color: var(--text); cursor: pointer; min-width: 92px; }
.gs-keys.recording { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--accent); }
.gs-row.off .gs-keys { opacity: .45; }
.gs-note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -2px; }
.gs-note.warn { color: var(--p1); }
.gs-note button { border: 0; background: none; color: var(--accent); padding: 0; font: inherit; cursor: pointer; }

/* drawing pad */
.draw-modal { padding: 3vh 16px; align-items: center; }
.draw-card { max-width: 1100px; height: 92vh; display: flex; flex-direction: column; }
.draw-head { display: flex; gap: 8px; align-items: center; padding: 14px 16px 8px; flex-wrap: wrap; }
.draw-head input { flex: 1; min-width: 140px; border: 0; background: none; font-size: 18px; font-weight: 650; outline: none; }
.draw-head select { max-width: 220px; }
.draw-tools { display: flex; gap: 10px; align-items: center; padding: 6px 16px 12px; flex-wrap: wrap; }
.swatches { display: flex; gap: 5px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--glass-border); padding: 0; box-shadow: inset 0 1px 2px rgba(0,0,0,.2); }
.swatch.on { outline: 2px solid var(--accent); outline-offset: 2px; }
#draw-size { width: 110px; accent-color: var(--accent); }
.canvas-wrap { flex: 1; margin: 0 16px 16px; border-radius: 18px; overflow: hidden; background: #fffdf8; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); position: relative; }
#draw-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; background: #fffdf8; }
.note-card { max-width: 820px; }
.note-body {
  flex: 1; margin: 0 16px 16px; padding: 18px 20px; border: 0; border-radius: 18px; resize: none; outline: none;
  background: var(--paper); color: var(--text); box-shadow: inset 0 0 0 1px var(--glass-border);
  font: inherit; font-size: 15px; line-height: 1.6; -webkit-user-select: text; user-select: text;
}

/* ---------- bulk bar & toasts ---------- */
.bulk {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 45; display: flex; gap: 6px; align-items: center;
  padding: 8px 10px 8px 16px; border-radius: 999px; background: var(--glass-strong); animation: rise .2s ease; flex-wrap: wrap; max-width: calc(100vw - 32px);
}
#bulk-count { font-weight: 650; margin-right: 6px; }
/* Toasts sit in a pile (see layoutToasts): see-through glass cards, the newest in front. */
.toasts { position: fixed; bottom: 22px; right: 22px; width: min(340px, calc(100vw - 32px)); z-index: 60; transition: height .3s var(--ease-out, ease); }
.toast {
  position: absolute; left: 0; right: 0; bottom: 0; transform-origin: bottom center;
  background: color-mix(in srgb, var(--glass-strong) 62%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid var(--glass-border); color: var(--text); padding: 12px 16px; border-radius: 18px; box-shadow: var(--shadow);
  display: flex; gap: 14px; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 500; cursor: default;
  transition: transform .38s var(--ease-out, cubic-bezier(.2, .8, .2, 1)), opacity .3s ease;
}
.toast span { min-width: 0; overflow-wrap: anywhere; }
.toast.behind > * { opacity: 0; transition: opacity .2s; } /* only the front card's words show in the pile */
.toast.behind { box-shadow: 0 6px 18px var(--glass-shade); }
.toasts:not(.fanned) .toast.behind { pointer-events: none; }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .detail { position: fixed; right: 14px; top: 14px; bottom: 14px; z-index: 40; max-width: calc(100vw - 28px); background: var(--glass-strong); }
}
@media (max-width: 760px) {
  .app { padding: 8px; gap: 8px; }
  .sidebar { position: fixed; inset: 8px auto 8px 8px; z-index: 45; transform: translateX(-110%); transition: transform .25s; background: var(--glass-strong); }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid; }
  .main-head { padding: 14px 16px 8px; flex-wrap: wrap; }
  /* Keep room for the title; buttons that don't fit drop to their own line. */
  .title-wrap { flex-basis: 180px; }
  .view { padding: 4px 12px 100px; }
  .detail { right: 8px; top: 8px; bottom: 8px; width: calc(100vw - 16px); }
  .proj-row { grid-template-columns: 100px 1fr 32px; }
  .cards-2 { grid-template-columns: 1fr; }
  .toasts { left: 16px; right: 16px; width: auto; }
  kbd { display: none; }
  .help-grid kbd { display: inline; }
}

/* Home-screen app on a phone: keep clear of the notch/status bar and the home bar.
   env() is 0 everywhere else, so desktop and normal browser tabs are unchanged. */
.app { height: 100dvh; }
@media (max-width: 760px) {
  .app {
    padding: calc(8px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right))
      calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
  }
  .sidebar { top: calc(8px + env(safe-area-inset-top)); bottom: calc(8px + env(safe-area-inset-bottom)); left: calc(8px + env(safe-area-inset-left)); }
  .detail { top: calc(8px + env(safe-area-inset-top)); bottom: calc(8px + env(safe-area-inset-bottom)); }
  .modal { padding-top: calc(8vh + env(safe-area-inset-top)); }
  .palette-card { max-height: calc(var(--vvh, 100dvh) - 8vh - env(safe-area-inset-top) - 16px); }
  .palette-results { max-height: none; }
  .bulk, .toasts { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* ---------- icons ---------- */
.ic { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.2em; display: inline-block; }
.icon-btn .ic { width: 17px; height: 17px; }
.icon-btn.sm .ic { width: 14px; height: 14px; }
.nav-item .ico { display: grid; place-items: center; color: var(--muted); }
.nav-item.active .ico { color: var(--accent); }
.nav-item .ico .ic { width: 17px; height: 17px; }
.brand .logo .ic { width: 70%; height: 70%; stroke-width: 2.3; }
.plus-badge .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.search-btn .ic { color: var(--muted); }
.btn .ic { width: 15px; height: 15px; }
.check .ic { width: 12px; height: 12px; stroke-width: 3; }
.caret { display: grid; place-items: center; }
.caret .ic { width: 14px; height: 14px; }
.inline-add .plus { display: grid; place-items: center; }
.inline-add .plus .ic { width: 17px; height: 17px; stroke-width: 2.4; }
.empty .big { color: var(--faint); }
.empty .big .ic { width: 46px; height: 46px; stroke-width: 1.5; }
.banner .ic, .card h3 .ic { width: 16px; height: 16px; }
.card h3 { display: flex; align-items: center; gap: 7px; }
.card h3 .ic { color: var(--deadline); }
.sketch.new { gap: 6px; }
.sketch.new .ic { width: 18px; height: 18px; }
.thumb.add .ic { width: 22px; height: 22px; }
.timer-btns .btn .ic { width: 14px; height: 14px; }
.seg button { display: inline-flex; align-items: center; gap: 5px; }
.seg button .ic { width: 14px; height: 14px; }
.date-pill .ic, .date-block .bh .ic { width: 15px; height: 15px; }
.date-block .bh { gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; }
.chip .ic { width: 13px; height: 13px; }
.quick-preview .chip.warnc { background: color-mix(in srgb, var(--p1) 14%, transparent); color: var(--p1); }

/* date badges in task rows */
.meta .due, .meta .dl, .meta .warn, .meta .mi { display: inline-flex; align-items: center; gap: 5px; }
.meta .due {
  padding: 2px 9px 2px 4px; border-radius: 999px; font-weight: 600; font-size: 11.5px;
  color: var(--muted); background: var(--glass-inset); border: 1px solid var(--glass-border);
}
.meta .due.overdue { color: var(--p1); background: color-mix(in srgb, var(--p1) 12%, transparent); border-color: transparent; }
.meta .due.today { color: var(--green); background: color-mix(in srgb, var(--green) 13%, transparent); border-color: transparent; }
.meta .due.tomorrow { color: var(--p2); background: color-mix(in srgb, var(--p2) 13%, transparent); border-color: transparent; }
.meta .due .cal { width: 16px; height: 16px; }
.meta .due .rep { width: 12px; height: 12px; opacity: .8; }
.meta .dl { padding: 2px 9px 2px 7px; }
.meta .dl .ic, .meta .warn .ic { width: 13px; height: 13px; }
.meta .mi .ic { width: 13px; height: 13px; opacity: .85; }
.ic.cal text { stroke: none; }
.dl.urgent .ic.cal path, .dl.overdue .ic.cal path { fill: #fff; }

.date-pill.overridden { opacity: .4; }

/* Star field over the night sky (dark mode only); a few stars twinkle slowly. */
.backdrop::before, .backdrop::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.backdrop::before {
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 60%, transparent), radial-gradient(1px 1px at 27% 72%, #fff 60%, transparent),
    radial-gradient(1.4px 1.4px at 41% 33%, #f6dc96 60%, transparent), radial-gradient(1px 1px at 58% 12%, #fff 60%, transparent),
    radial-gradient(1px 1px at 66% 58%, #fff 60%, transparent), radial-gradient(1.6px 1.6px at 79% 26%, #fff 60%, transparent),
    radial-gradient(1px 1px at 88% 81%, #fff 60%, transparent), radial-gradient(1px 1px at 7% 88%, #fff 60%, transparent),
    radial-gradient(1.2px 1.2px at 35% 92%, #f6dc96 60%, transparent), radial-gradient(1px 1px at 93% 47%, #fff 60%, transparent),
    radial-gradient(1px 1px at 51% 79%, #fff 60%, transparent), radial-gradient(1px 1px at 19% 45%, #fff 60%, transparent);
  background-size: 640px 640px;
}
.backdrop::after {
  background-image:
    radial-gradient(1.8px 1.8px at 22% 30%, #f6dc96 60%, transparent), radial-gradient(1.5px 1.5px at 72% 64%, #fff 60%, transparent),
    radial-gradient(1.5px 1.5px at 84% 14%, #fff 60%, transparent), radial-gradient(1.8px 1.8px at 46% 86%, #f6dc96 60%, transparent);
  background-size: 900px 900px;
  animation: twinkle 6s ease-in-out infinite alternate;
}
:root[data-theme="dark"] .backdrop::before { opacity: .55; }
:root[data-theme="dark"] .backdrop::after { opacity: .8; }
@keyframes twinkle { from { filter: brightness(.6); } to { filter: brightness(1.4); } }
@media (prefers-reduced-motion: reduce) { .backdrop::after { animation: none; } }

/* ---------- themed dropdowns (replace native <select>) ---------- */
select[data-dd] { display: none !important; } /* .btn styles would otherwise override [hidden] */
.dd-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 100%; }
.dd-btn .dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn .ic { width: 13px; height: 13px; flex-shrink: 0; opacity: .7; transition: transform .15s; }
.dd-btn[aria-expanded="true"] .ic { transform: rotate(180deg); }
.dd-field {
  width: 100%; padding: 9px 12px; border: 1px solid var(--glass-border); border-radius: 12px; background: var(--glass-inset);
  color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
@media (hover: hover) { .dd-field:hover { background: var(--hover); } }
.dd-field:focus-visible, .dd-field[aria-expanded="true"] { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dd-menu {
  position: fixed; z-index: 90; overflow-y: auto; padding: 6px; border-radius: 16px; max-width: min(420px, calc(100vw - 20px));
  background: color-mix(in srgb, var(--menu-bg) 94%, transparent); color: var(--text);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow), inset 0 1px 0 var(--glass-edge);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: rise .14s ease;
}
.dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px;
  cursor: pointer; font-size: 13px; white-space: nowrap;
}
.dd-opt .dd-text { overflow: hidden; text-overflow: ellipsis; }
.dd-opt.hl { background: var(--active); }
.dd-opt.on { color: var(--accent); font-weight: 600; }
.dd-opt .ic { width: 14px; height: 14px; flex-shrink: 0; stroke-width: 2.4; }

/* ============ Capri: the flagship neon theme ============
   Drawn from the Edgerunners S2 reference: hot-red glitter shards, an acid-green splinter and violet
   glitch offsets over near-black slate, with HUD corner ticks, chromatic-split type, halftone and scanlines. */
:root[data-theme="capri"], .wcard[data-wtheme="capri"] {
  --bg: #07070b;
  --glass: rgba(12, 10, 17, 0.7);
  --glass-strong: rgba(17, 14, 23, 0.9);
  --blur: blur(14px) saturate(170%);
  --glass-inset: rgba(255, 255, 255, 0.045);
  --glass-border: rgba(255, 46, 92, 0.26);
  --glass-edge: rgba(255, 106, 149, 0.45);
  --glass-shade: rgba(0, 0, 0, 0.5);
  --hover: rgba(255, 46, 92, 0.09);
  --active: rgba(255, 46, 92, 0.17);
  --line: rgba(255, 255, 255, 0.07);
  --text: #fbf3f7;
  --muted: #b3a6bd;
  --faint: #6f6479;
  --accent: #ff2e5c;
  --accent-2: #ff6a95;
  --accent-soft: rgba(255, 46, 92, 0.2);
  --on-accent: #fff;
  --menu-bg: #120f18;
  --neon-green: #39ff88;
  --violet: #9a4dff;
  --p1: #ff4766;
  --p2: #ffb21f;
  --p3: #7b93ff;
  --p4: #74687e;
  --green: #39ff88;
  --deadline: #b06bff;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.7), 0 2px 10px rgba(0, 0, 0, 0.45);
  --night: linear-gradient(135deg, #1c0f19, #07070b);
  --display: "Chakra Petch", Inter, sans-serif;
  color-scheme: dark;
}
/* A violet bloom up top and a red one down low, like neon spilling into a dark room. */
:root[data-theme="capri"] body {
  background:
    radial-gradient(110% 75% at 85% -15%, rgba(154, 77, 255, .24), transparent 55%),
    radial-gradient(90% 70% at -5% 115%, rgba(255, 46, 92, .22), transparent 60%),
    var(--bg);
}
/* Faint scanlines over everything. */
:root[data-theme="capri"] body::after {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 3px);
}

/* ---- shattered shards, glowing and glitching ----
   Each shard is one SVG image with its glow, violet offset and glint baked in. CSS cut-outs with a
   filter on an animated layer got dropped by iPhones in home-screen mode; plain images always draw. */
:root[data-theme="capri"] .blob {
  border-radius: 0; opacity: 1; filter: none;
  background: var(--shard) center / 100% 100% no-repeat;
  animation: shard-drift 13s ease-in-out infinite alternate, shard-glitch 9s steps(1) infinite;
}
:root[data-theme="capri"] .b1 { --shard: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-14 -14 128 128' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='f' x1='0' y1='0' x2='.6' y2='1'%3E%3Cstop offset='0' stop-color='%23ff3d68'/%3E%3Cstop offset='.65' stop-color='%23e0103f'/%3E%3Cstop offset='1' stop-color='%23a80a35'/%3E%3C/linearGradient%3E%3ClinearGradient id='h' x1='0' y1='0' x2='1' y2='.4'%3E%3Cstop offset='.4' stop-color='%23fff' stop-opacity='0'/%3E%3Cstop offset='.48' stop-color='%23fff' stop-opacity='.2'/%3E%3Cstop offset='.56' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3Cfilter id='g' x='-40%25' y='-40%25' width='180%25' height='180%25'%3E%3CfeGaussianBlur stdDeviation='5'/%3E%3C/filter%3E%3C/defs%3E%3Cpolygon points='8 0 46 14 38 26 70 18 62 40 100 30 74 58 90 72 52 66 40 100 30 70 0 84 18 52 2 36 24 30' fill='%23ff2e5c' opacity='.5' filter='url(%23g)'/%3E%3Cpolygon points='8 0 46 14 38 26 70 18 62 40 100 30 74 58 90 72 52 66 40 100 30 70 0 84 18 52 2 36 24 30' fill='%239a4dff' opacity='.6' transform='translate(4 3)'/%3E%3Cpolygon points='8 0 46 14 38 26 70 18 62 40 100 30 74 58 90 72 52 66 40 100 30 70 0 84 18 52 2 36 24 30' fill='url(%23f)'/%3E%3Cpolygon points='8 0 46 14 38 26 70 18 62 40 100 30 74 58 90 72 52 66 40 100 30 70 0 84 18 52 2 36 24 30' fill='url(%23h)'/%3E%3Cg fill='%23fff'%3E%3Ccircle cx='30' cy='34' r='.7'/%3E%3Ccircle cx='55' cy='48' r='.6' opacity='.8'/%3E%3Ccircle cx='42' cy='72' r='.8' opacity='.7'/%3E%3Ccircle cx='64' cy='30' r='.6'/%3E%3Ccircle cx='22' cy='58' r='.6' opacity='.85'/%3E%3C/g%3E%3C/svg%3E"); width: 46vw; height: 53vw; top: -12vw; left: -10vw; }
:root[data-theme="capri"] .b2 { --shard: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-14 -14 128 128' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='f' x1='0' y1='0' x2='.6' y2='1'%3E%3Cstop offset='0' stop-color='%23ff3d68'/%3E%3Cstop offset='.65' stop-color='%23e0103f'/%3E%3Cstop offset='1' stop-color='%23a80a35'/%3E%3C/linearGradient%3E%3ClinearGradient id='h' x1='0' y1='0' x2='1' y2='.4'%3E%3Cstop offset='.4' stop-color='%23fff' stop-opacity='0'/%3E%3Cstop offset='.48' stop-color='%23fff' stop-opacity='.2'/%3E%3Cstop offset='.56' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3Cfilter id='g' x='-40%25' y='-40%25' width='180%25' height='180%25'%3E%3CfeGaussianBlur stdDeviation='5'/%3E%3C/filter%3E%3C/defs%3E%3Cpolygon points='30 0 52 22 46 34 100 12 66 48 82 56 40 100 50 62 0 78 34 44 12 38' fill='%23ff2e5c' opacity='.5' filter='url(%23g)'/%3E%3Cpolygon points='30 0 52 22 46 34 100 12 66 48 82 56 40 100 50 62 0 78 34 44 12 38' fill='%239a4dff' opacity='.6' transform='translate(4 3)'/%3E%3Cpolygon points='30 0 52 22 46 34 100 12 66 48 82 56 40 100 50 62 0 78 34 44 12 38' fill='url(%23f)'/%3E%3Cpolygon points='30 0 52 22 46 34 100 12 66 48 82 56 40 100 50 62 0 78 34 44 12 38' fill='url(%23h)'/%3E%3Cg fill='%23fff'%3E%3Ccircle cx='30' cy='34' r='.7'/%3E%3Ccircle cx='55' cy='48' r='.6' opacity='.8'/%3E%3Ccircle cx='42' cy='72' r='.8' opacity='.7'/%3E%3Ccircle cx='64' cy='30' r='.6'/%3E%3Ccircle cx='22' cy='58' r='.6' opacity='.85'/%3E%3C/g%3E%3C/svg%3E"); width: 42vw; height: 46vw; bottom: -10vw; right: -8vw; opacity: .85; animation-delay: -6s, -3s; }
:root[data-theme="capri"] .b3 { --shard: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-14 -14 128 128' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='f' x1='0' y1='0' x2='.6' y2='1'%3E%3Cstop offset='0' stop-color='%235dffa0'/%3E%3Cstop offset='1' stop-color='%2312c956'/%3E%3C/linearGradient%3E%3ClinearGradient id='h' x1='0' y1='0' x2='1' y2='.4'%3E%3Cstop offset='.4' stop-color='%23fff' stop-opacity='0'/%3E%3Cstop offset='.48' stop-color='%23fff' stop-opacity='.2'/%3E%3Cstop offset='.56' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3Cfilter id='g' x='-40%25' y='-40%25' width='180%25' height='180%25'%3E%3CfeGaussianBlur stdDeviation='5'/%3E%3C/filter%3E%3C/defs%3E%3Cpolygon points='40 0 52 0 34 40 58 38 22 100 30 52 8 54' fill='%2339ff88' opacity='.5' filter='url(%23g)'/%3E%3Cpolygon points='40 0 52 0 34 40 58 38 22 100 30 52 8 54' fill='%239a4dff' opacity='.6' transform='translate(4 3)'/%3E%3Cpolygon points='40 0 52 0 34 40 58 38 22 100 30 52 8 54' fill='url(%23f)'/%3E%3Cpolygon points='40 0 52 0 34 40 58 38 22 100 30 52 8 54' fill='url(%23h)'/%3E%3C/svg%3E"); width: 16vw; height: 42vw; top: 28%; left: 18%; opacity: .9; animation-delay: -12s, -5s; }
:root[data-theme="capri"] .b4 { --shard: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-14 -14 128 128' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='f' x1='0' y1='0' x2='.6' y2='1'%3E%3Cstop offset='0' stop-color='%23ff3d68'/%3E%3Cstop offset='.65' stop-color='%23e0103f'/%3E%3Cstop offset='1' stop-color='%23a80a35'/%3E%3C/linearGradient%3E%3ClinearGradient id='h' x1='0' y1='0' x2='1' y2='.4'%3E%3Cstop offset='.4' stop-color='%23fff' stop-opacity='0'/%3E%3Cstop offset='.48' stop-color='%23fff' stop-opacity='.2'/%3E%3Cstop offset='.56' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3Cfilter id='g' x='-40%25' y='-40%25' width='180%25' height='180%25'%3E%3CfeGaussianBlur stdDeviation='5'/%3E%3C/filter%3E%3C/defs%3E%3Cpolygon points='0 20 60 0 44 30 100 34 50 52 70 100 26 58 10 70' fill='%23ff2e5c' opacity='.5' filter='url(%23g)'/%3E%3Cpolygon points='0 20 60 0 44 30 100 34 50 52 70 100 26 58 10 70' fill='%239a4dff' opacity='.6' transform='translate(4 3)'/%3E%3Cpolygon points='0 20 60 0 44 30 100 34 50 52 70 100 26 58 10 70' fill='url(%23f)'/%3E%3Cpolygon points='0 20 60 0 44 30 100 34 50 52 70 100 26 58 10 70' fill='url(%23h)'/%3E%3Cg fill='%23fff'%3E%3Ccircle cx='30' cy='34' r='.7'/%3E%3Ccircle cx='55' cy='48' r='.6' opacity='.8'/%3E%3Ccircle cx='42' cy='72' r='.8' opacity='.7'/%3E%3Ccircle cx='64' cy='30' r='.6'/%3E%3Ccircle cx='22' cy='58' r='.6' opacity='.85'/%3E%3C/g%3E%3C/svg%3E"); width: 26vw; height: 23vw; top: 8%; right: 14%; opacity: .6; animation-delay: -18s, -7s; }
@keyframes shard-drift {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  50% { transform: translate(2.5vw, -1.5vh) rotate(4deg) scale(1.04); }
  100% { transform: translate(-1.5vw, 2.5vh) rotate(-3deg) scale(.98); }
}
/* Every few seconds a shard skips a couple of frames, like a bad signal. */
@keyframes shard-glitch { 0%, 91%, 100% { translate: 0 0; } 92% { translate: -14px 3px; } 93.5% { translate: 9px -4px; } 95% { translate: -3px 0; } }

/* Glitter dust, and halftone dots fading in from two corners (anime print texture). */
:root[data-theme="capri"] .backdrop::before {
  opacity: .55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #ff6a95 60%, transparent), radial-gradient(1px 1px at 27% 72%, #fff 60%, transparent),
    radial-gradient(1.4px 1.4px at 41% 33%, #ff2e5c 60%, transparent), radial-gradient(1px 1px at 58% 12%, #fff 60%, transparent),
    radial-gradient(1px 1px at 66% 58%, #39ff88 60%, transparent), radial-gradient(1.6px 1.6px at 79% 26%, #ff6a95 60%, transparent),
    radial-gradient(1px 1px at 88% 81%, #fff 60%, transparent), radial-gradient(1px 1px at 7% 88%, #9a4dff 60%, transparent),
    radial-gradient(1.2px 1.2px at 35% 92%, #ff2e5c 60%, transparent), radial-gradient(1px 1px at 93% 47%, #fff 60%, transparent);
  background-size: 420px 420px;
}
:root[data-theme="capri"] .backdrop::after {
  opacity: 1; animation: none;
  background: radial-gradient(rgba(255, 46, 92, .32) 1px, transparent 1.7px) 0 0 / 7px 7px;
  -webkit-mask: radial-gradient(circle at 92% 8%, #000, transparent 32%), radial-gradient(circle at 4% 96%, #000, transparent 30%);
  mask: radial-gradient(circle at 92% 8%, #000, transparent 32%), radial-gradient(circle at 4% 96%, #000, transparent 30%);
}

/* ---- always moving: neon light slowly wheeling behind everything, glitter drifting up, halftone
   breathing, neon running round the glass edges. Transforms and opacity only, so phones stay smooth. ---- */
.aurora { display: none; }
:root[data-theme="capri"] .aurora {
  display: block; position: absolute; left: 50%; top: 50%; width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax;
  pointer-events: none; opacity: .5; z-index: -1;
  background: conic-gradient(from 0deg,
    transparent 0deg, rgba(255, 46, 92, .5) 40deg, transparent 95deg,
    transparent 150deg, rgba(154, 77, 255, .45) 195deg, transparent 250deg,
    transparent 290deg, rgba(255, 46, 92, .25) 320deg, transparent 350deg);
  -webkit-mask: radial-gradient(closest-side, transparent 4%, #000 32%, transparent 85%);
  mask: radial-gradient(closest-side, transparent 4%, #000 32%, transparent 85%);
  animation: capri-aurora 48s linear infinite, capri-aurora-pulse 7s ease-in-out infinite alternate;
}
@keyframes capri-aurora { to { transform: rotate(1turn); } }
@keyframes capri-aurora-pulse { from { opacity: .4; } to { opacity: .75; } }
:root[data-theme="capri"] .backdrop::before { inset: 0 0 -420px; animation: capri-dust 38s linear infinite, capri-twinkle 2.6s ease-in-out infinite alternate; }
@keyframes capri-dust { to { transform: translateY(-420px); } }
@keyframes capri-twinkle { from { opacity: .35; } to { opacity: .75; } }
:root[data-theme="capri"] .backdrop::after { animation: capri-breathe 4.5s ease-in-out infinite alternate; }
@keyframes capri-breathe { from { opacity: .55; } to { opacity: 1; } }
:root[data-theme="capri"] .glass::before { background-size: 300% 300%; animation: capri-edge 9s ease-in-out infinite alternate; }
@keyframes capri-edge { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
:root[data-theme="capri"] .brand .logo .ic { animation: capri-flicker 5s steps(1) infinite; }
/* At rest (window hidden, or another app in front): the ambient motion holds still instead of running the GPU. */
:root.at-rest :is(.blob, .aurora, .wordmark, .brand .logo .ic),
:root.at-rest :is(.backdrop, .glass)::before, :root.at-rest .backdrop::after { animation-play-state: paused !important; }
@keyframes capri-flicker { 0%, 87%, 91%, 100% { opacity: 1; } 88% { opacity: .35; } 89.5% { opacity: .85; } 90% { opacity: .5; } }

/* ---- glass panels: neon edge (red into violet) and HUD corner ticks ---- */
:root[data-theme="capri"] .glass {
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 106, 149, .3), inset 0 -1px 0 rgba(154, 77, 255, .3), inset 0 0 40px -18px rgba(255, 46, 92, .35);
}
:root[data-theme="capri"] .glass::before {
  background: linear-gradient(135deg, rgba(255, 46, 92, .85), rgba(255, 46, 92, .1) 28%, transparent 50%, rgba(154, 77, 255, .15) 72%, rgba(154, 77, 255, .8));
}
:root[data-theme="capri"] .glass::after {
  opacity: 1;
  background:
    linear-gradient(var(--accent), var(--accent)) left 7px top 7px / 12px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left 7px top 7px / 2px 12px no-repeat,
    linear-gradient(var(--neon-green), var(--neon-green)) right 7px bottom 7px / 12px 2px no-repeat,
    linear-gradient(var(--neon-green), var(--neon-green)) right 7px bottom 7px / 2px 12px no-repeat;
}
:root[data-theme="capri"] .modal-card {
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 46, 92, .35), 0 0 48px rgba(255, 46, 92, .18);
}

/* ---- type: a techno display face with a chromatic split ---- */
:root[data-theme="capri"] .main-head h1,
:root[data-theme="capri"] .wordmark,
:root[data-theme="capri"] .group-head,
:root[data-theme="capri"] .nav-title,
:root[data-theme="capri"] .timer-time,
:root[data-theme="capri"] .modal-card h3 { font-family: var(--display); }
:root[data-theme="capri"] .main-head h1 {
  text-transform: uppercase; letter-spacing: .03em; font-weight: 700;
  text-shadow: 2px 0 rgba(154, 77, 255, .85), -1.5px 0 rgba(57, 255, 136, .35);
}
:root[data-theme="capri"] .view-enter .main-head h1 { animation: capri-glitch-in .55s steps(1) both; }
@keyframes capri-glitch-in {
  0% { opacity: 0; }
  15% { opacity: 1; clip-path: inset(0 0 55% 0); transform: translateX(-6px); }
  30% { clip-path: inset(45% 0 0 0); transform: translateX(5px); text-shadow: -3px 0 #39ff88, 3px 0 #9a4dff; }
  45% { clip-path: inset(20% 0 30% 0); transform: translateX(-2px); }
  60%, 100% { clip-path: none; transform: none; }
}
:root[data-theme="capri"] .wordmark {
  display: inline-block; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  background: linear-gradient(100deg, #fff 0%, #ffc2d3 35%, #ff4f7a 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(1.5px 1.5px 0 rgba(154, 77, 255, .9));
  animation: capri-wordmark 7s steps(1) infinite;
}
@keyframes capri-wordmark {
  0%, 93%, 100% { transform: none; filter: drop-shadow(1.5px 1.5px 0 rgba(154, 77, 255, .9)); }
  94% { transform: translateX(-2px) skewX(-10deg); filter: drop-shadow(-2px 0 0 #39ff88) drop-shadow(2px 0 0 #9a4dff); }
  96% { transform: translateX(2px); filter: drop-shadow(2px 0 0 #39ff88) drop-shadow(-2px 0 0 #9a4dff); }
}
:root[data-theme="capri"] .brand .logo {
  color: var(--accent); background: #0a0910;
  box-shadow: inset 0 0 0 1px rgba(255, 46, 92, .5), 3px 3px 0 rgba(154, 77, 255, .7), 0 0 18px rgba(255, 46, 92, .3);
}
:root[data-theme="capri"] .brand .logo .ic { filter: drop-shadow(1px 1px 0 var(--violet)) drop-shadow(0 0 4px rgba(255, 46, 92, .7)); }

/* ---- controls ---- */
:root[data-theme="capri"] .btn.primary, :root[data-theme="capri"] .plus-badge {
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.8) 50%, transparent), radial-gradient(1px 1px at 70% 65%, rgba(255,255,255,.65) 50%, transparent),
    linear-gradient(135deg, #ff2e5c, #ff6a95);
  background-size: 9px 9px, 13px 13px, 100% 100%;
  color: #fff; text-shadow: 0 1px 0 rgba(120, 0, 30, .5);
  box-shadow: 3px 3px 0 var(--violet), 0 6px 24px rgba(255, 46, 92, .4);
}
@media (hover: hover) {
  :root[data-theme="capri"] .btn.primary:hover { box-shadow: -3px 3px 0 var(--neon-green), 3px -1px 0 var(--violet), 0 8px 28px rgba(255, 46, 92, .5); }
}
:root[data-theme="capri"] .nav-pill {
  background: linear-gradient(90deg, rgba(255, 46, 92, .3), rgba(255, 46, 92, .07) 70%, transparent);
  border-color: rgba(255, 46, 92, .45);
  box-shadow: inset 3px 0 0 var(--accent), 0 0 20px rgba(255, 46, 92, .2);
}
:root[data-theme="capri"] .nav-item.active { box-shadow: inset 3px 0 0 var(--accent), 0 2px 10px var(--glass-shade); }
:root[data-theme="capri"] .sidebar.has-pill .nav-item.active { box-shadow: none; }
:root[data-theme="capri"] .nav-item.active .ico { color: var(--accent); filter: drop-shadow(0 0 5px rgba(255, 46, 92, .8)); }
:root[data-theme="capri"] .group-head {
  text-transform: uppercase; letter-spacing: .07em; font-size: 13px;
  background: var(--glass-strong); border-color: rgba(255, 46, 92, .3);
  box-shadow: inset 3px 0 0 var(--accent), 0 4px 16px var(--glass-shade);
}
:root[data-theme="capri"] .group-head.overdue { box-shadow: inset 3px 0 0 var(--p1), 0 0 18px rgba(255, 71, 102, .15); }
:root[data-theme="capri"] .group-head.deadline { box-shadow: inset 3px 0 0 var(--deadline), 0 4px 16px var(--glass-shade); }
@media (hover: hover) {
  :root[data-theme="capri"] .task:hover { box-shadow: inset 0 -1px 0 rgba(255, 46, 92, .45), 0 6px 18px var(--glass-shade); }
}
:root[data-theme="capri"] .task.selected {
  border-color: rgba(57, 255, 136, .3);
  box-shadow: inset 3px 0 0 var(--neon-green), 0 0 22px rgba(57, 255, 136, .12), 0 4px 16px var(--glass-shade);
}
:root[data-theme="capri"] .check.p1 { box-shadow: 0 0 9px rgba(255, 71, 102, .55); }
:root[data-theme="capri"] .check.p2 { box-shadow: 0 0 9px rgba(255, 178, 31, .45); }
:root[data-theme="capri"] .check.p3 { box-shadow: 0 0 9px rgba(123, 147, 255, .45); }
:root[data-theme="capri"] .check.checked { box-shadow: 0 0 12px rgba(57, 255, 136, .7); color: #03140a; }
:root[data-theme="capri"] .meta .due.today { box-shadow: 0 0 10px rgba(57, 255, 136, .18); }
:root[data-theme="capri"] .meta .due.overdue { box-shadow: 0 0 10px rgba(255, 71, 102, .2); }
:root[data-theme="capri"] .bar { background: linear-gradient(180deg, #ff6a95, #ff2e5c); box-shadow: 3px 0 0 rgba(154, 77, 255, .6), 0 0 12px rgba(255, 46, 92, .4); }
:root[data-theme="capri"] .dp-seg.on, :root[data-theme="capri"] .dp-fill, :root[data-theme="capri"] .fc-bar > span { box-shadow: 0 0 8px rgba(255, 46, 92, .6); }
:root[data-theme="capri"] .fc-time { text-shadow: 2px 0 rgba(154, 77, 255, .7); }
:root[data-theme="capri"] .toast { border-color: rgba(255, 46, 92, .35); box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
:root[data-theme="capri"] ::selection { background: rgba(57, 255, 136, .32); }
:root[data-theme="capri"] ::-webkit-scrollbar-thumb { background-color: rgba(255, 46, 92, .3); }
:root[data-theme="capri"] .dd-opt.on, :root[data-theme="capri"] .add-task-btn { color: var(--accent); }
:root[data-theme="capri"] .timer-time { letter-spacing: .02em; text-shadow: 1.5px 0 rgba(154, 77, 255, .7); }

/* ======================================================================
   Liquid motion + touch
   ====================================================================== */
:root {
  --spring: cubic-bezier(.34, 1.56, .64, 1);      /* overshoots a touch, then settles */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --sheen: rgba(255, 255, 255, .55);
}
:root[data-theme="dark"] { --sheen: rgba(246, 220, 150, .09); }
:root[data-theme="capri"] { --sheen: rgba(255, 46, 92, .14); }

/* No tap-to-zoom on phones: iOS zooms into any field under 16px, and double-tap zooms too. */
html { touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
@media (pointer: coarse) {
  input, textarea, select { font-size: 16px !important; }
}

/* ---- thicker, wetter glass ---- */
.glass {
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-edge), inset 0 -1px 0 var(--glass-shade),
    inset 0 0 28px -10px var(--glass-edge);
}
/* A soft gloss across the top of each pane, like light caught in curved glass. */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--glass-edge) 45%, transparent), transparent 28%);
  opacity: .7;
}
/* The pointer light. */
.glass.lit, .task.lit {
  background-image: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--sheen), transparent 70%);
}
.task.lit { background-image: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), var(--sheen), transparent 70%); }

/* ---- springy controls ---- */
.btn, .icon-btn, .link-btn, .nav-item, .seg button, .dd-btn, .check, .date-pill, .chip {
  transition: transform .45s var(--spring), background .2s, box-shadow .25s, color .15s, border-color .2s, filter .2s;
}
.btn:active, .dd-btn:active, .date-pill:active, .chip:active { transform: scale(.94); transition-duration: .12s; }
.icon-btn:active, .link-btn:active { transform: scale(.86); transition-duration: .12s; }
.nav-item:active { transform: scale(.97); transition-duration: .12s; }
@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); }
  .btn.primary:hover { box-shadow: 0 10px 26px var(--accent-soft), inset 0 1px 0 rgba(255,255,255,.45); }
  .nav-item:hover .ico { transform: scale(1.12); }
  .task:hover { transform: translateY(-1px); box-shadow: 0 6px 18px var(--glass-shade), inset 0 1px 0 var(--glass-edge); }
}
.nav-item .ico { transition: transform .45s var(--spring), color .15s; }
.task { transition: background .2s, border-color .2s, box-shadow .3s, transform .45s var(--spring); }
/* The picked-up card follows the finger exactly; easing it would make it lag and wobble on a slow drag. */
.task.card-ghost { transition: none; }

/* ---- completing ---- */
.task.done-anim { animation: done .55s var(--ease-out) forwards; }
.task.reopen-anim { animation: reopen .48s var(--ease-out) forwards; pointer-events: none; }
.task.reopen-anim .task-content { text-decoration-color: transparent !important; color: var(--text) !important; transition: text-decoration-color .25s, color .25s; }
@keyframes reopen {
  0% { background-color: transparent; }
  35% { background-color: var(--accent-soft); transform: scale(1.01); opacity: 1; }
  100% { background-color: var(--accent-soft); transform: translateY(-10px) scale(.98); opacity: 0; filter: blur(3px); }
}
.task.leave-anim { animation: leave .26s cubic-bezier(.4, 0, 1, 1) forwards; pointer-events: none; }
@keyframes leave { to { opacity: 0; transform: translateX(28px) scale(.97); filter: blur(3px); } }
.task.done-anim .check { animation: check-pop .5s var(--spring); }
@keyframes check-pop {
  0% { transform: scale(.6); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); box-shadow: 0 0 0 12px transparent; }
}
@keyframes done {
  30% { transform: scale(.985); }
  100% { opacity: 0; transform: translateX(28px) scale(.97); filter: blur(3px); }
}

/* ---- arriving ---- */
.view-enter .task, .view-enter .group-head, .view-enter .card, .view-enter .empty {
  animation: flow-in .55s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 26ms);
}
.view-enter .main-head h1, .view-enter .main-head .sub { animation: flow-in .5s var(--ease-out) both; }
@keyframes flow-in { from { opacity: 0; transform: translateY(12px) scale(.985); filter: blur(5px); } }
/* Frosted-glass headers and cards slide and fade without the blur: blurring something that blurs what's
   behind it is heavy, and Chrome can flash the glass while it runs. */
.view-enter .group-head, .view-enter .card.glass { animation-name: flow-in-glass; }
@keyframes flow-in-glass { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.modal { animation: modal-fade .25s ease; }
@keyframes modal-fade { from { opacity: 0; -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); } }
.modal-card { animation: liquid-pop .48s var(--spring); }
@keyframes liquid-pop {
  0% { opacity: 0; transform: translateY(18px) scale(.9); filter: blur(8px); border-radius: 40px; }
  60% { opacity: 1; filter: blur(0); }
}
.detail { animation: drawer-in .5s var(--ease-out); }
@keyframes drawer-in { from { opacity: 0; transform: translateX(36px) scale(.97); filter: blur(6px); } }
.toast { animation: toast-in .5s var(--spring); }
@keyframes toast-in { from { opacity: 0; translate: 0 18px; scale: .92; } }
.dd-menu { animation: menu-in .28s var(--ease-out); transform-origin: top; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
@media (max-width: 760px) {
  .sidebar { transition: transform .5s var(--ease-out); }
}

/* ---- swipe a task left to delete it ---- */
.task > * { transform: translateX(var(--sx, 0)); transition: transform .5s var(--spring); }
.task.swiping > * { transition: none; }
.task.swipe-gone > * { transition: transform .28s var(--ease-out); }
.task.swipe-gone { transition: opacity .28s; opacity: 0; }
.task[data-swipe] { overflow: hidden; transform: none !important; }
.task[data-swipe="delete"] { background: color-mix(in srgb, var(--p1) 20%, transparent); }
.task.swipe-armed[data-swipe="delete"] { background: var(--p1); }
.task[data-swipe]::after {
  content: ""; position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px;
  background: currentColor; transition: transform .4s var(--spring), color .2s; transform: scale(.7);
  -webkit-mask: var(--swipe-icon) center / contain no-repeat; mask: var(--swipe-icon) center / contain no-repeat;
}
.task[data-swipe="delete"]::after {
  right: 18px; color: var(--p1);
  --swipe-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3'/%3E%3C/svg%3E");
}
.task.swipe-armed::after { color: #fff; transform: scale(1.15); }
@media (hover: none) {
  .task { touch-action: pan-y; }
  .task-actions { display: none; }     /* no hover on phones; swipe and the drawer cover these */
  .task:active:not([data-swipe]) { transform: scale(.985); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- sliding sidebar selector ---- */
.sidebar .nav, .sidebar .sidebar-head, .sidebar > *:not(.nav-pill) { position: relative; z-index: 1; }
.nav-pill {
  position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none; opacity: 0;
  border-radius: 12px; background: var(--active); border: 1px solid var(--glass-border);
  box-shadow: 0 4px 14px var(--glass-shade), inset 0 1px 0 var(--glass-edge);
  /* A short, plain glide: no overshoot, no stretch. */
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), width .26s cubic-bezier(.2, .8, .2, 1), height .26s cubic-bezier(.2, .8, .2, 1), opacity .15s;
  will-change: transform;
}
.nav-pill.instant { transition: none; }
.sidebar.has-pill .nav-item.active { background: transparent; border-color: transparent; box-shadow: none; }

/* ---- theme switching ---- */
/* View transitions: the new theme is revealed by a growing circle (animated from JS). */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 1; }
/* Fallback without view transitions: colours ease across instead of snapping. */
.theme-fading, .theme-fading *, .theme-fading *::before, .theme-fading *::after {
  transition: background-color .5s ease, color .5s ease, border-color .5s ease, box-shadow .5s ease, fill .5s ease, stroke .5s ease, opacity .5s ease !important;
}

/* ---- task right-click menu (borrows the dropdown menu's look) ---- */
.ctx-menu { min-width: 210px; padding: 5px; }
.ctx-menu .dd-opt { width: 100%; border: 0; background: none; color: var(--text); text-align: left; font-size: 13px; }
.ctx-menu .dd-opt:focus-visible { background: var(--active); outline: none; }
@media (hover: hover) { .ctx-menu .dd-opt:hover { background: var(--active); } }
.ctx-menu .dd-opt .ic { color: var(--muted); }
.ctx-menu .dd-opt.danger, .ctx-menu .dd-opt.danger .ic { color: var(--p1); }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.ctx-note { display: flex; align-items: center; gap: 6px; padding: 6px 10px 4px; font-size: 11.5px; color: var(--muted); }
.ctx-note .ic { width: 13px; height: 13px; }
.ctx-prio { display: flex; gap: 4px; padding: 4px 6px; }
.ctx-p {
  flex: 1; border: 1px solid var(--glass-border); background: var(--glass-inset); color: var(--muted);
  border-radius: 8px; padding: 4px 0; font-size: 12px; font-weight: 700;
  transition: transform .2s var(--spring), background .15s, color .15s;
}
@media (hover: hover) { .ctx-p:hover { background: var(--hover); } }
.ctx-p:active { transform: scale(.92); }
.ctx-p.p1 { color: var(--p1); } .ctx-p.p2 { color: var(--p2); } .ctx-p.p3 { color: var(--p3); }
.ctx-p.on { background: color-mix(in srgb, currentColor 18%, transparent); border-color: currentColor; }
.ctx-menu .dd-opt { justify-content: flex-start; gap: 10px; } .ctx-menu .dd-text { flex: 1; text-align: left; }

/* ---- no accidental highlighting ---- */
/* The interface itself (nav, buttons, task rows, headers) isn't selectable, like a native app.
   Fields you type in, comments, and the help sheet still are. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable], .comment, .help-grid, .hint, .error { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img, svg { -webkit-user-drag: none; }

/* ---- confirm dialog (replaces the browser's confirm box) ---- */
.confirm-card { max-width: 380px; text-align: center; justify-items: center; padding: 24px 22px 18px; gap: 10px; }
.confirm-card h3 { font-size: 17px; }
.confirm-body { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.confirm-icon {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center;
  color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 1px 0 var(--glass-edge);
  animation: confirm-icon-in .5s var(--spring);
}
.confirm-icon .ic { width: 22px; height: 22px; }
.confirm-card.is-danger .confirm-icon { color: var(--p1); background: color-mix(in srgb, var(--p1) 16%, transparent); }
.confirm-card .ask-actions { width: 100%; margin-top: 6px; }
.confirm-card .ask-actions .btn { flex: 1; }
.confirm-card .ask-actions .btn { white-space: nowrap; min-width: 0; }
/* Three choices don't fit side by side in this small card: stack them, the main one on top and Cancel as quiet text. */
.confirm-card .ask-actions:has(> .btn:nth-child(3)) { flex-direction: column-reverse; gap: 6px; }
.confirm-card .ask-actions:has(> .btn:nth-child(3)) .btn { flex: none; width: 100%; padding: 10px 16px; }
.confirm-card .ask-actions:has(> .btn:nth-child(3)) [data-ask="no"] { background: none; border-color: transparent; box-shadow: none; color: var(--muted); padding: 6px 16px; }
.btn.primary.danger-btn { background: linear-gradient(135deg, var(--p1), color-mix(in srgb, var(--p1) 75%, #fff)); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--p1) 35%, transparent), inset 0 1px 0 rgba(255,255,255,.35); }
.ask-modal.closing { animation: modal-out .16s ease forwards; }
.ask-modal.closing .modal-card { animation: card-out .16s ease forwards; }
@keyframes modal-out { to { opacity: 0; } }
@keyframes card-out { to { transform: scale(.96); opacity: 0; } }
@keyframes confirm-icon-in { from { transform: scale(.5) rotate(-12deg); opacity: 0; } }
:root[data-theme="capri"] .btn.primary.danger-btn { background: linear-gradient(135deg, #ff2e5c, #ff4766); box-shadow: 3px 3px 0 var(--violet), 0 6px 24px rgba(255, 46, 92, .4); }
:root[data-theme="capri"] .confirm-icon { box-shadow: 0 0 18px rgba(255, 46, 92, .35), inset 0 0 0 1px rgba(255, 46, 92, .4); }
.ask-modal { background: rgba(4, 5, 12, .55); }
.ask-card .btn:focus-visible, .ctx-menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ask-card .btn:focus:not(:focus-visible) { outline: none; }
.ctx-menu { overflow-y: auto; }

/* ---- date fields + calendar (replaces the browser's date box) ---- */
.date-field {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; min-width: 0;
  padding: 7px 12px 7px 9px; border: 1px solid var(--glass-border); border-radius: 10px;
  background: var(--glass-inset); color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: border-color .15s, background .15s, transform .3s var(--spring);
}
.date-field span { overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) { .date-field:hover { background: var(--hover); } }
.date-field:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.date-field.empty span { color: var(--muted); }
.date-field .cal { width: 16px; height: 16px; flex-shrink: 0; }
.date-field.wide { flex: 1; }
.date-row { flex-wrap: wrap; }
.date-row #d-due { flex: 1 1 160px; }
/* In the quick-add pills the pill already has an icon, so the field is just text. */
.date-field.bare { border: 0; background: none; padding: 3px 8px 3px 4px; font-size: 12.5px; }
.date-field.bare .cal { display: none; }
.date-field.bare.empty span, .date-field.bare.empty { color: var(--faint); }

.date-pop { width: 272px; padding: 10px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 8px; }
.dp-title { font-weight: 650; font-size: 13.5px; }
.dp-head [data-dp-month="-1"] .ic { transform: rotate(90deg); }
.dp-head [data-dp-month="1"] .ic { transform: rotate(-90deg); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--faint); padding: 2px 0 4px; }
.dp-day {
  aspect-ratio: 1; border: 1px solid transparent; background: none; border-radius: 9px; color: var(--text);
  font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 0;
  transition: background .12s, transform .25s var(--spring);
}
@media (hover: hover) { .dp-day:hover { background: var(--hover); } }
.dp-day:active { transform: scale(.88); }
.dp-day:focus-visible { outline: none; border-color: var(--accent); }
.dp-day.out { color: var(--faint); }
.dp-day.past:not(.on) { opacity: .55; }
.dp-day.today { color: var(--accent); font-weight: 700; border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.dp-day.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent, #fff); font-weight: 700; box-shadow: 0 4px 12px var(--accent-soft); }
.dp-foot { display: flex; gap: 6px; padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line); }
:root[data-theme="capri"] .dp-day.on { box-shadow: 2px 2px 0 var(--violet), 0 0 14px rgba(255, 46, 92, .45); }
:root[data-theme="capri"] .dp-title { font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; }
/* In the narrow layout the hover toolbar would sit on top of the task's title; right-click and swipes cover it. */
@media (max-width: 760px) { .task-actions { display: none; } }

/* ---- tap feedback ---- */
/* Uses the separate `scale` property so it stacks with each control's own transforms (see app.js). */
.tap-press { scale: .95; filter: brightness(1.12); transition: scale .1s ease-out, filter .1s ease-out; }
.tap-release { animation: tap-release .28s cubic-bezier(.22, 1, .36, 1); }
@keyframes tap-release {
  from { scale: .95; filter: brightness(1.12); }
  to { scale: 1; filter: none; }
}

/* ---- phone sidebar backdrop ---- */
.sidebar-scrim { display: none; }
@media (max-width: 760px) {
  .sidebar { transition: transform .32s var(--ease-out, cubic-bezier(.2, .8, .2, 1)); }
  /* No backdrop blur and fully removed while closed: an idle full-screen blur layer made iOS drop the
     Capri shards behind the glass. */
  .sidebar-scrim {
    display: block; position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, .45);
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .28s ease, visibility 0s linear .28s;
  }
  .sidebar.open ~ .sidebar-scrim { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .28s ease; }
}

/* ---- reschedule overdue ---- */
.busy { pointer-events: none; cursor: progress; animation: busy-pulse .7s ease-in-out infinite alternate; }
@keyframes busy-pulse { from { opacity: 1; } to { opacity: .45; } }
.task.resched-out { animation: resched-out .34s cubic-bezier(.5, 0, .75, 0) both; }
@keyframes resched-out { to { transform: translateX(48px) scale(.97); opacity: 0; filter: blur(2px); } }
.task.resched-in { animation: resched-in .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes resched-in {
  0% { transform: translateX(-28px); opacity: 0; box-shadow: 0 0 0 0 transparent; }
  35% { transform: none; opacity: 1; background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 22px color-mix(in srgb, var(--accent) 30%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .tap-release, .busy, .task.resched-out, .task.resched-in { animation: none; }
  .tap-press { scale: 1; }
}

/* Connect screen: the token this device used has stopped working. */
.expired-note { display: grid; gap: 4px; text-align: left; margin: 4px 0 14px; padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 1.45;
  background: color-mix(in srgb, var(--deadline) 12%, transparent); border: 1px solid color-mix(in srgb, var(--deadline) 32%, transparent); color: var(--text); }
.expired-note b { color: var(--deadline); font-size: 14px; }

/* Notes follow the theme. Written notes use its surfaces; sketches are saved on light paper and shown
   inverted on dark themes (dark paper, light ink, same hues), the editor and its colour swatches included. */
:root { --paper: #fffdf8; }
:root[data-theme="dark"] { --paper: rgba(14, 18, 34, .6); --sketch-invert: .9; --sketch-filter: invert(.9) hue-rotate(180deg); }
:root[data-theme="capri"] { --paper: rgba(16, 10, 30, .72); --sketch-invert: .94; --sketch-filter: invert(.94) hue-rotate(180deg); }
#draw-colors .swatch { filter: var(--sketch-filter, none); }
.note-body::placeholder { color: var(--muted); }
:root[data-theme="capri"] .sketch .note-paper, :root[data-theme="capri"] .note-body { border-color: rgba(255, 46, 92, .25); }
:root[data-theme="capri"] .note-body { box-shadow: inset 0 0 0 1px rgba(255, 46, 92, .22), inset 0 0 24px rgba(154, 77, 255, .08); }

/* ---- labels ---- */
.chip.label-chip { --lc: var(--accent); }
.chip.label-chip.on { background: color-mix(in srgb, var(--lc) 18%, transparent); border-color: color-mix(in srgb, var(--lc) 60%, transparent); color: color-mix(in srgb, var(--lc) 75%, var(--text)); font-weight: 600; }
.chip.new-label { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); border-style: dashed; background: transparent; }
.chip.new-label .ic { width: 12px; height: 12px; }
.ctx-colors { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; padding: 6px 8px 8px; }
.ctx-c { width: 16px; height: 16px; border-radius: 50%; border: 0; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); transition: transform .12s; }
@media (hover: hover) { .ctx-c:hover { transform: scale(1.2); } }
.ctx-c.on { outline: 2px solid var(--text); outline-offset: 2px; }
.label-edit { display: inline-flex; align-items: center; gap: 7px; }
.label-edit .dot { width: 9px; height: 9px; border-radius: 50%; }
.nav-item.menu-on { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-empty { padding: 4px 10px; color: var(--accent); }

/* Pull to sync (phones) */
.ptr {
  position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 50%; z-index: 30; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted); background: var(--glass-strong); box-shadow: var(--shadow);
  transform: translate(-50%, -60px); opacity: 0; pointer-events: none; transition: transform .3s var(--ease-out, ease), opacity .25s, color .15s;
}
.ptr.show { transition: color .15s; }
.ptr.spinning { transition: transform .25s var(--ease-out, ease), color .15s; }
.ptr .ic { width: 20px; height: 20px; }
.ptr.armed, .ptr.spinning { color: var(--accent); }
.ptr.spinning .ic { animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin { to { rotate: 360deg; } }

/* Reminders: the bell in the sidebar and its menu */
.remind-btn { position: relative; }
.remind-btn.on { color: var(--accent); }
.remind-btn.on::after { content: ''; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--glass-strong); }
.remind-menu { width: 290px; }
.remind-status { display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; white-space: normal; padding: 10px 12px 8px; }
.remind-status .ic { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.remind-status b { color: var(--text); font-size: 13px; }
.remind-status.on .ic { color: var(--accent); }
.dd-opt.strong { color: var(--accent); font-weight: 650; }
.remind-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 12px 4px; }
.remind-lead { padding: 2px 8px 6px; }
.remind-lead .ctx-p { flex: 1; font-size: 11.5px; white-space: nowrap; }
.remind-lead .ctx-p.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.remind-opt .ic { opacity: 0; }
.remind-opt.on .ic { opacity: 1; color: var(--accent); }
.remind-opt .dd-text { white-space: normal; }

/* Desktop Right now widget (the desktop app's small window, loaded with ?widget=1) */
html.widget-mode, html.widget-mode body { background: transparent !important; overflow: hidden; }
html.widget-mode :is(.backdrop, #app, #connect, .toasts) { display: none !important; }
.wcard {
  position: fixed; inset: 6px; display: grid; align-content: start; gap: 4px; padding: 12px 15px; border-radius: 20px;
  background: color-mix(in srgb, var(--bg) var(--wbg, 82%), transparent); border: 1px solid var(--glass-border); color: var(--text);
  -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: inset 0 1px 0 var(--glass-edge); -webkit-app-region: drag; user-select: none; overflow: hidden;
}
.w-top { display: flex; align-items: center; justify-content: space-between; height: 18px; }
.w-label { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.w-label .ic { width: 12px; height: 12px; }
.wcard.now .w-label { color: var(--accent); }
.w-open { -webkit-app-region: no-drag; border: 0; background: none; color: var(--muted); padding: 2px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.w-open .ic { width: 14px; height: 14px; }
.w-open:hover { color: var(--accent); background: var(--hover); }
.w-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; padding-bottom: 1px; }
.w-left { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.w-left b { color: var(--text); font-weight: 700; font-size: 14px; }
.wcard.now .w-left b { color: var(--accent); }
.w-bar { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 3px 0 1px; }
.w-bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.w-next { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-theme="capri"] .wcard { border-color: rgba(255, 46, 92, .35); }
:root[data-theme="capri"] .w-bar > span { box-shadow: 0 0 8px rgba(255, 46, 92, .6); }

/* Pinned to the desktop, the window shows what's on now in a slim strip above the page. */
.now-strip {
  display: flex; align-items: center; gap: 10px; margin: 10px 16px 0; padding: 7px 14px; border-radius: 14px; cursor: pointer;
  background: var(--glass-inset); border: 1px solid var(--glass-border); font-size: 13px; color: var(--muted); min-width: 0; flex-shrink: 0;
}
.now-strip .ic { width: 15px; height: 15px; flex-shrink: 0; }
.now-strip b { color: var(--text); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.now-strip.now { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--glass-inset)); }
.now-strip.now .ic, .now-strip.now .ns-left { color: var(--accent); }
.ns-left { white-space: nowrap; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.ns-bar { flex: 1; min-width: 40px; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.ns-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.ns-next { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 12px; }
@media (max-width: 560px) { .ns-next { display: none; } }
/* widget kinds: lists (today, deadlines), the focus timer, and moving it (Mac) */
.w-count { font-weight: 700; color: var(--text); opacity: .7; margin-left: 2px; }
.w-list { display: grid; gap: 3px; margin-top: 2px; }
.w-row { display: flex; align-items: center; gap: 8px; min-width: 0; height: 26px; font-size: 13px; }
.w-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--muted); }
.w-dot.p1 { border-color: var(--p1); } .w-dot.p2 { border-color: var(--p2); } .w-dot.p3 { border-color: var(--p3); }
.w-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.w-when { flex-shrink: 0; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.w-when.late, .w-when.overdue { color: var(--p1); font-weight: 650; }
.w-when.urgent, .w-when.soon { color: var(--deadline); font-weight: 650; }
.w-clock { display: flex; align-items: baseline; gap: 8px; }
.w-time { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.w-state { font-size: 12px; color: var(--muted); }
.wcard.now .w-time { color: var(--accent); }
.w-bar.brk > span { background: var(--green); }
.wcard.moving { border: 2px dashed var(--accent); cursor: grab; }
.wcard.moving .w-label { color: var(--accent); }
.w-done { -webkit-app-region: no-drag; border: 0; border-radius: 99px; padding: 2px 12px; font-weight: 700; font-size: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent, #fff); }
:root[data-theme="capri"] .wcard.now .w-time { text-shadow: 2px 0 rgba(154, 77, 255, .7); }
.wcard > * { zoom: var(--wz, 1); }
.w-check { -webkit-app-region: no-drag; flex-shrink: 0; width: 17px; height: 17px; padding: 0; border-radius: 50%; border: 1.5px solid var(--muted);
  background: none; color: transparent; display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.w-check .ic { width: 11px; height: 11px; stroke-width: 3; }
.w-check.p1 { border-color: var(--p1); } .w-check.p2 { border-color: var(--p2); } .w-check.p3 { border-color: var(--p3); }
.w-check:hover { border-color: var(--accent); color: var(--accent); }
.w-check.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.w-row.done .w-name { text-decoration: line-through; color: var(--muted); }
.w-row.done .w-when { opacity: .45; }
.w-grip { position: fixed; right: 7px; bottom: 7px; width: 16px; height: 16px; z-index: 2; cursor: nwse-resize; -webkit-app-region: no-drag;
  opacity: 0; transition: opacity .15s; border-bottom-right-radius: 14px;
  background: linear-gradient(135deg, transparent 50%, var(--muted) 50%, var(--muted) 58%, transparent 58%, transparent 70%, var(--muted) 70%, var(--muted) 78%, transparent 78%); }
html.widget-mode body:hover .w-grip, .w-grip:active { opacity: .7; }

/* The widget's looks, picked in the widget studio */
.wcard { border-radius: var(--wr, 20px); -webkit-backdrop-filter: blur(var(--wblur, 20px)) saturate(1.5); backdrop-filter: blur(var(--wblur, 20px)) saturate(1.5); }
.wcard[data-density="compact"] { padding: 9px 12px; gap: 2px; }
.wcard[data-density="roomy"] { padding: 16px 19px; gap: 6px; }
.w-row { height: calc(var(--wrow, 29px) - 3px); }
.wcard[data-bg="solid"] { -webkit-backdrop-filter: none; backdrop-filter: none; }
.wcard[data-bg="tint"] { background: color-mix(in srgb, color-mix(in srgb, var(--accent) 22%, var(--bg)) var(--wbg, 82%), transparent); }
.wcard[data-bg="gradient"] {
  background: linear-gradient(140deg, color-mix(in srgb, color-mix(in srgb, var(--accent) 48%, var(--bg)) var(--wbg, 82%), transparent),
    color-mix(in srgb, color-mix(in srgb, var(--accent-2) 22%, var(--bg)) var(--wbg, 82%), transparent));
}
.wcard[data-bg="clear"] { background: transparent; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  text-shadow: 0 1px 2px color-mix(in srgb, var(--bg) 85%, transparent), 0 0 12px color-mix(in srgb, var(--bg) 60%, transparent); }
.wcard[data-border="none"] { border-color: transparent; }
.wcard[data-border="accent"] { border: 1.5px solid color-mix(in srgb, var(--accent) 70%, transparent); }
.wcard.shadowed { box-shadow: inset 0 1px 0 var(--glass-edge), 0 3px 5px rgba(0, 0, 0, .22); }
.wcard.tinted .w-label, .wcard.tinted .w-count { color: var(--accent); }
.wcard.tinted .w-check:not(.p1):not(.p2):not(.p3) { border-color: color-mix(in srgb, var(--accent) 70%, var(--muted)); }
.wcard.accent-title :is(.w-title, .w-time, .w-left b) { color: var(--accent); }
.wcard.light-title :is(.w-title, .w-time) { font-weight: 500; }
.wcard.light-title .w-name { font-weight: 450; }
/* Rounded, serif and mono come from Google Fonts (index.html), so Windows gets them too; only fetched once used. */
.wcard[data-font="rounded"], [data-font="rounded"] { font-family: "Nunito", ui-rounded, system-ui, sans-serif; }
.wcard[data-font="serif"], [data-font="serif"] { font-family: "Source Serif 4", ui-serif, Georgia, serif; }
.wcard[data-font="mono"], [data-font="mono"] { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: -0.02em; }
.wcard[data-font="system"], [data-font="system"] { font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
.wcard[data-align="center"] { text-align: center; }
.wcard[data-align="center"] .w-clock { justify-content: center; }
.w-top { gap: 8px; }
.w-label { flex: 1; min-width: 0; }
.w-hclock { font-size: 11px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.w-proj { margin-left: 7px; font-size: 11px; font-weight: 500; color: var(--muted); }

/* ---- Widget studio (desktop app) ---- */
.wstudio { padding: 5vh 16px 16px; align-items: flex-start; }
.ws-card { max-width: 980px; height: min(760px, 90vh); display: flex; flex-direction: column; padding: 0;
  background: color-mix(in srgb, var(--bg) 98.5%, transparent); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(30px) saturate(1.4); backdrop-filter: blur(30px) saturate(1.4); box-shadow: 0 30px 80px rgba(0, 0, 0, .28); }
.ws-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 10px; }
.ws-head > div { flex: 1; min-width: 0; }
.ws-head h3 { margin: 0; font-size: 17px; }
.ws-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.ws-logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--on-accent, #fff);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 16px var(--accent-soft); }
.ws-logo .ic { width: 19px; height: 19px; }
.ws-tabs { display: flex; gap: 6px; padding: 0 18px 12px; overflow-x: auto; flex-shrink: 0; border-bottom: 1px solid var(--line); }
.ws-tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--hover);
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ws-tab .ic { width: 15px; height: 15px; }
.ws-tab:hover { color: var(--text); }
.ws-tab.on { color: var(--text); background: var(--active); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ws-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.ws-tab.shown .ws-dot { background: var(--green, #4fb36a); }
.ws-add { border-style: dashed; background: none; }
.ws-addwrap { position: relative; }
.ws-addmenu { position: fixed; z-index: 5; display: grid; padding: 5px; margin-top: 4px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: 0 14px 40px rgba(0, 0, 0, .2); }
.ws-addmenu button { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; border-radius: 9px; cursor: pointer; text-align: left; }
.ws-addmenu button:hover { background: var(--active); }
.ws-addmenu .ic { width: 15px; height: 15px; color: var(--muted); }
.ws-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 42%) 1fr; }
.ws-left { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--line); min-height: 0; }
.ws-stage { position: relative; flex: 1; min-height: 220px; border-radius: 18px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.ws-stage[data-wall="dusk"], .ws-wall[data-wall="dusk"] { background: radial-gradient(circle at 20% 15%, #ffb18a, transparent 45%), radial-gradient(circle at 85% 80%, #6d4bd8, transparent 55%), linear-gradient(160deg, #f07a8c, #4b3a9e); }
.ws-stage[data-wall="ocean"], .ws-wall[data-wall="ocean"] { background: radial-gradient(circle at 75% 20%, #7fe0e8, transparent 45%), linear-gradient(160deg, #1f8fc0, #0b2f63); }
.ws-stage[data-wall="forest"], .ws-wall[data-wall="forest"] { background: radial-gradient(circle at 30% 25%, #c9e6a4, transparent 45%), linear-gradient(160deg, #3f8a5a, #12322a); }
.ws-stage[data-wall="light"], .ws-wall[data-wall="light"] { background: linear-gradient(160deg, #f5f3ee, #d9dde6); }
.ws-stage[data-wall="dark"], .ws-wall[data-wall="dark"] { background: linear-gradient(160deg, #23263a, #08090f); }
.ws-frame { position: absolute; left: 50%; top: calc(50% - 10px); transform-origin: center; pointer-events: none; }
.ws-frame .wcard { position: absolute; -webkit-app-region: no-drag; }
.ws-size { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .85); text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.ws-stage[data-wall="light"] .ws-size { color: rgba(0, 0, 0, .55); text-shadow: none; }
.ws-under { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.ws-walls { display: flex; gap: 6px; }
.ws-wall { width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.ws-wall.on { border-color: var(--text); }
.ws-right { overflow-y: auto; padding: 4px 18px 18px; overscroll-behavior: contain; }
.ws-sec { padding: 14px 0 6px; border-bottom: 1px solid var(--line); }
.ws-sec:last-child { border-bottom: 0; }
.ws-sec h4 { margin: 0 0 8px; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ws-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0; flex-wrap: wrap; }
.ws-rl { display: grid; gap: 1px; min-width: 0; font-size: 13.5px; font-weight: 550; }
.ws-rl small { font-size: 11.5px; font-weight: 450; color: var(--muted); }
.ws-seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 12px; background: var(--hover); border: 1px solid var(--line); }
.ws-seg button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 5px 10px; border-radius: 9px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.ws-seg button .ic { width: 14px; height: 14px; }
.ws-seg button:hover { color: var(--text); }
.ws-seg button.on { background: var(--active); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.ws-kinds { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); }
.ws-kinds button { justify-content: center; }
.ws-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0; cursor: pointer; }
.ws-main { padding: 4px 0 10px; }
.ws-switch { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 38px; height: 22px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer;
  transition: background .2s; margin: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.ws-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s var(--spring, ease); }
.ws-switch:checked { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.ws-switch:checked::after { transform: translateX(16px); }
.ws-input { width: 200px; max-width: 100%; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--hover); color: var(--text); font: inherit; font-size: 13px; }
.ws-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ws-screen { position: relative; width: 120px; height: 72px; border-radius: 10px; border: 2px solid var(--line); background: var(--hover); flex-shrink: 0; }
.ws-screen span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--muted); font-weight: 600; pointer-events: none; }
.ws-corner { position: absolute; width: 34px; height: 20px; border-radius: 5px; border: 1.5px solid var(--line); background: var(--glass-strong); cursor: pointer; padding: 0; transition: background .15s, border-color .15s; }
.ws-corner:hover { border-color: var(--accent); }
.ws-corner.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.ws-corner.top-left { top: 5px; left: 5px; } .ws-corner.top-right { top: 5px; right: 5px; }
.ws-corner.bottom-left { bottom: 5px; left: 5px; } .ws-corner.bottom-right { bottom: 5px; right: 5px; }
.ws-sizes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ws-wh { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.ws-wh input { width: 58px; padding: 6px 7px; border-radius: 9px; border: 1px solid var(--line); background: var(--hover); color: var(--text); font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ws-slider { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 300px; }
.ws-slider input { flex: 1; accent-color: var(--accent); }
.ws-slider b { width: 40px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ws-swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ws-swatch { box-sizing: border-box; width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--sw); cursor: pointer; padding: 0; position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); transition: transform .12s; }
.ws-swatch:hover { transform: scale(1.12); }
.ws-swatch.theme { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.ws-swatch.custom { background: conic-gradient(#e8505b, #f29d38, #e2b53a, #4fb36a, #3f9be0, #6a6ff0, #ec6fa9, #e8505b); overflow: hidden; }
.ws-swatch.custom.on { background: var(--sw); }
.ws-swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.ws-swatch.on { border-color: var(--bg); box-shadow: 0 0 0 2px var(--text); }
.ws-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ws-preset { display: grid; gap: 6px; padding: 6px 6px 8px; border-radius: 14px; border: 1.5px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ws-preset:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.ws-preset.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ws-pv { height: 52px; display: grid; align-content: center; justify-items: start; gap: 4px; padding: 8px 10px; text-align: left;
  background: var(--pbg); color: var(--ptext); border: 1px solid rgba(127, 127, 127, .2); }
.ws-pv b { font-size: 16px; line-height: 1; color: var(--ptitle, var(--ptext)); }
.ws-pv i { display: block; height: 4px; width: 70%; border-radius: 9px; background: var(--pa); }
.ws-pv i + i { width: 45%; opacity: .45; background: var(--ptext); }
.ws-preset[data-theme-hint="light"], .ws-preset[data-theme-hint="auto"] { --pbg: #f6f3ec; --ptext: #1b1d2b; }
.ws-preset[data-theme-hint="dark"] { --pbg: #141826; --ptext: #eef0f7; }
:root[data-theme="dark"] .ws-preset[data-theme-hint="auto"], :root[data-theme="capri"] .ws-preset[data-theme-hint="auto"] { --pbg: #141826; --ptext: #eef0f7; }
.ws-preset[data-bg="tint"] .ws-pv { background: color-mix(in srgb, var(--pa) 25%, var(--pbg)); }
.ws-preset[data-bg="gradient"] .ws-pv { background: linear-gradient(140deg, color-mix(in srgb, var(--pa) 55%, var(--pbg)), var(--pbg)); }
.ws-preset[data-bg="clear"] .ws-pv { background: repeating-conic-gradient(rgba(127, 127, 127, .12) 0 25%, transparent 0 50%) 0 0 / 12px 12px; border-style: dashed; }
.ws-preset[data-bg="glass"] .ws-pv { background: linear-gradient(140deg, color-mix(in srgb, var(--pbg) 80%, #8ab4ff), var(--pbg)); }
.ws-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--hover); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; margin: 4px 6px 4px 0; }
.ws-btn .ic { width: 15px; height: 15px; }
.ws-btn:hover { background: var(--active); }
.ws-btn.danger { color: var(--p1); }
.ws-foot { display: flex; flex-wrap: wrap; }
.ws-legacy { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); background: var(--accent-soft); padding: 10px 12px; border-radius: 12px; }
.ws-legacy .ic { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.ws-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 60px 20px; color: var(--muted); }
.ws-empty .ic { width: 34px; height: 34px; color: var(--accent); }
.ws-empty b { color: var(--text); font-size: 15px; }
@media (max-width: 760px) {
  .ws-card { height: 92vh; }
  .ws-body { grid-template-columns: 1fr; overflow-y: auto; }
  .ws-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .ws-stage { min-height: 240px; }
  .ws-right { overflow: visible; }
}
.ws-switch-row[hidden] { display: none; }

/* Polish: smooth changes, a ticked task sliding away, the studio opening and closing */
.wcard { transition: background .3s ease, border-color .3s ease, border-radius .25s ease, box-shadow .3s ease, padding .2s ease; }
.w-row { transition: opacity .25s ease, transform .25s ease, height .26s ease, margin .26s ease; }
.w-row.leaving { opacity: 0; transform: translateX(14px); height: 0; margin-top: -3px; overflow: hidden; }
.w-check { flex-shrink: 0; }
.w-check.on .ic { animation: w-tick .3s var(--spring, ease); }
@keyframes w-tick { from { transform: scale(.3); opacity: 0; } }
.ws-frame .wcard { transition: background .3s ease, border-color .3s ease, border-radius .25s ease, box-shadow .3s ease; }
.ws-frame { transition: opacity .2s ease, filter .2s ease; }
.ws-frame.off { opacity: .55; filter: grayscale(.5); }
.wstudio .ws-card { animation: ws-in .32s var(--spring, cubic-bezier(.2, .9, .3, 1.2)); }
@keyframes ws-in { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.wstudio.closing { animation: ws-fade-out .18s ease forwards; }
.wstudio.closing .ws-card { animation: ws-out .18s ease forwards; }
@keyframes ws-fade-out { to { opacity: 0; } }
@keyframes ws-out { to { transform: translateY(8px) scale(.98); opacity: 0; } }
.ws-addmenu { animation: menu-in .2s var(--ease-out, ease); }
.ws-card :is(button, input):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ws-seg button:focus-visible, .ws-tab:focus-visible { outline-offset: 0; }
.ws-tab:not(.shown) span { opacity: .7; }
.ws-preset .ws-pv { transition: transform .15s ease; }
.ws-preset:hover .ws-pv { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) {
  .wcard, .w-row, .ws-frame, .ws-frame .wcard, .wstudio .ws-card, .wstudio.closing, .wstudio.closing .ws-card { transition: none; animation: none; }
}

/* The sidebar timer's options, and the setting on the Focus page */
.timer-more { margin-left: auto; opacity: .55; transition: opacity .15s; }
.timer:hover .timer-more, .timer-more:focus-visible { opacity: 1; }
.timer-more .ic { fill: currentColor; stroke: none; }
.timer-menu { width: 230px; }
.timer-show { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }

/* ---- Capri+ nudges: the card, locked options, the 30-day teaser ---- */
button.plan-tag { cursor: pointer; font-family: "Chakra Petch", Inter, sans-serif; }
button.plan-tag:hover { color: var(--text); border-color: var(--plus-1); }
.plus-card { max-width: 440px; text-align: left; }
.plus-card .plus-big { font-size: 26px; font-weight: 800; background: linear-gradient(135deg, var(--plus-1), var(--plus-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plus-card h3 { margin: 2px 0 10px; font-size: 16px; line-height: 1.35; }
.plus-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 9px; }
.plus-list li { display: flex; gap: 10px; align-items: flex-start; }
.plus-list li > .ic { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--plus-1); }
.plus-list b { display: block; font-size: 13.5px; }
.plus-list small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.locked { position: relative; opacity: .55; }
.locked::after { content: "+"; position: absolute; top: -3px; right: -1px; font-size: 10px; font-weight: 800; color: var(--plus-1); }
.remind-plus { padding: 2px 12px 8px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.remind-plus .plus-chip { margin-left: 0; }
.plus-teaser { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 12px 14px; border-radius: 16px; font-size: 13px; color: var(--muted); }
.plus-teaser .plus-chip { margin-left: 0; }
.plus-teaser span { flex: 1; }
.trend-card { position: relative; overflow: hidden; }
.trend-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.trend-stats b { display: block; font-size: 22px; font-weight: 700; }
.trend-stats small { color: var(--muted); font-size: 11.5px; }
.trend-bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; }
.trend-bars span { flex: 1; border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, var(--plus-1), var(--plus-2)); opacity: .85; }
.plus-locked .trend-stats, .plus-locked .trend-bars { filter: blur(5px); opacity: .6; pointer-events: none; user-select: none; }
.plus-over { position: absolute; inset: 40px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; font-size: 13px; font-weight: 600; padding: 0 16px; }
.accent-swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.accent-sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; background: var(--sw); cursor: pointer; padding: 0; box-shadow: 0 0 0 1px var(--glass-border); }
.accent-sw.theme { background: conic-gradient(var(--accent), var(--accent-2), var(--accent)); }
.accent-sw.on { border-color: var(--text); }
.plus-mini {
  display: inline-flex; align-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; line-height: 1; flex: none;
  padding: 1px 4px; border-radius: 6px; margin-left: 6px; vertical-align: middle; opacity: .8;
  color: var(--plus-1); border: 1px solid color-mix(in srgb, var(--plus-1) 55%, transparent);
}
.nav-item:hover .plus-mini { opacity: 1; }
.on-free #widget-btn, .on-free #theme-btn { position: relative; }
.on-free #widget-btn::after, .on-free #theme-btn::after {
  content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(135deg, var(--plus-1), var(--plus-2));
}
.sketch.new .sketch-left { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 4px; }
.btn .plus-chip, .chip .plus-chip { margin-left: 6px; }
.note-count { text-align: right; font-size: 11.5px; color: var(--faint); margin: -10px 20px 10px; font-variant-numeric: tabular-nums; }
.note-count.near { color: var(--muted); }
.note-count a { color: var(--plus-1); }

/* ---- app tour ---- */
.tour { position: fixed; inset: 0; z-index: 1000; animation: modal-fade .25s ease; }
.tour.closing { animation: modal-out .2s ease forwards; }
/* The spotlight: a clear hole, the rest of the screen dimmed by its shadow. */
.tour-spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px var(--accent-soft), 0 0 0 200vmax rgba(4, 6, 14, .62);
  transition: left .35s var(--ease-out, ease), top .35s var(--ease-out, ease), width .35s var(--ease-out, ease), height .35s var(--ease-out, ease), opacity .2s;
}
.tour.centered .tour-spot { left: 50%; top: 50%; width: 0; height: 0; box-shadow: 0 0 0 200vmax rgba(4, 6, 14, .62); }
.tour-card {
  position: fixed; width: min(340px, calc(100vw - 32px)); padding: 18px 18px 14px; border-radius: 20px;
  background: var(--glass-strong); display: grid; gap: 8px; z-index: 1;
  transition: left .35s var(--ease-out, ease), top .35s var(--ease-out, ease);
}
.tour.centered .tour-card { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 32px)); }
.tour-card.step-in > * { animation: flow-in-glass .35s var(--ease-out, ease) both; }
.tour-card h3 { margin: 0; font-size: 16.5px; }
.tour-card p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.tour-count { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.tour-dots { display: flex; gap: 5px; margin-top: 4px; }
.tour-dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--glass-border); transition: width .25s, background .25s; }
.tour-dots span.on { width: 18px; background: var(--accent); }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tour-actions .spacer { flex: 1; }
.tour-actions .btn { padding: 7px 14px; }
.tour-actions .link-btn { padding: 4px 6px; margin-left: -6px; font-size: 13px; }
@media (max-width: 760px) {
  .tour-card { left: 16px; right: 16px; width: auto; }
  .tour.centered .tour-card { left: 50%; right: auto; width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; } .tour-card.step-in > * { animation: none; } }

/* iPhone and iPad: Add to Home Screen steps (ios-install.js), on the downloads page and in the app's reminder. */
.ios-steps { margin: 0; padding: 0; list-style: none; counter-reset: ios; display: grid; gap: 10px; }
.ios-steps li {
  counter-increment: ios; position: relative; padding-left: 34px; min-height: 24px;
  font-size: 13.5px; line-height: 1.5; color: var(--text); text-align: left;
}
.ios-steps li::before {
  content: counter(ios); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft);
}
.ios-steps b { font-weight: 600; }
.ios-card .ios-steps { margin: 4px 0 6px; }
.ios-card .ask-actions .btn:first-child { font-size: 13px; }
.ios-ic { display: inline-block; width: 17px; height: 17px; vertical-align: -3px; color: var(--accent); }
