/* Creamy (the default look): a warm ivory page; the quadrants are white cards with their color's tint. */
:root {
  --bg: #f8f6f1;
  --card: #ffffff;
  --panel: var(--card); /* the quadrants' card, under their tint */
  --ink: #1f1e1c;
  --muted: #9c9a95;
  --line: rgba(0, 0, 0, 0.06);
  --red: #e5484d;
  --blue: #3b7cf5;
  --ochre: #c4922b;
  --grey: #8b8e96;
  --red-tint: rgba(229, 72, 77, 0.07);
  --blue-tint: rgba(59, 124, 245, 0.07);
  --ochre-tint: rgba(196, 146, 43, 0.09);
  --grey-tint: rgba(139, 142, 150, 0.08);
  --violet: #7a5c8f; /* the Inbox */
  --green: #3f9a6b; /* Done */
  --violet-tint: rgba(122, 92, 143, 0.07);
  --green-tint: rgba(63, 154, 107, 0.08);
  --overdue: #e5484d;
  --radius: 18px;
  /* a quadrant never needs more than 6 rows (5 tasks + one being inserted): cap its height */
  --qmax: 316px;
  color-scheme: light;
}

/* Looks, picked in the menu (account.js; set on <html data-theme> before first paint in index.html).
   Creamy, the default, is :root above. The widgets offer the same three (ios/App/FTFWidget/Model.swift,
   android …/widgets/WidgetData.java). */

/* White: plain white quadrant cards, no tint, on a light grey page (so the cards stand out). */
:root[data-theme="white"] {
  --bg: #f2f2f7;
  --panel: #ffffff;
  --ink: #1d1e20;
  --muted: #9a9ca1;
}
/* Black: pure black quadrant cards, no tint, on a dark grey page; bright quadrant colors. Menus and sheets are a
   lighter grey so they stand out. */
:root[data-theme="black"] {
  --bg: #1c1c1e;
  --panel: #000000;
  --card: #2c2c2e;
  --ink: #f2f2f4;
  --muted: #8e8e93;
  --line: rgba(255, 255, 255, 0.08);
  --red: #ff5a60;
  --blue: #5b93ff;
  --ochre: #f2c23e;
  --grey: #a1a1a8;
  --red-tint: rgba(255, 90, 96, 0.12);
  --blue-tint: rgba(91, 147, 255, 0.12);
  --ochre-tint: rgba(242, 194, 62, 0.12);
  --grey-tint: rgba(161, 161, 168, 0.10);
  --violet: #b597d0;
  --green: #5ccf8f;
  --violet-tint: rgba(181, 151, 208, 0.12);
  --green-tint: rgba(92, 207, 143, 0.11);
  --overdue: #ff5a60;
  color-scheme: dark;
}

/* the logo's lettering is purple; on black it switches to a light lavender copy */
.ink-light { display: none !important; }
:root[data-theme="black"] .ink-light { display: block !important; }
:root[data-theme="black"] .ink-dark { display: none !important; }

/* the menu's look switcher */
.menu-look { display: flex; gap: 6px; padding: 6px 4px 6px 10px; align-items: center; font-size: 14px; color: var(--ink); }
.menu-look span { flex: 1; }
.menu .menu-look button {
  flex: none; width: 26px; height: 26px; padding: 0; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); cursor: pointer;
}
.menu .menu-look button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--blue); }
/* Creamy: a warm latte cream, the page's cream deepened toward Make it quick's gold, so it reads as cream (never a
   second white) next to White's swatch. */
.menu-look [data-look="creamy"] { background: #957a8d; } /* the logo's lettering (#805e76), a little lighter */
.menu-look [data-look="white"] { background: #ffffff; }
.menu-look [data-look="black"] { background: #000000; }

/* the menu's text size: − A + scales the tasks, due dates and quadrant titles (--fs, 0.85–1.3; A goes back to 1) */
.menu-size { display: flex; gap: 6px; padding: 6px 4px 6px 10px; align-items: center; font-size: 14px; color: var(--ink); }
.menu-size span { flex: 1; }
.menu .menu-size button {
  flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: var(--grey-tint); color: var(--ink); font: inherit; font-size: 17px; line-height: 1; cursor: pointer;
}
.menu .menu-size #size-reset { background: none; font-size: 15px; font-weight: 600; }
.menu .menu-size button:disabled { opacity: 0.3; cursor: default; }

/* ---------- logo button + account menu ---------- */
.brand {
  position: fixed;
  z-index: 20;
  top: max(6px, env(safe-area-inset-top));
  left: max(6px, env(safe-area-inset-left));
  padding: 3px;
  border: 0;
  border-radius: 11px;
  background: transparent; /* the logo is cut out, so it sits right on the app background */
  cursor: pointer;
  opacity: 0; /* it only ever fades: it never moves */
  pointer-events: none;
  transition: opacity 0.35s;
}
.brand.show, .brand[aria-expanded="true"] { opacity: 1; pointer-events: auto; }
/* menu open: logo + name on a pill of the app background, above the dimmed page */
.brand[aria-expanded="true"] { background: var(--bg); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); transition: opacity 0.35s, background 0.2s; }
.brand { display: flex; align-items: center; }
.brand > img { display: block; flex: none; width: 36px; height: 36px; border-radius: 8px; }
/* the name slides out to the right when the menu is open; the mark never moves */
.brand-name { display: block; overflow: hidden; max-width: 0; opacity: 0; transition: max-width 0.3s ease, opacity 0.2s, padding 0.3s; }
.brand-name img { display: block; height: 20px; width: auto; }
/* optically centered on the mark: the centers of their ink line up (measured: the mark's sits 0.9px below its
   box's middle, the lettering's 0.4px above), so the slot moves down 1.25px. The margin moves the centered slot,
   not the image: the slot clips. */
.brand-name { margin-top: 2.5px; }
/* even gaps along the pill, 10px of space each: its edge to the mark's ink, the mark's ink to "f", "s" to the edge
   (the mark's image has ~7px of clear space on each side; the pill has 3px of padding) */
.brand[aria-expanded="true"] .brand-name { max-width: 140px; opacity: 1; padding: 0 7px 0 3px; }
.menu-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(20, 20, 24, 0.22); animation: fade 0.2s ease-out; }
.menu-backdrop[hidden] { display: none; }
.brand:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.menu {
  position: fixed;
  z-index: 21;
  top: calc(max(6px, env(safe-area-inset-top)) + 50px);
  left: max(6px, env(safe-area-inset-left));
  width: 250px;
  padding: 8px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.08);
  animation: pop 0.16s ease-out;
}
.menu[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu-user { display: flex; align-items: center; gap: 10px; padding: 8px; margin-bottom: 4px; border-radius: 10px; background: var(--grey-tint); }
.menu-user[hidden] { display: none; }
.menu-user { cursor: pointer; } /* opens your plan */
.menu-user:hover, .menu-user:focus-visible { background: var(--line); outline: none; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 600; font-size: 14px; }
.who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#menu-name { font-weight: 600; font-size: 14px; }
#menu-email { font-size: 12px; color: var(--muted); }
.menu button[role="menuitem"] {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.menu button[role="menuitem"]:hover, .menu button[role="menuitem"]:focus-visible { background: var(--grey-tint); outline: none; }
.menu button[hidden] { display: none; }

/* ---------- sign-in sheet ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 20, 24, 0.32);
  animation: fade 0.2s ease-out;
}
.sheet-backdrop[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: relative;
  width: min(380px, 100%);
  max-height: calc(100% - 32px);
  overflow: auto;
  padding: 28px 24px 20px;
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: pop 0.2s ease-out;
}
.sheet section[hidden] { display: none; }
.sheet h2 { margin: 6px 0 18px; font-size: 20px; font-weight: 600; }
.sheet-logo { display: block; width: 140px; height: auto; margin: 0 auto 4px; }
.sheet-close {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer;
}
.sheet-close:hover { background: var(--grey-tint); }
.sso, .solid {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 48px; margin-bottom: 10px;
  border-radius: 14px; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
}
.sso { border: 1px solid var(--line); border-color: color-mix(in srgb, var(--ink) 14%, transparent); background: var(--card); color: var(--ink); }
.sso:hover { background: var(--grey-tint); }
.sso[hidden] { display: none; }
.sso svg { width: 19px; height: 19px; }
.sso[data-sso="apple"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.sso[disabled], .solid[disabled] { opacity: 0.55; cursor: progress; }
.solid { border: 0; background: var(--blue); color: #fff; margin-top: 12px; }
.quiet, .link { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.quiet { margin-top: 4px; padding: 10px; }
.quiet[disabled] { cursor: default; font-variant-numeric: tabular-nums; }
.link { padding: 0; color: var(--blue); }
.sheet input {
  width: 100%; height: 50px; padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); border-radius: 14px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 17px; outline: none;
}
.sheet input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent); }
.mail-art { display: block; width: 52px; height: 52px; margin: 0 auto 4px; color: var(--blue); }
.waiting { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 6px; color: var(--muted); font-size: 13.5px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }
.sheet-hint { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.sheet-sub { margin: -8px 0 16px; color: var(--muted); font-size: 14px; }
.sheet-sub strong { color: var(--ink); font-weight: 500; }
.sheet-note { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
.sheet-note:empty, .sheet-error:empty { display: none; }
.sheet-error { margin: 8px 0 0; color: var(--overdue); font-size: 13px; text-align: left; }

.toast {
  position: fixed; z-index: 40; left: 50%; bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: var(--card); font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  animation: pop 0.2s ease-out;
}

/* ---------- plan + paywall ---------- */
/* the plan: a label in the name bar, and "Upgrade to Plus" on Free */
.who-top { display: flex; align-items: center; gap: 8px; }
.plan-badge { flex: none; margin-left: auto; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.plan-badge.plus { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.plan-badge.lifetime { color: var(--ochre); background: color-mix(in srgb, var(--ochre) 18%, transparent); }
.menu button.menu-plan { font-weight: 600; color: var(--blue); }

.paywall { text-align: center; }
.paywall-logo { display: block; width: 64px; height: 64px; margin: 0 auto 2px; border-radius: 14px; }
.paywall h2 { margin-bottom: 6px; }
.paywall-reason { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.paywall-reason:empty { display: none; }
.perks { list-style: none; margin: 0 0 18px; padding: 0; text-align: left; display: grid; gap: 8px; font-size: 14.5px; }
.perks li { display: flex; gap: 10px; align-items: flex-start; }
.perks li::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.plans { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-bottom: 4px; } /* the plans this store sells */
.plans .plan[hidden] { display: none; }
.paywall [hidden] { display: none !important; } /* parts of the sheet hidden for your plan (plus.js) */
.plan {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 16px 4px 12px; border-radius: 14px; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--card); border: 1.5px solid color-mix(in srgb, var(--ink) 14%, transparent);
}
.plan[aria-checked="true"] { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 7%, var(--card)); }
.plan-name { font-size: 13px; color: var(--muted); }
.plan-price { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.plan-per { font-size: 11.5px; color: var(--muted); }
.plan-save {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 1px 8px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 600;
}
.paywall-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.paywall-cancel { display: block; margin: 6px auto 0; padding: 6px 10px; font-size: 13px; }
/* on Plus, your plan: marked, and not for buying again */
.plans .plan.current { border-style: dashed; }
.plans .plan.current::after { content: "Your plan"; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); padding: 1px 8px; border-radius: 999px; background: var(--muted); color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; }
.plans .plan.current .plan-save { display: none; }
.paywall-note:empty { display: none; }
.paywall-legal { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.paywall-legal a { color: inherit; }
.menu button.menu-delete { color: var(--overdue); font-size: 13px; }
.solid.danger { background: var(--overdue); }

.menu-version { margin: 6px 10px 2px; font-size: 11.5px; color: var(--muted); }

/* This app is older than the server allows (compat.js): changes stay on the device until it's updated */
.update-bar {
  position: fixed; z-index: 30; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
  background: var(--ink); color: var(--bg); border-radius: 14px; font-size: 14px; line-height: 1.35;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.update-bar span { flex: 1; }
.update-bar button { flex: none; border: 0; border-radius: 10px; padding: 8px 14px; background: var(--bg); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }

/* ---------- the screen (app.js): the Inbox, the four quadrants and Done ----------
   A computer: Inbox | the 2×2 | Done, each section edited where it is. A phone or tablet: the Inbox above the 2×2
   and Done below it as one line; tapping a section opens it as a full page to write in (.page). */
* { box-sizing: border-box; }
/* every task one size: iOS enlarges text it judges small on its own (an iPhone held sideways), unevenly */
html { scrollbar-width: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html::-webkit-scrollbar { display: none; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.app {
  height: 100%;
  --pad-top: max(16px, env(safe-area-inset-top));
  padding: var(--pad-top) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.board {
  height: 100%; max-width: 1320px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(190px, 1fr) minmax(0, 2.6fr) minmax(190px, 1fr); gap: 14px;
}
.matrix { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; min-height: 0; min-width: 0; }
/* room at the top for the logo, and at the bottom for the Undo pill: both appear over the page, never over a section.
   A short screen keeps the room for the tasks instead. */
/* the logo sits at max(6px, the status bar) and is 42px tall with its menu pill: the sections start 12px below it */
@media (min-height: 560px) { .board { padding-top: calc(max(6px, env(safe-area-inset-top)) + 42px + 12px - var(--pad-top)); padding-bottom: 50px; } }
/* with the voice mic: room for it and, above it, the Undo pill (voice.js) */
@media (min-height: 560px) {
  body:has(> .voice-mic:not([hidden])) .board { padding-bottom: 116px; }
  @media (max-width: 720px) { body:has(> .voice-mic:not([hidden])) .board { padding-bottom: 122px; } } /* a phone's margin is 6px less */
}

/* a section: its color's tint on a white card (Creamy); plain cards on White and Black */
.sec { background: linear-gradient(var(--t), var(--t)), var(--panel); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; min-width: 0; transition: box-shadow 0.15s; }
:root:is([data-theme="white"], [data-theme="black"]) :is(.sec, .page-bg) { background: var(--panel); }
.head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 6px; flex: none; }
.head .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.head .icon { display: none; flex: none; width: 17px; height: 17px; fill: var(--c); color: var(--c); }
.head h2 { margin: 0; font-size: 16px; font-weight: 500; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head .count { margin-left: auto; font-size: 14px; font-weight: 500; color: var(--c); opacity: 0.8; font-variant-numeric: tabular-nums; }
.head .sub, .head .chev { display: none; }
/* Creamy keeps it minimal: a dot, no counts. White and Black, like the widgets: each section's icon (Done's a
   check), a bolder title, and the count */
:root:is([data-theme="creamy"], :not([data-theme])) :is(.head, .page-head) .count { display: none; }
:root:is([data-theme="white"], [data-theme="black"]) .head .dot { display: none; }
:root:is([data-theme="white"], [data-theme="black"]) .head .icon { display: block; }
:root:is([data-theme="white"], [data-theme="black"]) .head h2 { font-weight: 600; }
:root[data-theme="black"] :is(.head, .page-head) .count { color: var(--ink); opacity: 0.7; }

.list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 10px; scrollbar-width: none; }
.list::-webkit-scrollbar { display: none; }

/* a line: its circle ("+" on the "+" line), its text and, right after the text, its due date */
.row { display: flex; align-items: flex-start; gap: 10px; padding: 5px 8px; border-radius: 10px; position: relative; font-size: 15.5px; line-height: 1.4; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.circle { flex: none; width: 18px; height: 18px; margin-top: 2px; padding: 0; border-radius: 50%; border: 1.6px solid var(--c); background: transparent; cursor: pointer; position: relative; transition: background-color 0.18s, border-color 0.18s; }
.circle::after { content: ""; position: absolute; inset: -9px; } /* a finger-sized target */
.body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.text { outline: none; cursor: text; white-space: pre-wrap; caret-color: var(--ink); }
.text[contenteditable] { -webkit-user-select: text; user-select: text; }
.row:is(.add, .draft) .text { display: inline-block; min-width: 50%; max-width: 100%; vertical-align: top; }
.due { margin-left: 0.45em; font-size: 0.8em; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due:empty { display: none; }
.due.today { color: var(--c); font-weight: 600; }
.due.overdue { color: var(--overdue); font-weight: 600; }
.due.preview { opacity: 0.6; font-style: italic; }
/* the "+" line: a "+" until it has text, then the circle it will have */
.row.add .circle { border-color: transparent; color: var(--muted); opacity: 0.55; background: linear-gradient(currentColor, currentColor) center / 11px 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 11px no-repeat; }
.row.add.filled .circle { border-color: var(--c); background: none; opacity: 1; }
.row.draft .circle { opacity: 0.6; }
/* a sixth task: the one pushed on shows where it goes */
.row.will-bump .circle { border-style: dashed; }
.row.will-bump::after { content: attr(data-bump-to); align-self: center; margin-left: auto; padding-left: 8px; font-size: 12px; color: var(--c); white-space: nowrap; }
.row.task.will-bump { opacity: 0.5; }
/* done: the circle fills and the words are crossed out, line by line */
.text { background: linear-gradient(currentColor, currentColor) no-repeat 0 60% / 0% 1.5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-size 0.34s ease, color 0.3s; }
.row:is(.done, .completing) .text { background-size: 100% 1.5px; color: var(--muted); }
.row:is(.done, .completing) .circle { border-color: var(--c); background: var(--c) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 72% no-repeat; }
.row.completing .circle { animation: check-pop 0.32s ease-out; }
@keyframes check-pop { 45% { transform: scale(1.22); } }
.row.done .text { cursor: default; }
.due.when { float: right; margin-left: 0.8em; color: var(--muted); font-weight: 400; }
.empty { margin: 0; padding: 4px 8px; color: var(--muted); font-size: 13px; }
/* under Done: what was deleted in the last 30 days, quieter, a trash can where the circle would be (tap it to bring the task back) */
.row.deleted .circle { border-color: transparent; color: var(--muted); background: none; opacity: 0.75; }
.row.deleted .circle::before { content: ""; position: absolute; inset: 0; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h16M9 7V4.5h6V7M6.5 7l1 12.5h9l1-12.5M10 10.5v6M14 10.5v6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h16M9 7V4.5h6V7M6.5 7l1 12.5h9l1-12.5M10 10.5v6M14 10.5v6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.row.deleted .text { color: var(--muted); cursor: default; }
.row.deleted:hover .circle { opacity: 1; }
/* at rest on the board, a long task shows two lines */
.board .row.task:not(.editing) .body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* dragging: hold a task (a finger) or drag it (a mouse) into any of the six */
.row.pressing { transform: scale(0.97); transition: transform 0.22s ease-out; }
.row.lifted { opacity: 0.25; }
.row.drop-before::before { content: ""; position: absolute; left: 8px; right: 8px; top: -1px; height: 2px; border-radius: 2px; background: var(--c); }
:is(.sec, .chip).over { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 60%, transparent); }
.ghost { position: fixed; left: 0; top: 0; z-index: 80; margin: 0; pointer-events: none; border-radius: 12px; background: linear-gradient(var(--t), var(--t)), var(--panel); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18); }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }

/* phones and tablets: the Inbox above the 2×2, Done below it as one line */
@media (max-width: 1000px) {
  .board { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; max-width: 760px; }
  .matrix { gap: 10px; }
  .sec-inbox .list { flex: none; max-height: 100px; }
  .sec-done .list { display: none; }
  .sec-done .head { padding: 12px 16px; cursor: pointer; }
  .sec-done .head :is(.sub, .chev) { display: block; }
  .sec-done .head .count { margin-left: 4px; }
  .head .sub { margin-left: auto; color: var(--muted); font-size: 13px; }
  .head .chev { margin-left: 6px; color: var(--muted); font-size: 20px; line-height: 1; }
}
/* not enough height (a phone held sideways): the Inbox is one line too, like Done; tap it for its page */
@media (max-width: 1000px) and (max-height: 559px) {
  .sec-inbox .list { display: none; }
  .sec-inbox .head { padding: 12px 16px; cursor: pointer; }
  .sec-inbox .head .chev { display: block; margin-left: auto; }
  .sec-inbox .head .count + .chev { margin-left: 6px; }
}
@media (max-width: 720px) and (max-height: 559px) { .sec-inbox .head { padding: 11px 13px; } }
@media (max-width: 720px) {
  .app { --pad-top: max(10px, env(safe-area-inset-top)); padding: var(--pad-top) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .board, .matrix { gap: 8px; }
  .sec { border-radius: 14px; }
  .head { gap: 7px; padding: 11px 12px 4px; }
  .head h2 { font-size: 17px; }
  .head .icon { width: 17px; height: 17px; }
  .head .count { font-size: 15px; }
  .sec-done .head { padding: 11px 13px; }
  .list { padding: 0 4px 6px; }
  /* tasks the size of iPhone Notes text (17px) */
  .row { gap: 8px; padding: 4px 6px; font-size: 17px; }
  .circle { width: 19px; height: 19px; border-width: 1.5px; margin-top: 2px; }
  .sec-inbox .list { max-height: 86px; }
}

/* a section as a full page (phones and tablets), sized to what the keyboard leaves */
.page { position: fixed; z-index: 15; left: 0; right: 0; top: 0; height: 100%; display: flex; }
.page-bg { position: absolute; inset: 0; background: linear-gradient(var(--t), var(--t)), var(--panel); }
.page-inner { position: relative; }
.page[hidden] { display: none; }
.page-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.page-head { display: flex; align-items: center; gap: 2px; padding: 8px 20px 2px 6px; flex: none; }
.back { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--c); cursor: pointer; }
.back svg { width: 24px; height: 24px; }
.page-head h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.015em; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head .count { margin-left: auto; font-size: 15px; color: var(--c); opacity: 0.75; font-variant-numeric: tabular-nums; }
.chips { flex: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 6px 10px 10px; }
.chip { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 7px 2px 6px; border: 0; border-radius: 12px; background: none; color: var(--muted); font: inherit; font-size: 11.5px; line-height: 1.1; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip .label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip[aria-current="true"] { background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); font-weight: 600; }
.page-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 8px 24px; }
.page .list { overflow: visible; padding: 0; }
.page .row { gap: 12px; padding: 9px 10px; font-size: 17px; } /* never under 16px: iOS zooms into smaller text you type in */
.page .circle { width: 21px; height: 21px; margin-top: 2px; border-width: 1.6px; }
html.paging .brand { opacity: 0 !important; pointer-events: none !important; }
.back:focus-visible, .chip:focus-visible, .circle:focus-visible, .undo-bar .undo:focus-visible { outline: 2px solid var(--c, var(--blue)); outline-offset: 2px; }

/* undo: a small pill for five seconds, above the keyboard; a task pushed out of a full quadrant gets an arrow */
.undo-bar { position: fixed; z-index: 30; left: 50%; bottom: calc(var(--kb, 0px) + max(16px, env(safe-area-inset-bottom))); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px); padding: 7px 7px 7px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); }
.undo-bar.bumped .msg::before { content: "↘"; margin-right: 6px; opacity: 0.8; }
.undo-bar[hidden] { display: none; }
.undo-bar .msg { overflow: hidden; text-overflow: ellipsis; opacity: 0.9; }
.undo-bar .undo { flex: none; padding: 5px 12px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .text, .circle, .chip, .row.pressing { transition: none; }
  .row.completing .circle { animation: none; }
}

/* ---------- onboarding (onboarding.js): what it is, how it works, sign in or try as a guest ----------
   A phone: the whole screen. A computer: a card over the dimmed page. */
.ob { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(20, 20, 24, 0.35); }
.ob[hidden] { display: none; }
.ob-card { width: min(420px, 100%); height: min(780px, 100%); display: flex; flex-direction: column; padding: 30px 26px 26px; border-radius: 28px; background: var(--bg); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25); }
@media (max-width: 600px), (hover: none) and (max-width: 900px) {
  .ob { background: var(--bg); }
  .ob-card { width: 100%; height: 100%; border-radius: 0; box-shadow: none; padding: max(18px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
}
html.onboarding .brand { opacity: 0 !important; pointer-events: none !important; }
.ob-top { flex: none; display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.ob-dots { display: flex; gap: 0; margin-left: -6px; }
/* each dot is a button with a finger-sized target around it */
.ob-dot { display: grid; place-items: center; min-width: 19px; height: 32px; padding: 0 3px; border: 0; background: none; cursor: pointer; }
.ob-dot:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 8px; }
.ob-dots span { width: 7px; height: 7px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 15%, transparent); transition: background-color 0.3s, width 0.3s; }
.ob-dots span.on { width: 18px; background: var(--ink); }
.ob-skip { border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; padding: 6px 4px; cursor: pointer; }
.ob-skip[hidden] { display: none; }
.ob-steps { flex: 1; min-height: 0; position: relative; }
.ob-step { position: absolute; inset: 0; overflow-y: auto; padding-top: 20px; scrollbar-width: none; }
.ob-step[hidden] { display: none; }
.ob-step h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.ob-step h1:not(:has(+ .ob-lead)) { margin-bottom: 22px; }
.ob-lead { margin: 0 0 20px; color: var(--muted); font-size: 16px; line-height: 1.45; text-wrap: pretty; }
.ob-cta { flex: none; display: grid; gap: 10px; padding-top: 14px; }
.ob-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 16px; border: 0; border-radius: 14px; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.ob-btn svg { width: 19px; height: 19px; flex: none; }
.ob-solid { background: var(--ink); color: var(--bg); }
.ob-line { background: none; color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 16%, transparent); }
.ob-quiet { background: none; color: var(--muted); font-weight: 500; padding: 10px; }
.ob-btn:focus-visible, .ob-skip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ob-note { margin: 2px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.ob-note.ob-error { color: var(--overdue); }

/* 1: the matrix, filling in */
.ob-mx { display: grid; grid-template-columns: 18px 1fr 1fr; grid-template-rows: 18px 1fr 1fr; gap: 6px; }
.ob-ax { display: grid; place-items: center; color: var(--muted); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.ob-side { writing-mode: vertical-rl; transform: rotate(180deg); }
/* Chinese, Japanese, Korean: written top to bottom, each character upright (turned, they read upside down) */
/* and a title breaks after its comma, never inside a word (程|度) */
:is(:lang(zh), :lang(ja), :lang(ko)) .ob-step h1 { word-break: keep-all; overflow-wrap: anywhere; }
:is(:lang(zh), :lang(ja), :lang(ko)) .ob-side { transform: none; text-orientation: upright; letter-spacing: 0.15em; }
.ob-q { display: flex; flex-direction: column; gap: 4px; min-height: 92px; padding: 12px 12px 14px; border-radius: 14px; background: linear-gradient(var(--t), var(--t)), var(--card); animation: ob-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d) backwards; }
:root:is([data-theme="white"], [data-theme="black"]) .ob-q { background: var(--panel); }
.ob-q h2 { margin: 0; display: flex; align-items: center; gap: 7px; color: var(--c); font-size: 14.5px; font-weight: 600; }
/* as in the app: the dot centred over the tasks' circles (13px), the title where their text starts (the same gap) */
.ob-q h2::before, .ob-w h2::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 3px; border-radius: 50%; background: var(--c); }
.ob-q p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.ob-task { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 13px; line-height: 1.3; color: var(--ink); }
.ob-circle { flex: none; width: 13px; height: 13px; border-radius: 50%; border: 1.4px solid var(--c); }
@keyframes ob-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.ob-why { margin: 18px 0 0; font-size: 15px; line-height: 1.45; text-wrap: pretty; }
.ob-why b { color: var(--blue); font-weight: 600; }
/* the matrix walk-through: urgent (the left column), then important (the top row), then Make time */
.ob-mx { cursor: pointer; }
.ob-q { transition: filter 0.5s, box-shadow 0.5s; }
.ob-mx[data-beat] .ob-q { filter: grayscale(0.9) opacity(0.35); }
.ob-mx[data-beat="urgent"] .ob-u, .ob-mx[data-beat="important"] .ob-i, .ob-mx[data-beat="focus"] .ob-f { filter: none; box-shadow: inset 0 0 0 1.5px var(--c); }
.ob-ax { transition: color 0.4s; }
.ob-ax.hot { color: var(--ink); font-weight: 700; }
.ob-beat { margin: 24px 0 0; min-height: 2.9em; font-size: 15px; font-weight: 500; line-height: 1.45; text-wrap: pretty; transition: opacity 0.25s; }
.ob-beat.out { opacity: 0; }
.ob-beat b { font-weight: 700; }

/* 2: how it works, each with a small looping picture */
.ob-how { margin: 0; padding: 0; display: grid; gap: 10px; }
.ob-how li { list-style: none; display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; background: var(--card); animation: ob-in 0.45s ease-out var(--d) backwards; }
:root[data-theme="black"] .ob-how li { background: var(--panel); }
.ob-how strong { display: block; margin-bottom: 1px; font-size: 15px; font-weight: 600; }
.ob-how span { font-size: 13px; color: var(--muted); line-height: 1.35; }
.ob-demo { height: 60px; border-radius: 11px; background: linear-gradient(var(--t), var(--t)), var(--bg); position: relative; overflow: hidden; }
.ob-inbox { --t: var(--violet-tint); }
.ob-inbox i { position: absolute; left: 12px; right: 12px; height: 9px; border-radius: 5px; background: color-mix(in srgb, var(--violet) 35%, transparent); }
.ob-inbox i:nth-child(1) { top: 13px; animation: ob-catch 3.2s ease-in-out infinite; }
.ob-inbox i:nth-child(2) { top: 28px; opacity: 0.6; }
.ob-inbox i:nth-child(3) { top: 42px; opacity: 0.35; }
@keyframes ob-catch { 0%, 15% { transform: translateY(-30px); opacity: 0; } 35%, 100% { transform: none; opacity: 1; } }
.ob-five { --t: var(--red-tint); display: grid; grid-template-rows: repeat(5, 1fr); gap: 3px; padding: 7px 10px; }
.ob-five i { border-radius: 3px; background: color-mix(in srgb, var(--red) 35%, transparent); }
.ob-five i:last-child { animation: ob-push 3.2s ease-in-out infinite; }
@keyframes ob-push { 0%, 40% { transform: none; opacity: 1; } 70%, 100% { transform: translateX(110%); opacity: 0; } }
/* hold a task and drag it across */
.ob-hold { --t: transparent; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px; }
.ob-hold b { border-radius: 7px; background: var(--blue-tint); }
.ob-hold b + b { background: var(--red-tint); }
.ob-hold i { position: absolute; left: 10px; top: 25px; width: calc(50% - 14px); height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--blue) 45%, transparent); animation: ob-hold 3.2s ease-in-out infinite; }
@keyframes ob-hold { 0%, 15% { transform: none; box-shadow: none; } 30% { transform: scale(1.12); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18); } 70% { transform: translateX(calc(100% + 10px)) scale(1.12); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18); } 85%, 100% { transform: translateX(calc(100% + 10px)); box-shadow: none; } }
.ob-done { --t: var(--green-tint); display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.ob-done b { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1.6px solid var(--green); animation: ob-fill 3.2s ease-in-out infinite; }
.ob-done s { flex: 1; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 18%, transparent); position: relative; text-decoration: none; }
.ob-done s::after { content: ""; position: absolute; left: 0; top: 3px; height: 2px; width: 0; background: var(--muted); animation: ob-strike 3.2s ease-in-out infinite; }
@keyframes ob-fill { 0%, 20% { background: transparent; } 30%, 100% { background: var(--green); } }
@keyframes ob-strike { 0%, 25% { width: 0; } 45%, 100% { width: 100%; } }
/* voice: the mic (as in the app) and the sound it hears */
.ob-voice { --t: var(--violet-tint); display: flex; align-items: center; justify-content: center; gap: 3px; }
.ob-voice b { display: grid; place-items: center; width: 30px; height: 30px; margin-right: 7px; border-radius: 50%; background: var(--violet); color: #fff; animation: ob-listen 1.6s ease-out infinite; }
.ob-voice svg { width: 17px; height: 17px; }
.ob-voice i { width: 3px; height: 22px; border-radius: 2px; background: color-mix(in srgb, var(--violet) 55%, transparent); transform: scaleY(0.3); animation: ob-wave 1.1s ease-in-out infinite; }
.ob-voice i:nth-of-type(2) { animation-delay: 0.15s; }
.ob-voice i:nth-of-type(3) { animation-delay: 0.3s; }
.ob-voice i:nth-of-type(4) { animation-delay: 0.45s; }
.ob-voice i:nth-of-type(5) { animation-delay: 0.6s; }
@keyframes ob-wave { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@keyframes ob-listen { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--violet) 40%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }

/* 3: sign in */
/* the app's own icon, as on the home screen */
.ob-mark { display: block; width: 72px; height: 72px; margin: 6px 0 20px; border-radius: 22.5%; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14); }
/* the widgets screen: four widgets as on a home screen, a quadrant each, with a few tasks in its color */
.ob-ws { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px; border-radius: 26px; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.ob-w { aspect-ratio: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 13px 12px; border-radius: 20px; overflow: hidden; background: linear-gradient(var(--t), var(--t)), var(--card); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); animation: ob-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d) backwards; }
:root:is([data-theme="white"], [data-theme="black"]) .ob-w { background: var(--panel); }
.ob-w h2 { margin: 0 0 2px; display: flex; align-items: center; gap: 7px; color: var(--c); font-size: 14px; font-weight: 600; white-space: nowrap; }
.ob-w .ob-task span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-whereto { margin: 24px 0 0; font-size: 15px; font-weight: 500; line-height: 1.45; text-wrap: pretty; } /* as the matrix's line (.ob-beat) */
.ob-perks { margin: 0; padding: 0; display: grid; gap: 10px; }
.ob-perks li { list-style: none; display: flex; gap: 10px; font-size: 15px; }
.ob-perks li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 72% no-repeat; }

@media (prefers-reduced-motion: reduce) {
  .ob *, .ob *::before, .ob *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* completing a task: a small burst of confetti from its circle, in its section's color and Done's green */
.burst { position: fixed; z-index: 70; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 2px; }

/* A section's header lines up with its tasks: the dot (or icon) centred over the circles, the title where the
   text starts. --inset (the list's and the row's padding), --mark (a circle) and --gap (circle to text) are the
   rows' own measurements. */
.sec { --inset: 16px; --mark: 18px; --gap: 10px; }
.sec .head { padding-left: var(--inset); gap: var(--gap); }
.sec .head .dot { margin: 0 calc((var(--mark) - 8px) / 2); }
.sec .head .icon { margin: 0 calc((var(--mark) - 17px) / 2); }
@media (max-width: 720px) {
  .sec { --inset: 10px; --mark: 19px; --gap: 8px; }
}

/* The onboarding fits the screen it's on: the whole screen on a phone; a card on a tablet or computer, sized to the
   window (taller windows give it more room, a short one scrolls its screens). The first time, it covers the app
   entirely (nothing of it shows behind); from the menu, it sits over the dimmed app. */
.ob.ob-first { background: var(--bg); }
.ob-card { width: min(460px, 100% - 32px); height: min(820px, 100% - 48px); }
@media (min-width: 601px) and (min-height: 900px) { .ob-card { width: min(500px, 100% - 64px); height: min(880px, 100% - 96px); padding: 36px 34px 30px; } }
@media (max-width: 600px), (hover: none) and (max-width: 900px), (max-height: 560px) {
  .ob-card { width: 100%; height: 100%; }
}
@media (max-height: 560px) { .ob-card { border-radius: 0; box-shadow: none; } .ob-mx .ob-q { min-height: 72px; } }
.ob-first .ob-card { box-shadow: none; }

/* the top row: the language (left), the screens (middle), Skip (right) */
.ob-top { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
.ob-top .ob-dots { margin-left: 0; justify-self: center; }
.ob-top .ob-skip { justify-self: end; }
.ob-lang { position: relative; justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; max-width: 100%; padding: 0 8px 0 2px; border-radius: 9px; color: var(--muted); font-size: 14px; cursor: pointer; }
.ob-lang:hover, .ob-lang:focus-within { color: var(--ink); }
.ob-lang:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.ob-globe { display: grid; place-items: center; flex: none; }
.ob-globe svg { width: 19px; height: 19px; }
.ob-lang-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the phone's own list to pick from, over the globe and the name */
.ob-lang-pick { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; appearance: none; -webkit-appearance: none; border: 0; }
@media (max-width: 380px) { .ob-lang-name { display: none; } } /* a small phone: the globe alone */

/* the menu's language row: its name on the right */
.menu-lang-now { float: right; margin-left: 12px; color: var(--muted); }
.menu button#menu-lang { position: relative; }
.menu-lang-pick { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; border: 0; }

/* the language list on a computer (lang-list.js): a card under the globe or the row, the current one checked */
.lang-list { position: fixed; z-index: 5; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 6px; border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 0, 0, 0.08); animation: pop 0.14s ease-out; outline: none; }
.lang-list::-webkit-scrollbar { display: none; }
.lang-list.up { animation-name: pop-up; }
@keyframes pop-up { from { opacity: 0; transform: translateY(4px) scale(0.98); } }
:root[data-theme="black"] .lang-list { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent); }
.lang-list [role="option"] { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 9px; font-size: 14px; line-height: 1.3; cursor: pointer; }
.lang-list [role="option"].active { background: var(--grey-tint); }
:root[data-theme="black"] .lang-list [role="option"].active { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.lang-list [role="option"] svg { flex: none; width: 16px; height: 16px; color: var(--blue); visibility: hidden; }
.lang-list [role="option"][aria-selected="true"] { font-weight: 600; }
.lang-list [role="option"][aria-selected="true"] svg { visibility: visible; }

/* the first open: nothing of the app shows until the intro covers it (index.html sets data-first before first paint) */
html[data-first] .app, html[data-first] .brand { visibility: hidden; }

/* Voice input (voice.js): the mic, bottom center (above the keyboard; over a section's page too, not Done's), and the
   sheet of what was heard */
.voice-mic { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(var(--kb, 0px) + max(16px, env(safe-area-inset-bottom))); width: 52px; height: 52px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--violet); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--violet) 35%, transparent); cursor: pointer; transition: bottom 0.2s ease; }
.voice-mic svg { width: 24px; height: 24px; }
.voice-mic:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.voice-mic.on { background: var(--red); animation: voice-pulse 1.2s ease-in-out infinite; }
@keyframes voice-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 45%, transparent); } 50% { box-shadow: 0 0 0 12px transparent; } }
.voice-mic[hidden], .page[data-sec="done"]:not([hidden]) ~ .voice-mic { display: none; }
/* the mic stays at the bottom; the undo pill (Done, Undo) shows above it (not on Done's page, where there's no mic) */
.voice-mic:not([hidden]) ~ .undo-bar { bottom: calc(var(--kb, 0px) + max(16px, env(safe-area-inset-bottom)) + 64px); }
.page[data-sec="done"]:not([hidden]) ~ .voice-mic ~ .undo-bar { bottom: calc(var(--kb, 0px) + max(16px, env(safe-area-inset-bottom))); }

.voice-sheet { position: fixed; z-index: 40; left: 50%; bottom: calc(var(--kb, 0px) + max(16px, env(safe-area-inset-bottom)) + 64px); /* above the mic */ transform: translateX(-50%); width: min(480px, calc(100% - 24px)); max-height: calc(100% - 92px - var(--kb, 0px)); overflow: auto; padding: 14px; border-radius: 22px; background: var(--card); color: var(--ink); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2); }
.voice-sheet[hidden] { display: none; }
.voice-heard { font-size: 14px; color: var(--muted); padding: 2px 4px 0; min-height: 20px; }
.voice-heard.said { color: var(--ink); opacity: 0.75; font-style: italic; }
.voice-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.voice-cards:empty { display: none; }
.voice-card { position: relative; padding: 10px 12px 12px; border-radius: 14px; background: var(--t); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.voice-top { display: flex; align-items: center; gap: 8px; }
.voice-text { flex: 1; min-width: 0; padding: 4px 6px; margin-left: -6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 17px; font-weight: 600; }
.voice-text:hover { border-color: var(--line); }
.voice-text:focus { outline: none; border-color: color-mix(in srgb, var(--c) 45%, transparent); background: var(--card); }
.voice-due { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 9px; border-radius: 999px; background: var(--card); color: var(--muted); font-size: 13px; }
.voice-undue { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.voice-undue:hover { color: var(--ink); }
.voice-delete { flex: none; width: 32px; height: 32px; margin-right: -6px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.voice-delete svg { width: 18px; height: 18px; }
.voice-delete:hover { color: var(--red); background: var(--card); }
/* in the app, the first tap of the mic: what the microphone is for, before the phone asks; or how to turn it back on */
.voice-heard:empty { display: none; }
.voice-heard:empty + .voice-cards { margin-top: 0; }
.voice-ask { padding: 2px 4px 0; }
.voice-ask h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.voice-ask p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.voice-ask .voice-actions { margin-top: 14px; }
.voice-why { margin: 4px 0 9px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.voice-why mark { padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--ink); }
.voice-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.voice-chip { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.voice-chip:hover { border-color: var(--c); }
.voice-chip[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.voice-actions { display: flex; gap: 8px; margin-top: 12px; }
.voice-actions[hidden] { display: none; }
.voice-actions button { flex: 1; padding: 11px; border: 0; border-radius: 12px; font: inherit; font-size: 15px; cursor: pointer; }
.voice-cancel { background: var(--line); color: var(--ink); }
.voice-add { position: relative; overflow: hidden; background: var(--ink); color: var(--bg); font-weight: 600; }
.voice-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: color-mix(in srgb, var(--bg) 65%, transparent); }
.counting .voice-bar { animation: voice-count linear forwards; }
@keyframes voice-count { from { width: 0; } to { width: 100%; } }
:root[data-theme="black"] .voice-cancel { background: rgba(255, 255, 255, 0.1); }

/* the keyboard shortcuts: keys on the left, what they do on the right; only offered where there's a keyboard */
.sheet.keys { width: min(460px, 100%); }
.keys-list { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; margin: 0; text-align: left; }
.keys-list dt { display: flex; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.keys-list dd { margin: 0; font-size: 14px; line-height: 1.35; }
.keys-list kbd { min-width: 24px; padding: 4px 7px; border-radius: 7px; font: 600 12px/1.2 inherit; text-align: center;
  background: color-mix(in srgb, var(--ink) 6%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); border-bottom-width: 2px; }
@media (hover: none) { #menu-keys { display: none; } }
/* a done or deleted line reached from the keyboard */
.row.done:focus, .row.deleted:focus { outline: none; }
.row.done:focus-visible, .row.deleted:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 10px; }
