/* The new web app (/app). Desktop layout: sidebar | page (header with its toolbar, fast-add over it, list); Info is a popup over it.
   Light and dark: every dark rule hangs off `nw-dark` on the root, which the page's head sets before the first paint from
   Settings → Appearance (phase 8A): Dark, or System while the computer is dark (prefers-color-scheme); Light never.
   System fonts, plain lists, square checkboxes. */

:root {
  color-scheme: light;
  /* Shared sizes (web round 12): the sidebar's width, and the row's layout, which the entry box's text lines up with. */
  --nw-sidebar-width: 240px;
  --nw-row-pad-x: 12px;
  --nw-row-gap: 10px;
  /* A row's height and its padding above and below, which the checkbox, chevron, star and Delete buttons reach over
     (negative margins) to take the row's full height; the entry row is the same height. Web round 18 (the app's round
     16 rows): a one-line row keeps a two-line row's room, its padding, the name's line (14 px at 1.4, the body's), the
     due line's (13 px at 1.3, `.nw-due`) and its bottom border (about 41.5 px, was 38), so a plain row, a row with a
     due line and a completed one with "Completed on" are one height and a check-off never changes it. */
  --nw-row-height: calc(2 * var(--nw-row-pad-y) + 1.4 * 14px + 1.3 * 13px + 1px);
  --nw-row-pad-y: 2px;
  /* The checkbox's room in the row (its button is wider, over the padding and the gap). */
  --nw-check-room: 22px;
  --nw-outline-column: 20px;
  --nw-level-step: 30px;
  --nw-bg: #ffffff;
  --nw-text: #1d1d1f;
  --nw-muted: #6e6e73;
  --nw-line: #e3e3e6;
  --nw-sidebar-bg: #f2f2f4;
  --nw-hover: rgba(0, 0, 0, 0.04);
  --nw-selected: rgba(0, 113, 227, 0.12);
  --nw-accent: #0071e3;
  --nw-field-bg: #ffffff;
  --nw-banner-bg: #1d1d1f;
  --nw-banner-text: #ffffff;
  --nw-lost-bg: #b3261e;
  --nw-header-text: #000000;
  /* The due line's tones (`.red`, `.orange`) and the unstarred star's outline (system gray). */
  --nw-overdue: #ff3b30;
  --nw-today: #ff9500;
  --nw-star-outline: #8e8e93;
  /* The row's symbols, drawn as masks in the colour they sit in. */
  --nw-notes-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='2.25' y='1.75' width='11.5' height='12.5' rx='2.25' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3Cpath d='M5 5.25h6M5 8h6M5 10.75h3.5' stroke='%23000' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E");
  --nw-alarm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8.75' r='5.5' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3Cpath d='M8 5.75v3.25l2 1.5M1.75 3.75 4 1.75M14.25 3.75 12 1.75M4.5 13.25l-1.25 1.5M11.5 13.25l1.25 1.5' fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --nw-repeat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 7.5a5.5 5.5 0 0 1 9.6-3.4M13.5 8.5a5.5 5.5 0 0 1-9.6 3.4' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M13 1.5v3.5H9.5M3 14.5V11h3.5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --nw-reorder-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 13.5V2.5M2 5.5l3-3 3 3M11 2.5v11M8 10.5l3 3 3-3' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  /* Select (web round 9, in Reorder's place): a checkmark in a circle. */
  --nw-trash-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 4h11M6.25 4V2.5h3.5V4M4 4l.75 9.5h6.5L12 4M6.75 6.5v4.75M9.25 6.5v4.75' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --nw-folder-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1.75 4.25a1 1 0 0 1 1-1h3.5l1.5 1.5h5.5a1 1 0 0 1 1 1v6.75a1 1 0 0 1-1 1H2.75a1 1 0 0 1-1-1z' fill='none' stroke='%23000' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E");
  --nw-info-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8.6' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Ccircle cx='10' cy='6.1' r='1.2'/%3E%3Cpath d='M10 9v5.6' stroke='%23000' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E");
  --nw-close-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 1.5l9 9M10.5 1.5l-9 9' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  --nw-ellipsis-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='2.75' cy='8' r='1.5' fill='%23000'/%3E%3Ccircle cx='8' cy='8' r='1.5' fill='%23000'/%3E%3Ccircle cx='13.25' cy='8' r='1.5' fill='%23000'/%3E%3C/svg%3E");
  --nw-plus-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2.5v11M2.5 8h11' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  --nw-checkmark-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.25 3.25L13 4.75' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --nw-chevron-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3l5 5-5 5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --nw-star-fill-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.6l2.6 5.4 5.9.8-4.3 4.1 1.1 5.9L10 15l-5.3 2.8 1.1-5.9L1.5 7.8l5.9-.8z' fill='%23000' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E");
  --nw-search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='5.75' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Cpath d='M12.75 12.75l4.5 4.5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  --nw-gear-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M14.82 6.97L14.82 9.03L13.14 9.28L12.54 10.73L13.55 12.10L12.10 13.55L10.73 12.54L9.28 13.14L9.03 14.82L6.97 14.82L6.72 13.14L5.27 12.54L3.90 13.55L2.45 12.10L3.46 10.73L2.86 9.28L1.18 9.03L1.18 6.97L2.86 6.72L3.46 5.27L2.45 3.90L3.90 2.45L5.27 3.46L6.72 2.86L6.97 1.18L9.03 1.18L9.28 2.86L10.73 3.46L12.10 2.45L13.55 3.90L12.54 5.27L13.14 6.72z' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'/%3E%3Ccircle cx='8' cy='8' r='2.25' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E");
  --nw-sidebar-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='1.5' y='2.5' width='13' height='11' rx='2.25' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3Cpath d='M6 2.75v10.5' stroke='%23000' stroke-width='1.4'/%3E%3Cpath d='M3.25 5.25h1.25M3.25 7.25h1.25M3.25 9.25h1.25' stroke='%23000' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E");
  --nw-star-outline-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.6l2.6 5.4 5.9.8-4.3 4.1 1.1 5.9L10 15l-5.3 2.8 1.1-5.9L1.5 7.8l5.9-.8z' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E");
}

:root:where(.nw-dark) {
  color-scheme: dark;
  --nw-bg: #1c1c1e;
  --nw-text: #f2f2f7;
  --nw-muted: #a1a1a6;
  --nw-line: #38383a;
  --nw-sidebar-bg: #242426;
  --nw-hover: rgba(255, 255, 255, 0.05);
  --nw-selected: rgba(10, 132, 255, 0.25);
  --nw-accent: #0a84ff;
  --nw-field-bg: #2c2c2e;
  --nw-banner-bg: #f2f2f7;
  --nw-banner-text: #1c1c1e;
  --nw-lost-bg: #d93a32;
  --nw-header-text: #ffffff;
  --nw-overdue: #ff453a;
  --nw-today: #ff9f0a;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--nw-bg);
  color: var(--nw-text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* MARK: Layout */

.nw-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Always exactly its width (web round 20): a flex item is at least as wide as its widest unbreakable content, so a long
   page name, in bold when it is the open page's, widened it as pages were picked; `min-width: 0` lets the names cut off
   with their ellipsis instead. */
.nw-side {
  flex: 0 0 var(--nw-sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--nw-sidebar-bg);
  border-right: 1px solid var(--nw-line);
}

/* Hidden with the header's sidebar button (web round 11, `nw-sidebar-hidden` on the root, set by the page's head before
   the first paint): it slides out to the left over 0.2 s as the page widens, then is hidden, so nothing in it can be
   reached (the script also makes it inert); shown again, it is visible at once and slides back. No slide under Reduce
   Motion. */
.nw-side { transition: margin-left 0.2s ease, visibility 0s linear 0s; }
.nw-sidebar-hidden .nw-side {
  overflow: hidden;
  margin-left: calc(-1 * var(--nw-sidebar-width));
  visibility: hidden;
  transition: margin-left 0.2s ease, visibility 0s linear 0.2s;
}
@media (prefers-reduced-motion: reduce) {
  .nw-side, .nw-sidebar-hidden .nw-side { transition: none; }
}

.nw-side-search { padding: 12px 8px 4px; }

/* The scroll bar's room is kept whether the page list scrolls or not (scroll bars always shown), so the names don't
   move when it comes and goes. */
.nw-sidebar {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 8px 8px 0;
}

/* Classic site and Settings stay at the sidebar's bottom while the page list scrolls under them (web round 9). */
.nw-side-footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  margin: auto -8px 0;
  padding: 8px 8px 10px;
  border-top: 1px solid var(--nw-line);
  background: var(--nw-sidebar-bg);
}

.nw-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  /* What is scrolled into view (the entry box, a focused row) stops below the pinned header (web round 11); the script
     keeps its height here. */
  scroll-padding-top: var(--nw-header-height, 68px);
}

/* Info's popup (web round 9): a centred panel over the dimmed page, as Page Info's dialog is; below a dialog opened
   from it (a delete confirmation, z-index 50), the menus and the banner (25, so its Undo stays reachable). It scrolls
   itself, its bar kept at the top. */
.nw-info-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.28);
}

.nw-info-modal[hidden] { display: none; }

.nw-info-slot {
  width: min(460px, calc(100vw - 32px));
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 12px;
  background: var(--nw-bg);
  box-shadow: var(--nw-shadow);
}

.nw-info-slot:focus { outline: none; }

/* MARK: Sidebar */

.nw-pages {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nw-page-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}

.nw-page-link:hover { background: var(--nw-hover); }

/* A page row: its link, then the "…" button for the page's items (Rename, Color, Reminders, Delete). */
.nw-page:has(> .nw-page-more) { display: flex; align-items: center; gap: 2px; }
.nw-page > .nw-page-link { flex: 1 1 auto; min-width: 0; }

.nw-page-more, .nw-template-more {
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--nw-muted);
  cursor: pointer;
}

.nw-page-more::before, .nw-template-more::before {
  content: "";
  position: absolute;
  inset: 5px;
  background: currentColor;
  -webkit-mask: var(--nw-ellipsis-icon) center / contain no-repeat;
  mask: var(--nw-ellipsis-icon) center / contain no-repeat;
}
.nw-page-more:hover, .nw-page-more.nw-menu-open,
.nw-template-more:hover, .nw-template-more.nw-menu-open { background: var(--nw-hover); color: var(--nw-text); }

.nw-page.nw-selected > .nw-page-link {
  background: var(--nw-selected);
  font-weight: 600;
}

.nw-page-focus { margin-bottom: 8px; }

/* A page's colour dot: its swatch for the appearance (`--nw-dot`, as the group headers' dots), with the app's grey outline
   on a light one that is hard to see. */
.nw-page-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--nw-dot);
}

.nw-page-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nw-blank { color: var(--nw-muted); font-style: italic; }

/* A shared page's marker, the app's `person.2` in the secondary colour (every shared page: own or shared to you). */
.nw-shared-marker {
  flex: none;
  width: 18px;
  height: 12px;
  background: var(--nw-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Ccircle cx='8.5' cy='4.5' r='3.5'/%3E%3Cpath d='M1 15c0-3.9 3.4-6 7.5-6s7.5 2.1 7.5 6z'/%3E%3Ccircle cx='17' cy='5' r='3'/%3E%3Cpath d='M17.5 9.3c3.3.2 5.5 2 5.5 5.7h-5.4c0-2.2-.8-4.2-2.4-5.4.7-.2 1.5-.3 2.3-.3z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Ccircle cx='8.5' cy='4.5' r='3.5'/%3E%3Cpath d='M1 15c0-3.9 3.4-6 7.5-6s7.5 2.1 7.5 6z'/%3E%3Ccircle cx='17' cy='5' r='3'/%3E%3Cpath d='M17.5 9.3c3.3.2 5.5 2 5.5 5.7h-5.4c0-2.2-.8-4.2-2.4-5.4.7-.2 1.5-.3 2.3-.3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* A blank page name stays blank, as the app's `displayName`; the empty title keeps its line. */
.nw-page-title:empty::before { content: "\200B"; }

/* "No Lists" (`PageWording.emptyLists`): the app's empty page list. */
.nw-no-pages {
  margin: 16px 8px 0;
  color: var(--nw-muted);
  font-weight: 600;
  text-align: center;
}

.nw-page-count {
  color: var(--nw-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* My Priorities' count: a red capsule with white digits, as the iPad sidebar's (round 18); the pages keep their grey
   counts. The system red for the appearance. */
.nw-page-focus .nw-page-count {
  flex: none;
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-weight: 600;
  text-align: center;
}
:where(.nw-dark) .nw-page-focus .nw-page-count { background: #ff453a; }

.nw-new-page {
  margin: 8px 0 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--nw-accent);
  text-align: left;
  cursor: pointer;
}

.nw-new-page:hover { background: var(--nw-hover); }

/* The app's New Page is its "+" (`plus`): the sign is drawn, the button's name is "New Page". */
.nw-new-page-plus::before { content: "+"; margin-right: 6px; font-weight: 600; }

/* The Templates section (`TemplateSection`, the page list's section 1): after the pages and New Page, under its
   "Templates" header; each row is its colour dot and name (no count, no shared marker) as a button, then its "…". */
.nw-templates { margin: 16px 0 0; }
.nw-templates > h2 {
  margin: 0 0 4px;
  padding: 0 8px;
  color: var(--nw-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.nw-template-list { list-style: none; margin: 0; padding: 0; }
.nw-template { display: flex; align-items: center; gap: 2px; }
.nw-template-open {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nw-template-open:hover { background: var(--nw-hover); }

/* MARK: Header (page color at the app's opacity) */

/* Pinned at the top of the main column while the list scrolls under it (web round 11): solid (the page's background,
   with the band over it), above the rows, below the menus, the Info popup, the banner and the dialogs. */
.nw-header {
  position: sticky;
  top: 0;
  z-index: 5;
  flex: 0 0 auto;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px 18px 16px;
  background: var(--nw-bg);
  color: var(--nw-header-text);
}

/* The sidebar button (`sidebar.left`), first in the header, in the toolbar's round button. */
.nw-sidebar-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--nw-header-text);
  cursor: pointer;
}
.nw-sidebar-toggle::before {
  content: "";
  position: absolute;
  inset: 7px;
  background: currentColor;
  -webkit-mask: var(--nw-sidebar-icon) center / contain no-repeat;
  mask: var(--nw-sidebar-icon) center / contain no-repeat;
}
.nw-sidebar-toggle:hover { background: rgba(255, 255, 255, 0.8); }
:where(.nw-dark) .nw-sidebar-toggle { background: rgba(0, 0, 0, 0.3); }

.nw-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--nw-page-color);
  opacity: var(--nw-header-opacity, 0.5);
}

/* The app's band (`PageBar.color`): the exact colour in light mode (Increase Contrast too); in dark mode the app's dark
   swatch, its stronger one with Increase Contrast. */
:where(.nw-dark) .nw-header::before { background: var(--nw-page-color-dark, var(--nw-page-color)); opacity: var(--nw-header-opacity-dark, 0.62); }
@media (prefers-contrast: more) {
  :where(.nw-dark) .nw-header::before { background: var(--nw-page-color-dark-more, var(--nw-page-color)); }
}

.nw-page-title,
.nw-search-title {
  flex: 1 1 auto;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nw-page-title.nw-blank { color: inherit; opacity: 0.6; }

/* While a search shows (`.nw-searching`, on the main column, which no swap replaces), the header's title is the app's
   search title (`SearchStrings.title`) and the page's toolbar is hidden; each header the server draws carries both titles,
   so a poll's new header shows the same. */
.nw-search-title { display: none; }
.nw-main.nw-searching .nw-search-title { display: block; }
.nw-main.nw-searching .nw-header :is(.nw-page-title, .nw-toolbar, .nw-reorder-bar) { display: none; }

/* The page's own commands (`PageToolbarLayout`): Reorder (`arrow.up.arrow.down`), then the "…" menu (`ellipsis`, a
   drawn icon so it sits in the middle, as a text glyph on its baseline doesn't), then fast-add's "+" (`plus`). */
.nw-toolbar { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }

.nw-toolbar button {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--nw-header-text);
  cursor: pointer;
}

:where(.nw-dark) .nw-toolbar button { background: rgba(0, 0, 0, 0.3); }

.nw-toolbar button:hover:not(:disabled), .nw-toolbar button.nw-menu-open { background: rgba(255, 255, 255, 0.8); }
.nw-toolbar button:disabled { opacity: 0.4; cursor: default; }
.nw-toolbar .nw-more::before,
.nw-toolbar .nw-add::before {
  content: "";
  position: absolute;
  inset: 8px;
  background: currentColor;
  -webkit-mask: var(--nw-reorder-icon) center / contain no-repeat;
  mask: var(--nw-reorder-icon) center / contain no-repeat;
}

/* Select says its word (web round 11, `ListWording.select`), in the same pill as its neighbours: their height, their
   fill and their round ends, as wide as the word needs. */
.nw-toolbar .nw-reorder {
  width: auto;
  min-width: 32px;
  padding: 0 12px;
  font-weight: 500;
  white-space: nowrap;
}
.nw-toolbar .nw-more::before { -webkit-mask-image: var(--nw-ellipsis-icon); mask-image: var(--nw-ellipsis-icon); }
.nw-toolbar .nw-add::before { -webkit-mask-image: var(--nw-plus-icon); mask-image: var(--nw-plus-icon); }

/* Reorder's bar (`ReorderSelectionBar`), in the toolbar's place while the page is reordered: Done (`checkmark`), then,
   apart, Move (`folder`) and Delete (`trash`, red when it can act) as one group, each with the selection's count. */
.nw-toolbar[hidden], .nw-reorder-bar[hidden] { display: none; }
.nw-reorder-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.nw-reorder-done { margin-right: 18px; }

.nw-reorder-bar button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--nw-header-text);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

:where(.nw-dark) .nw-reorder-bar button { background: rgba(0, 0, 0, 0.3); }

.nw-reorder-bar button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.8); }
.nw-reorder-bar button:disabled { opacity: 0.4; cursor: default; }
.nw-delete-selected:not(:disabled) { color: var(--nw-danger, #ff3b30); }

.nw-reorder-bar button::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  background: currentColor;
}

.nw-reorder-done::before { -webkit-mask: var(--nw-checkmark-icon) center / contain no-repeat; mask: var(--nw-checkmark-icon) center / contain no-repeat; }
.nw-move-selected::before { -webkit-mask: var(--nw-folder-icon) center / contain no-repeat; mask: var(--nw-folder-icon) center / contain no-repeat; }
.nw-delete-selected::before { -webkit-mask: var(--nw-trash-icon) center / contain no-repeat; mask: var(--nw-trash-icon) center / contain no-repeat; }

/* MARK: Settings page */

.nw-settings-header { background: var(--nw-sidebar-bg); border-bottom: 1px solid var(--nw-line); }
.nw-settings-header::before { display: none; }

.nw-settings {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 560px;
  padding: 18px 24px 48px;
}

.nw-setting {
  margin: 0;
  padding: 0;
  border: 0;
}

.nw-setting-title {
  padding: 0;
  margin-bottom: 6px;
  color: var(--nw-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.nw-setting-choices {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--nw-line);
  border-radius: 10px;
  overflow: hidden;
}

.nw-setting-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--nw-field-bg);
  cursor: pointer;
}

.nw-setting-choices .nw-setting-choice + .nw-setting-choice { border-top: 1px solid var(--nw-line); }
.nw-setting > .nw-switch { border: 1px solid var(--nw-line); border-radius: 10px; }
.nw-setting-choice input { margin: 0; accent-color: var(--nw-accent); }

.nw-setting-help {
  margin: 6px 12px 0;
  color: var(--nw-muted);
  font-size: 12px;
}

/* Information's support row (phase 8A): a row like the choices', a link to the support website (a new tab). */
/* Information's rows: Support Website and (round 14) Classic site */
.nw-support-link, .nw-classic-link { color: var(--nw-accent); text-decoration: none; }
.nw-support-link:hover, .nw-classic-link:hover { background: var(--nw-hover); text-decoration: underline; }

/* Settings → Account (phase 8D): the account's email, then rows that open its dialogs; Delete Account in its own box, red. */
.nw-account-address { margin: 0; cursor: default; overflow-wrap: anywhere; }
.nw-account-action {
  width: 100%;
  border: 0;
  color: var(--nw-accent);
  font: inherit;
  text-align: left;
}
.nw-account-action:hover { background: var(--nw-hover); }
.nw-account-action:focus-visible { outline: 2px solid var(--nw-accent); outline-offset: -2px; }
.nw-account-delete { color: var(--nw-danger); }
.nw-account-delete:focus-visible { outline-color: var(--nw-danger); }
.nw-dialog-error { margin: 0; color: var(--nw-danger); font-size: 13px; }
.nw-dialog-error[hidden] { display: none; }
.nw-dialog-buttons button:disabled { opacity: 0.45; cursor: default; }

/* The app's two screens as groups: General, then Reminder Defaults with each default's screen in place under its row. */
.nw-settings-group {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.nw-settings-heading { margin: 0; font-size: 17px; font-weight: 600; }
.nw-settings-group-help { margin: -16px 0 0; color: var(--nw-muted); font-size: 12px; }

/* A default's row value, on its title's line: bold while its Automatic switch is on (`ReminderDefaultRow.isBold`). The title
   floats so the value can sit beside it. */
.nw-setting[data-default] { position: relative; }
.nw-setting[data-default] > legend { float: left; width: 100%; }
.nw-setting[data-default] > :not(legend) { clear: both; }
.nw-default-value {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  color: var(--nw-muted);
  font-size: 12px;
}
.nw-default-value[data-on="1"] { color: var(--nw-text); font-weight: 700; }

.nw-setting-subhead {
  margin: 14px 0 6px;
  color: var(--nw-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* The long lists (7 to 21 choices) in two columns, in the app's order across then down. */
.nw-setting[data-default] .nw-setting-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--nw-field-bg);
}
.nw-setting[data-default] .nw-setting-choices .nw-setting-choice + .nw-setting-choice { border-top: 0; }
.nw-setting[data-default] .nw-setting-choices .nw-setting-choice:nth-child(even) { border-left: 1px solid var(--nw-line); }
.nw-setting[data-default] .nw-setting-choices .nw-setting-choice:nth-child(n + 3) { border-top: 1px solid var(--nw-line); }

/* The Due Time wheel, as a list of its 5-minute steps. */
.nw-setting-time {
  margin-top: 10px;
  padding: 7px 10px;
  border: 1px solid var(--nw-line);
  border-radius: 10px;
  background: var(--nw-field-bg);
  color: inherit;
  font: inherit;
}

.nw-settings-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}

/* The gear before the word, in the link's own colour (light and dark). */
.nw-settings-link::before {
  content: "";
  flex: 0 0 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--nw-gear-icon) center / contain no-repeat;
  mask: var(--nw-gear-icon) center / contain no-repeat;
}

.nw-settings-link:hover { background: var(--nw-hover); }
.nw-settings-link.nw-selected { background: var(--nw-selected); font-weight: 600; }

/* MARK: Search and fast-add */

.nw-search,
.nw-entry-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--nw-line);
  border-radius: 8px;
  background: var(--nw-field-bg);
  outline: none;
}

.nw-search:focus,
.nw-entry-input:focus,
.nw-info input:focus,
.nw-info textarea:focus,
.nw-info select:focus {
  border-color: var(--nw-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--nw-accent) 25%, transparent);
}

/* Fast-add's box (`FastAddField`) and Done (the checkmark), inline as the classic site's (round 10): while entering, the
   script puts the form in a row of the list (`nw-entry-row`) at the spot the new tasks land; the page title and the
   toolbar stay. The box's text starts where the new task's name will (web round 11), worked out from the row's own
   sizes (the root's variables): the row's padding, the checkbox's room and the gap make a top-level name's x; a page
   with parents adds the outline column and its gap, and a subtask's row one more level, where a page's first subtask
   also lands once it has one. The box's own left edge is its border and padding (1 + 10) before that. No line down a
   subitem box's left (web round 11). */
.nw-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.nw-entry[hidden] { display: none; }

.nw-entry-row {
  --nw-entry-text-inset: 11px;
  /* The outline column and the level, when they apply (the rules below; each sets the same value, so neither has to win). */
  --nw-entry-outline: 0px;
  --nw-entry-level: 0px;
  display: flex;
  align-items: center;
  min-height: var(--nw-row-height);
  padding: var(--nw-row-pad-y) 6px var(--nw-row-pad-y) calc(var(--nw-row-pad-x) + var(--nw-check-room) + var(--nw-row-gap)
    + var(--nw-entry-outline) + var(--nw-entry-level) - var(--nw-entry-text-inset));
  border-bottom: 1px solid var(--nw-line);
}

.nw-rows:has(> .nw-row > :is(.nw-chevron, .nw-chevron-space)) > .nw-entry-row,
.nw-entry-row[data-level="1"] { --nw-entry-outline: calc(var(--nw-outline-column) + var(--nw-row-gap)); }

.nw-entry-row > .nw-entry { flex: 1 1 auto; }

/* The entry row's checkbox (round 13): the rows' square, greyed and inert, where a row's button sits (its left edge at
   the outline column and level, the row's full height), out of the flow so the box keeps its own inset. */
.nw-entry-row { position: relative; }
.nw-entry-row > .nw-check {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--nw-entry-outline) + var(--nw-entry-level));
  min-height: 0;
  margin: 0;
  cursor: default;
  pointer-events: none;
  opacity: 0.45;
}

/* A subitem box: always past the outline column (above: the parent gets its chevron with the first subtask), one level in. */
.nw-entry-row[data-level="1"] { --nw-entry-level: var(--nw-level-step); }

/* A one-row textarea (round 13): 32 px for one line (18 px lines, 6 px padding), growing with its text (the script sets
   its height); never a scroll bar or a resize handle. */
.nw-entry .nw-entry-input {
  flex: 1 1 auto;
  display: block;
  min-width: 0;
  min-height: 32px;
  padding-top: 6px;
  padding-bottom: 6px;
  color: var(--nw-text);
  font: inherit;
  line-height: 18px;
  resize: none;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.nw-entry .nw-entry-input::placeholder { color: var(--nw-muted); opacity: 1; }

.nw-entry-done {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: none;
  color: var(--nw-accent);
  cursor: pointer;
}

.nw-entry-done:hover { background: var(--nw-hover); }
.nw-entry-done:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--nw-accent); }

.nw-entry-done::before {
  content: "";
  position: absolute;
  inset: 8px;
  background: currentColor;
  -webkit-mask: var(--nw-checkmark-icon) center / contain no-repeat;
  mask: var(--nw-checkmark-icon) center / contain no-repeat;
}

/* MARK: List */

.nw-list {
  --nw-list-inset: 12px;
  padding: 0 var(--nw-list-inset) 48px;
}

.nw-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* The app's row (`TaskRowView`), its points as pixels: checkbox 18 (the author's web round 9 choice; the app's is 22),
   star 20, icons 15, 10 between them, 30 per level. `nw-completed` is the stored state, which the checkbox shows at
   once. The rest of the look (the struck-out one-line name, the dimmed line, icons and star) is the one from before a
   check-off while the row is `nw-look-held`, until the page's settle (`TaskRowLook`): "looks completed" is completed and not held, or held and not completed. */
.nw-row {
  display: flex;
  align-items: center;
  gap: var(--nw-row-gap);
  min-height: var(--nw-row-height);
  padding: var(--nw-row-pad-y) var(--nw-row-pad-x);
  border-bottom: 1px solid var(--nw-line);
  border-radius: 0;
  cursor: default;
  outline: none;
}

.nw-row:hover { background: var(--nw-hover); }
.nw-row.nw-selected-row { background: var(--nw-selected); }
/* On the page, the hover and the selection run edge to edge, over the list's inset on both sides (the row and its
   content stay where they are): a strip of the same colour each side, which a box's shadow draws only outside it. */
.nw-list .nw-row:hover {
  box-shadow: calc(-1 * var(--nw-list-inset)) 0 var(--nw-hover), var(--nw-list-inset) 0 var(--nw-hover);
}
.nw-list .nw-row.nw-selected-row {
  box-shadow: calc(-1 * var(--nw-list-inset)) 0 var(--nw-selected), var(--nw-list-inset) 0 var(--nw-selected);
}

/* A search result's reveal: tinted with the page's bar band, its colour and opacity, as the app's (`RevealTint`, UI round
   8; the list carries the header's band variables), behind the row, edge to edge, fading in over 0.2 s (ease-in) and out
   over 0.4 s (ease-out); the script sets the times from the list (`RevealTiming`). None of it moves under Reduce Motion.
   The row isolates it, so it sits behind the row's content but over the page. A row with no band (the Info panel's subtasks, My
   Priorities) keeps the accent at 0.2. */
.nw-row { position: relative; isolation: isolate; }
.nw-row::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--nw-page-color, var(--nw-accent)) calc(var(--nw-header-opacity, 0.2) * 100%), transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--nw-reveal-out, 400ms) ease-out;
}
.nw-list .nw-row::before { inset: 0 calc(-1 * var(--nw-list-inset)); }
:where(.nw-dark) .nw-row::before {
  background: color-mix(in srgb, var(--nw-page-color-dark, var(--nw-page-color, var(--nw-accent))) calc(var(--nw-header-opacity-dark, 0.2) * 100%), transparent);
}
@media (prefers-contrast: more) {
  :where(.nw-dark) .nw-row::before {
    background: color-mix(in srgb, var(--nw-page-color-dark-more, var(--nw-page-color, var(--nw-accent))) calc(var(--nw-header-opacity-dark, 0.2) * 100%), transparent);
  }
}
.nw-row.nw-revealed::before { opacity: 1; transition: opacity var(--nw-reveal-in, 200ms) ease-in; }
@media (prefers-reduced-motion: reduce) {
  .nw-row::before, .nw-row.nw-revealed::before { transition: none; }
}
/* A child's indent goes after the chevron's column (the app's outline column stays at the row's leading edge). */
.nw-row[data-level="1"] > .nw-check { margin-left: calc(var(--nw-level-step) - var(--nw-row-pad-x)); }
.nw-row.nw-pending { opacity: 0.6; }

/* A finger held on a row starts subitem entry (`TaskRowHold`), not the browser's own callout. */
.nw-list .nw-row { -webkit-touch-callout: none; }

.nw-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* An open name wraps; a completed one is one line, cut at the end. */
.nw-name {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

:is(.nw-row.nw-completed:not(.nw-look-held), .nw-row.nw-look-held:not(.nw-completed)) .nw-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--nw-muted);
  text-decoration: line-through;
}

.nw-row .nw-name.nw-blank { font-style: normal; }

/* The name is the row's button for the keyboard (ruling Z): no button look, a ring only when focused from the keyboard. */
.nw-row .nw-name[role="button"] { border-radius: 3px; }
.nw-row .nw-name[role="button"]:focus { outline: none; }
.nw-row .nw-name[role="button"]:focus-visible { box-shadow: 0 0 0 2px var(--nw-accent); }

/* A name edited in place (web round 20): a click on it on the page makes it a box where it is, in the name's own type,
   with the focus ring. It takes the name's room (the name is hidden while it shows) and grows with its text. */
/* The name is as wide as its text, so a click beside a short one is on the row (which does nothing), not on it. */
.nw-list .nw-row .nw-name { cursor: text; align-self: flex-start; max-width: 100%; }
.nw-row .nw-name[hidden] { display: none; }
.nw-name-edit {
  display: block;
  box-sizing: border-box;
  width: calc(100% + 6px);
  margin: -2px -3px;
  padding: 1px 3px;
  border: 0;
  border-radius: 4px;
  outline: none;
  box-shadow: 0 0 0 2px var(--nw-accent);
  background: var(--nw-bg);
  color: var(--nw-text);
  font: inherit;
  line-height: inherit;
  resize: none;
  overflow: hidden;
  user-select: text;
  -webkit-user-select: text;
}

/* The app's (i) after the star (web round 20): a circled i in the accent colour that opens Info, its hit area the row's
   height and 32 px wide. Not while reordering, where a click anywhere on a row selects it. */
.nw-info-button {
  flex: 0 0 auto;
  position: relative;
  align-self: stretch;
  width: 32px;
  min-height: 32px;
  margin: calc(-1 * var(--nw-row-pad-y)) 0 calc(-1 * var(--nw-row-pad-y)) -8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--nw-accent);
  cursor: pointer;
}
.nw-info-button::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 20px;
  height: 20px;
  margin: auto;
  background: currentColor;
  -webkit-mask: var(--nw-info-icon) center / contain no-repeat;
  mask: var(--nw-info-icon) center / contain no-repeat;
}
.nw-info-button:focus { outline: none; }
.nw-info-button:focus-visible::after { content: ""; position: absolute; inset: 4px 2px; border-radius: 6px; box-shadow: 0 0 0 2px var(--nw-accent); }
.nw-reordering .nw-list .nw-info-button { display: none; }

/* The second line (footnote, 13 pt): one line, in the tone's colour, the completed colour on a completed row; the
   repeat icon before the text, at half opacity on a completed row. */
.nw-due {
  display: flex;
  align-items: baseline;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.3;
  color: var(--nw-muted);
}

/* My Priorities' breadcrumb, the row's last line (footnote, secondary, one line). */
.nw-crumb {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.3;
  color: var(--nw-muted);
}

.nw-due.nw-tone-overdue { color: var(--nw-overdue); }
.nw-due.nw-tone-today { color: var(--nw-today); }

.nw-icon-repeat {
  flex: 0 0 auto;
  align-self: center;
  width: 12px;
  height: 12px;
  background: currentColor;
  -webkit-mask: var(--nw-repeat-icon) center / contain no-repeat;
  mask: var(--nw-repeat-icon) center / contain no-repeat;
}

:is(.nw-row.nw-completed:not(.nw-look-held), .nw-row.nw-look-held:not(.nw-completed)) .nw-due { color: var(--nw-muted); }
:is(.nw-row.nw-completed:not(.nw-look-held), .nw-row.nw-look-held:not(.nw-completed)) .nw-icon-repeat { opacity: 0.5; }

/* The outline column (`OutlineChevron`): `chevron.right` (15 pt, semibold, secondary) in a 20 pt column, pointing right
   when collapsed and down when open, turning over the app's 0.2 s (`--nw-outline-ms`, set by the script) and not at
   all under Reduce Motion. On a page with parents a row without children keeps the column empty. */
.nw-chevron,
.nw-chevron-space {
  flex: 0 0 auto;
  width: var(--nw-outline-column);
}

.nw-chevron {
  position: relative;
  align-self: stretch;
  min-height: 36px;
  margin-top: calc(-1 * var(--nw-row-pad-y));
  margin-bottom: calc(-1 * var(--nw-row-pad-y));
  padding: 0;
  border: 0;
  background: none;
  color: var(--nw-muted);
  cursor: pointer;
}

.nw-chevron:disabled { opacity: 0.4; cursor: default; }

.nw-chevron::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: currentColor;
  -webkit-mask: var(--nw-chevron-icon) center / contain no-repeat;
  mask: var(--nw-chevron-icon) center / contain no-repeat;
  transform: rotate(0deg);
  transition: transform var(--nw-outline-ms, 200ms) ease-in-out;
}

.nw-chevron[aria-expanded="true"]::before { transform: rotate(90deg); }
.nw-chevron.nw-turn-from-open::before { transform: rotate(90deg); transition: none; }
.nw-chevron.nw-turn-from-closed::before { transform: rotate(0deg); transition: none; }

@media (prefers-reduced-motion: reduce) {
  .nw-chevron::before { transition: none; }
}

/* The checkbox: `square`, or `checkmark.square` when checked, the same outline in the same secondary colour. The
   button is the row's full height and 48 px wide (from the row's left edge to past the gap, over the name's first
   pixels), so a click near the square never opens Info. */
.nw-check {
  flex: 0 0 auto;
  position: relative;
  align-self: stretch;
  width: 48px;
  min-height: 36px;
  /* Over the row's padding to its left, and past its room over the gap and the name's first pixels: -12 and -14. */
  margin: calc(-1 * var(--nw-row-pad-y)) calc(var(--nw-check-room) + var(--nw-row-pad-x) - 48px) calc(-1 * var(--nw-row-pad-y)) calc(-1 * var(--nw-row-pad-x));
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nw-check::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 1.5px solid var(--nw-muted);
  border-radius: 4px;
  box-sizing: border-box;
  background: transparent;
}

.nw-completed .nw-check::after {
  content: "";
  position: absolute;
  left: 18.5px;
  top: 50%;
  width: 5px;
  height: 9px;
  margin-top: -6.5px;
  border: solid var(--nw-muted);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

/* The notes and alarm icons (`note.text`, `alarm`, 15 pt), notes above, secondary; half opacity on a completed row. */
.nw-icons {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: var(--nw-muted);
}

.nw-icons i {
  display: block;
  width: 15px;
  height: 15px;
  background: currentColor;
}

.nw-icon-notes { -webkit-mask: var(--nw-notes-icon) center / contain no-repeat; mask: var(--nw-notes-icon) center / contain no-repeat; }
.nw-icon-alarm { -webkit-mask: var(--nw-alarm-icon) center / contain no-repeat; mask: var(--nw-alarm-icon) center / contain no-repeat; }
:is(.nw-row.nw-completed:not(.nw-look-held), .nw-row.nw-look-held:not(.nw-completed)) .nw-icons { opacity: 0.5; }

/* The star (20 pt): filled with its page's colour (`--nw-row-color`) and outlined in that colour at half over black
   when starred, a grey outline otherwise (`TaskRowStarStyle`); faded to 0.33 on a completed row. The button is the
   row's full height and 44 px wide (over the gap before it and the row's right padding). */
.nw-star {
  flex: 0 0 auto;
  position: relative;
  align-self: stretch;
  width: 44px;
  min-height: 36px;
  margin: calc(-1 * var(--nw-row-pad-y)) 0 calc(-1 * var(--nw-row-pad-y)) -10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.nw-star:disabled { cursor: default; }

.nw-star::before,
.nw-star::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
}

.nw-star::after {
  background: var(--nw-star-outline);
  -webkit-mask: var(--nw-star-outline-icon) center / contain no-repeat;
  mask: var(--nw-star-outline-icon) center / contain no-repeat;
}

/* The page colour as the app draws it (ruling G): the dark swatch in dark mode, and with Increase Contrast
   (`prefers-contrast: more`) the app's stronger swatches. */
.nw-star { --nw-star-color: var(--nw-row-color); }
@media (prefers-contrast: more) { .nw-star { --nw-star-color: var(--nw-row-color-more, var(--nw-row-color)); } }
:where(.nw-dark) .nw-star { --nw-star-color: var(--nw-row-color-dark, var(--nw-row-color)); }
@media (prefers-contrast: more) {
  :where(.nw-dark) .nw-star { --nw-star-color: var(--nw-row-color-dark-more, var(--nw-row-color)); }
}

.nw-starred .nw-star::before {
  background: var(--nw-star-color);
  -webkit-mask: var(--nw-star-fill-icon) center / contain no-repeat;
  mask: var(--nw-star-fill-icon) center / contain no-repeat;
}

.nw-starred .nw-star::after { background: color-mix(in srgb, var(--nw-star-color) 50%, #000); }

.nw-row:not(.nw-look-held) .nw-star.nw-star-faded,
.nw-row.nw-look-held .nw-star:not(.nw-star-faded) { opacity: 0.33; }

/* The row's Delete (the app's swipe, made a visible button), last in the row, the row's full height and 44 px wide (over
   the gap before it and the row's right padding). While the page is reordered Reorder's selection circle takes its place
   (`ReorderSelectionCircle`: an empty circle, filled with a check when selected). */
.nw-delete,
.nw-select {
  flex: 0 0 auto;
  position: relative;
  align-self: stretch;
  width: 44px;
  min-height: 36px;
  margin: calc(-1 * var(--nw-row-pad-y)) -12px calc(-1 * var(--nw-row-pad-y)) -10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--nw-muted);
  cursor: pointer;
}

.nw-delete::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: currentColor;
  -webkit-mask: var(--nw-trash-icon) center / contain no-repeat;
  mask: var(--nw-trash-icon) center / contain no-repeat;
}

.nw-select { display: none; }

.nw-select::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 1.5px solid var(--nw-muted);
  border-radius: 50%;
}

.nw-select[aria-checked="true"]::before { border-color: var(--nw-accent); background: var(--nw-accent); }

.nw-select[aria-checked="true"]::after {
  content: "";
  position: absolute;
  left: 16.5px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  background: #fff;
  -webkit-mask: var(--nw-checkmark-icon) center / contain no-repeat;
  mask: var(--nw-checkmark-icon) center / contain no-repeat;
}

/* Reordering (`ReorderEntry`): the circle shows, the Delete goes, and the row's own controls are inert (a click anywhere on
   the row selects it, a drag moves it). */
.nw-reordering .nw-list .nw-select { display: block; }
.nw-reordering .nw-list .nw-delete { display: none; }
.nw-reordering .nw-list :is(.nw-check, .nw-star, .nw-chevron) { pointer-events: none; }
.nw-reordering .nw-list .nw-row { cursor: grab; }
/* While Reorder waits for the page's settle, the rows' controls are already off. */
.nw-reorder-starting .nw-list :is(.nw-check, .nw-star, .nw-chevron, .nw-delete) { pointer-events: none; }

/* Reorder's steps (the app's VoiceOver actions: Move Up, Move Down, Indent, Outdent): only while reordering; always in the
   tab order and the accessibility tree, drawn only on the row that holds the focus. A step the rules don't allow is off
   (`aria-disabled`) but stays reachable. */
.nw-steps { display: none; }
.nw-reordering .nw-list .nw-steps { display: flex; flex: 0 0 auto; gap: 4px; }

.nw-reordering .nw-list .nw-row:not(:focus-within) .nw-step {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.nw-step {
  padding: 3px 8px;
  border: 1px solid var(--nw-line);
  border-radius: 6px;
  background: var(--nw-field-bg);
  color: var(--nw-text);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.nw-step[aria-disabled="true"] { opacity: 0.4; cursor: default; }

/* The hold's Add Subtask for the mouse, the keyboard and screen readers (ruling R): a small "+" just before the star of
   every top-level page row, as the classic site's (round 10; the server puts it on no other). It always shows, on every
   device (web round 11; it showed only on hover and focus before), and is in the tab order and the accessibility tree;
   in Select mode and while entering it is hidden but keeps its room, so no name re-wraps. */
.nw-row-add {
  flex: 0 0 auto;
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--nw-muted);
  cursor: pointer;
}

.nw-row-add::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: currentColor;
  -webkit-mask: var(--nw-plus-icon) center / contain no-repeat;
  mask: var(--nw-plus-icon) center / contain no-repeat;
}

.nw-row-add:hover { background: var(--nw-hover); color: var(--nw-text); }
.nw-row-add:focus { outline: none; }
.nw-row-add:focus-visible { box-shadow: 0 0 0 2px var(--nw-accent); }
/* Hidden in Select mode. While entering it shows (web round 12); a click on it then only ends entry (round 13), as any
   click outside the box. */
.nw-reordering .nw-list .nw-row-add { visibility: hidden; }

.nw-empty {
  margin: 24px 12px;
  color: var(--nw-muted);
}

/* My Priorities' completed rows come in chunks (`FocusChunking`): the button after the rows that brings the next one. */
.nw-completed-more { margin: 14px 12px 28px; }
.nw-completed-more button {
  font: inherit;
  font-size: 15px;
  color: var(--nw-accent);
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
}
.nw-completed-more button:disabled { color: var(--nw-muted); cursor: default; }

.nw-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 12px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nw-muted);
  text-transform: none;
}

/* A group header's page dot (`PageSwatch(heading:)`: 14 pt), the swatch for the appearance, with the app's grey outline
   on a light one that is hard to see (light mode only; the Increase Contrast swatch never needs it). */
.nw-group-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--nw-dot);
}
.nw-group-dot[data-outlined], .nw-page-dot[data-outlined] { box-shadow: inset 0 0 0 1px #6e6e73; }
@media (prefers-contrast: more) {
  .nw-group-dot, .nw-page-dot { background: var(--nw-dot-more, var(--nw-dot)); }
  .nw-group-dot[data-outlined], .nw-page-dot[data-outlined] { box-shadow: none; }
}
:where(.nw-dark) .nw-group-dot, :where(.nw-dark) .nw-page-dot { background: var(--nw-dot-dark, var(--nw-dot)); }
:where(.nw-dark) .nw-group-dot[data-outlined], :where(.nw-dark) .nw-page-dot[data-outlined] { box-shadow: none; }
@media (prefers-contrast: more) {
  :where(.nw-dark) .nw-group-dot, :where(.nw-dark) .nw-page-dot { background: var(--nw-dot-dark-more, var(--nw-dot)); }
}

/* My Priorities with nothing starred (`EmptyStateView`): the star symbol over the title, centred. */
.nw-empty.nw-empty-starred,
.nw-empty.nw-empty-search {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 72px 12px;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--nw-text);
}
.nw-empty.nw-empty-starred::before,
.nw-empty.nw-empty-search::before {
  content: "";
  width: 44px;
  height: 44px;
  background: var(--nw-muted);
  -webkit-mask: var(--nw-star-outline-icon) center / contain no-repeat;
  mask: var(--nw-star-outline-icon) center / contain no-repeat;
}
/* "No Results" (`EmptyStateView` with `magnifyingglass`). */
.nw-empty.nw-empty-search::before {
  -webkit-mask-image: var(--nw-search-icon);
  mask-image: var(--nw-search-icon);
}

/* MARK: Info panel */

.nw-info {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0 16px 24px;
}

/* The sheet's bar: the title "Info" in the middle, Close at the end. */
.nw-info-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0 -16px 4px;
  padding: 0 44px;
  background: var(--nw-bg);
}

.nw-info-heading { margin: 0; font-size: 15px; font-weight: 600; color: var(--nw-text); }

/* The panel's stack (the sheet's navigation): only the top screen shows. */
.nw-info[hidden] { display: none; }

/* Back, at the start of a pushed screen's bar, worded as the screen under it (the app's back button). */
.nw-info-back {
  position: absolute;
  top: 7px;
  left: 4px;
  max-width: 40%;
  padding: 4px 8px 4px 2px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--nw-accent);
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.nw-info-back::before { content: "‹"; display: inline-block; margin-right: 4px; font-size: 20px; line-height: 15px; vertical-align: -1px; }
.nw-info-back:hover { background: var(--nw-hover); }
.nw-info-back:focus-visible { outline: 2px solid var(--nw-accent); outline-offset: 0; }

/* A row that pushes a screen (the Page row): its label, then the chevron. */
.nw-info-link {
  width: 100%;
  margin: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nw-info-link::after { content: "›"; color: var(--nw-muted); font-size: 20px; line-height: 1; }
.nw-info-link:hover { background: var(--nw-hover); }
.nw-info-link:focus-visible { outline: 2px solid var(--nw-accent); outline-offset: 2px; border-radius: 6px; }

/* The Page screen (`SchedulePagePicker`): each page's dot and name, the current one checked. */
.nw-info-choices { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--nw-line); }
.nw-info-choices > li { border-bottom: 1px solid var(--nw-line); }
.nw-info-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--nw-text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.nw-info-choice:hover { background: var(--nw-hover); }
.nw-info-choice:focus-visible { outline: 2px solid var(--nw-accent); outline-offset: -2px; border-radius: 6px; }
.nw-info-choice-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.nw-info-check::before { content: "✓"; color: var(--nw-accent); font-weight: 600; }

.nw-info-main { display: flex; flex-direction: column; gap: 12px; }

.nw-info-close {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--nw-hover);
  color: var(--nw-muted);
  cursor: pointer;
}

/* The X (web round 20): drawn, not a character, so it is exactly in the button's middle whatever the font, and bigger. */
.nw-info-close::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 12px;
  height: 12px;
  margin: auto;
  background: currentColor;
  -webkit-mask: var(--nw-close-icon) center / contain no-repeat;
  mask: var(--nw-close-icon) center / contain no-repeat;
}

/* The app's red Delete row, last in the panel. */
.nw-info-delete {
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--nw-line);
  border-radius: 8px;
  background: var(--nw-field-bg);
  color: var(--nw-danger);
  cursor: pointer;
}

.nw-info-delete:hover:not(:disabled) { background: var(--nw-hover); }
.nw-info-delete:disabled { opacity: 0.4; cursor: default; }

.nw-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  border: 0;
  padding: 0;
  color: var(--nw-muted);
  font-size: 12px;
}

.nw-field.nw-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--nw-text);
  font-size: 14px;
}

.nw-field legend {
  padding: 0;
  margin-bottom: 4px;
}

.nw-info input[type="text"],
.nw-info input[type="date"],
.nw-info input[type="number"],
.nw-info textarea,
.nw-info select {
  padding: 6px 8px;
  border: 1px solid var(--nw-line);
  border-radius: 6px;
  background: var(--nw-field-bg);
  color: var(--nw-text);
  font-size: 14px;
  outline: none;
}

.nw-info .nw-info-notes { resize: vertical; min-height: 96px; }

/* The name, growing with its text, with the star at its end (the rows' star, its state in `aria-pressed`). */
.nw-info-name-row { display: flex; align-items: flex-start; gap: 8px; }
.nw-info .nw-info-name { flex: 1 1 auto; box-sizing: border-box; min-height: 0; resize: none; overflow: hidden; font-size: 16px; line-height: 1.35; }
.nw-info-star { margin: 0 -10px 0 -6px; align-self: center; }
.nw-info-star[aria-pressed="true"]::before {
  background: var(--nw-star-color);
  -webkit-mask: var(--nw-star-fill-icon) center / contain no-repeat;
  mask: var(--nw-star-fill-icon) center / contain no-repeat;
}
.nw-info-star[aria-pressed="true"]::after { background: color-mix(in srgb, var(--nw-star-color) 50%, #000); }
.nw-info-star.nw-star-faded { opacity: 0.33; }

/* The schedule rows (`ScheduleRowsSection`): the title, its value under it in its tone, and the switch at the end; the
   date and time pickers under them while on. */
.nw-info-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 8px;
  position: relative;
  padding: 6px 0;
  border-top: 1px solid var(--nw-line);
  color: var(--nw-text);
  font-size: 14px;
}
.nw-info-row > :not(.nw-info-label):not(.nw-info-switch) { grid-column: 1 / -1; justify-self: start; }
.nw-info-label { display: flex; flex-direction: column; gap: 2px; }
.nw-info-label > span { display: block; }
.nw-info-title.nw-dim { color: var(--nw-muted); }
.nw-info-value { font-size: 13px; color: var(--nw-muted); }
.nw-info-value.nw-tone-overdue { color: var(--nw-overdue); }
.nw-info-value.nw-tone-today { color: var(--nw-today); }
/* The app's switch: a pill whose knob slides, green when on. */
.nw-info-switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: 11px;
  background: var(--nw-line);
  cursor: pointer;
  transition: background-color 0.15s;
}
.nw-info-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.nw-info-switch:checked { background: #34c759; }
.nw-info-switch:checked::before { transform: translateX(16px); }
.nw-info-switch:focus-visible { outline: 2px solid var(--nw-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .nw-info-switch, .nw-info-switch::before { transition: none; } }
/* Automatically Star is the app's menu: the whole row opens it. */
.nw-info-row[data-row="autostar"] { cursor: pointer; }
.nw-info .nw-info-menu { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
/* The menu itself is invisible: the row shows its keyboard focus. */
.nw-info-row[data-row="autostar"]:has(.nw-info-menu:focus-visible) { outline: 2px solid var(--nw-accent); outline-offset: 2px; border-radius: 6px; }
/* The Alert row's alert and the Repeat row's rule, under their switches: rows that push the Alert and Repeat screens
   (`ScheduleRows.alertRow`, `repeatRow`). Their labels are spans (a button holds only phrasing content), drawn as blocks. */
.nw-info-row > .nw-info-sublink {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  justify-self: stretch;
  padding: 6px 0 0;
  border-top: 1px solid var(--nw-line);
  color: var(--nw-text);
}

/* The Alert screen (`AlertEditorView`): the header, the Auto-Snooze row, the mode's picker, Remove Alert; Save in the bar. */
.nw-info-save {
  position: absolute;
  top: 7px;
  right: 42px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--nw-accent);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.nw-info-save:hover { background: var(--nw-hover); }
.nw-info-save:focus-visible { outline: 2px solid var(--nw-accent); outline-offset: 0; }
.nw-editor-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 60px;
  color: var(--nw-text);
  font-size: 15px;
  text-align: center;
}
/* Auto-Snooze and the Repeat screen's Every and On rows: the title, its value at the end (`LabeledContent`), then the
   chevron, on one line. */
.nw-info-row.nw-info-link:is([data-block="autosnooze"], [data-action="repeat-every"], [data-action="repeat-on"]) { grid-template-columns: 1fr auto auto; }
.nw-info-row.nw-info-link:is([data-block="autosnooze"], [data-action="repeat-every"], [data-action="repeat-on"]) > .nw-info-title { grid-column: auto; }
.nw-info-row.nw-info-link:is([data-block="autosnooze"], [data-action="repeat-every"], [data-action="repeat-on"]) > .nw-info-detail { grid-column: auto; justify-self: end; color: var(--nw-muted); }
.nw-alert-picker { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--nw-line); }
.nw-alert-select { min-width: 12em; }
.nw-info-notes-row .nw-info-notes { width: 100%; box-sizing: border-box; }
.nw-info-delete-row { display: flex; flex-direction: column; }

/* The Info sheet's subtasks and Add Subtask */
.nw-subtasks { display: flex; flex-direction: column; gap: 6px; }
.nw-subtask-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--nw-line); }
.nw-subtask-rows:empty { display: none; }
/* Each subtask is the page's row (`TaskRowView` in the sheet), flush at the left; its name pushes its Info. */
.nw-subtask-rows .nw-row { padding-left: 4px; }
.nw-subtask-rows .nw-name { cursor: pointer; }
.nw-add-subtask {
  align-self: flex-start;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--nw-accent);
  cursor: pointer;
}
.nw-add-subtask::before { content: "+ "; }
.nw-add-subtask[hidden], .nw-subtask-entry[hidden] { display: none; }
.nw-subtask-entry { margin: 0; }
.nw-subtask-input { width: 100%; }

/* The compact time pickers (hour, minute in 5-minute steps, AM/PM) */
.nw-field-label { display: block; }
.nw-time { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--nw-text); }
.nw-time select { min-width: 3.6em; }
.nw-time select:disabled { opacity: 0.45; }
.nw-time-colon { color: var(--nw-muted); }

/* The Repeat screens (`RepeatEditorView`, `RepeatEveryView`, `RepeatOnView`): Type and Frequency sections, the pushed
   rows with their value at the end, the chosen rows' text in the tint (`CheckmarkRow`), the wheels as selects. */
.nw-info-group { display: flex; flex-direction: column; }
.nw-info-group-title { margin: 0 0 4px; padding: 0 4px; color: var(--nw-muted); font-size: 12px; font-weight: 400; text-transform: uppercase; }
.nw-info-screen:is([data-screen="repeat"], [data-screen="repeaton"]) .nw-info-choice:is([aria-current="true"], [aria-pressed="true"]) .nw-info-choice-name { color: var(--nw-accent); }
.nw-repeat-picker { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--nw-line); }
.nw-repeat-picker .nw-alert-select { min-width: 6em; }
.nw-info-save:disabled { opacity: 0.4; cursor: default; }
.nw-info-save:disabled:hover { background: none; }

/* MARK: Banner */

.nw-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 48px));
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--nw-banner-bg);
  color: var(--nw-banner-text);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  /* Above Info's popup (20). */
  z-index: 25;
  cursor: default;
}

.nw-banner[hidden] { display: none; }
.nw-banner[data-kind="lost"] { background: var(--nw-lost-bg); color: #fff; }

/* MARK: Part 2: rows while dragging, menus, dialogs, search */

:root {
  --nw-menu-bg: #ffffff;
  --nw-shadow: 0 8px 28px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --nw-danger: #c4271d;
}

:root:where(.nw-dark) {
  --nw-menu-bg: #2c2c2e;
  --nw-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --nw-danger: #ff6961;
}

.nw-row { user-select: none; -webkit-user-select: none; }
.nw-row[hidden] { display: none; }
/* A subtask row sliding shut (`slideOutline` in the script): a copy of the row that has left the page, drawn while it
   goes; inert, and out of the pointer's way, so the rows under it are what a click reaches. */
.nw-row.nw-outline-ghost { pointer-events: none; }
.nw-list .nw-row.nw-outline-ghost:hover { background: none; box-shadow: none; }

/* Dragging (a row at any time since web round 9; the cursor stays the name's own until the drag starts, since a click on
   it opens Info): nothing is text-selected on the way. */
body.nw-dragging, body.nw-dragging * { cursor: grabbing !important; }
body.nw-dragging { user-select: none; -webkit-user-select: none; }
.nw-row.nw-drag-source { opacity: 0.35; }
/* The drop's place: a line between rows, starting at the level the drop takes (30 px a level, the rows' indent). */
.nw-row.nw-drop-before, .nw-row.nw-drop-after { position: relative; }
.nw-row.nw-drop-before::after, .nw-row.nw-drop-after::after {
  content: "";
  position: absolute;
  left: calc(12px + var(--nw-drop-indent, 0px));
  right: 0;
  height: 2px;
  background: var(--nw-accent);
  pointer-events: none;
}
.nw-row.nw-drop-before::after { top: -1px; }
.nw-row.nw-drop-after::after { bottom: -1px; }

/* A page dragged in the sidebar (`PageMove`): its place is a line between pages; My Priorities stays first. A template
   drags the same way among the templates. */
.nw-pages > .nw-page:not(.nw-page-focus), .nw-template { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
:is(.nw-page, .nw-template).nw-drag-source { opacity: 0.35; }
:is(.nw-page, .nw-template).nw-drop-before, :is(.nw-page, .nw-template).nw-drop-after { position: relative; }
:is(.nw-page, .nw-template).nw-drop-before::after, :is(.nw-page, .nw-template).nw-drop-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 0;
  height: 2px;
  background: var(--nw-accent);
  pointer-events: none;
}
:is(.nw-page, .nw-template).nw-drop-before::after { top: -1px; }
:is(.nw-page, .nw-template).nw-drop-after::after { bottom: -1px; }
.nw-page-ghost { padding: 0 4px; }
/* A task dragged over another page in the sidebar (web round 9): the page it would move to. */
.nw-page.nw-drop-target > .nw-page-link { background: var(--nw-accent); color: #fff; }
.nw-page.nw-drop-target > .nw-page-link .nw-page-count { color: inherit; }

.nw-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 30;
  pointer-events: none;
  list-style: none;
  background: var(--nw-bg);
  border: 0;
  border-radius: 6px;
  box-shadow: var(--nw-shadow);
  opacity: 0.92;
}

/* Menus */
.nw-menu {
  position: fixed;
  z-index: 40;
  min-width: 180px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  padding: 5px;
  border-radius: 8px;
  background: var(--nw-menu-bg);
  box-shadow: var(--nw-shadow);
}

.nw-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 5px 10px 5px 24px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--nw-text);
  text-align: left;
  white-space: nowrap;
  cursor: default;
  position: relative;
}

.nw-menu-item:hover:not(:disabled) {
  background: var(--nw-accent);
  color: #fff;
}

.nw-menu-item:disabled { color: var(--nw-muted); opacity: 0.6; }
/* Color swatches (Page Info, Page Settings): the app's palette (`PagePalettePicker`, 44 pt circles). The chosen
   one is ringed in the text colour inside a gap (the app's 3 pt ring, 6 pt padding); a light one that is hard to see gets
   the app's 1 pt grey outline (light mode only; the Increase Contrast swatch never needs it); a colour another page has
   carries the app's faint white Pages symbol (0.75). */
.nw-swatches {
  display: grid;
  grid-template-columns: repeat(6, 36px);
  gap: 6px;
  padding: 6px;
}

.nw-swatch {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--nw-text);
  cursor: pointer;
}

.nw-swatch:hover { transform: scale(1.08); }
.nw-swatch[aria-checked="true"] { padding: 5px; box-shadow: inset 0 0 0 3px currentColor; }

.nw-swatch-dot {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--nw-swatch);
}
.nw-swatch[data-outlined] .nw-swatch-dot { box-shadow: inset 0 0 0 1px #6e6e73; }
@media (prefers-contrast: more) {
  .nw-swatch-dot { background: var(--nw-swatch-more, var(--nw-swatch)); }
  .nw-swatch[data-outlined] .nw-swatch-dot { box-shadow: none; }
}
:where(.nw-dark) .nw-swatch-dot { background: var(--nw-swatch-dark, var(--nw-swatch)); }
:where(.nw-dark) .nw-swatch[data-outlined] .nw-swatch-dot { box-shadow: none; }
@media (prefers-contrast: more) {
  :where(.nw-dark) .nw-swatch-dot { background: var(--nw-swatch-dark-more, var(--nw-swatch)); }
}

.nw-swatch-mark { display: none; width: 15px; color: rgba(255, 255, 255, 0.75); }
.nw-swatch-mark svg { display: block; width: 100%; height: auto; }
.nw-swatch[data-in-use="1"] .nw-swatch-mark { display: block; }

/* Dialogs */
.nw-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  background: rgba(0, 0, 0, 0.28);
}

.nw-dialog {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(380px, calc(100vw - 32px));
  padding: 18px;
  border-radius: 12px;
  background: var(--nw-menu-bg);
  box-shadow: var(--nw-shadow);
}

.nw-dialog-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.nw-dialog-text { margin: 0; color: var(--nw-muted); }

.nw-dialog-name {
  padding: 7px 10px;
  border: 1px solid var(--nw-line);
  border-radius: 8px;
  background: var(--nw-field-bg);
  outline: none;
}

.nw-dialog-name:focus {
  border-color: var(--nw-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--nw-accent) 25%, transparent);
}

.nw-dialog .nw-swatches { padding: 2px; grid-template-columns: repeat(8, 36px); }
.nw-dialog-check { display: flex; align-items: center; gap: 8px; }
/* Page Settings' sections (Name, Color, Sorting), each under its header. */
.nw-dialog-section { display: flex; flex-direction: column; gap: 6px; }
.nw-dialog-section-title { margin: 0; font-size: 12px; font-weight: 600; color: var(--nw-muted); }
.nw-dialog-choices { display: flex; flex-direction: column; gap: 6px; }
.nw-dialog-choice { display: flex; align-items: center; gap: 8px; }
/* Page Info's sharing row ("Shared by" and the owner, as the app's LabeledContent) and its Reminders switch. */
.nw-dialog-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.nw-shared-by-owner { color: var(--nw-muted); overflow-wrap: anywhere; text-align: right; }
.nw-page-info-reminders { cursor: pointer; }
.nw-page-info-footer { margin: 0; }
.nw-dialog-buttons[hidden] { display: none; }
.nw-dialog-help { margin: -6px 0 0; color: var(--nw-muted); font-size: 12px; }

.nw-dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.nw-dialog-buttons button {
  padding: 5px 14px;
  border: 1px solid var(--nw-line);
  border-radius: 7px;
  background: var(--nw-field-bg);
  cursor: pointer;
}

.nw-dialog-buttons .nw-default { border-color: var(--nw-accent); background: var(--nw-accent); color: #fff; }
.nw-dialog-buttons .nw-danger { border-color: var(--nw-danger); background: var(--nw-danger); }

/* Search results (in place of the list while searching) */
.nw-main.nw-searching .nw-list,
.nw-main.nw-searching .nw-entry,
.nw-main.nw-searching .nw-settings { display: none; }

.nw-search-results { padding: 6px 12px 48px; }
.nw-search-results[hidden] { display: none; }

.nw-result-group { margin-top: 12px; }

/* A page's section header (`section.listName`, the inset grouped list's header). */
.nw-result-page {
  margin: 8px 12px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nw-muted);
}

.nw-result-rows { list-style: none; margin: 0; padding: 0; }

/* One result (`SearchResultRow`): the name (struck out and secondary when completed), the parent's name (footnote,
   secondary, one line), the page row's due line; then the notes mark (15 pt) and the star (20 pt, its page's colour,
   0.33 when completed). The whole row is the button. */
.nw-result {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--nw-line);
  cursor: pointer;
  outline: none;
}

.nw-result:hover { background: var(--nw-hover); }
.nw-result:focus-visible { box-shadow: inset 0 0 0 2px var(--nw-accent); }
.nw-result.nw-completed .nw-name { color: var(--nw-muted); text-decoration: line-through; }
.nw-result.nw-completed .nw-due { color: var(--nw-muted); }
.nw-result.nw-completed .nw-icon-repeat { opacity: 0.5; }

.nw-result-parent {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.3;
  color: var(--nw-muted);
}

.nw-result .nw-star {
  align-self: center;
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  cursor: inherit;
}
.nw-result .nw-star::before,
.nw-result .nw-star::after { left: 0; }
.nw-result .nw-star.nw-star-faded { opacity: 0.33; }

/* Move's page list (`ReorderMovePicker`): each page's colour and name; a click picks it. */
.nw-move-targets { margin: 0; padding: 0; list-style: none; max-height: 50vh; overflow-y: auto; }

.nw-move-target {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--nw-text);
  text-align: left;
  cursor: pointer;
}

.nw-move-target:hover, .nw-move-target:focus-visible { background: var(--nw-hover); outline: none; }
/* Room for Save beside Close. */
.nw-info-bar:has(.nw-info-save) { padding: 0 104px; }

/* MARK: Account pages (phase 8D: /app/signin, /app/forgot, /app/reset): one centred card on the sidebar's grey, in light
   and dark as the rest of the app. */
.nw-account {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
  background: var(--nw-sidebar-bg);
}

.nw-account-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(360px, 100%);
  margin: 0;
  padding: 24px;
  border-radius: 14px;
  background: var(--nw-menu-bg);
  box-shadow: var(--nw-shadow);
}

.nw-account-title { margin: 0 0 4px; font-size: 20px; font-weight: 600; text-align: center; }
.nw-account-text, .nw-account-notice { margin: 0; color: var(--nw-muted); text-align: center; }
.nw-account-notice { color: var(--nw-text); font-weight: 500; }
.nw-account-error { margin: 0; color: var(--nw-danger); text-align: center; }

.nw-account-field {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--nw-line);
  border-radius: 8px;
  background: var(--nw-field-bg);
  outline: none;
}

.nw-account-field:focus {
  border-color: var(--nw-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--nw-accent) 25%, transparent);
}

.nw-account-button {
  padding: 9px 14px;
  border: 1px solid var(--nw-accent);
  border-radius: 8px;
  background: var(--nw-accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.nw-account-button:focus-visible { outline: 2px solid var(--nw-accent); outline-offset: 2px; }
.nw-account-links { display: flex; justify-content: center; gap: 18px; margin: 0; font-size: 13px; }
.nw-account-links a { color: var(--nw-accent); text-decoration: none; }
.nw-account-links a:hover { text-decoration: underline; }
