/* Glass look adapted from the home dashboard. All colours are tokens.
   Themes: blue (default, the dashboard look), dark (neutral), light.
   <html data-theme> is set before first paint by the script in index.html. */

:root {
  --blur: blur(20px);
  --blur-strong: blur(30px);
  --radius-card: 32px;
  --radius-pill: 18px;
  --radius-sm: 14px;

  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --tabbar-h: 64px;
}

/* Shared by blue and dark: white glass on a dark background. */
:root, :root[data-theme="blue"], :root[data-theme="dark"] {
  color-scheme: dark;
  --text: #fff;
  --muted: rgba(255, 255, 255, .6);

  --glass: rgba(255, 255, 255, .08);
  --glass-hover: rgba(255, 255, 255, .18);
  --glass-track: rgba(255, 255, 255, .05);
  --glass-border: rgba(255, 255, 255, .12);
  --glass-highlight: inset 0 1px 1px rgba(255, 255, 255, .15);
  --shadow: 0 20px 60px rgba(0, 0, 0, .35);
  --shadow-sm: 0 8px 30px rgba(0, 0, 0, .2);

  --accent: #78c8ff;
  --place: #f5a66a;
  --active-bg: linear-gradient(135deg, rgba(100, 180, 255, .35), rgba(100, 180, 255, .15));
  --active-border: rgba(100, 180, 255, .4);
}

:root, :root[data-theme="blue"] {
  --bg: #0f172a;
  --bg-image:
    /* eased (smoothstep) fades: same colour at the centre, fully gone at 40%, no hard edge where they end */
    radial-gradient(circle at top left, rgba(75, 108, 183, 1) 0%, rgba(75, 108, 183, .972) 4%, rgba(75, 108, 183, .896) 8%, rgba(75, 108, 183, .784) 12%, rgba(75, 108, 183, .648) 16%, rgba(75, 108, 183, .5) 20%, rgba(75, 108, 183, .352) 24%, rgba(75, 108, 183, .216) 28%, rgba(75, 108, 183, .104) 32%, rgba(75, 108, 183, .028) 36%, rgba(75, 108, 183, 0) 40%),
    radial-gradient(circle at top right, rgba(24, 40, 72, 1) 0%, rgba(24, 40, 72, .972) 4%, rgba(24, 40, 72, .896) 8%, rgba(24, 40, 72, .784) 12%, rgba(24, 40, 72, .648) 16%, rgba(24, 40, 72, .5) 20%, rgba(24, 40, 72, .352) 24%, rgba(24, 40, 72, .216) 28%, rgba(24, 40, 72, .104) 32%, rgba(24, 40, 72, .028) 36%, rgba(24, 40, 72, 0) 40%),
    linear-gradient(135deg, #0f172a, #1e293b);
  --glass-strong: rgba(60, 68, 90, .55);
}

:root[data-theme="dark"] {
  --bg: #121316;
  --bg-image:
    radial-gradient(circle at top left, #33363d 0%, transparent 45%),
    linear-gradient(135deg, #16171a, #1f2126);
  --glass-strong: rgba(58, 60, 66, .6);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f8;
  --bg-image:
    radial-gradient(circle at top left, #c7d5f5 0%, transparent 45%),
    radial-gradient(circle at top right, #dde5f3 0%, transparent 40%),
    linear-gradient(135deg, #f4f6fb, #e6ebf3);
  --text: #0f172a;
  --muted: rgba(15, 23, 42, .6);

  --glass: rgba(255, 255, 255, .55);
  --glass-strong: rgba(255, 255, 255, .8);
  --glass-hover: rgba(255, 255, 255, .75);
  --glass-track: rgba(255, 255, 255, .35);
  --glass-border: rgba(15, 23, 42, .08);
  --glass-highlight: inset 0 1px 1px rgba(255, 255, 255, .7);
  --shadow: 0 20px 60px rgba(15, 23, 42, .12);
  --shadow-sm: 0 8px 30px rgba(15, 23, 42, .08);

  --accent: #2f6fe0;
  --place: #c55a11;
  --active-bg: linear-gradient(135deg, rgba(70, 140, 255, .28), rgba(70, 140, 255, .12));
  --active-border: rgba(70, 140, 255, .45);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--bg);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  /* The page never bounces past its ends (iPhone's rubber band), so the top and bottom bars never move
     with it, whatever the finger does; and a sideways swipe doesn't go back or forward a page (app.js: installSwipe). */
  overscroll-behavior: none;
}

body {
  overscroll-behavior: none;
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-image);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1 { font-weight: 300; font-size: clamp(1.6rem, 5vw, 2.4rem); margin: .5rem 0 1.25rem; }
h2 { font-weight: 500; font-size: 1.2rem; margin: 0 0 .5rem; }
h3 { font-weight: 500; font-size: .95rem; margin: 1rem 0 .5rem; color: var(--muted); }
code { font-size: .9em; }
.muted { color: var(--muted); }

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.glass, .card, .appbar, .tabbar, .sheet, .menu {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--shadow);
}

button {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  background: var(--glass);
  box-shadow: var(--glass-highlight);
  cursor: pointer;
  touch-action: manipulation;
  transition: background .2s, transform .2s;
}
button:hover:not(:disabled) { background: var(--glass-hover); }
button:disabled { opacity: .4; cursor: default; }

/* ---------- header ---------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  border-width: 0 0 1px;
  border-radius: 0;
  box-shadow: var(--glass-highlight), var(--shadow-sm);
}

.page-title {
  margin: 0;
  flex: none;
  font-size: 1.6rem;
  font-weight: 300;
  white-space: nowrap;
}

.pill {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: .8rem;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  white-space: nowrap;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  border-color: var(--glass-border);
}

/* Top nav (laptop): pill strip like the dashboard's view nav. */
.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
#topnav-links {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  padding: 4px;
  border-radius: 24px;
  background: var(--glass-track);
}
.topnav a, .topnav summary, .menu a {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--glass);
  box-shadow: var(--glass-highlight), var(--shadow-sm);
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.topnav a:hover, .topnav summary:hover { background: var(--glass-hover); transform: translateY(-1px); }
.topnav .icon { width: 18px; height: 18px; }
.topnav [aria-current], .menu [aria-current], .tab[aria-current], .sheet-list [aria-current] {
  background: var(--active-bg);
  border-color: var(--active-border);
}
#topnav-overflow { position: relative; }
.topnav summary { list-style: none; }
.topnav summary::-webkit-details-marker { display: none; }
.menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  gap: 6px;
  min-width: 180px;
  padding: 8px;
  border-radius: 22px;
  background: var(--glass-strong);
}
.menu a { box-shadow: none; }

/* ---------- main ---------- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
}

.card {
  padding: 20px 22px;
  margin-bottom: 16px;
  border-radius: var(--radius-card);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
}

.empty {
  text-align: center;
  padding: 15vh 16px;
}
.empty h2 { font-weight: 400; font-size: 1.1rem; }

.banner {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px + var(--sel-lift));
  transform: translateX(-50%);
  z-index: 45;
  padding: 10px 12px 10px 18px;
  border-radius: 24px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.banner button { margin-left: 8px; background: var(--active-bg); border-color: var(--active-border); }

/* ---------- settings bits ---------- */

.pin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pin-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--glass-track);
  border: 1px solid var(--glass-border);
}
.pin-list li span { flex: 1; }
.pin-list li:not(:has(button)) { padding-block: 10px; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- bottom tab bar + More sheet (phone) ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 6px 8px calc(6px + var(--safe-bottom));
  border-width: 1px 0 0;
  border-radius: 0;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 6px 2px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  box-shadow: none;
  font-size: .7rem;
  color: var(--muted);
}
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab span.tab-two { line-height: 1.05; text-align: center; margin-bottom: -6px; }
.tab[aria-current] { color: var(--text); }

.sheet {
  margin: auto auto 0;
  width: 100%;
  max-width: 560px;
  padding: 8px 16px calc(16px + var(--safe-bottom));
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  border-bottom: 0;
  background: var(--glass-strong);
  color: var(--text);
}
.sheet::backdrop { background: rgba(0, 0, 0, .35); }
.sheet-handle {
  position: sticky;
  top: -4px;
  z-index: 2;
  touch-action: none;
  cursor: grab;
  width: 40px;
  height: 5px;
  margin: 4px auto 12px;
  border-radius: 3px;
  background: var(--muted);
  opacity: .5;
}
.sheet-handle::before { content: ''; position: absolute; inset: -14px -70px -10px; } /* a bigger area to grab, stopping short of what's under it */
.sheet-handle:focus { outline: none; } /* More's sheet opens with the focus here, so a phone keyboard doesn't cover the list */
.sheet-list { display: grid; gap: 6px; }
.sheet-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--glass-track);
}

/* ---------- layout switch ---------- */

@media (max-width: 767px) {
  .topnav { display: none; }
  .page-title { font-size: 1.5rem; }
}

@media (min-width: 768px) {
  .tabbar { display: none; }
  main { padding-bottom: 32px; }
  .banner { bottom: calc(24px + var(--sel-lift)); }
}

/* ---------- settings: theme picker + drag list ---------- */

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 24px;
  background: var(--glass-track);
}
.segmented button { box-shadow: var(--glass-highlight), var(--shadow-sm); }
.segmented button[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }

.pin-list li.divider {
  padding: 8px 14px 2px;
  background: none;
  border: 0;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
}
.drag-handle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 36px;
  padding: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}
.pin-list li.dragging {
  position: relative;
  z-index: 1;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
}
.pin-list li.dragging .drag-handle { cursor: grabbing; }

/* ---------- shared form bits ---------- */

:where(input:not([type="file"], [type="checkbox"], [type="radio"]), select, textarea) {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-track);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--active-border); }
textarea { resize: vertical; }
textarea { min-width: 0; } /* one sized to its words (field-sizing) in a row still wraps a long link, not grows past its box */
/* Fields drawn without a box of their own (the line inside a rounded box, a row's name) have square
   corners: a field clips its text cursor to its own corners, so a rounded one cut the cursor's ends off
   when the text starts near its edge. */
:is(.task-add-line .new-task-line, .adv-title, .entry-note, .line .item-title, .pile-new .new-task, .focus input, .bb-paper :is(input, textarea)) { border-radius: 0; }
label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); }
label > input, label > select { font-size: 1rem; color: var(--text); }
button.primary { background: var(--active-bg); border-color: var(--active-border); }
button.danger { color: #ff8a80; }
[data-theme="light"] button.danger { color: #c62828; }
.spacer { flex: 1; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.sheet h2 { margin-top: 4px; }
.sheet { max-height: 92dvh; overflow: auto; }
.icon-btn.small { width: 30px; height: 30px; border-radius: 10px; flex: none; }

/* ---------- Find Things ---------- */

.find-head { margin-bottom: 10px; }
.find-new { display: flex; flex-wrap: wrap; gap: 8px; }
/* Phones: the + New pills slide sideways so Share, 👁 and ⋯ stay on the first line (as Scans' and Contracts'). */
@media (max-width: 560px) {
  .lists-head.find-head { flex-wrap: nowrap; }
  .find-new { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .find-new::-webkit-scrollbar { display: none; }
  .find-new > button { flex: none; }
}
.find-bar { position: sticky; top: calc(var(--safe-top) + 62px); z-index: 5; margin-bottom: 10px; }
/* An area's main page: its whole top sticks (Find Things, Tasks, Contacts; Batch Book has its own), glass once stuck; on the boxes page the search inside it doesn't stick by itself. */
.find-sticky, .sticky-top { position: sticky; top: calc(var(--safe-top) + 62px); z-index: 5; margin: 0 -10px 8px; padding: 0 10px 2px; border-radius: 0 0 16px 16px; transition: box-shadow .15s, background-color .15s; }
.find-sticky .find-bar { position: static; }
.find-sticky .find-areas { margin-bottom: 6px; }
.sticky-top-mark, .find-sticky-mark { height: 1px; margin-bottom: -1px; }
/* A sticky bar is its own layer, so a menu opened in it can only sit as high as the bar. While one is open, lift that bar above the other sticky bars on the page (still under the app bar). */
:is(.find-bar, .find-sticky, .sticky-top, .dump-bar, .bb-sticky, .list-top, .box-top, .box-lid):has(details[open]) { z-index: 9; }
:is(.find-sticky, .sticky-top).stuck { background: var(--glass-strong); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 10px 18px -10px rgba(0, 0, 0, .55); }
@media (min-width: 768px) { .find-sticky, .sticky-top { top: 62px; } }
@media (max-width: 767px) { .find-sticky, .sticky-top { top: 0; } }
.search {
  font-size: 1.05rem;
  padding: 12px 18px !important;
  border-radius: 24px !important;
  background: var(--glass) !important;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--glass-highlight), var(--shadow-sm);
}
.search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
/* The ✕ inside every search box (js/searchclear.js). */
.search-wrap { position: relative; display: flex; flex: 1 1 200px; min-width: 0; }
.search-wrap > .search { flex: 1; width: 100%; min-width: 0; padding-right: 46px !important; }
.search-x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: .9rem; line-height: 1; background: var(--glass-track); border: 0; box-shadow: none; color: var(--muted); }
.search-x[hidden] { display: none; }
.find-areas { margin: 0 0 16px; }
.find-areas[hidden] { display: none; }
/* A card's ⠿ (Find Things boxes, Lists, Contacts, Batch Book), all placed and shown the same way, as on Batch Book:
   top left, over the card's corner; on desktop only on hover, on touch screens always. A click selects the card.
   The card's first line moves right to make room for it. */
:is(.box-card, .c-card, .bb-card-li, .list-card-li)[data-id] { position: relative; }
/* Cards have no ⠿ (listkit `tiles`): hold to choose, then drag from anywhere; never the browser's own drag of a card's link or picture (iPad), nor its press-and-hold menu. */
:is(.box-card, .c-card, .bb-card-li, .list-card-li, .thought), :is(.box-card, .c-card, .bb-card-li, .list-card-li, .thought) :is(a, img) { -webkit-user-drag: none; -webkit-touch-callout: none; }
:is(.c-card, .bb-card-li, .list-card-li, .thought).selected { touch-action: none; } /* a chosen card drags with the finger rather than scrolling the page */
.tool-menu { position: relative; }
.tool-menu summary { list-style: none; cursor: pointer; }
.tool-menu summary::-webkit-details-marker { display: none; }
.tool-menu .menu { left: auto; right: 0; z-index: 20; }
.tool-menu .menu button { text-align: left; box-shadow: none; }
.tool-menu .menu hr { border: 0; border-top: 1px solid var(--glass-border); margin: 2px 4px; width: calc(100% - 8px); }
.tool-menu .menu a { padding: 6px 14px; border-radius: var(--radius-pill); box-shadow: none; background: none; }
.tool-menu .menu a:hover { background: var(--glass-hover); }
.archive-hint { margin: 14px 4px; font-size: .9rem; }
.archive-hint a, .bin-note { color: var(--accent); }
.bin-note { color: var(--muted); font-size: .85rem; margin: 10px 4px 16px; }
.seg-link { padding: 6px 14px; border-radius: var(--radius-pill); background: var(--glass); box-shadow: var(--glass-highlight), var(--shadow-sm); }
.seg-link:hover { background: var(--glass-hover); }
.small-btn { padding: 3px 10px; font-size: .8rem; margin-left: 6px; }

/* ---------- Archive & Bin ---------- */
.bin-head { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.bin-head .segmented button[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }
.bin-group { margin-bottom: 22px; }
.bin-group > h2 { font-weight: 300; font-size: 1.2rem; margin: 0 4px 8px; }
.bin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bin-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.bin-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.bin-kind { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bin-title { font-weight: 500; overflow-wrap: anywhere; }
.bin-sub { font-size: .78rem; }
.bin-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.bin-actions button { padding: 5px 12px; font-size: .85rem; }

.find-section { margin-bottom: 28px; }
.find-section > h2 { font-weight: 300; font-size: 1.4rem; margin: 0 4px 12px; }
.find-section > h2 .box-where { font-size: .9rem; margin-left: 6px; }
.result-count { margin: 0 4px 10px; }

/* Spacing sets the boxes' size: Tight is small boxes (more on screen), Loose is big ones showing more of each box. */
.box-grid { --box-min: 150px; --box-lines: 6; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--box-min), 100%), 1fr)); gap: 10px; }
#main[data-density="tight"] .box-grid { --box-min: 108px; --box-lines: 4; gap: 6px; }
#main[data-density="loose"] .box-grid { --box-min: 230px; --box-lines: 14; gap: 14px; }
#main[data-density="tight"] .box-card { padding: 7px 8px 8px; border-radius: 14px; }
#main[data-density="tight"] .box-code { font-size: 1.1rem; }
.box-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px 12px;
  text-align: left;
  font-size: .8rem;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--glass-highlight), var(--shadow-sm);
  transition: background .2s, transform .15s;
}
.box-card:hover { background: var(--glass-hover); }
.box-card:active { transform: scale(.98); }
.box-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.box-code { font-size: 1.35rem; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; flex: none; }
.box-name { font-weight: 500; font-size: .85rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.no-code .box-name { font-size: .95rem; }
.box-where { color: var(--place); font-size: .75rem; }
.box-notes, .box-path { font-size: .72rem; color: var(--muted); }
.box-card { cursor: pointer; }
.box-card:focus-visible { outline: 2px solid var(--active-border); outline-offset: 2px; }
.box-pills { display: block; margin-top: 4px; font-size: .74rem; line-height: 1.4; max-height: calc(var(--box-lines) * 1.4em); overflow: hidden; overflow-wrap: anywhere; }
.box-item { margin-right: .55em; }
.box-item.sub { opacity: .6; }
.box-item .nowrap { white-space: nowrap; }
.box-item svg { width: 1em; height: 1em; margin-right: 2px; vertical-align: -.15em; opacity: .55; }
.box-pills.all { max-height: none; }
.box-more { font-size: .7rem; }
.box-more:empty { display: none; }
/* Big enough to tap on a phone; always faintly there, at the bottom of the box. */
.quick-add {
  margin-top: auto;
  min-height: 34px;
  padding: 6px 10px !important;
  font-size: .8rem;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--glass-track) 55%, transparent) !important;
  border-color: transparent !important;
  color: var(--text);
}
.box-card .box-more { margin-bottom: 6px; }
#main[data-density="tight"] .quick-add { min-height: 30px; padding: 4px 8px !important; font-size: .74rem; }
.quick-add::placeholder { color: var(--muted); opacity: .6; }
.box-card:hover .quick-add, .quick-add:focus { background: var(--glass-track) !important; border-color: var(--glass-border) !important; }
.quick-add:focus { border-color: var(--active-border) !important; }
.add-card { justify-content: center; align-items: center; min-height: 64px; color: var(--muted); border-style: dashed; box-shadow: none; }

/* Box page: the card zoomed up to full size. */
.box-page-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.box-page-bar .back { padding: 6px 14px 6px 10px; }
.box-page {
  padding: 20px 22px;
  border-radius: 28px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  box-shadow: var(--glass-highlight), var(--shadow);
}
.box-page-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.box-page-head input { background: transparent; border-color: transparent; padding: 4px 8px; }
.box-page-head input:hover, .box-page-head input:focus { border-color: var(--glass-border); }
.box-page-head .box-code-input { width: 4.2em; flex: none; font-size: 2.2rem; font-weight: 600; letter-spacing: -.02em; }
.box-page-head .box-name-input { flex: 1; min-width: 0; font-size: 1.4rem; font-weight: 300; }
.box-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.box-fields input[name="location_note"] { color: var(--place); }
label.inline { display: flex; align-items: center; gap: 6px; }
label.inline select { width: auto; max-width: 220px; font-size: .85rem; padding: 6px 8px; color: var(--text); }
@media (max-width: 560px) {
  .box-fields { grid-template-columns: 1fr; }
  .box-page { padding: 16px; }
  .box-page-head .box-code-input { font-size: 1.8rem; }
  .box-page-head .box-name-input { font-size: 1.15rem; }
}

/* Zoom between card and box page (view transitions). */
::view-transition-group(box-zoom) { animation-duration: .38s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(box-zoom), ::view-transition-new(box-zoom) { height: 100%; width: 100%; object-fit: cover; object-position: top left; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(box-zoom) { animation-duration: .3s; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .15s; }
}

.item-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; } /* never wider than the page, however long a name or note */
.item-list li { display: flex; gap: 4px; align-items: center; border-radius: var(--radius-sm); }
.item-list li[data-depth="1"] { margin-left: 28px; }
.item-list li[data-depth="1"] input[name="name"] { font-size: .88rem; color: var(--muted); }
.item-list li[data-depth="1"] input[name="name"]:focus { color: var(--text); }
.item-list .drag-handle { width: 28px; height: 30px; opacity: .35; }
.item-list li:hover .drag-handle, .item-list li:focus-within .drag-handle { opacity: .8; }
.item-list li.dragging { position: relative; z-index: 2; background: var(--glass-strong); box-shadow: var(--shadow); }
.hint { font-size: .75rem; margin: 6px 2px 0; }
.item-list li.selected { background: var(--active-bg); box-shadow: inset 0 0 0 1px var(--active-border); }
.item-list li.selected .drag-handle { opacity: 1; color: var(--accent); }
.item-list li.group-drag { background: none; box-shadow: none; }
.item-list li.group-drag > :not(.drag-ghost) { visibility: hidden; }
.drag-ghost { position: absolute; left: 0; right: 0; display: grid; pointer-events: none; }
.drag-ghost.fade-top { -webkit-mask-image: linear-gradient(transparent, #000 30%); mask-image: linear-gradient(transparent, #000 30%); }
.drag-ghost.fade-bottom { -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.drag-ghost.fade-top.fade-bottom { -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); }
.ghost-count { flex: none; font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: var(--active-bg); border: 1px solid var(--active-border); }
/* A group being dragged (listkit.js): copies of its rows, lifted as one pane of glass. */
.drag-ghost.drag-stack { right: auto; margin: 0 !important; padding: 0; z-index: 1; }
.drag-stack > li { visibility: visible !important; }
.drag-stack > li > .ghost-count { align-self: center; margin-left: auto; }
.item-list .drag-handle { touch-action: none; }
.select-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  padding: 6px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--active-border);
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.select-bar .select-count { font-size: .85rem; margin-right: 6px; }
.select-bar button { padding: 5px 10px; font-size: .85rem; box-shadow: none; }
body.is-dragging .select-bar { opacity: 0; pointer-events: none; }
.select-bar button[hidden] { display: none; }
.select-bar button { display: inline-flex; align-items: center; }
/* A group (Move ▸) opens sideways to show its buttons (listkit.js). */
.select-bar .kit-group { display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: 999px; transition: background-color .2s, border-color .2s; }
/* Open, the group's button and its buttons share one shaded pill, so it's clear they came out of it. */
.select-bar .kit-group:has(> [aria-expanded="true"]) { background: var(--active-bg); border-color: var(--active-border); padding: 2px; margin: -3px 0; }
.select-bar .kit-group-items { display: inline-flex; gap: 4px; overflow: hidden; }
.select-bar .kit-group-items[hidden] { display: none; }
.select-bar .kit-group-items:not([hidden]) { animation: kit-open .2s cubic-bezier(.2, .8, .2, 1); }
.select-bar [data-kit-group][aria-expanded="true"] { background: none; border-color: transparent; font-weight: 600; }
@keyframes kit-open { from { clip-path: inset(0 100% 0 0); opacity: .4; } to { clip-path: inset(0); opacity: 1; } }
/* Things floating above the bottom stack up: selection bar, then the update banner, then toasts. */
body { --sel-lift: 0px; --upd-lift: 0px; }
body.has-select-bar { --sel-lift: 58px; }
body:has(#update-banner:not([hidden])) { --upd-lift: 70px; }
/* An invitation waiting (sharing.js): its bar sits above the update one when both show; toasts go above it. */
body:has(#share-banner) { --upd-lift: 84px; }
body:has(#share-banner):has(#update-banner:not([hidden])) { --upd-lift: 150px; }
.share-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; white-space: normal; width: max-content; max-width: min(680px, calc(100vw - 24px)); z-index: 46; }
body:has(#update-banner:not([hidden])) .share-banner { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px + var(--sel-lift) + 66px); }
.share-banner-words { flex: 1 1 260px; }
.share-banner-acts { display: flex; gap: 6px; margin-left: auto; }
.share-banner-acts button { margin: 0; padding: 5px 12px; }
.share-banner-acts .primary { background: var(--accent, var(--active-bg)); }
/* Shared with me (views/shared.js) */
.sw { max-width: 820px; margin: 0 auto; padding: 8px 16px 40px; }
.sw-title { font-size: 1.4rem; font-weight: 500; margin: 8px 0 16px; }
.sw-group { margin: 0 0 24px; }
.sw-group h2 { font-size: 1.05rem; margin: 0 0 4px; }
.sw-group > p { margin: 0 0 10px; font-size: .9rem; }
.sw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-border); cursor: pointer; }
.sw-row:hover { border-color: var(--active-border); }
.sw-area { flex: none; font-size: .8rem; }
.sw-words { flex: 1 1 240px; }
.sw-acts { display: flex; gap: 6px; margin-left: auto; }
.sw-acts button { padding: 4px 12px; }

body.has-select-bar main { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 80px); }
@media (min-width: 768px) {
  .select-bar { bottom: 24px; }
  body.is-dragging .select-bar { opacity: 0; pointer-events: none; }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px + var(--sel-lift) + var(--upd-lift));
  z-index: 50;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .85rem;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--active-border);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
/* The countdown: how long it stays, running down from the top (toast.js). */
.toast-timer { flex: none; width: 16px; height: 16px; margin: 0 -4px 0 -6px; transform: rotate(-90deg); }
.toast-timer circle { fill: none; stroke-width: 2.6; }
.toast-timer .toast-track { stroke: color-mix(in srgb, var(--text) 16%, transparent); }
.toast-timer .toast-left { stroke: var(--accent, var(--text)); stroke-linecap: round; stroke-dasharray: 100; animation: toast-left var(--ms, 6s) linear forwards; }
@keyframes toast-left { to { stroke-dashoffset: -100; } }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { padding: 3px 12px; font-weight: 600; color: var(--accent); background: none; box-shadow: none; border-color: var(--glass-border); }
@media (min-width: 768px) { .toast { bottom: calc(28px + var(--sel-lift) + var(--upd-lift)); } }
kbd { font: inherit; font-size: .72em; line-height: 1.2; vertical-align: middle; padding: 1px 5px; margin-left: 4px; border-radius: 6px; border: 1px solid var(--glass-border); opacity: .7; }
@media (hover: none) { kbd { display: none; } }
/* Any button showing a key: its text, icon and keys are centred as boxes, not on the text baseline, which sat them low on Windows (Segoe UI and symbol fallback fonts). Zero specificity so each button's own display rules still win. */
:where(button:has(> kbd, > span > kbd)) { display: inline-flex; align-items: center; justify-content: center; }
:where(button > span:has(> kbd)) { display: inline-flex; align-items: center; }
/* A back button's Esc shows only while nothing is being typed: the first Esc leaves the field. */
#main:has(:is(input:not([type="checkbox"], [type="radio"]), textarea, [contenteditable="true"]):focus) .back kbd { display: none; }
.item-list li:hover, .item-list li:focus-within { background: var(--glass-track); }
.item-list input { padding: 5px 10px; background: transparent; border-color: transparent; font-size: .95rem; }
.item-list input:focus { background: var(--glass-track); border-color: var(--active-border); }
.item-list .item-note { max-width: 34%; font-size: .85rem; color: var(--muted); }
.item-list .item-note:placeholder-shown { opacity: 0; }
.item-list li:hover .item-note, .item-list li:focus-within .item-note { opacity: 1; }
.item-list .icon-btn { opacity: .45; background: none; box-shadow: none; }
.item-list li:hover .icon-btn, .item-list li:focus-within .icon-btn { opacity: 1; }

@media (min-width: 768px) {
  .find-bar { top: 72px; }
  #import-sheet { margin: auto; border-radius: var(--radius-card); border-bottom: 1px solid var(--glass-border); }
}

/* ---------- Day Planner ---------- */

:root, :root[data-theme="blue"], :root[data-theme="dark"] {
  --hand: "Segoe Print", "Bradley Hand", "Noteworthy", "Chalkboard SE", "Comic Sans MS", cursive;
  --ink: #9cc4ff;
  --rule: rgba(140, 180, 255, .16);
  --margin-rule: rgba(255, 120, 130, .45);
  --focus-ink: #ff8a8a;
  --energy-ink: #8fdcaa;
  --calm: rgba(120, 220, 170, .14);
}
:root[data-theme="light"] {
  --ink: #0b4f8a;
  --rule: rgba(70, 120, 200, .22);
  --margin-rule: rgba(220, 60, 70, .45);
  --focus-ink: #c62828;
  --energy-ink: #2f8f5b;
  --calm: rgba(40, 160, 110, .12);
}
.hand { font-family: var(--hand); }

.day-nav { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; margin-bottom: 8px; container-type: inline-size; } /* one line on every paper, so its open menus stay put */
.day-nav button { padding: 6px 14px; }
.day-nav .share-btn { display: inline-flex; align-items: center; gap: 6px; }
.day-nav .cal-icon { padding: 6px 10px; display: inline-flex; align-items: center; }
.day-nav .icon { width: 18px; height: 18px; }

.day-head { margin: 4px 4px 14px; }
.day-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 6px 0 0; }
.day-title .weekday { font-family: var(--hand); font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 700; color: var(--ink); line-height: 1.1; }
.day-title .date { font-size: clamp(1.4rem, 4.5vw, 2.3rem); font-weight: 600; color: var(--ink); opacity: .85; }
.day-rel { margin: 2px 0 10px; font-size: .85rem; }
.down-day { margin: 0 0 12px; padding: 10px 14px; border-radius: 16px; background: var(--calm); font-size: .9rem; }
.did-things { margin: 0 0 12px; font-family: var(--hand); font-size: 1.2rem; color: var(--ink); }

.focus { display: flex; align-items: baseline; gap: 12px; font-size: 1rem; color: var(--text); margin-bottom: 10px; }
.focus > span { flex: none; font-family: var(--hand); font-size: 1.05rem; color: var(--focus-ink); text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--focus-ink); line-height: 1.2; }
.focus input { font-weight: 700; font-size: 1.15rem; color: var(--focus-ink) !important; background: transparent !important; border-color: transparent !important; padding: 4px 6px !important; }
.focus input:focus { border-color: var(--glass-border) !important; }
.energy { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.energy > span { margin-right: 4px; }
.energy button { padding: 4px 12px; font-size: .85rem; }
.energy button[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); color: var(--text); }

.carry { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 14px; border-radius: 16px; background: var(--glass); border: 1px dashed var(--active-border); font-size: .9rem; }
.carry button { padding: 4px 12px; font-size: .85rem; }

.paper {
  padding: 6px 0 10px;
  border-radius: 24px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  box-shadow: var(--glass-highlight), var(--shadow);
}
.line { display: grid; grid-template-columns: 64px 1fr; min-height: 2.375rem; border-bottom: 1px solid var(--rule); }
.line .margin {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  border-right: 2px solid var(--margin-rule);
  font-family: var(--hand);
  font-size: .9rem;
  color: var(--ink);
  opacity: .85;
}
.line .content { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 10px 0 8px; }
.line.blank .content { cursor: text; }
/* An empty slot you can write on lights up a little under the pointer (no "+", so nothing moves). */
.line.blank:not(.covered):hover .content { background: color-mix(in srgb, var(--text) var(--line-hover), transparent); }
.line.blank .content:has(input)::before { content: none; }
.line.section-label .content { font-family: var(--hand); color: var(--muted); font-size: .95rem; }
.line .item-title { flex: 1; min-width: 0; font-family: var(--hand); font-size: 1.1rem; padding: 4px 6px; background: transparent; border-color: transparent; color: var(--text); }
.line .item-title:focus { background: var(--glass-track); border-color: var(--active-border); }
.line.done .item-title { text-decoration: line-through; opacity: .5; }
.tick { width: 18px; height: 18px; flex: none; accent-color: #6fb0ff; cursor: pointer; }
.span-tag { flex: none; font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: var(--glass-track); border: 1px solid var(--glass-border); color: var(--muted); }
.line .more { flex: none; padding: 2px 8px; background: none; box-shadow: none; opacity: .4; }
.line:hover .more, .line:focus-within .more { opacity: 1; }

.item-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  padding: 10px 12px 12px 74px;
  border-bottom: 1px solid var(--rule);
  background: var(--glass-track);
}
.item-details .wide { grid-column: 1 / -1; }
.item-details textarea { font-size: .9rem; padding: 6px 8px; color: var(--text); line-height: 1.4; resize: vertical; }
.item-details input, .item-details select { font-size: .9rem; padding: 6px 8px; color: var(--text); }
.detail-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.detail-actions button { padding: 5px 12px; font-size: .85rem; }
.detail-actions .close-details { margin-right: auto; }

.pile, .day-tasks, .day-notes { margin-top: 20px; }
.pile h2, .day-tasks h2, .day-notes h2 { font-family: var(--hand); font-weight: 700; font-size: 1.6rem; color: var(--ink); margin: 0 4px 6px; border-bottom: 2px solid var(--rule); }
.pile-list { list-style: none; margin: 0 0 10px; padding: 0; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border); overflow: hidden; }
.pile-list .line .margin { border-right-style: dashed; }
.pile-empty { padding: 12px 16px; font-size: .9rem; }
#dump { font-size: 1.05rem; }
.day-bottom { display: grid; gap: 0 24px; }
@media (min-width: 900px) { .day-bottom { grid-template-columns: 1fr 1fr; } }
.md-bar { display: flex; gap: 4px; margin: 0 0 6px; }
.md-bar button { padding: 3px 10px; font-size: .85rem; }
#notes { font-size: 1.05rem; line-height: 1.6; }

.is-down-day .paper { box-shadow: var(--glass-highlight), var(--shadow), inset 0 0 0 999px var(--calm); }

.cal-sheet { max-width: 380px; }
@media (min-width: 768px) { .cal-sheet { margin: auto; border-radius: var(--radius-card); border-bottom: 1px solid var(--glass-border); } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.cal-head button { padding: 4px 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow { font-size: .72rem; color: var(--muted); padding-bottom: 4px; }
.cal-grid button { position: relative; padding: 8px 0; border-radius: 12px; font-size: .9rem; box-shadow: none; background: transparent; }
.cal-grid button:hover { background: var(--glass-hover); }
.cal-grid button.down { color: var(--muted); }
.cal-grid button.today { border-color: var(--active-border); }
.cal-grid button.current { background: var(--active-bg); border-color: var(--active-border); }
.cal-grid button.busy::after, .cal-key .dot { content: ""; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--place); }
.cal-key { font-size: .78rem; margin-top: 10px; }
.cal-key .dot { position: relative; display: inline-block; left: 0; bottom: 1px; margin: 0 4px 0 0; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.settings-grid input, .settings-grid select { color: var(--text); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text); margin: 6px 0; }
.check-row input { width: auto; }
.check-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex: none; accent-color: #6fb0ff; cursor: pointer; }
/* Fields in a settings grid fit their column (date fields were wider and overlapped). */
.settings-grid :is(input, select) { box-sizing: border-box; min-width: 0; max-width: 100%; }
#down-days button[aria-pressed="true"] { background: var(--calm); border-color: rgba(120, 220, 170, .5); }


/* ---------- Planner paper styles ---------- */
/* Each paper re-points the colour tokens inside .planner, so everything in
   the planner (inputs, chips, toasts' neighbours) follows the page. */

.paper-pick { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.paper-pick select { width: auto; padding: 5px 8px; font-size: .85rem; color: var(--text); }

.planner:not([data-paper="glass"]) {
  background: var(--paper-bg);
  background-image: var(--paper-pattern, none);
  background-size: var(--paper-pattern-size, auto);
  color: var(--text);
  border-radius: 22px;
  padding: 16px 16px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.planner:not([data-paper="glass"]) .paper {
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-radius: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.planner:not([data-paper="glass"]) .pile-list { background: transparent; border-color: var(--rule); }
.planner:not([data-paper="glass"]) button,
.planner:not([data-paper="glass"]) .seg-link { box-shadow: none; }
.planner:not([data-paper="glass"]) input:not([type="checkbox"]),
.planner:not([data-paper="glass"]) textarea,
.planner:not([data-paper="glass"]) select { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Notebook: light yellow paper, faint grey lines, red margin, handwriting. */
.planner[data-paper="notebook"], .bb-paper[data-paper="notebook"] {
  color-scheme: light;
  --paper-bg: #f5edc6;
  --text: #1f2d3d;
  --muted: rgba(31, 45, 61, .55);
  --ink: #1d4f91;
  --rule: rgba(95, 110, 130, .26);
  --margin-rule: rgba(214, 60, 60, .65);
  --focus-ink: #c62828;
  --energy-ink: #2f8f5b;
  --glass: rgba(0, 0, 0, .06);
  --glass-hover: rgba(0, 0, 0, .1);
  --glass-track: rgba(0, 0, 0, .05);
  --glass-strong: #fffbe9;
  --glass-border: rgba(0, 0, 0, .1);
  --glass-highlight: inset 0 0 0 transparent;
  --active-bg: rgba(29, 79, 145, .12);
  --active-border: rgba(29, 79, 145, .38);
  --calm: rgba(60, 150, 100, .12);
  --place: #d2691e;
}

/* Techie: dark terminal, monospace, 24-hour times, grid. */
.planner[data-paper="techie"], .bb-paper[data-paper="techie"] {
  color-scheme: dark;
  --paper-bg: #0b1016;
  --paper-pattern: linear-gradient(rgba(79, 209, 197, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(79, 209, 197, .05) 1px, transparent 1px);
  --paper-pattern-size: 24px 24px;
  --hand: ui-monospace, "Cascadia Code", "SF Mono", Consolas, Menlo, monospace;
  --text: #d7e2ee;
  --muted: #7f8ea3;
  --ink: #4fd1c5;
  --rule: rgba(79, 209, 197, .14);
  --margin-rule: rgba(79, 209, 197, .55);
  --focus-ink: #f6c177;
  --energy-ink: #9be3b4;
  --glass: rgba(79, 209, 197, .05);
  --glass-hover: rgba(79, 209, 197, .12);
  --glass-track: rgba(79, 209, 197, .06);
  --glass-strong: #111a22;
  --glass-border: rgba(79, 209, 197, .22);
  --glass-highlight: inset 0 0 0 transparent;
  --active-bg: rgba(79, 209, 197, .16);
  --active-border: rgba(79, 209, 197, .55);
  --calm: rgba(246, 193, 119, .08);
  font-family: var(--hand);
  border-radius: 8px;
}
.planner[data-paper="techie"] .day-title .weekday { text-transform: uppercase; letter-spacing: .08em; font-size: clamp(1.8rem, 6vw, 2.6rem); }
.planner[data-paper="techie"] .day-title .weekday::before { content: "> "; opacity: .6; }
.planner[data-paper="techie"] .day-title .date { font-family: var(--hand); font-size: clamp(1rem, 3.5vw, 1.4rem); }
.planner[data-paper="techie"] .line { min-height: 2rem; border-bottom-style: dashed; grid-template-columns: 72px 1fr; }
.planner[data-paper="techie"] .line .margin { font-size: .8rem; }
.planner[data-paper="techie"] .line .item-title { font-size: .95rem; }
.planner[data-paper="techie"] .focus > span { text-transform: uppercase; border-bottom: 0; }
.planner[data-paper="techie"] .focus > span::after { content: ":"; }
.planner[data-paper="techie"] .pile h2, .planner[data-paper="techie"] .day-tasks h2, .planner[data-paper="techie"] .day-notes h2 {
  font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600;
}
.planner[data-paper="techie"] .pile h2::before, .planner[data-paper="techie"] .day-tasks h2::before, .planner[data-paper="techie"] .day-notes h2::before { content: "## "; opacity: .5; }

/* Dot journal: cream paper, dot grid, no rules, handwriting. */
.planner[data-paper="dots"], .bb-paper[data-paper="dots"] {
  color-scheme: light;
  --paper-bg: #fffdf6;
  --paper-pattern: radial-gradient(circle, rgba(60, 60, 60, .22) 1px, transparent 1.4px);
  --paper-pattern-size: 19px 19px;
  --text: #2b2b2b;
  --muted: rgba(43, 43, 43, .55);
  --ink: #26357a;
  --rule: transparent;
  --margin-rule: transparent;
  --focus-ink: #d9480f;
  --energy-ink: #2f8f5b;
  --glass: rgba(0, 0, 0, .025);
  --glass-hover: rgba(0, 0, 0, .06);
  --glass-track: rgba(255, 255, 255, .7);
  --glass-strong: #fffdf6;
  --glass-border: rgba(0, 0, 0, .12);
  --glass-highlight: inset 0 0 0 transparent;
  --active-bg: rgba(38, 53, 122, .1);
  --active-border: rgba(38, 53, 122, .35);
  --calm: rgba(60, 150, 100, .1);
  --place: #d9480f;
}
.planner[data-paper="dots"] .line { min-height: 2.375rem; }
.planner[data-paper="dots"] .line .margin { justify-content: center; padding: 0; }
.planner[data-paper="dots"] .line.has-item .content::before { content: "•"; color: var(--ink); font-size: 1.3rem; margin-right: -2px; }
.planner[data-paper="dots"] .day-title .weekday { text-decoration: underline; text-decoration-color: var(--focus-ink); text-underline-offset: 8px; text-decoration-thickness: 3px; }
.planner[data-paper="dots"] .pile h2, .planner[data-paper="dots"] .day-tasks h2, .planner[data-paper="dots"] .day-notes h2 { border-bottom: 0; }

/* Minimal: clean white page, system font, hairlines, roomy. */
.planner[data-paper="minimal"], .bb-paper[data-paper="minimal"] {
  color-scheme: light;
  --paper-bg: #ffffff;
  --hand: system-ui, -apple-system, "Segoe UI", sans-serif;
  --text: #15171a;
  --muted: #8a9099;
  --ink: #15171a;
  --rule: rgba(0, 0, 0, .06);
  --margin-rule: transparent;
  --focus-ink: #15171a;
  --energy-ink: #2f6f4b;
  --glass: rgba(0, 0, 0, .025);
  --glass-hover: rgba(0, 0, 0, .05);
  --glass-track: rgba(0, 0, 0, .03);
  --glass-strong: #ffffff;
  --glass-border: rgba(0, 0, 0, .09);
  --glass-highlight: inset 0 0 0 transparent;
  --active-bg: rgba(0, 0, 0, .06);
  --active-border: rgba(0, 0, 0, .25);
  --calm: rgba(60, 150, 100, .08);
  --place: #b45309;
}
.planner[data-paper="minimal"] .day-title .weekday { font-weight: 300; letter-spacing: -.02em; }
.planner[data-paper="minimal"] .day-title .date { font-weight: 300; color: var(--muted); }
.planner[data-paper="minimal"] .line { min-height: 2.875rem; grid-template-columns: 56px 1fr; }
.planner[data-paper="minimal"] .line .margin { font-size: .75rem; color: var(--muted); }
.planner[data-paper="minimal"] .line .item-title { font-size: 1rem; }
.planner[data-paper="minimal"] .focus > span { border-bottom: 0; font-size: .75rem; letter-spacing: .12em; color: var(--muted); font-family: var(--font); }
.planner[data-paper="minimal"] .pile h2, .planner[data-paper="minimal"] .day-tasks h2, .planner[data-paper="minimal"] .day-notes h2 {
  font-family: var(--font); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); border-bottom: 1px solid var(--rule);
}


/* ---------- Notes editor (richtext.js) ---------- */
.rich-edit, .rich-raw {
  min-height: 9em;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-track);
  font-size: 1.05rem;
  line-height: 1.6;
  outline: none;
  overflow-wrap: anywhere;
}
.rich-edit:focus, .rich-raw:focus { border-color: var(--active-border); }
.rich-edit ul { margin: 0; padding-left: 1.3em; }
.rich-edit.is-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; position: absolute; }
.rich-edit.is-empty { position: relative; }
.rich-raw { width: 100%; font-family: ui-monospace, Consolas, Menlo, monospace !important; font-size: .9rem; }
.md-bar .md-toggle { margin-left: auto; font-size: .78rem; }
.md-bar .md-toggle[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }
.rich.raw .md-bar [data-cmd] { opacity: .35; pointer-events: none; }


/* Planner drag: grip to move onto a time, bottom handle to set length */
.line.has-item { position: relative; }
.drag-grip {
  flex: none;
  padding: 2px 4px;
  font-size: .9rem;
  line-height: 1;
  background: none;
  box-shadow: none;
  border: 0;
  color: var(--muted);
  opacity: .35;
  cursor: grab;
  touch-action: none;
}
.line:hover .drag-grip, .line:focus-within .drag-grip { opacity: .9; }
.resize-grip {
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 44px;
  height: 9px;
  margin-left: -22px;
  border-radius: 999px;
  background: var(--active-border);
  opacity: 0;
  cursor: ns-resize;
  touch-action: none;
  z-index: 2;
}
.line.has-item:hover .resize-grip, .line.resizing .resize-grip { opacity: .8; }
@media (hover: none) { .resize-grip { opacity: .5; } .drag-grip { opacity: .7; } }
.drag-float {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: var(--glass-strong);
  border: 1px solid var(--active-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: .95;
}
.drag-float[data-when]::after {
  content: attr(data-when);
  position: absolute;
  right: 8px;
  top: -12px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: .75rem;
  background: var(--active-bg);
  border: 1px solid var(--active-border);
  color: var(--text);
}
.drag-source { opacity: .35; }
.line.drop-target { background: var(--active-bg); }
.line.will-cover .content { border-left: 3px solid var(--active-border); margin-left: 10px; background: var(--glass-track); }


/* ---------- Tasks ---------- */
.tasks-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.tasks-head .segmented { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tasks-head .segmented button[aria-pressed="true"], .energy-pick button[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }
.task-add { display: flex; gap: 8px; align-items: flex-start; }
.task-add textarea { flex: 1; min-height: 44px; font-size: 1rem; }
.task-add button { flex: none; padding: 9px 14px; }
.task-list { list-style: none; margin: 10px 0 16px; padding: 0; display: grid; gap: 2px; }
.task-list > li[data-task] {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 2px 6px;
  border-radius: 14px;
  border: 1px solid transparent;
}
.task-list > li[data-task]:hover, .task-list > li[data-task]:focus-within { background: var(--glass); border-color: var(--glass-border); }
.task-list > li[data-depth="1"] { margin-left: 28px; }
.task-list > li[data-depth="2"] { margin-left: 56px; }
.task-list > li[data-depth="3"], .task-list > li[data-depth="4"] { margin-left: 84px; }
.task-list > li.dragging { position: relative; z-index: 2; background: var(--glass-strong); box-shadow: var(--shadow); }
.task-list > li[data-carry]:not([data-carry=""])::after { content: attr(data-carry); font-size: .7rem; padding: 1px 7px; border-radius: 999px; background: var(--active-bg); border: 1px solid var(--active-border); }
.task-list .drag-handle { width: 26px; height: 30px; opacity: .3; }
.task-list li:hover .drag-handle { opacity: .8; }
.task-title { flex: 1; min-width: 0; padding: 6px 8px; font-size: 1rem; background: transparent; border-color: transparent; }
.task-title:focus { background: var(--glass-track); border-color: var(--active-border); }
.task-list li.done .task-title { text-decoration: line-through; opacity: .5; }
.task-list .more { flex: none; padding: 2px 8px; background: none; box-shadow: none; opacity: .5; }
.task-list li:hover .more, .task-list .more[aria-expanded="true"] { opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 55%; }
.chip {
  font-size: .72rem;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--glass-track);
  border: 1px solid var(--glass-border);
  color: var(--muted);
  white-space: nowrap;
}
.chip[style*="--c"] { border-color: var(--c); color: var(--text); }
.chip.late { color: #ff8a80; border-color: rgba(255, 138, 128, .5); }
.chip.pri-1 { color: #ff8a80; }
.chip.pri-2 { color: var(--place); }
button.chip { box-shadow: none; cursor: pointer; }
a.chip { color: var(--text); text-decoration: none; }
.task-details { list-style: none; margin: 0 0 8px 34px; padding: 12px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-border); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.detail-grid input, .detail-grid select { font-size: .9rem; padding: 6px 8px; color: var(--text); }
.energy-pick { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.energy-pick button { padding: 4px 12px; font-size: .85rem; }
.task-notes { margin-bottom: 10px; }
.task-notes .rich-edit { min-height: 4em; font-family: var(--font); font-size: .95rem; }
.milestone { font-weight: 500; font-size: 1rem; margin: 18px 4px 4px; color: var(--text); }
.milestone a { color: var(--accent); }
.done-toggle button { padding: 4px 12px; font-size: .85rem; }
.project-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border); border-left: 4px solid var(--c); }
.project-head .project-name { flex: 1; min-width: 160px; font-size: 1.3rem; font-weight: 300; background: transparent; border-color: transparent; }
.bar { display: block; flex: 1; min-width: 80px; height: 6px; border-radius: 999px; background: var(--glass-track); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 999px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.project-card { display: grid; gap: 8px; text-align: left; padding: 14px 16px; border-radius: 20px; border: 1px solid var(--glass-border); border-top: 4px solid var(--c); background: var(--glass); }
.project-card .project-title { font-size: 1.1rem; font-weight: 500; }
.project-next { display: grid; gap: 2px; font-size: .8rem; color: var(--muted); }
.project-next span::before { content: "○ "; }

/* Day Planner: tasks section */
.day-task-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.day-task-list li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-border); }
.day-task-list .task-link { flex: 1; min-width: 0; color: var(--text); font-family: var(--hand); font-size: 1.05rem; }
.day-task-list li.done .task-link { text-decoration: line-through; opacity: .5; }
.day-task-list.ongoing li { border-style: dashed; }
.day-task-list.ideas li { background: transparent; }
.day-tasks h3 { font-size: .85rem; margin: 10px 4px 6px; }
.task-tick { width: 18px; height: 18px; accent-color: #6fb0ff; }


/* ---------- Brain Dump ---------- */
/* Three parts: the "New note" card, "Your notes" (search + filter tabs), then the notes. */
.dump-capture.card { padding: 12px 14px 12px; margin-bottom: 26px; }
.dump-h-row { display: flex; align-items: center; gap: 8px; min-height: 32px; margin-bottom: 8px; }
.dump-h { margin: 0; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dump-h-row .save-state { margin: 0 0 0 auto; }
#dump-body .rich-edit, #dump-body .rich-raw { font-size: 1.15rem; line-height: 1.5; min-height: 7em; }
#dump-att:empty { display: none; }
/* Kind of the new note: small filled pills inside the card. */
.dump-kinds-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.dump-caption { font-size: .8rem; color: var(--muted); }
.dump-kinds { display: flex; flex-wrap: wrap; gap: 5px; }
.dump-kinds button { padding: 4px 11px; font-size: .82rem; line-height: 1.3; border-radius: 999px; box-shadow: none; }
.dump-kinds button[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }
.dump-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--glass-border); }
.dump-foot .primary { padding-inline: 18px; }
/* Filter: plain text tabs with an underline, one row, so it doesn't look like the kind pills. */
.dump-find { margin-bottom: 6px; }
.dump-bar .search { width: 100%; }
.dump-filter-row { display: flex; align-items: stretch; margin-top: 6px; border-bottom: 1px solid var(--glass-border); }
.dump-filter { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.dump-filter::-webkit-scrollbar { display: none; }
.dump-filter-row button { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; box-shadow: none; padding: 6px 9px 5px; font-size: .85rem; line-height: 1.2; color: var(--muted); }
.dump-filter button[aria-pressed="true"] { color: inherit; border-bottom-color: currentColor; font-weight: 600; }
.dump-filter-row button:hover:not(:disabled) { background: none; color: var(--text); } /* underline tabs never get a box, as Tasks' */
.thought-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 10px; }
.thought { padding: 10px 14px 10px; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-border); }
.thought.pinned { border-color: var(--active-border); }
.thought-head { display: flex; align-items: center; gap: 8px; font-size: .8rem; }
.kind-select { width: auto !important; padding: 2px 8px !important; font-size: .78rem; border-radius: 999px !important; color: var(--text); }
.pin { padding: 2px 8px; background: none; box-shadow: none; font-size: 1rem; color: var(--place); }
.thought-body { font-size: 1.05rem; line-height: 1.55; margin: 6px 2px; cursor: text; overflow-wrap: anywhere; }
.thought-body ul { margin: 0; padding-left: 1.2em; }
.thought-edit { font-size: 1.05rem; margin: 6px 0; }
.thought-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.thought-actions button { padding: 3px 10px; font-size: .78rem; box-shadow: none; background: transparent; border-color: var(--glass-border); }
.thought:not(:hover):not(:focus-within) .thought-actions > :not(.att-row) { opacity: .55; }
/* A note's photos and files: small, in its bottom bar from the left, so the text has the whole tile. */
.thought-actions .att-row { flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; overflow: hidden; gap: 4px; margin: 0; }
.thought-actions .att-open { padding: 0; border-radius: 4px; }
.thought-actions .att-img .att-open img { height: 26px; max-width: 40px; }
.thought-actions .att-file .att-open { padding: 2px 6px; font-size: .7rem; max-width: 110px; }
.thought-actions .att-file .att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thought-actions :is(.att-pdf, .att-wait), .thought:not(:has(.thought-edit)) .thought-actions .att .att-x { display: none; }
.thought-panel { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; align-items: end; margin-top: 10px; padding: 10px; border-radius: 14px; background: var(--glass-track); }
.thought-panel .wide { grid-column: 1 / -1; }
.thought-panel input, .thought-panel select { color: var(--text); font-size: .9rem; padding: 6px 8px; }
.make-contact { position: fixed; z-index: 55; padding: 6px 14px; background: var(--active-bg); border-color: var(--active-border); box-shadow: var(--shadow); }
.converted-note { list-style: none; text-align: center; }
.converted-note button { padding: 4px 12px; font-size: .85rem; }

/* ---------- Contacts ---------- */
.c-capture { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.c-capture textarea { flex: 1; min-height: 48px; }
.c-capture button { flex: none; padding: 9px 14px; }
.c-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.c-card { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border); }
.c-card.pinned { border-color: var(--active-border); }
.c-main { flex: 1 1 180px; min-width: 0; display: grid; gap: 1px; }
.c-name { font-weight: 500; }
.c-about { font-size: .8rem; }
.what-was-this { font-size: .8rem; color: var(--place); font-style: italic; }
.c-details { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.detail-chip { color: var(--accent); border-color: var(--active-border); }
.c-when { font-size: .75rem; margin-left: auto; }
.older summary { cursor: pointer; color: var(--muted); margin: 10px 4px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.cat-grid > .cat-cards { display: contents; } /* its category cards sit in the grid beside + New category */
.research { margin: 0 0 12px; padding: 10px 14px; border-radius: 16px; background: var(--glass-track); }
.research summary { cursor: pointer; font-weight: 500; }
.research textarea { margin-top: 6px; }
.research-row { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: -2px 0 8px 14px; }
.research-row button { padding: 2px 10px; font-size: .75rem; box-shadow: none; }
.research-row button[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }
.stars { margin-left: auto; display: flex; }
.stars button { padding: 0 3px; background: none; border: 0; color: var(--muted); font-size: 1rem; }
.stars button[aria-pressed="true"] { color: #f0c24b; background: none; }
.c-page { display: grid; gap: 6px; }
.c-page .wide { grid-column: 1 / -1; }
.c-page label input, .c-page label select { color: var(--text); }
.energy-pick button[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }
.detail-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.detail-rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.detail-rows input { flex: 1 1 160px; padding: 6px 10px; color: var(--text); }
.detail-rows .d-label { flex: 0 1 110px; color: var(--muted); }
.detail-rows a.icon-btn { text-decoration: none; display: grid; place-items: center; border: 1px solid var(--glass-border); }
.d-used { font-size: .72rem; }
.log-form { display: flex; flex-wrap: wrap; gap: 6px; }
.log-form select { width: auto; padding: 6px 8px; color: var(--text); }
.log-form input { flex: 1 1 180px; padding: 6px 10px; color: var(--text); }
/* New entry (and an entry open to edit): its own box, one kind of thing per row. */
.log-box { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--glass-border); border-radius: 14px; background: var(--glass-track); }
.log-box .log-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.log-box .log-kind select { flex: 1 1 140px; }
.log-box .log-foot .log-when { flex: 1 1 230px; }
.log-box .log-foot .log-when input { flex: 1 1 auto; }
.log-box .log-foot .spacer { flex: 1; }
.log-box .log-foot [data-act^="log-"]:last-child { margin-left: auto; }
.log-box .att-row { margin: 0; }
.log-pending { display: flex; flex-wrap: wrap; gap: 6px; }
.log-pending:empty { display: none; }
.timeline .entry-files .att-row { margin: 4px 0 2px; }
/* A case's page (Contacts and Cases): New entry, the case's own files, the Timeline, then its details, each a card in the ticket look (.adv-card). */
.c-opened > :is(.sticky-top, .sticky-top-mark) { display: none; }
.adv-status.waiting { color: #d9a441; border-color: color-mix(in srgb, #d9a441 50%, transparent); background: color-mix(in srgb, #d9a441 10%, transparent); }
/* A case (Contacts and Cases, 1.60.92): one control size everywhere (.kc-btn: 44px, 14px corners, glass), a hero
   card with the status built in, the New entry composer as the one raised surface, then the photos and the Timeline. */
.kase-top, .kase { max-width: 760px; }
.kase-top { display: flex; align-items: center; gap: 8px; margin: 0 auto 14px; }
.kase-top .spacer { flex: 1; }
.kase-top .page-share { margin-left: 0; }
.kase { --kc-h: 44px; --kc-r: 14px; display: block; margin-inline: auto; }
.kc-btn { height: var(--kc-h); min-height: var(--kc-h); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: var(--kc-r); border: 1px solid var(--glass-border); background: var(--glass); box-shadow: none; color: var(--text); font: inherit; font-size: .95rem; font-weight: 550; white-space: nowrap; cursor: pointer; }
.kc-btn.round { width: var(--kc-h); padding: 0; border-radius: 999px; font-size: 1.15rem; }
.kc-btn.primary { background: var(--accent); border-color: transparent; color: #0b1626; font-weight: 700; }
.kc-btn.danger { color: var(--danger, #ff8a8a); }
.kc-btn[hidden] { display: none; }
select.kc-btn { width: auto; padding: 0 14px; }
/* The hero: the case's own card, its status colour down the left (as a project's colour edge). */
.kase-hero { position: relative; margin: 0 0 22px; padding: 18px 16px 16px 21px; border-radius: 20px; border: 1px solid var(--glass-border); background: linear-gradient(160deg, color-mix(in srgb, var(--st) 15%, var(--glass)) 0%, var(--glass) 60%); overflow: hidden; }
.kase-hero::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--st); }
.kase-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kase-fold { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--glass-track); border: 1px solid var(--glass-border); font-size: .95rem; letter-spacing: 0; }
.kase-title, .kase-summary { display: block; width: 100%; box-sizing: border-box; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; resize: none; overflow: hidden; color: var(--text); font: inherit; field-sizing: content; }
.kase-title { font-size: 1.7rem; font-weight: 700; line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; }
.kase-summary { margin-top: 8px; font-size: 1rem; line-height: 1.4; color: var(--muted); }
.kase-summary::placeholder { color: var(--muted); opacity: .6; }
.kase-title:focus, .kase-summary:focus { outline: none; box-shadow: 0 2px 0 var(--accent); }
.kase-status { margin-top: 16px; height: 52px; display: inline-flex; align-items: center; gap: 10px; padding: 0 20px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--st) 55%, transparent); background: color-mix(in srgb, var(--st) 16%, transparent); box-shadow: none; color: var(--st); font: inherit; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.kase-status i, .kase-dot { width: 12px; height: 12px; flex: none; border-radius: 99px; background: var(--st, currentColor); box-shadow: 0 0 0 4px color-mix(in srgb, var(--st, currentColor) 25%, transparent); }
.kase-dot { display: inline-block; margin-right: 12px; vertical-align: -1px; }
.kase-caret { font-size: .85rem; opacity: .7; }
.pill-menu.kase-menu { min-width: 220px; }
.pill-menu.kase-menu button { padding: 11px 14px; font-size: 1rem; font-weight: 600; }
.kase-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent); }
.kase-stats div { padding: 10px 0 10px 12px; border-left: 1px solid color-mix(in srgb, var(--text) 10%, transparent); }
.kase-stats div:first-child { border-left: 0; padding-left: 0; }
.kase-stats b { display: block; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kase-stats span { font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kase-facts, .kase-edit-people { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.kase-fact { height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px 0 5px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass); box-shadow: none; color: var(--text); font: inherit; font-size: .9rem; font-weight: 550; text-decoration: none; cursor: pointer; }
.kase-fact em { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 99px; background: var(--glass-track); font-style: normal; font-size: .85rem; }
.kase-fact small { color: var(--muted); font-weight: 500; }
.kase-fact.add { padding: 0 14px; border-style: dashed; color: var(--muted); }
.kase-fact .chip-x { margin-left: -4px; }
.kase-edit { display: grid; gap: 10px; margin-top: 14px; }
.kase-edit .detail-rows li { flex-wrap: nowrap; }
.kase-edit .detail-rows input { min-width: 0; flex: 1 1 0; height: var(--kc-h); border-radius: var(--kc-r); }
.kase-edit .detail-rows .d-label { flex: 0 1 36%; }
.kase-edit-people:empty { display: none; }
.kase-edit-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.kase-edit-bar .spacer { flex: 1; }
.fact-box { flex: 1 1 240px; min-width: 0; display: grid; }
.fact-box input { width: 100%; justify-content: flex-start; font-weight: 500; cursor: text; }
.fact-box input[aria-expanded="true"] { border-radius: 14px 14px 0 0; border-color: var(--active-border); }
.fact-box .fact-suggest { position: static; margin-top: -1px; max-width: none; max-height: 300px; box-shadow: none; } /* in the page's flow, so the case's box never cuts it off */
.fact-suggest .dd-opt { display: flex; align-items: baseline; gap: 8px; padding-left: 10px; white-space: normal; overflow-wrap: anywhere; }
.fact-suggest .dd-opt em { flex: none; width: 1.2em; text-align: center; font-style: normal; color: var(--muted); }
.fact-suggest .dd-opt b { font-weight: 600; }
.fact-suggest .fact-ref, .fact-suggest .fact-new { color: var(--muted); }
.fact-suggest .fact-ref b, .fact-suggest .fact-new b { color: var(--text); }
/* New entry: the one raised surface on the page. */
.kc { display: grid; gap: 12px; margin: 0 0 26px; padding: 14px; border-radius: 20px; border: 1px solid var(--glass-border); background: color-mix(in srgb, var(--text) 7%, var(--glass)); box-shadow: 0 10px 30px rgb(0 0 0 / .28); }
.kc-kinds { display: flex; gap: 8px; margin: 0 -14px; padding: 0 14px 2px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.kc-kinds::-webkit-scrollbar { display: none; }
.kc-kind { flex: none; width: 66px; height: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; border-radius: var(--kc-r); border: 1px solid var(--glass-border); background: var(--glass-track); box-shadow: none; color: var(--muted); font: inherit; font-size: .72rem; font-weight: 600; cursor: pointer; }
.kc-kind b { font-size: 1.5rem; line-height: 1; }
.kc-kind[aria-pressed="true"] { color: var(--text); background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); }
.kc-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; height: var(--kc-h); padding: 4px; border-radius: var(--kc-r); border: 1px solid var(--glass-border); background: var(--glass-track); }
.kc-seg[hidden] { display: none; }
.kc-seg button { height: auto; min-height: 0; padding: 0; border-radius: 10px; border: 1px solid transparent; background: none; box-shadow: none; color: var(--muted); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; }
.kc-seg button[aria-pressed="true"] { color: var(--text); background: var(--glass); border-color: var(--glass-border); box-shadow: 0 1px 6px rgb(0 0 0 / .25); }
.kc-text { width: 100%; box-sizing: border-box; min-height: 84px; padding: 12px 14px; border-radius: var(--kc-r); border: 1px solid var(--glass-border); background: var(--glass-track); box-shadow: none; color: var(--text); font: inherit; font-size: 1rem; line-height: 1.4; resize: vertical; field-sizing: content; }
.kc .log-pending:empty { display: none; }
.kc-bar { display: flex; gap: 8px; align-items: center; }
.kc-when { position: relative; flex: 1; min-width: 0; justify-content: flex-start; padding: 0 10px; }
.kc-when input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.kc-ico { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--glass-track); font-size: .95rem; }
.kc-when-t { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.1; }
.kc-when-t b { font-weight: 650; }
.kc-when-t small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: .74rem; font-weight: 500; }
/* The case's own photos and documents: big square tiles, + first. */
.kase-lab { display: flex; justify-content: space-between; margin: 0 0 10px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kase-files { margin: 0 0 26px; }
.kase-files .att-row { gap: 8px; margin: 0; }
.kase-files .att-open { width: 76px; height: 76px; justify-content: center; border-radius: var(--kc-r); }
.kase-files .att-img .att-open img { width: 76px; height: 76px; max-width: none; object-fit: cover; }
.kase-files .att-file .att-open { flex-direction: column; padding: 6px; font-size: .7rem; text-align: center; }
.kase-files .att-name { max-width: 9ch; }
.kase-files .att-add { order: -1; width: 76px; height: 76px; justify-content: center; padding: 0; border: 1.5px dashed var(--glass-border); border-radius: var(--kc-r); color: var(--muted); font-size: 1.6rem; }
.kase-files .att-add span { display: none; }
.kase-files .att-add .icon { display: none; }
.kase-files .att-add::before { content: '+'; font-size: 1.8rem; font-weight: 300; line-height: 1; }
.kase .ctl { padding: 0; }
.kase .ctl-body { white-space: pre-wrap; }
.kase-foot { display: flex; gap: 8px; margin-top: 26px; }
.kase-foot .kc-btn { flex: 1; }
/* The Timeline: a rail down the left with each event's emoji on it (all lined up), and the event in its own callout. */
.ctl { list-style: none; margin: 0; padding: 6px 12px 14px; }
.ctl-month { position: relative; padding: 12px 0 6px 56px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ctl-month::before, .ctl-item::before { content: ''; position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: color-mix(in srgb, var(--text) 16%, transparent); }
.ctl > li:first-child::before { top: 18px; }
.ctl > li:last-child::before { bottom: calc(100% - 22px); }
.ctl-item { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; padding: 5px 0; }
.ctl-icon { position: relative; z-index: 1; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; font-size: 1.45rem; line-height: 1; background: var(--glass-track); border: 2px solid color-mix(in srgb, var(--text) 18%, transparent); box-shadow: 0 0 0 4px var(--glass); }
.ctl-in .ctl-icon { border-color: var(--accent); }
.ctl-out .ctl-icon { border-color: #d9a441; }
.ctl-done .ctl-icon { border-color: #4caf7a; }
.ctl-card { position: relative; min-width: 0; padding: 8px 12px 9px; border-radius: 12px; border: 1px solid var(--glass-border); background: color-mix(in srgb, var(--text) 5%, var(--glass)); overflow-wrap: anywhere; }
.ctl-card::before { content: ''; position: absolute; left: -7px; top: 15px; width: 12px; height: 12px; transform: rotate(45deg); border-left: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); background: inherit; }
.ctl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: .9rem; }
.ctl-head time { font-size: .76rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ctl-head .entry-edit-btn { margin-left: auto; width: 28px; height: 28px; min-height: 0; padding: 0; display: inline-grid; opacity: .5; }
.ctl-card:hover .entry-edit-btn, .ctl-head .entry-edit-btn:focus-visible { opacity: 1; }
.ctl-body { margin-top: 3px; font-size: .92rem; line-height: 1.4; }
.ctl-body a, .ctl-head a { color: var(--accent); }
.ctl-gist { margin-top: 3px; font-weight: 600; line-height: 1.35; }
.kc-text.kc-headline { min-height: 0; margin-bottom: 8px; padding-block: 10px; }
/* A long entry folded to its first lines (fold.js), fading out above More / Less. */
.folded { max-height: var(--fold-h, 8em); overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent); mask-image: linear-gradient(to bottom, #000 65%, transparent); }
.ctl-fold { display: inline-block; margin-top: 4px; padding: 1px 10px; border-radius: 999px; font: inherit; font-size: .82rem; cursor: pointer; color: var(--text); border: 1px solid color-mix(in srgb, var(--energy-ink, #4caf7a) 40%, transparent); background: color-mix(in srgb, var(--energy-ink, #4caf7a) 13%, transparent); }
.ctl-fold:is(:hover, :focus-visible) { border-color: color-mix(in srgb, var(--energy-ink, #4caf7a) 65%, transparent); background: color-mix(in srgb, var(--energy-ink, #4caf7a) 24%, transparent); outline: none; }
.ctl-card .entry-files .att-row { margin: 6px 0 0; }
.ctl > li.entry-edit { position: relative; padding: 6px 0 6px 56px; }
.ctl > li.entry-edit::before { content: ''; position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: color-mix(in srgb, var(--text) 16%, transparent); }
.ctl-empty { padding: 8px 0; }
@media (max-width: 520px) {
  .ctl { padding: 4px 8px 12px; }
  .ctl-month { padding-left: 50px; }
  .ctl-item { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
  .ctl-icon { width: 40px; height: 40px; font-size: 1.35rem; }
  .ctl-month::before, .ctl-item::before, .ctl > li.entry-edit::before { left: 19px; }
  .ctl > li.entry-edit { padding-left: 0; }
  .ctl > li.entry-edit::before { display: none; }
}
.timeline { list-style: none; margin: 8px 0; padding: 0 0 0 12px; border-left: 2px solid var(--glass-border); display: grid; gap: 6px; }
.timeline li { font-size: .9rem; }
.timeline li .muted { font-size: .75rem; margin-right: 6px; }
.timeline li.look { opacity: .6; }
.log-form .log-when { display: inline-flex; gap: 4px; flex: 0 1 auto; }
.log-form .log-when input { flex: 0 1 auto; min-width: 0; }
.log-form [hidden] { display: none; }
.timeline .entry-edit-btn { display: inline-grid; margin-left: 6px; width: 26px; height: 26px; min-height: 0; padding: 0; opacity: .45; vertical-align: middle; }
.timeline li:hover .entry-edit-btn, .timeline .entry-edit-btn:focus-visible { opacity: 1; }
.timeline li.entry-edit { padding: 6px 0; }
.case-files { margin: 4px 0 8px; }
.links { margin: 0; padding-left: 18px; }
.links a { color: var(--accent); }
.raw-body summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.raw-body pre { white-space: pre-wrap; font-family: inherit; margin: 6px 0; padding: 10px; border-radius: 12px; background: var(--glass-track); }
.chip-x { padding: 0 4px; background: none; border: 0; box-shadow: none; color: var(--muted); }
#case-add-contact { width: auto; padding: 4px 8px; font-size: .85rem; color: var(--text); }


/* Backup card */
.backup-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 8px 0; }
.file-btn { display: inline-flex; padding: 6px 14px; border-radius: var(--radius-pill); background: var(--glass); border: 1px solid var(--glass-border); color: var(--text); font-size: 1rem; cursor: pointer; }
.file-btn:hover { background: var(--glass-hover); }
#backup-status.warn { color: var(--place); }
.sync-out-reason { color: var(--place); font-weight: 600; margin: 0 0 8px; }

/* ---------- Shared list behaviour (listkit.js) in every list ---------- */
li[data-id].selected { background: var(--active-bg) !important; box-shadow: inset 0 0 0 1px var(--active-border); }
li[data-id].selected .drag-handle { opacity: 1; color: var(--accent); }
/* A chosen parent's sub-rows: chosen with it, a lighter shade (listkit.js). */
li[data-id].carried { background: color-mix(in srgb, var(--accent) 13%, transparent) !important; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
li[data-id].carried .drag-handle { opacity: .8; color: var(--accent); }
/* A selected card (Brain Dump, Contacts, Find Things boxes, recipes): the same clear accent ring everywhere, as Batch Book. */
:is(.thought, .c-card, .box-card, .bb-card-li, .list-card-li)[data-id].selected { box-shadow: 0 0 0 3px var(--accent); }
/* Phones: holding a card selects it, so no text selection or Copy / Look Up menu (text being edited still selects). */
@media (hover: none) {
  :is(.thought, .c-card, .box-card, .bb-card-li, .list-card-li)[data-id] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  :is(.thought, .c-card, .box-card, .bb-card-li, .list-card-li)[data-id] :is(input, textarea, [contenteditable="true"], .thought-edit) { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
}
li[data-id].group-drag { background: none !important; box-shadow: none; position: relative; }
li[data-id].group-drag > :not(.drag-ghost) { visibility: hidden; }
li[data-id].dragging { position: relative; z-index: 3; background: var(--glass-strong); box-shadow: var(--shadow); }
li[data-id] > .drag-handle { touch-action: none; }
.task-list > .list-head { list-style: none; font-weight: 500; font-size: .95rem; margin: 16px 4px 4px; color: var(--text); }
.task-list > .list-head:first-child { margin-top: 6px; }
.task-list > .list-head a { color: var(--accent); }
.kit-grip { flex: none; width: 26px; height: 30px; opacity: .3; }
li[data-id]:hover .kit-grip { opacity: .8; }

.rich-edit h4 { margin: .6em 0 .2em; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-family: var(--font); }
.rich-edit h4:first-child { margin-top: 0; }


/* ---------- History ---------- */
.history-btn { text-decoration: none; margin-left: 4px; }
.history-list > li.h-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 14px; border: 1px solid transparent; }
.history-list > li.h-row:hover { background: var(--glass); border-color: var(--glass-border); }
.h-time { flex: none; font-size: .8rem; width: 3.2em; }
.h-main { flex: 1; min-width: 0; display: grid; }
.h-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-sub { font-size: .75rem; }
.h-row.undone .h-label { text-decoration: line-through; opacity: .6; }
.h-row [data-act="undo"] { padding: 4px 12px; font-size: .85rem; }
.h-details { list-style: none; margin: 0 0 8px 40px; padding: 8px 12px; border-radius: 12px; background: var(--glass-track); font-size: .82rem; }
.h-details ul { margin: 0; padding-left: 16px; }


/* Day Planner: pick up and move */
.line.has-item.selected { background: var(--active-bg); box-shadow: inset 3px 0 0 var(--active-border); }
.line.has-item.selected .drag-grip { opacity: 1; color: var(--accent); }
.pickup-stack {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  display: grid;
  gap: 3px;
  transform: rotate(-1.2deg);
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .35));
}
.pickup-row { box-sizing: border-box; display: flex; align-items: center; gap: 8px; min-height: var(--pick-h, auto); padding: 2px 12px 2px var(--pick-pad, 12px); border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--active-border); font-size: var(--pick-font, 1.05rem); color: var(--text); }
.pickup-more { font-size: .75rem; color: var(--muted); padding-left: 12px; }
.pickup-stack[data-when]::before {
  content: attr(data-when);
  position: absolute; /* beside the row, never pushing it from under the pointer */
  right: 0;
  bottom: 100%;
  margin-bottom: 3px;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: .75rem;
  background: var(--active-bg);
  border: 1px solid var(--active-border);
  color: var(--text);
}
.drop-preview { flex: 1; min-width: 0; opacity: .55; padding: 2px 8px; border: 1px dashed var(--active-border); border-radius: 10px; font-size: 1.05rem; animation: preview-in .15s ease-out; }
@keyframes preview-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: .55; transform: none; } }
.line.has-item .drop-preview { flex: none; max-width: 45%; }


/* ---------- Lists ---------- */
.lists-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.lists-head .tool-menu { margin-left: auto; }
.list-card { text-decoration: none; color: var(--text); }
.list-grid { margin: 0; padding: 0; list-style: none; }
.list-grid[data-mine] + .list-grid-theirs { margin-top: var(--grid-gap, 14px); }
.list-theirs { font-weight: 600; color: var(--text); opacity: .85; }
.list-card-li { display: flex; flex-direction: column; list-style: none; border-radius: 20px; }
.list-card-li > .list-card { flex: 1; align-content: start; }
.list-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.list-actions a { color: var(--accent); }
.list-bar { flex: 1 1 120px; max-width: 260px; }
.list-actions button[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }
.checklist:not(.task-list) > li[data-id] { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 2px 6px; border-radius: 14px; border: 1px solid transparent; }
.checklist:not(.task-list) > li[data-id]:hover { background: var(--glass); border-color: var(--glass-border); }
.checklist:not(.task-list) > li[data-depth="1"] { margin-left: 28px; }
.checklist .icon-btn.small { opacity: .35; background: none; box-shadow: none; }
.checklist li:hover .icon-btn.small { opacity: 1; }


/* Day Planner: blocked-out time, pushes and the stretch preview */
.line.blank.covered:hover .content::before { content: none; }
.line.has-item.preview .content, .line.blank.preview .content { transform: rotate(-.8deg); transform-origin: left center; }
.line.has-item.preview { outline: 1px dashed var(--active-border); outline-offset: -2px; }
.line.has-item.pushed .content { transform: rotate(.6deg); transform-origin: left center; opacity: .75; }
.line.has-item.pushed .margin { color: var(--place); }
.line.has-item.preview .content, .line.has-item.pushed .content { transition: transform .12s; }

.margin-time {
  width: 100%;
  padding: 2px 0 !important;
  text-align: right;
  font-family: var(--hand);
  font-size: .9rem;
  color: var(--ink) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  cursor: text;
}
.margin-time:hover { border-color: var(--glass-border) !important; }
.margin-time:focus { background: var(--glass-track) !important; border-color: var(--active-border) !important; text-align: center; }

.line .content { flex-wrap: wrap; }
.item-note { flex-basis: 100%; margin: -4px 0 4px 52px; font-size: .78rem; color: var(--muted); font-family: var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#main:not([data-density="tight"]) .line.has-item:has(.item-note) { min-height: 3.125rem; }

.paper { position: relative; }
.now-marker {
  position: absolute;
  left: 3px;
  z-index: 2;
  margin-top: -.55em;
  font-size: .7rem;
  line-height: 1.1;
  color: var(--focus-ink);
  pointer-events: none;
  transition: top .4s ease;
}


/* Let go + going through unfinished items */
.line.has-item.dropped .item-title { text-decoration: line-through; opacity: .45; }
.line.has-item.dropped .tick { opacity: .3; }
.carry button { margin-left: 4px; }
.review-sheet { max-width: 640px; }
.review-sheet:focus { outline: none; } /* has the cursor as it opens (planner.js) */
@media (min-width: 768px) { .review-sheet { margin: auto; border-radius: var(--radius-card); border-bottom: 1px solid var(--glass-border); } }
/* Bring in from tasks and Unfinished from earlier days: each one in its own box, never wider than the sheet. */
.review-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.review-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px; border-radius: 14px; background: var(--glass-track); border: 1px solid var(--glass-border); transition: opacity .18s, transform .18s; }
.review-list li.leaving { opacity: 0; transform: translateX(24px); }
.review-title { flex: 1 1 200px; font-size: 1.05rem; }
.review-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.review-actions button { padding: 4px 10px; font-size: .82rem; }
.review-about { font-size: .8rem; color: var(--muted); }
/* The title with 🗑 in the box's corner, well away from the other buttons. */
.review-head { display: flex; align-items: flex-start; gap: 8px; flex: 1 1 100%; min-width: 0; }
.review-head .review-title { flex: 1 1 auto; min-width: 0; }
.review-delete { flex: none; margin: -4px -6px 0 0; padding: 4px 8px; font-size: .95rem; background: none; border-color: transparent; box-shadow: none; opacity: .7; }
.review-delete:hover { opacity: 1; }
.review-every li { border-style: dashed; background: none; } /* acts on every box above it */
.review-sheet .review-all button { padding: 6px 16px; font-size: .92rem; }

.bin-filters { margin: 8px 0; }
.bin-filters button[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }
.item-note .note-icon { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; stroke-width: 2; }
.item-note { cursor: pointer; }
.item-note:hover { color: var(--text); }
.item-note.open { white-space: pre-wrap; overflow: visible; text-overflow: clip; }
.item-note .more-lines { font-size: .72rem; color: var(--accent); margin-left: 4px; }
.task-list > li[data-task] { flex-wrap: wrap; }
.task-note { margin: -6px 0 6px 64px; }

/* Notebook: item text in the same ink as the margin times */
.planner[data-paper="notebook"] .line .item-title,
.planner[data-paper="notebook"] .day-task-list .task-link,
.planner[data-paper="notebook"] .pickup-row { color: var(--ink); }
/* Blue theme, glass paper: the big day name in white */
:root:not([data-theme="light"]):not([data-theme="dark"]) .planner[data-paper="glass"] .day-title .weekday,
:root[data-theme="blue"] .planner[data-paper="glass"] .day-title .weekday { color: #fff; }


/* An item spanning several slots: one block over its lines. The slot lines
   keep their margin times; the item's content is stretched over them all,
   text centred, with a bar down the side. */
.span-block { position: relative; }
.span-block > .line.has-item { position: static; }
.span-block > .line.has-item > .content {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 64px;
  right: 6px;
  z-index: 1;
  align-content: center;
  padding-left: 4px; /* + the 4px bar = the 8px of a one-line item, so titles line up */
  border-left: 4px solid var(--accent);
  border-radius: 4px 12px 12px 4px;
  background: transparent; /* the bar and the missing lines say "one item" */
}
.span-block > .line.has-item > .resize-grip { bottom: -1px; left: calc(64px + (100% - 64px) / 2); }
.span-block > .line.blank.covered .content { cursor: default; }
.span-block > .line.blank.covered:hover .content::before { content: none; }
.line.blank.covered .content { cursor: default; }
.line.blank.covered:hover .content::before { content: none; }
.span-block > .line.has-item.selected > .content { background: var(--active-bg); box-shadow: inset 0 0 0 1px var(--active-border); }
.span-block > .line.has-item.preview > .content { outline: 1px dashed var(--active-border); }
.span-block > .line.has-item.done > .content { opacity: .55; }
/* A task ticked off in the Tasks list, shown on the schedule at the time it was ticked (planner.js doneRow). */
.line.done-copy > .content { opacity: .55; }
.line.done-copy .copy-gap { flex: none; padding: 2px 4px; font-size: .9rem; line-height: 1; visibility: hidden; }
.line.done-copy .item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.done-here { flex-wrap: wrap; column-gap: 14px; font-family: var(--hand); color: var(--muted); }

.note-emoji { font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; font-size: .85rem; margin-right: 4px; font-style: normal; }
.note-edit { flex-basis: 100%; margin: 2px 0 8px 52px; min-width: 0; }
.note-edit .rich-edit, .note-edit .rich-raw, .detail-notes .rich-edit, .detail-notes .rich-raw { min-height: 4.5em; font-size: .95rem; line-height: 1.45; padding: 6px 10px; }
.detail-note .field-label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.md-emoji { display: inline-flex; gap: 2px; }
.md-emoji button { padding: 3px 7px; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.md-bar { flex-wrap: wrap; }
.item-note.open { white-space: normal; }
.item-note .note-body { display: inline-block; vertical-align: top; }
.item-note .note-body ul { margin: 0; padding-left: 1.2em; }
.item-note .note-body h4 { margin: 2px 0; font-size: .85rem; }
/* No ruled lines inside a multi-slot item: the block reads as one piece.
   (Margin times stay; the block keeps a line at its bottom edge.) */
.span-block > .line:not(:last-child) { border-bottom-color: transparent; }

/* ---------- Links in notes (refs.js, linkpicker.js) ---------- */
.rich { position: relative; }
.ref {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  border-radius: 4px;
  padding: 0 1px;
  white-space: nowrap;
}
.ref:hover { text-decoration-style: solid; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ref-new { animation: ref-made 1.6s ease-out; }
@keyframes ref-made { 0%, 30% { background: color-mix(in srgb, var(--accent) 40%, transparent); } 100% { background: transparent; } }

.ref-picker, .ref-menu {
  position: absolute;
  z-index: 60;
  background: color-mix(in srgb, var(--bg, #0f172a) 94%, var(--text) 6%);
  color: var(--text);
  border: 1px solid var(--active-border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm, 0 8px 30px rgba(0, 0, 0, .3));
  font-family: var(--font);
  font-size: .9rem;
}
.ref-picker { width: min(340px, 100%); padding: 6px; scroll-margin-bottom: calc(var(--tabbar-h) + 24px); }
.ref-picker .ref-q { width: 100%; font-size: .95rem; padding: 6px 8px; }
.ref-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.ref-list li { display: grid; grid-template-columns: 24px 1fr; column-gap: 6px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.ref-list li.ref-none, .ref-list li.ref-new, .ref-list li.ref-empty { display: block; }
.ref-list li.ref-none { color: var(--muted); }
.ref-list li.ref-none kbd { font-size: .7rem; border: 1px solid var(--glass-border); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.ref-list li.ref-new { color: var(--accent); }
.ref-list li.ref-empty { cursor: default; font-size: .82rem; }
.ref-list li.active { background: var(--active-bg); }
.ref-list li.ticked { box-shadow: inset 3px 0 0 var(--accent); }
.ref-list li.ticked .ref-icon::after { content: " ✓"; color: var(--accent); }
.ref-icon { grid-row: span 2; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.ref-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-sub { font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .72rem; padding: 6px 4px 0; }
.ref-foot .ref-go { padding: 3px 10px; font-size: .8rem; }
.ref-menu { display: flex; gap: 4px; padding: 4px; }
.ref-menu button { padding: 3px 10px; font-size: .82rem; }

/* While typing in a note, everything else dims (richtext.js). */
.note-spotlight {
  position: absolute;
  z-index: 900;
  pointer-events: none;
  border-radius: 12px;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .5);
  animation: note-dim .2s ease-out;
}
@keyframes note-dim { from { box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0); } }
.check-row .inline-text { width: 12em; padding: 3px 8px; font-size: .9rem; margin-left: 4px; }

/* Housekeeping at the bottom of the Day Planner. */
.day-housekeeping { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--rule, var(--glass-border)); }
.day-housekeeping h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-family: var(--font); font-weight: 600; }
.day-housekeeping .paper-pick { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.hk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hk-actions button { font-size: .85rem; padding: 5px 12px; }

/* The top and bottom bars stay solid in the app's theme whatever paper the
   page underneath is (light papers made the see-through bar unreadable). */
.tabbar, .appbar { background: color-mix(in srgb, var(--bg, #0f172a) 88%, transparent); }

/* Wide screens: the Day Planner page may use more width, and once the plan
   is over 1000px wide Tasks and Notes sit in a column to its right, one
   under the other (planner.js adds .docked). */
main:has(> .planner), main:has(.planner) { max-width: 1600px; }
.planner.docked {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 30%);
  grid-template-areas: "nav nav" "head head" "down down" "carry carry" "gcal gcal" "stitle side" "paper side" "pile side" "hk side";
  column-gap: 24px;
  align-items: start;
}
.planner.docked > .day-nav { grid-area: nav; }
.planner.docked > .day-head { grid-area: head; }
.planner.docked > .carry { grid-area: carry; }
.planner.docked > .gcal { grid-area: gcal; } /* its own row, the full width; beside the date when it fits (below) */
.planner.docked > .down-note { grid-area: down; }
.planner.docked > .paper { grid-area: paper; }
.planner.docked > .pile { grid-area: pile; }
.planner.docked > .day-housekeeping { grid-area: hk; }
.planner.docked > .day-bottom { grid-area: side; grid-template-columns: 1fr; }

/* Pills and the note share the line under an item's title. */
.item-sub { flex-basis: 100%; display: flex; align-items: baseline; gap: 6px; min-width: 0; margin: -4px 0 4px 52px; }
.item-sub .item-note { flex: 1 1 auto; min-width: 0; margin: 0; }
#main:not([data-density="tight"]) .line.has-item:has(.item-sub) { min-height: 3.125rem; }
.pill-act { flex: none; font-size: .72rem; line-height: 1.4; padding: 0 8px; border-radius: 999px; background: var(--glass-track); border: 1px solid var(--glass-border); color: var(--muted); font-family: var(--font); cursor: pointer; }
.pill-act .pill-hover { display: none; }
.pill-act:hover, .pill-act:focus-visible { color: var(--accent); border-color: var(--active-border); }
.pill-act:hover .pill-now, .pill-act:focus-visible .pill-now { display: none; }
.pill-act:hover .pill-hover, .pill-act:focus-visible .pill-hover { display: inline; }

/* Item titles wrap onto more lines when they're long (a one-line textarea
   that grows); the row grows with them. */
.line textarea.item-title {
  display: block;
  resize: none;
  overflow: hidden;
  field-sizing: content;
  flex: 1 1 0%;
  width: auto;
  min-width: 6em;
  min-height: 0;
  line-height: 1.3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* Task and list item names (Tasks, project tasks, Lists): one line in the list, as before, fading out
   when cut short; tapped (being written in, its pills or its panel open) the whole name shows, wrapping
   onto as many lines as it needs (inline.js autosize where field-sizing isn't supported). */
.task-list > li[data-task] > textarea.task-title { display: block; resize: none; overflow: hidden; field-sizing: content; min-height: 0; white-space: pre; overflow-wrap: normal; }
#main[data-density="tight"] .task-list > li[data-task]:not(.pills-open, :has(+ .task-details)) > textarea.task-title:not(:focus) { height: auto !important; text-overflow: ellipsis; }
.task-list > li[data-task]:is(.pills-open, :has(+ .task-details)) > textarea.task-title, .task-list > li[data-task] > textarea.task-title:focus { white-space: pre-wrap; overflow-wrap: anywhere; }

/* The link dropdown and chip menu use their own colours: papers change the
   page's text colour, which made them unreadable on some. A plain light card
   reads the same on every paper and theme. */
.ref-picker, .ref-menu {
  --text: #16202e;
  --muted: #5b6676;
  --accent: #1f5fd1;
  --glass-border: rgba(0, 0, 0, .14);
  --glass-track: #f3f5f9;
  --active-bg: #dde8fb;
  --active-border: rgba(31, 95, 209, .45);
  background: #ffffff;
  color: var(--text);
  border-color: rgba(0, 0, 0, .18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.ref-picker .ref-q { background: #f3f5f9; color: #16202e; border: 1px solid rgba(0, 0, 0, .18); font-family: var(--font); }
.ref-picker .ref-q::placeholder { color: #7a8494; }
.ref-picker button, .ref-menu button { color: #16202e; background: #eef2f8; border: 1px solid rgba(0, 0, 0, .14); font-family: var(--font); }
.ref-picker .ref-go { background: #1f5fd1; color: #fff; border-color: #1f5fd1; }

/* Energy as lightning (⚡ ⚡⚡ ⚡⚡⚡); pills on the line under a task. */
.bolts { font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; letter-spacing: -2px; }
.task-list .item-sub { margin: -6px 0 6px 64px; }
.item-sub .task-note { margin: 0; }
.pill-menu, .energy .energy-choose {
  position: fixed;
  z-index: 950;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.pill-menu button, .energy .energy-choose button {
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .14);
  background: #f3f5f9;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  letter-spacing: -2px;
  cursor: pointer;
}
.pill-menu button[aria-checked="true"], .energy .energy-choose button[aria-pressed="true"] { background: #dde8fb; border-color: #1f5fd1; }
.pill-menu button:hover, .pill-menu button:focus-visible, .energy .energy-choose button:hover { border-color: #1f5fd1; outline: none; }

/* Day name colour per paper: white on Techie (like Glass), black on Dot journal. */
.planner[data-paper="techie"] .day-title .weekday { color: #fff; }
.planner[data-paper="dots"] .day-title .weekday { color: #15171a; }

/* Day Planner Tasks: a plain list (not the lined paper) with its entry box. */
.pile-list .line { grid-template-columns: 1fr; border-bottom: 1px solid var(--glass-border); }
.pile-list .line:last-child { border-bottom: 0; }
.pile-list .line .margin { display: none; }
.bring-sheet { max-width: 720px; }
.bring-main { display: flex; flex-direction: column; gap: 1px; flex: 1 1 220px; min-width: 0; }
.bring-main .review-title { flex: none; }
/* What's in the day's plan already: a tinted strip (green, as ↓ Bring in from tasks), not offered again. */
.bring-already { margin: 4px 0 12px; padding: 8px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--energy-ink, #4caf7a) 35%, transparent); background: color-mix(in srgb, var(--energy-ink, #4caf7a) 10%, transparent); }
.bring-already summary { cursor: pointer; font-size: .9rem; }
.bring-already ul { margin: 6px 0 2px; padding-left: 1.4em; display: grid; gap: 2px; }

/* Share menu in the day nav. */
.day-nav .share-menu { margin-left: auto; }
.day-nav .share-menu summary { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--glass-border); background: var(--glass); }
.share-menu .menu { min-width: 260px; }
.share-menu .menu button:disabled { opacity: .45; cursor: not-allowed; }

/* Placeholder text: light, near white on the blue and dark themes (the
   browser default grey was hard to read on blue). */
:root:not([data-theme="light"]) :is(input, textarea)::placeholder { color: rgba(255, 255, 255, .72); opacity: 1; }
:root:not([data-theme="light"]) .quick-add::placeholder { color: rgba(255, 255, 255, .6); }
.planner:not([data-paper="glass"]):not([data-paper="techie"]) :is(input, textarea)::placeholder { color: color-mix(in srgb, var(--ink, #333) 55%, transparent); }
.ref-picker .ref-q::placeholder { color: #7a8494; }

/* Find Things: search inside a box; matches look highlighted with a felt-tip
   pen (uneven ends, a little tilt), sized to the text. */
.box-find { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.box-find .search { flex: 1; }
.box-hits { font-size: .85rem; white-space: nowrap; }
:root { --highlighter: rgba(255, 224, 50, .9); }
.item-list li.hit input[name="name"] {
  flex: 0 1 auto;
  field-sizing: content;
  min-width: 3em;
  max-width: 100%;
  color: #1c1a10;
  border-color: transparent;
  border-radius: 6px 12px 7px 14px / 12px 6px 14px 7px;
  background:
    linear-gradient(100deg, transparent 0%, var(--highlighter) 3%, color-mix(in srgb, var(--highlighter) 78%, transparent) 40%, var(--highlighter) 70%, color-mix(in srgb, var(--highlighter) 85%, transparent) 96%, transparent 100%);
  transform: rotate(-0.6deg);
}
.item-list li.hit input[name="name"]:focus { transform: none; }

/* Find Things: a thing gets the whole line; tags and the note sit under it;
   its panel holds quantity, tags and the note. */
.item-list li[data-id] { flex-wrap: wrap; }
.item-list li[data-id] input[name="name"] { flex: 1 1 0%; min-width: 0; }
.item-list .qty { flex: none; }
.item-list .item-sub { margin: -2px 0 4px 36px; }
.item-list .item-note { max-width: none; opacity: 1; font-size: .8rem; }
.tag-pill { text-transform: none; }
.thing-panel { display: block; padding: 10px 12px; margin: 2px 0 8px 28px; border-radius: 14px; background: var(--glass-track); border: 1px solid var(--glass-border); }
.thing-panel .field-label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.tag-edit .tag-list { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-right: 6px; }
.tag-edit .tag-add { width: 12em; padding: 4px 8px; font-size: .9rem; }
.thing-notes .rich-edit { min-height: 4em; font-size: .95rem; }

/* The box code reads as a code: monospace on a shaded label, as wide as the
   code itself, so the name sits right after it. */
.box-page-head .box-code-input {
  width: auto;
  field-sizing: content;
  min-width: 2.5ch;
  max-width: 9ch;
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 2px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  border: 1px dashed color-mix(in srgb, var(--text) 30%, transparent);
}
.box-page-head .box-code-input:placeholder-shown { font-size: 1.2rem; }
.box-card .box-code { font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace; }
.item-list .more { background: transparent; border-color: transparent; box-shadow: none; opacity: .45; padding: 2px 8px; }
.item-list li:hover .more, .item-list li:focus-within .more, .item-list .more[aria-expanded="true"] { opacity: 1; }

/* ⚙ view settings for a day */
.energy .view-menu { margin-left: auto; }
.view-settings { min-width: 280px; padding: 8px 10px; }
.view-settings h4 { margin: 8px 2px 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--font); }
.view-settings h4:first-child { margin-top: 2px; }
.view-opts { display: flex; flex-wrap: wrap; gap: 4px; }
.view-opts button { padding: 4px 10px; font-size: .85rem; }
.view-opts button[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }

/* Tasks & notes first: they come before the timed plan. */
.planner.tasks-first:not(.docked) { display: flex; flex-direction: column; }
.planner.tasks-first:not(.docked) > .day-nav { order: -3; }
.planner.tasks-first:not(.docked) > .day-head { order: -3; }
.planner.tasks-first:not(.docked) > .carry { order: -3; }
.planner.tasks-first:not(.docked) > .day-bottom { order: -2; margin-bottom: 16px; }
.planner.docked.tasks-first {
  grid-template-columns: minmax(300px, 30%) minmax(0, 1fr);
  grid-template-areas: "nav nav" "head head" "down down" "carry carry" "gcal gcal" "side stitle" "side paper" "side pile" "side hk";
}

.cal-sheet { width: min(380px, calc(100vw - 16px)); }
.cal-grid .cal-pad { min-height: 2.4em; }
.cal-head strong { flex: 1; text-align: center; }

/* Lists: notes under items, and the item panel. */
.checklist:not(.task-list) li[data-id] { flex-wrap: wrap; }
.checklist:not(.task-list) .item-sub { margin: -6px 0 6px 64px; }
.list-panel { display: block; }
.list-notes .rich-edit { min-height: 4em; font-size: .95rem; font-family: var(--font); }
.ex-preview { max-height: 320px; overflow: auto; padding: 10px 12px; border-radius: 10px; background: var(--glass-track); border: 1px solid var(--glass-border); font-size: .82rem; white-space: pre-wrap; }

/* Nothing may push the page wider than the screen: long links and long
   unbroken text wrap, and the page never scrolls sideways. */
.ref { white-space: normal; overflow-wrap: anywhere; }
/* A web address in text (weburl.js): a link to open, and text to change. While it's being written in, the cursor is a text one. */
.web-url { color: var(--accent, inherit); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 2px; word-break: break-all; cursor: pointer; } /* breaks anywhere, so it starts on the line it belongs to (a one-line preview shows its start) */
[contenteditable="true"]:focus .web-url { cursor: text; }
.url-menu { z-index: 1000; gap: 6px; inset: auto; margin: 0; overflow: visible; color: inherit; } /* a popover, so over a sheet too (weburl.js) */
.url-menu button { white-space: nowrap; }
.rich-edit, .thought-body, .item-note, .note-body, .review-title { overflow-wrap: anywhere; min-width: 0; }
html, body { overflow-x: clip; }
main { min-width: 0; max-width: 100%; }

/* Dragging sideways: the row sits at the depth it will land at, and says so. */
li.dragging[data-drop-depth] { box-shadow: var(--shadow), inset 3px 0 0 var(--accent); }
li.dragging[data-drop-label]:not([data-drop-label=""])::after {
  content: attr(data-drop-label);
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .72rem;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #0b1220;
  pointer-events: none;
}

/* Press and hold an item's text to open its panel: the row fills while held. */
.holding { transition: box-shadow .45s ease-in; box-shadow: inset 0 0 0 2px var(--active-border), inset 0 0 0 999px color-mix(in srgb, var(--accent) 10%, transparent) !important; }
:is(.item-title, .task-title, .item-list input[name="name"]) { -webkit-touch-callout: none; }
.thought-title { font-weight: 700; font-size: 1.12em; margin-bottom: 2px; }

/* Phones: no top bar (the bottom tabs say where you are; History is in
   Settings). The page starts just below the status bar. */
@media (max-width: 767px) {
  .appbar { display: none; }
  main { padding-top: calc(var(--safe-top) + 12px); }
  .find-bar { top: calc(var(--safe-top) + 6px); }
}

/* Glass paper: no border, and a touch more see-through. */
.planner[data-paper="glass"] .paper {
  border: 0;
  background: color-mix(in srgb, var(--glass) 55%, transparent);
  box-shadow: var(--shadow);
}

/* Notebook paper: the day name in black ink. */
.planner[data-paper="notebook"] .day-title .weekday { color: #15171a; }

/* ⚙ view settings take the look of the day's paper (glass = the dark glass
   card). The paper pills keep their own looks; every pill has a border and
   the chosen one a two-tone ring, so all paper × pill combinations read. */
.view-settings {
  --vm-bg: #172033;
  --vm-text: #e8eefc;
  --vm-muted: #9aa7bd;
  --vm-line: rgba(255, 255, 255, .16);
  --vm-btn: rgba(255, 255, 255, .07);
  --vm-on: rgba(100, 180, 255, .32);
  --vm-on-line: rgba(120, 190, 255, .8);
  background: var(--vm-bg);
  color: var(--vm-text);
  border: 1px solid var(--vm-line);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
  font-family: var(--font);
}
.planner[data-paper="notebook"] .view-settings { --vm-bg: #f5edc6; --vm-text: #1d4f91; --vm-muted: #7a6f4a; --vm-line: #d8cd98; --vm-btn: rgba(29, 79, 145, .06); --vm-on: rgba(29, 79, 145, .16); --vm-on-line: #1d4f91; box-shadow: 0 12px 30px rgba(0, 0, 0, .25), inset 4px 0 0 -1px #e06c6c; }
.planner[data-paper="techie"] .view-settings { --vm-bg: #0b1016; --vm-text: #4fd1c5; --vm-muted: #6b8f8b; --vm-line: rgba(79, 209, 197, .4); --vm-btn: rgba(79, 209, 197, .07); --vm-on: rgba(79, 209, 197, .22); --vm-on-line: #4fd1c5; font-family: ui-monospace, Consolas, monospace; }
.planner[data-paper="dots"] .view-settings { --vm-bg: #fffdf6; --vm-text: #15171a; --vm-muted: #6e6a5e; --vm-line: #ddd6c4; --vm-btn: rgba(0, 0, 0, .04); --vm-on: rgba(0, 0, 0, .1); --vm-on-line: #15171a; background-image: radial-gradient(circle, rgba(60, 60, 60, .16) 1px, transparent 1.4px); background-size: 12px 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .22); }
.planner[data-paper="minimal"] .view-settings { --vm-bg: #fff; --vm-text: #15171a; --vm-muted: #8a9099; --vm-line: #d5d8dd; --vm-btn: #f4f5f7; --vm-on: #e3e6ea; --vm-on-line: #15171a; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); }
.view-settings h4 { color: var(--vm-muted); }
.view-settings .view-opts button:not(.paper-pill) { background: var(--vm-btn); color: var(--vm-text); border: 1px solid var(--vm-line); box-shadow: none; font-family: inherit; }
.view-settings .view-opts button:not(.paper-pill)[aria-pressed="true"] { background: var(--vm-on); border-color: var(--vm-on-line); font-weight: 600; }

.view-settings .view-opts .paper-pill { border-radius: 999px; padding: 5px 12px; font-size: .85rem; box-shadow: none; position: relative; }
.view-settings .view-opts .paper-pill[aria-pressed="true"] { outline: 2px solid #111; outline-offset: 2px; box-shadow: 0 0 0 2px #fff !important; }
.view-settings .view-opts .paper-pill[aria-pressed="true"]::after { content: " ✓"; }
.view-settings .view-opts .paper-pill[data-look="glass"] {
  background: linear-gradient(135deg, #7aa6ee 0%, #3f64b8 55%, #2b4586 100%); /* solid, so it reads on light menus too */
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .35);
}
.view-settings .view-opts .paper-pill[data-look="notebook"] {
  background: #f5edc6;
  color: #1d4f91;
  border: 1px solid #d8cd98;
  box-shadow: inset 4px 0 0 -1px #e06c6c;
  font-family: var(--hand);
}
.view-settings .view-opts .paper-pill[data-look="techie"] {
  background: #0b1016;
  color: #4fd1c5;
  border: 1px solid rgba(79, 209, 197, .5);
  font-family: ui-monospace, Consolas, monospace;
}
.view-settings .view-opts .paper-pill[data-look="dots"] {
  background-color: #fffdf6;
  background-image: radial-gradient(circle, rgba(60, 60, 60, .28) 1px, transparent 1.4px);
  background-size: 8px 8px;
  color: #15171a;
  border: 1px solid #ddd6c4;
  font-family: var(--hand);
}
.view-settings .view-opts .paper-pill[data-look="minimal"] {
  background: #fff;
  color: #15171a;
  border: 1px solid #d5d8dd;
  font-weight: 300;
}

/* Glass: the lined plan has no background or border at all. */
.planner[data-paper="glass"] .paper { background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Day Planner Tasks: the same lined paper as the plan (margin rule and
   lines), "New task" as its last line, done ones folded under "Done". */
.pile-paper { border-top: 1px solid var(--rule); }
.pile-paper .pile-list { background: transparent; border: 0; border-radius: 0; margin: 0; overflow: visible; }
.pile-paper .pile-list .line { grid-template-columns: 64px 1fr; border-bottom: 1px solid var(--rule); }
.pile-paper .pile-list .line .margin { display: flex; border-right-style: solid; }
.pile-paper .pile-list .line:last-child { border-bottom: 1px solid var(--rule); }
.pile-new .new-task { flex: 1; min-width: 0; background: transparent; border-color: transparent; font-size: 1.1rem; padding: 4px 6px; color: var(--text); }
.pile-new .new-task:focus { background: var(--glass-track); border-color: var(--active-border); }
.pile-gap { box-sizing: border-box; height: 2.375rem; border: 2px dashed var(--active-border); background: color-mix(in srgb, var(--accent) 14%, transparent); list-style: none; } /* where it would drop (the same dashed outline as .drop-slot) */
.pile-done li[data-pile] { opacity: .75; }
.pile h2 .task-count, .done-toggle .task-count {
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  vertical-align: middle;
  padding: 1px 8px;
  margin-left: 6px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--glass-track);
  border: 1px solid var(--glass-border);
}
.done-toggle .task-count { font-size: .72rem; }

/* Day notes: smaller text, so more fits. */
.day-notes .rich-edit, .day-notes .rich-raw { font-size: .92rem; line-height: 1.45; min-height: 6em; }

/* Notes toolbars stay on one line and scroll sideways if they must. */
.md-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 3px; }
.md-bar::-webkit-scrollbar { display: none; }
.md-bar button, .md-bar .md-emoji { flex: none; }
.md-bar button { padding: 3px 8px; }
.md-bar .md-toggle { margin-left: auto; }

/* "Schedule" over the plan, styled like "Tasks" and level with it when
   they sit side by side. */
.schedule-title { font-family: var(--hand); font-weight: 700; font-size: 1.6rem; color: var(--ink); margin: 20px 4px 6px; border-bottom: 2px solid var(--rule); }
.planner.docked > .schedule-title { grid-area: stitle; }
.planner.docked > .day-bottom > .pile:first-child { margin-top: 20px; }
.planner.docked > .day-bottom { align-self: start; }
.planner[data-paper="techie"] .schedule-title::before { content: "## "; opacity: .5; }
.planner[data-paper="minimal"] .schedule-title { font-family: var(--font); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.planner[data-paper="dots"] .schedule-title { border-bottom: 0; }

/* Tasks: smaller writing and lines, so more fits. */
.pile-paper .line { min-height: 2rem; }
.pile-paper .line .item-title, .pile-new .new-task { font-size: .95rem; }
.pile-gap { height: 2rem; }

/* Toolbars that scroll sideways can be dragged with the mouse. */
.md-bar.drag-scrolling { cursor: grabbing; user-select: none; }

/* No line at the very top of the lined paper (the title's underline does
   that job), on every paper. */
.planner[data-paper] .paper, .planner[data-paper] .pile-paper { border-top: 0; }

/* Section titles (Schedule, Tasks, Notes) and their underline, per paper. */
.planner :is(.schedule-title, .pile h2, .day-notes h2) { padding-bottom: 2px; }
.planner[data-paper="glass"] :is(.schedule-title, .pile h2, .day-notes h2) { border-bottom: 3px solid rgba(255, 255, 255, .22); }
:root:not([data-theme="light"]) .planner[data-paper="glass"] :is(.schedule-title, .pile h2, .day-notes h2) { color: #f6e7a6; } /* pastel yellow on blue */
.planner[data-paper="notebook"] :is(.schedule-title, .pile h2, .day-notes h2) { border-bottom: 3px solid #1d4f91; }
.planner[data-paper="techie"] :is(.schedule-title, .pile h2, .day-notes h2) { border-bottom-width: 3px; }
.planner[data-paper="minimal"] :is(.schedule-title, .pile h2, .day-notes h2) { padding-bottom: 8px; }

/* Notebook: the day name in a deep slate blue. */
.planner[data-paper="notebook"] .day-title .weekday { color: #344e6a; }

/* Desktop "More" dropdown: solid enough to read over the page. */
#topnav-overflow .menu { background: color-mix(in srgb, var(--bg, #0f172a) 94%, transparent); border: 1px solid var(--glass-border); box-shadow: 0 12px 34px rgba(0, 0, 0, .45); }

/* ⚙ on every page: sits before the ⋯ menu. Spacing buttons are line icons. */
.page-cog { margin-left: auto; }
.page-cog + .tool-menu { margin-left: 4px; }
.density-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; display: block; }
.density-opts button { padding: 5px 10px; }

/* Spacing everywhere: rows get closer or further apart. */
#main { --row-gap: 6px; --row-pad: 6px; }
#main[data-density="tight"] { --row-gap: 2px; --row-pad: 2px; }
#main[data-density="loose"] { --row-gap: 10px; --row-pad: 10px; }
#main .item-list, #main .checklist, #main .thought-list { display: grid; gap: var(--row-gap); }
#main .checklist.task-list { gap: 0; } /* an open list drawn as Tasks: ruled lines touch on lined paper (the cards look sets its own gap) */
#main .thought { padding-block: var(--row-pad); }

/* Tasks: each task on its own card. */
.task-list { display: grid; gap: var(--row-gap); }
.task-list > li[data-task] { background: var(--glass-track); border-color: var(--glass-border); padding: var(--row-pad) 8px; }
.task-list > li.list-head { background: none; }

/* Tight: one line per task; the note is just 📝 and pills sit in the line. */
#main[data-density="tight"] .task-list > li[data-task] { flex-wrap: nowrap; min-height: 34px; }
#main[data-density="tight"] .task-list > li[data-task] > .item-sub { flex: 0 1 auto; margin: 0; order: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
#main[data-density="tight"] .task-list > li[data-task] > .chips { order: 2; flex-wrap: nowrap; overflow: hidden; }
#main[data-density="tight"] .task-list > li[data-task] > .more { order: 3; }
/* Owner and Waiting on pills: on the task's own line in every spacing, never squeezed out (tight included). */
.task-list > li[data-task] > .who-pills { flex: 0 1 auto; display: inline-flex; gap: 4px; min-width: min-content; }
.who-pills .chip { white-space: nowrap; }
/* The owner's name always shows in full; Waiting on gives way first (to a few letters). */
.who-pills .who-pill.owner { flex: none; max-width: 10em; overflow: hidden; text-overflow: ellipsis; }
.who-pills .who-pill.waiting { flex: 0 1 auto; min-width: 4.5em; max-width: 12em; overflow: hidden; text-overflow: ellipsis; }
#main[data-density="tight"] .task-list > li[data-task] > .who-pills { order: 2; }
#main[data-density="tight"] .task-note .note-loose { display: none; }
/* Tight: the start of the note on the task's own line (no icon). */
#main[data-density="tight"] .task-note { flex: 0 1 auto; min-width: 0; overflow: hidden; }
#main[data-density="tight"] .task-note .note-medium { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: .85em; }

/* Medium: the note under the task, every line run together on one line. */
#main:not([data-density="tight"]):not([data-density="loose"]) .task-note .note-loose { display: none; }
.task-note .note-medium .sep { opacity: .5; margin: 0 2px; }
#main:not([data-density="tight"]):not([data-density="loose"]) .task-note { white-space: normal; }

/* Loose: the note as written (line breaks, lists, bold). */
#main[data-density="loose"] .task-note .note-medium { display: none; }
#main[data-density="loose"] .task-note { white-space: normal; display: flex; gap: 4px; align-items: flex-start; }
#main[data-density="loose"] .task-note .note-loose { display: block; }
#main[data-density="loose"] .task-note .note-loose ul { margin: 2px 0; padding-left: 1.2em; }
#main:not([data-density="tight"]):not([data-density="loose"]) .task-note .note-medium { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
#main:not([data-density="tight"]) .task-note { display: flex; gap: 4px; align-items: baseline; }
#main:not([data-density="tight"]) .task-note .note-medium, #main:not([data-density="tight"]) .task-note .note-loose { flex: 1; min-width: 0; }

/* Sub-tasks live inside their parent's card: indented with padding (not
   margin), no gap or border between them, rounded only at the ends. */
.task-list > li[data-depth="1"], .task-list > li[data-depth="2"], .task-list > li[data-depth="3"], .task-list > li[data-depth="4"] { margin-left: 0; }
.task-list > li[data-depth="1"] { padding-left: 36px; }
.task-list > li[data-depth="2"] { padding-left: 64px; }
.task-list > li[data-depth="3"], .task-list > li[data-depth="4"] { padding-left: 92px; }
.task-list > li.group-top { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }
.task-list > li.group-kid { margin-top: calc(-1 * var(--row-gap)); border-radius: 0; border-top-color: transparent; }
.task-list > li.group-kid:not(.group-end) { border-bottom-color: transparent; }
.task-list > li.group-kid.group-end { border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; }
.task-list > li.group-kid::before { content: ""; position: absolute; left: 22px; top: 0; bottom: 0; width: 1px; background: var(--glass-border); }
.task-list > li.group-kid { position: relative; }

/* Page tabs wrap onto a second row rather than hide under the ⚙ / ⋯. */
.tasks-head .segmented { flex-wrap: wrap; overflow: visible; }
.tasks-head { align-items: flex-start; }
.tasks-head .page-cog, .tasks-head .page-cog + .tool-menu { flex: none; }
/* Tight: the title keeps its room; chips and pills shrink (and clip) first. */
#main[data-density="tight"] .task-list > li[data-task] > .task-title { flex: 1 1 55%; min-width: 45%; }
#main[data-density="tight"] .task-list > li[data-task] > .chips { flex: 0 1 auto; min-width: 0; max-width: none; }
#main[data-density="tight"] .task-list > li[data-task] > .item-sub { flex: 0 1 auto; }

/* Tasks: the "New task" line at the end of the list, shaped like a task. */
.task-add-line { display: flex; align-items: center; gap: 10px; margin: var(--row-gap, 6px) 0 4px; padding: var(--row-pad, 6px) 8px var(--row-pad, 6px) 16px; min-height: 42px; border-radius: 14px; border: 1px dashed var(--glass-border); }
.task-add-line:focus-within { border-style: solid; border-color: var(--active-border); background: var(--glass-track); }
.task-add-line .add-mark { width: 22px; text-align: center; color: var(--muted); font-size: 1.1rem; }
.task-add-line .new-task-line { flex: 1; min-width: 0; background: transparent; border: 0; padding: 4px 6px; font-size: 1rem; color: var(--text); box-shadow: none; }
.task-add-line .new-task-line:focus { outline: none; }

/* Brain Dump cards: sized by how much is in them, laid out by spacing.
   Tight: small squares, title only. Medium: a mix of sizes (short notes
   small, long notes wide), text cut after a few lines. Loose: everything
   shown; long notes full width, short ones narrower. */
#main .thought-list { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-flow: dense; align-items: start; }
/* Cards: the notes in a row are as tall as the tallest, Archive and ⋯ at the bottom of each. */
#main:not([data-skin="minimal"]) .thought-list { align-items: stretch; }
#main:not([data-skin="minimal"]):not([data-zoom]) .thought { display: flex; flex-direction: column; }
#main:not([data-skin="minimal"]) .thought > .thought-actions { margin-top: auto; }
#main .thought { min-width: 0; }
#main .thought.size-m { grid-column: span 2; }
#main .thought.size-l { grid-column: 1 / -1; }
/* Medium spacing: long notes are wide but not the whole row, so more sit side by side. */
#main:not([data-density="loose"]):not([data-density="tight"]) .thought.size-l { grid-column: span 3; }
@media (max-width: 560px) { #main .thought.size-m, #main:not([data-density="loose"]):not([data-density="tight"]) .thought.size-l { grid-column: 1 / -1; } }
#main:not([data-density="loose"]):not([data-density="tight"]) .thought .thought-body {
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}

#main[data-density="tight"] .thought-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
#main[data-density="tight"] .thought, #main[data-density="tight"] .thought.size-m, #main[data-density="tight"] .thought.size-l { grid-column: auto; aspect-ratio: 1; display: flex; flex-direction: column; overflow: hidden; padding: 10px 12px; }
#main[data-density="tight"] .thought .thought-body { flex: 1; overflow: hidden; margin: 4px 0 0; }
#main[data-density="tight"] .thought .thought-body > :not(.thought-title) { display: none; }
#main[data-density="tight"] .thought .thought-title { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; font-size: 1rem; }
#main[data-density="tight"] .thought .thought-actions, #main[data-density="tight"] .thought .kind-select { display: none; }

#main[data-density="loose"] .thought-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
#main[data-density="loose"] .thought.size-m, #main[data-density="loose"] .thought.size-l { grid-column: 1 / -1; }

/* Sync */
.recovery-code { font-family: ui-monospace, Consolas, monospace; font-size: 1rem; padding: 12px 14px; border-radius: 10px; background: var(--glass-track); border: 1px dashed var(--glass-border); white-space: pre-wrap; word-break: break-all; user-select: all; }
.sync-devices { margin: 8px 0; padding-left: 1.2em; }
#sync-status[data-state="syncing"] { opacity: .8; }
#sync-status[data-state="ok"] { color: #7dd3a8; border-color: rgba(125, 211, 168, .4); }
#sync-status[data-state="offline"] { color: var(--muted); }
#sync-status[data-state="error"] { color: #f5a66a; border-color: rgba(245, 166, 106, .5); }

/* Attachments on notes */
.att-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 2px; }
#dump-att { margin: 2px 2px 6px; }
.att { position: relative; display: inline-flex; }
.att-open { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 1px solid var(--glass-border); border-radius: 10px; background: var(--glass-track, transparent); color: inherit; font-size: .78rem; cursor: pointer; overflow: hidden; box-shadow: none; }
.att-img .att-open img { display: block; height: 64px; max-width: 120px; object-fit: cover; }
.att-file .att-open { padding: 5px 9px; }
.att-open img:has(+ .att-pdf) { object-position: center top; }
.att-pdf { position: absolute; left: 4px; bottom: 4px; padding: 1px 5px; border-radius: 6px; background: rgb(0 0 0 / .62); color: #fff; font-size: .62rem; font-weight: 600; line-height: 1.4; pointer-events: none; }
.att-file .icon { width: 1.1em; height: 1.1em; flex: none; }
.att-name { max-width: 15ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; padding: 0; border-radius: 50%; font-size: .8rem; line-height: 1; display: none; place-items: center; box-shadow: none; }
.att:hover .att-x, .att:focus-within .att-x { display: grid; }
@media (hover: none) { .att-x { display: grid; opacity: .75; } }
.att-add { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; font-size: .78rem; box-shadow: none; background: transparent; border: 1px dashed var(--glass-border); border-radius: 10px; }
.att-add .icon { width: 1.1em; height: 1.1em; }
.att-count { display: none; }
#main[data-density="tight"] .att-count { display: inline-flex; gap: 3px; align-items: center; }
#main[data-density="tight"] .thought:not(.zoomed) .att-row { display: none; }
button.att-count { font: inherit; font-size: inherit; padding: 1px 8px; }
.drop-over { outline: 2px dashed var(--active-border, currentColor); outline-offset: 2px; }
/* Where dropped files will go (attachments.js dropBox): one box for the page, over everything. */
.drop-box { position: fixed; z-index: 2000; pointer-events: none; border: 2px dashed rgba(70, 140, 255, .8); border-radius: 10px; background: rgba(70, 140, 255, .06); }
.drop-box[hidden] { display: none; }
.drop-show { background: var(--active-bg) !important; border-color: rgba(70, 140, 255, .8) !important; box-shadow: 0 0 0 3px rgba(70, 140, 255, .35) !important; }
.thought-actions .icon { width: 1.05em; height: 1.05em; vertical-align: -.15em; }
.save-state { font-size: .78rem; color: var(--muted, inherit); opacity: .85; margin: 2px 4px; min-height: 1.1em; }
.save-state[data-state="saving"] { opacity: .6; }
.save-state[data-state="failed"] { color: #ff8a8a; opacity: 1; }
.save-state[hidden] { display: none; }

/* Notes: full toolbar (text size) and sized lines */
.rich .md-sizes { display: none; gap: 2px; }
.rich.bar-full .md-sizes { display: inline-flex; }
.md-sizes button { padding: 3px 8px; }
.md-sizes small { font-size: .8em; }
.md-sizes sup { font-size: .7em; }
.md-bar .md-mode { font-size: .78rem; }
.md-bar .md-mode[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }
.rich-edit h3, .thought-body h3, .note-body h3, .item-note h3 { margin: .35em 0 .15em; font-size: 1.35em; font-weight: 700; line-height: 1.25; text-transform: none; letter-spacing: 0; color: inherit; }
.rich-edit [data-sz="s"], .thought-body [data-sz="s"], .note-body [data-sz="s"], .item-note [data-sz="s"] { font-size: .82em; }

/* Notes: normal text a touch softer than the full text colour, so bold stands out */
:is(.rich-edit, .rich-raw, .thought-body, .note-body, .note-medium, .note-loose, .item-note) { color: color-mix(in srgb, var(--text) 86%, transparent); }
:is(.rich-edit, .thought-body, .note-body, .note-medium, .note-loose, .item-note) :is(b, strong) { color: var(--text); font-weight: 800; }

/* Long notes: the editor scrolls inside itself, so the toolbar stays on the page */
.rich-edit, .rich-raw { max-height: min(50vh, 32rem); overflow-y: auto; overscroll-behavior: contain; }

.rich-edit ul ul, .thought-body ul ul, .note-body ul ul, .note-loose ul ul { margin: 0; padding-left: 1.3em; }

/* Bullets in notes: first level always a filled dot; deeper levels open circle, then square */
:is(.rich-edit, .thought-body, .note-body, .note-medium, .note-loose, .item-note, .detail-notes, .task-notes, .list-notes, .thing-notes) ul { list-style-type: disc; }
:is(.rich-edit, .thought-body, .note-body, .note-medium, .note-loose, .item-note, .detail-notes, .task-notes, .list-notes, .thing-notes) ul ul { list-style-type: circle; }
:is(.rich-edit, .thought-body, .note-body, .note-medium, .note-loose, .item-note, .detail-notes, .task-notes, .list-notes, .thing-notes) ul ul ul { list-style-type: square; }
:is(.rich-edit, .thought-body, .note-body, .note-loose, .item-note) li::marker { font-family: system-ui, sans-serif; }

/* Compact spacing: editing a note takes the whole page */
#main[data-zoom] :is(.dump-capture, .dump-find, .dump-bar, .make-contact, .converted-note) { display: none; }
#main[data-zoom] > .hint { display: none; }
#main[data-zoom] .thought:not(.zoomed) { display: none; }
#main[data-zoom] .thought-list { grid-template-columns: 1fr; }
#main[data-zoom] .thought.zoomed { grid-column: 1 / -1; aspect-ratio: auto; display: block; padding: 12px 16px 16px; }
#main[data-zoom] .thought.zoomed :is(.thought-actions, .kind-select) { display: flex; }
#main[data-zoom] .thought.zoomed .kind-select { display: inline-block; }
#main[data-zoom] .thought.zoomed .rich-edit { min-height: 50vh; max-height: 65vh; }
.zoom-back { font-size: .9rem; margin: 0 2px 8px; color: var(--muted); }
#main[data-density="tight"] .thought-list { gap: 10px; }
#main[data-density="tight"] .thought .thought-title { font-size: .88rem; }
#main[data-density="tight"] .thought .thought-head { font-size: .72rem; }

/* A row you were sent to lights up for a moment */
/* "Here it is" after following a link (js/flash.js): a yellow outline pulsing 5 times. */
/* Colour, strength and number of pulses can be set per flash (flash.js):
   --flash-rgb, --flash-a (0 to 1), --flash-n, --flash-ms, --flash-w (ring), --flash-glow,
   --flash-radius, --flash-inset (inset: the ring inside the element). */
@keyframes here-pulse {
  0%, 100% { box-shadow: var(--flash-inset,) 0 0 0 2px rgb(var(--flash-rgb, 255 214 64) / 0), var(--flash-inset,) 0 0 0 rgb(var(--flash-rgb, 255 214 64) / 0); }
  50% { box-shadow: var(--flash-inset,) 0 0 0 var(--flash-w, 3px) rgb(var(--flash-rgb, 255 214 64) / calc(.95 * var(--flash-a, 1))), var(--flash-inset,) 0 0 var(--flash-glow, 18px) rgb(var(--flash-rgb, 255 214 64) / calc(.55 * var(--flash-a, 1))); }
}
.flash { animation: here-pulse var(--flash-ms, .7s) ease-in-out var(--flash-n, 5); border-radius: var(--flash-radius, 12px); position: relative; z-index: 1; }

.trust-help { margin: 8px 0; font-size: .9rem; }
.trust-help summary { cursor: pointer; color: var(--muted); }
.trust-steps { margin: 6px 0; padding-left: 1.2em; display: grid; gap: 6px; }

/* ---------- Tasks: tabs that fit a phone, chips under the title, the new-task entry ---------- */
.tasks-head .segmented { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; overflow: visible; display: flex; }
.tasks-head .segmented button { flex: 1 1 0; min-width: 0; padding: 7px 4px; text-align: center; }
@media (max-width: 480px) { .tasks-head .segmented button { font-size: .85rem; padding: 7px 2px; } }
/* Contacts: + New contact (+ New case on Cases) at the left, as in Contracts and Batch Book; on phones the tabs go under it. */
.c-new-btn, .new-project-btn { flex: none; white-space: nowrap; }
.new-project-btn[hidden] { display: none; }
.tasks-head .new-project-btn { padding: 5px 12px; font-size: .88rem; line-height: 1.2; align-self: center; }
@media (max-width: 480px) { .tasks-head .new-project-btn { order: 1; } }
.task-list .item-sub { flex-wrap: wrap; row-gap: 4px; }
.task-list .item-sub .chips { display: inline-flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.task-list .item-sub .task-note { flex: 1 1 12ch; }
#main[data-density="tight"] .task-list .item-sub { flex-wrap: nowrap; }
#main[data-density="tight"] .task-list .item-sub .chips { flex-wrap: nowrap; }
#task-body { min-height: 55vh; }

.task-entry { margin: var(--row-gap, 6px) 0 4px; }
.task-entry:not(.open) .task-entry-more, .task-entry:not(.typed) .task-entry-more { display: none; }
.task-entry-more { display: grid; gap: 8px; padding: 2px 8px 8px 54px; }
.entry-note { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--glass-border); color: var(--text); font: inherit; font-size: .95rem; padding: 4px 2px; resize: none; overflow: hidden; box-shadow: none; }
.entry-note:focus { outline: none; border-bottom-color: var(--active-border); }
.entry-note::placeholder { color: var(--muted); }
.entry-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.entry-chip { position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass-track); font-size: .82rem; color: var(--muted); cursor: pointer; }
.entry-chip.set { color: var(--text); border-color: var(--active-border); background: var(--active-bg); }
.entry-chip :is(input, select) { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.task-entry-more .hint { margin: 0; font-size: .75rem; }

/* An empty page: just a big ＋ (tap it, or anywhere on the page) */
.task-entry.is-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 45vh; }
.task-entry.is-empty:not(.open) .task-add-line { display: none; }
.task-entry.is-empty.open .entry-plus { display: none; }
.task-entry.is-empty .task-add-line, .task-entry.is-empty .task-entry-more { width: 100%; }
.entry-plus { width: 68px; height: 68px; border-radius: 50%; font-size: 2rem; line-height: 1; display: grid; place-items: center; border: 1px dashed var(--glass-border); background: var(--glass-track); color: var(--muted); box-shadow: none; }

/* The panel: note, plan, folded "More" */
.task-details .task-notes { margin-bottom: 10px; }
.task-details .energy-pick { margin-bottom: 8px; }
.detail-more { grid-column: 1 / -1; margin: 6px 0 10px; }
.detail-more > summary { cursor: pointer; color: var(--muted); font-size: .85rem; padding: 4px 0; }
.detail-more[open] > summary { margin-bottom: 8px; }
.linklike { align-self: end; background: none; border: 0; box-shadow: none; color: var(--accent, var(--text)); font-size: .85rem; text-align: left; padding: 6px 2px; }
@media (max-width: 480px) {
  .task-details { margin-left: 0; padding: 10px; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .detail-actions { flex-wrap: wrap; }
  .task-entry-more { padding-left: 16px; }
}
.task-list .item-sub .chips { justify-content: flex-start; max-width: none; }

/* Home Screen warning */
.install-alert { border: 1px solid #ff8a8a; background: rgba(220, 60, 60, .16); border-radius: 12px; padding: 10px 14px; }
.install-alert p { margin: 6px 0; }
.install-alert b { color: #ffb4b4; }
.install-alert .primary { margin: 6px 0; }
.install-steps { margin: 8px 0; padding-left: 1.3em; display: grid; gap: 6px; }
.install-ok { color: #8fe0a8; margin: 0; }
.install-banner { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 8px 14px; background: #b3261e; color: #fff; font-size: .85rem; line-height: 1.35; }
.install-banner a { color: #fff; text-decoration: underline; font-weight: 600; }
.install-banner button { margin-left: auto; flex: none; background: none; border: 0; box-shadow: none; color: #fff; font-size: 1rem; padding: 0 4px; }
.task-entry.is-empty .add-mark { width: 20px; height: 20px; border: 2px solid var(--glass-border); border-radius: 5px; }

/* Rows must be able to shrink to the phone's width */
.task-list { grid-template-columns: minmax(0, 1fr); }
.task-list > li { min-width: 0; }
.task-list > li[data-task] > .task-title { min-width: 0; }
.task-list .item-sub { min-width: 0; max-width: calc(100% - 64px); }
.task-details { min-width: 0; }
.task-details .detail-grid > * { min-width: 0; }
.task-details .md-bar { max-width: 100%; }
@media (min-width: 700px) { .tasks-head .segmented { flex: 0 1 460px; } .tasks-head .segmented button { padding: 7px 14px; } .tasks-head { justify-content: flex-start; } .tasks-head .page-cog { margin-left: auto; } }
.task-list > li.task-details, .task-details { margin-left: 0; }

/* A task and its open panel read as one card */
.task-list > li:has(+ li.task-details) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }
.task-list > li.task-details { margin-top: calc(-1 * var(--row-gap, 2px)); margin-bottom: 8px; border-top-left-radius: 0; border-top-right-radius: 0; border-top-color: transparent; background: var(--glass-track); }

/* iPhone Safari: date, time and select fields must shrink to their column and match each other */
.detail-grid input, .detail-grid select, .task-entry-more input, .task-entry-more select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.detail-grid input[type="date"], .detail-grid input[type="time"] { -webkit-appearance: none; appearance: none; min-height: 2.4rem; text-align: left; display: block; }
.detail-grid input[type="date"]::-webkit-date-and-time-value, .detail-grid input[type="time"]::-webkit-date-and-time-value { text-align: left; }
.detail-actions button { white-space: nowrap; }
.task-details, .task-details * { max-width: 100%; }
.task-details .md-bar { max-width: 100%; overflow-x: auto; }

/* ---------- Dropdowns take the theme: never a plain white box ---------- */
:root, :root[data-theme="blue"] { --menu-bg: #1a2444; }
:root[data-theme="dark"] { --menu-bg: #25272d; }
:root[data-theme="light"] { --menu-bg: #ffffff; }
/* The list a <select> opens (where the browser lets a page style it; iPhone and Android use their own picker, which follows the theme's light or dark). */
select option, select optgroup { background-color: var(--paper-bg, var(--menu-bg)); color: var(--text); }
select:focus option:checked { background-color: var(--active-border, #35507a); }
/* The small pop-up for energy and lists */
.pill-menu, .energy .energy-choose { background: var(--menu-bg); border: 1px solid var(--active-border); }
.pill-menu button, .energy .energy-choose button { background: var(--glass); border: 1px solid var(--glass-border); color: var(--text); }
.pill-menu button[aria-checked="true"], .energy .energy-choose button[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }
.pill-menu button:hover, .pill-menu button:focus-visible, .energy .energy-choose button:hover { border-color: var(--accent, var(--active-border)); background: var(--glass-hover); outline: none; }

/* Numbered lists */
.rich-edit ol, .thought-body ol, .note-body ol, .note-loose ol { margin: 0; padding-left: 1.6em; }
:is(.md-ol, .rich-edit ol) > li + li { margin-top: .45em; } /* a little room between numbered items, with no blank line typed */
:is(.rich-edit, .thought-body, .note-body, .note-medium, .note-loose, .item-note, .detail-notes, .task-notes, .list-notes, .thing-notes) ol { list-style-type: decimal; }
:is(.rich-edit, .thought-body, .note-body, .note-loose) ol ol, :is(.rich-edit, .thought-body, .note-body, .note-loose) ul ol, :is(.rich-edit, .thought-body, .note-body, .note-loose) ol ul { margin: 0; padding-left: 1.4em; }
:is(.rich-edit, .thought-body, .note-body, .note-loose) ol li::marker { font-family: system-ui, sans-serif; }

/* Pills under an item being edited in place (js/editpills.js). */
.edit-pills { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px 52px; }
.task-list .edit-pills { margin: -2px 0 8px 64px; }
.item-list .edit-pills { margin: 0 0 6px 36px; }
.checklist .edit-pills { margin: -2px 0 8px 64px; }
.line .edit-pills { margin: 2px 0 6px 0; }
.edit-pills .pill-more { color: var(--text); }
@media (max-width: 700px) { .edit-pills, .task-list .edit-pills, .checklist .edit-pills { margin-left: 16px; } }
/* Phones (the trial): no ⋯; More, holding the text or tapping the note open the panel. */
body.pills-only :is(.task-list, .item-list, .checklist, .planner) .more:not([aria-expanded="true"]) { display: none; }

/* A note full screen (js/fullnote.js): on phones when you tap into a note, on a
   laptop from the ⤢ button. Toolbar at the bottom, just above the keyboard. */
.md-full { font-size: 1rem !important; }
/* Its key: Alt+Enter goes full screen, Esc comes back (kbd hides on touch screens). */
.md-full kbd { font-size: .62rem; }
.rich.is-full .md-full-in, .rich:not(.is-full) .md-full-out { display: none; }
/* Alt Enter shows only where the key opens this note (richtext.js altTarget). */
.rich:not(.alt-target):not(:focus-within):not(.is-full) .md-full-in { display: none; }
.note-full-head { display: none; }
.rich.is-full {
  position: fixed; left: 0; right: 0; top: 0; height: 100dvh; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; margin: 0;
  padding: calc(var(--safe-top) + 8px) 12px 8px;
  background: var(--bg); border-radius: 0; box-sizing: border-box;
}
.rich.is-full > .note-full-head { display: flex; align-items: center; gap: 10px; flex: none; }
.note-full-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--muted); }
.note-full-done { padding: 6px 18px; }
.rich.is-full > .rich-edit, .rich.is-full > .rich-raw { flex: 1; min-height: 0 !important; max-height: none !important; overflow-y: auto; border-color: transparent; background: transparent; font-size: 1.1rem; }
.rich.is-full > .md-bar { order: 9; flex: none; margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.rich.is-full > .md-bar::-webkit-scrollbar { display: none; }
.rich.is-full .md-full { border-color: color-mix(in srgb, var(--energy-ink, #4caf7a) 65%, transparent); background: color-mix(in srgb, var(--energy-ink, #4caf7a) 24%, transparent); }
@media (min-width: 761px) { .rich.is-full { right: auto; width: min(900px, 100vw); left: max(0px, calc(50vw - 450px)); } }
/* Nothing on the page behind it scrolls, and nothing on the way up can trap the fixed note. */
html.note-full, html.note-full body { overflow: hidden; }
html.note-full :has(> .rich.is-full), html.note-full :has(.rich.is-full) { transform: none !important; filter: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; contain: none !important; }

/* ↗ Make: lines of a note into tasks or a contact (js/linemake.js). */
.md-make-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; padding: 6px 8px; border-radius: 12px; background: var(--glass-track); border: 1px solid var(--glass-border); font-size: .85rem; }
.md-make-menu button { padding: 4px 12px; font-size: .85rem; }
.rich.is-full > .md-make-menu { order: 8; margin: 0; }

/* Compact Brain Dump cards: the note's whole text run together, filling the square. */
.thought-flat { display: none; }
#main[data-density="tight"] .thought .thought-body > .thought-title { display: none; }
#main[data-density="tight"] .thought .thought-body > .thought-flat { display: block; height: 100%; overflow: hidden; font-size: .88rem; line-height: 1.35; overflow-wrap: anywhere; -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent); mask-image: linear-gradient(to bottom, #000 80%, transparent); }

/* The app's own questions (js/ask.js). */
.ask-sheet { max-width: 460px; }
@media (min-width: 768px) { .ask-sheet { margin: auto; border-radius: var(--radius-card); border-bottom: 1px solid var(--glass-border); } }
/* What's new after an update (whatsnew.js): one row per change, Show me on the right. */
.whatsnew-sheet { max-width: 620px; }
@media (min-width: 768px) { .whatsnew-sheet { margin: auto; border-radius: var(--radius-card); border-bottom: 1px solid var(--glass-border); } }
.whatsnew-head { display: flex; align-items: center; gap: 10px; }
.whatsnew-head h2 { margin: 0; flex: 1; }
.whatsnew-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 58vh; overflow-y: auto; }
.whatsnew-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--glass-border); }
.whatsnew-text { flex: 1; line-height: 1.35; }
.whatsnew-more, .whatsnew-v { display: block; font-size: .85rem; margin-top: 3px; }
.whatsnew-v { font-size: .75rem; }
.whatsnew-list .pill-act { flex: none; }
.whatsnew-nav { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.whatsnew-when { flex: 1; text-align: center; font-size: .9rem; }
.whatsnew-nav .pill-act[disabled] { opacity: .35; cursor: default; }
#install-card > .check-row { margin: 2px 0 12px; } /* Show update info, under the version line */
.ask-field { display: grid; gap: 4px; margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
.ask-field input, .ask-field select { width: 100%; box-sizing: border-box; font-size: 16px; color: var(--text); }

/* Settings → Sync: the home server's certificate (backlog 67). */
.trust-cert { margin: 10px 0 0; }
.trust-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.trust-row .button { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: var(--radius-pill); background: var(--active-bg); border: 1px solid var(--active-border); color: var(--text); text-decoration: none; }
.trust-url { font-size: .82rem; overflow-wrap: anywhere; }
.trust-steps ol { margin: 4px 0 0; padding-left: 1.2em; }
.sync-reach { margin: 8px 0 0; font-size: .9rem; }

/* Notes toolbar in sections: text style | Make | links | Markdown. */
.md-sep { flex: none; align-self: stretch; width: 1px; margin: 3px 5px; background: var(--glass-border); }

/* Phones always edit notes full screen, so no ⤢. */
@media (pointer: coarse) and (max-width: 760px) { .md-full { display: none !important; } }
.note-full-backdrop { position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, .55); }
/* Phones: solid behind it, so no page shows round Safari's ↑ ↓ ✓ bar under the note. */
@media (pointer: coarse) and (max-width: 760px) { .note-full-backdrop { background: var(--bg); } }

/* Link chips carry their icon: it is part of the chip, so they go together. */
.ref::before { margin-right: .25em; font-style: normal; text-decoration: none; display: inline-block; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.ref[data-ref^="tasks/"]::before { content: '☑️'; }
.ref[data-ref^="contacts/"]::before { content: '📞'; }
.ref[data-ref^="thoughts/"]::before { content: '📝'; }
.ref[data-ref^="day_items/"]::before, .ref[data-ref^="days/"]::before { content: '🗓️'; }
.ref[data-ref^="cases/"]::before { content: '📁'; }
.ref[data-ref^="items/"]::before, .ref[data-ref^="places/"]::before { content: '📦'; }
.ref[data-ref^="lists/"]::before, .ref[data-ref^="list_items/"]::before { content: '📋'; }

/* Day Planner: Tasks and Notes keep to their column (a notes toolbar that
   scrolls sideways had made them as wide as the whole toolbar, off the screen
   on a phone and over the schedule on a laptop). */
.day-bottom, .day-bottom > *, .planner.docked > *, .rich, .rich > * { min-width: 0; }
.day-bottom > * { max-width: 100%; }

/* Settings → Your words: the Dictionary and Brain Dump types (words.js). */
.words-sheet { max-width: 640px; }
@media (min-width: 768px) { .words-sheet { margin: auto; border-radius: var(--radius-card); border-bottom: 1px solid var(--glass-border); } }
.dict-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; padding: 2px 0 5px; border-bottom: 1px solid var(--glass-border); }
.dict-row input { flex: 1 1 0; min-width: 0; box-sizing: border-box; font-size: 16px; padding: 3px 8px; border-color: transparent; background: transparent; color: var(--text); text-overflow: ellipsis; }
.dict-row input:focus { border-color: var(--active-border); background: var(--glass-track); }
.dict-row.custom input { color: var(--accent); }
.dict-row .icon-btn.small { width: 26px; height: 26px; font-size: .95rem; box-shadow: none; }
.dict-reset:disabled { opacity: .3; }
/* What it is and where it shows: small, grey, under the text. */
.dict-hint { flex-basis: 100%; margin: -2px 34px 0 8px; font-size: .7rem; font-style: italic; line-height: 1.3; color: var(--muted); opacity: .75; }
.dict-search { width: 100%; box-sizing: border-box; margin: 6px 0 4px; }
.dict-group h3 { margin: 14px 0 2px; }
.types-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.types-list li { display: flex; gap: 6px; align-items: center; }
.types-list input { flex: 1; min-width: 0; box-sizing: border-box; font-size: 16px; color: var(--text); }
/* Life areas / groups (Find Things): groups indented under their life area; dragging as in Tasks. */
.types-list.nested li[data-depth="1"] { margin-left: 28px; }
.types-list.nested li[data-depth="0"] input { font-weight: 600; }
.types-list.nested li.selected { background: var(--glass); border-radius: 10px; }
.types-list.nested li.nest-target { outline: 2px dashed var(--active-border, currentColor); outline-offset: 2px; border-radius: 10px; }
.types-list.nested li.dragging.nest-preview { margin-left: 28px; }
.types-list.nested li.dragging.coming-out { margin-left: 0; }
.manager-hint { font-size: .85rem; margin: 4px 0 8px; }
.words-sheet .select-bar { position: sticky; bottom: 8px; left: auto; transform: none; width: fit-content; margin: 8px auto 0; }
.types-add { display: flex; gap: 6px; margin: 8px 0; }
.types-add input { flex: 1; min-width: 0; box-sizing: border-box; font-size: 16px; color: var(--text); }

/* The version, after the sync state and at the top of Settings (js/version.js). */
.app-version-top { flex: none; margin-left: 8px; font-size: .68rem; color: var(--muted); opacity: .55; letter-spacing: .02em; }
.app-version { margin: 0 0 6px; font-size: .78rem; }

/* Touch screens: no ✕ on sheets (drag the handle down or tap outside), and a
   thicker handle that's easier to grab. */
@media (pointer: coarse) {
  .sheet-handle { width: 56px; height: 7px; border-radius: 4px; opacity: .65; margin: 6px auto 14px; }
  .sheet-handle::before { inset: -18px -90px -12px; }
}

/* The empty page's ＋ is drawn (a text ＋ never sits exactly in the middle). */
.entry-plus { padding: 0; }
.entry-plus .icon { width: 28px; height: 28px; display: block; }

.dict-row .icon-btn.small { display: grid; place-items: center; padding: 0; }
.dict-row .icon-btn.small .icon { width: 17px; height: 17px; }

/* Text size choices, each written at its own size, lined up in one row. */
#text-size { align-items: center; }
#text-size button { min-height: 2.4rem; line-height: 1.1; }

/* "Add note" under a task being edited in place (js/editpills.js, tasks). */
.edit-pills .pill-note { flex-basis: 100%; order: -1; margin: -4px 0 2px; padding: 2px 0; border: 0; background: transparent; resize: none; font-size: .9rem; line-height: 1.4; color: var(--text); field-sizing: content; min-height: 1.4em; }
.edit-pills .pill-note::placeholder { color: var(--muted); opacity: .7; }
/* "Add note" lines up with the task's text (the pills sit further left on phones). */
@media (max-width: 700px) { .task-list .edit-pills .pill-note { margin-left: 48px; flex-basis: calc(100% - 48px); } }
/* Task list tabs stay on one line each ("Task Dump"). */
.tasks-head .segmented button { white-space: nowrap; flex: 1 1 auto; }

/* Tasks and list items: the note under an item starts where the title's text
   starts (the title has 8px of padding and a 1px border). */
.task-list .item-sub { margin-left: 72px; }
.task-list .item-sub { max-width: calc(100% - 72px); }
.task-list .edit-pills .pill-note { margin-left: 8px; flex-basis: calc(100% - 8px); }
@media (max-width: 700px) { .task-list .edit-pills .pill-note { margin-left: 56px; flex-basis: calc(100% - 56px); } }
/* Typing a note in place: square corners, so the cursor isn't clipped by a rounded edge. */
.edit-pills .pill-note, .edit-pills .pill-note:focus { border-radius: 0; border: 0; outline: none; box-shadow: none; }
/* Editing a title in place: no border or rounded box, just the line lit up a little. */
.task-title:focus { border-color: transparent; border-radius: 0; background: color-mix(in srgb, var(--text) var(--line-lit), transparent); box-shadow: none; }

.link-btn { padding: 0; margin-left: 6px; border: 0; background: none; box-shadow: none; color: var(--accent); font-size: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
/* Day Planner lines: typing on a line (a new one or an item's text) shows no
   border or rounded box, just the line lit up a little, like task titles. */
.line .item-title:focus { border-color: transparent; border-radius: 0; background: color-mix(in srgb, var(--text) var(--line-lit), transparent); box-shadow: none; }

/* Glass: a note shown under an item (tasks, Day Planner items, list items,
   things in Find Things; medium and loose spacing) in italics, a touch smaller
   and a touch fainter than the text of the item. */
:root[data-theme="blue"] #main:not([data-density="tight"]) .item-note { font-size: calc(.78rem * .93); } /* 7% under the usual note size */
:root[data-theme="blue"] #main:not([data-density="tight"]) .item-note,
:root[data-theme="blue"] #main:not([data-density="tight"]) .item-note :is(.note-medium, .note-loose, .note-body, .more-lines) {
  font-style: italic;
  color: color-mix(in srgb, var(--text) 78%, transparent);
}

/* Settings fields: time and date boxes shrink to their column on iPhone
   (Safari won't narrow them with its own look on), and every field in a
   settings grid is the same height, dropdowns included. */
.settings-grid input[type="time"], .settings-grid input[type="date"] { -webkit-appearance: none; appearance: none; display: block; text-align: left; }
.settings-grid input[type="time"]::-webkit-date-and-time-value, .settings-grid input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.settings-grid :is(input, select) { height: 46px; line-height: normal; }

/* Day Planner item panel on iPhone: time and date boxes fit their column
   (Safari's own look kept them too wide), and all its fields are one height. */
.item-details > * { min-width: 0; }
.item-details input, .item-details select { box-sizing: border-box; min-width: 0; max-width: 100%; width: 100%; height: 40px; line-height: normal; }
.item-details input[type="time"], .item-details input[type="date"] { -webkit-appearance: none; appearance: none; display: block; text-align: left; }
.item-details input[type="time"]::-webkit-date-and-time-value, .item-details input[type="date"]::-webkit-date-and-time-value { text-align: left; }
@media (max-width: 560px) { .item-details { padding-left: 16px; } }

/* Touch screens: an item's resize bar only shows while its panel is open
   (it sat over the text of every item). */
@media (hover: none) {
  .resize-grip { opacity: 0; pointer-events: none; }
  .line.has-item:has(+ .item-details) .resize-grip, .line.resizing .resize-grip { opacity: .6; pointer-events: auto; }
}

/* Tick boxes drawn the same everywhere (iPhone filled empty ones in black). */
input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin: 0; flex: none;
  border: 1.5px solid color-mix(in srgb, var(--text) 55%, transparent);
  border-radius: 5px; background: transparent;
  display: inline-grid; place-content: center; cursor: pointer;
}
input[type="checkbox"]::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); opacity: 0; }
input[type="checkbox"]:checked { background: #6fb0ff; border-color: #6fb0ff; }
input[type="checkbox"]:checked::after { opacity: 1; }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--active-border); outline-offset: 2px; }

/* Tasks, compact spacing: no note text, just 📝 (see the end of this file). */
/* Tasks, expanded spacing: the note as written, up to about 8 lines, fading
   out at the bottom if there's more (tap it to open the task and read it all). */
#main[data-density="loose"] .task-note .note-loose { max-height: 10.5em; overflow: hidden; }
#main[data-density="loose"] .task-note.is-long .note-loose { -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to bottom, #000 70%, transparent); }
.task-note .note-more { display: none; }
#main[data-density="loose"] .task-note.is-long { flex-direction: column; }
#main[data-density="loose"] .task-note .note-more { display: block; font-size: .85em; color: var(--accent); margin-top: 2px; }

/* Brain Dump: Share on a saved note (copy, or the phone's share sheet). */
.share-note { display: inline-block; position: relative; }
.share-note > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; font-size: .78rem; border: 1px solid var(--glass-border); border-radius: 999px; cursor: pointer; }
.share-note > summary::-webkit-details-marker { display: none; }
.share-note > summary .icon { width: 1em; height: 1em; }
.share-note .menu { position: absolute; z-index: 20; left: 0; top: calc(100% + 4px); min-width: 230px; }

/* Wide Day Planner (schedule and Tasks/Notes side by side): more room across,
   between the two columns and at the sides. */
.planner.docked { column-gap: 44px; padding-inline: 20px; }
/* Day Planner: more room under the line beneath Schedule, Tasks and Notes. */
.planner :is(.schedule-title, .pile h2, .day-notes h2) { margin-bottom: 16px; }

/* iPhone: the bottom bar's buttons sit lower, into the home-bar area a little
   (iOS reserves ~34 px; the buttons stay clear of the home bar line itself). */
.tabbar { padding-bottom: calc(6px + max(0px, var(--safe-bottom) - 18px)); }
/* Each button's tap area reaches the bar's top and bottom edges, so a tap just under a button (in the home-bar area) still opens it. */
.tabbar .tab { position: relative; }
.tabbar .tab::after { content: ''; position: absolute; left: -2px; right: -2px; top: -7px; bottom: calc(-7px - max(0px, var(--safe-bottom) - 18px)); }

/* Search everything (js/search.js): top bar on a laptop, More list on a phone. */
.top-search { position: relative; flex: 0 1 260px; min-width: 150px; }
.top-search .search { padding: 7px 14px !important; font-size: .9rem; border-radius: 18px !important; }
#top-results { position: absolute; right: 0; top: calc(100% + 6px); width: min(460px, 90vw); max-height: 70vh; overflow-y: auto; padding: 6px; z-index: 30; }
#more-search { width: 100%; box-sizing: border-box; margin: 0 0 10px; }
#more-results { max-height: 60vh; overflow-y: auto; margin-bottom: 8px; }
.sr-group { padding: 4px 2px 6px; }
.sr-group + .sr-group { border-top: 1px solid var(--glass-border); }
.sr-group h4 { margin: 6px 8px 4px; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sr-item { display: grid; gap: 1px; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: var(--text); cursor: pointer; }
.sr-item:hover, .sr-item:focus { background: var(--glass-hover); outline: none; }
.sr-title { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-snip { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results mark { background: color-mix(in srgb, #f2d35b 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.sr-more { margin: 2px 8px; padding: 2px 8px; font-size: .8rem; border: 0; background: none; box-shadow: none; color: var(--accent); cursor: pointer; }
.sr-empty { margin: 10px; }

/* Day Planner: Day focus and Energy on one line (Energy to the right; they
   wrap on a narrow screen). Both labels in handwriting with a double underline
   drawn by hand, Day focus in red and Energy in a pastel green. */
.focus-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin-bottom: 10px; }
.focus-row .focus { flex: 1 1 300px; min-width: 0; margin-bottom: 0; align-items: center; }
.focus-row .energy { flex: none; margin-left: auto; }
.focus-row .energy .view-menu { margin-left: auto; }
.hand-label { position: relative; font-family: var(--hand); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em; line-height: 1.2; border-bottom: 0 !important; padding-bottom: 7px; }
.energy .energy-label { color: var(--energy-ink); margin-right: 6px; }
.hand-label::before {
  content: ''; position: absolute; left: -3px; right: -6px; bottom: -3px; height: 9px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 12' preserveAspectRatio='none'%3E%3Cpath d='M1 3.6 C 22 2.2, 48 2.4, 70 2.9 S 92 3.8, 99 3.1' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M4 9.8 C 26 8.3, 52 8.6, 74 8.4 S 90 7.9, 94 8.6' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 12' preserveAspectRatio='none'%3E%3Cpath d='M1 3.6 C 22 2.2, 48 2.4, 70 2.9 S 92 3.8, 99 3.1' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M4 9.8 C 26 8.3, 52 8.6, 74 8.4 S 90 7.9, 94 8.6' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
}
.planner:is([data-paper="techie"], [data-paper="minimal"]) .hand-label::before { display: none; }
/* The day's Energy (next to Day focus): only the chosen ⚡ level, then a line
   for a few words, typed like Day focus. The ⚡ pills (and ✕) show under it
   while you're changing it. The line takes the rest of the row, so the 👁
   sits at the right on every screen. */
.focus-row .energy { flex: 1 1 260px; flex-wrap: wrap; row-gap: 6px; }
.energy .energy-level { padding: 2px 8px; font-size: .95rem; border-color: transparent; background: transparent; box-shadow: none; }
.energy #energy-note { flex: 1 1 120px; min-width: 0; width: auto; font-weight: 700; font-size: 1.15rem; color: var(--energy-ink) !important; background: transparent !important; border-color: transparent !important; border-radius: 0 !important; padding: 4px 6px !important; box-shadow: none; }
.energy #energy-note:hover { background: color-mix(in srgb, var(--text) var(--line-hover), transparent) !important; }
.energy #energy-note:focus { background: color-mix(in srgb, var(--text) var(--line-lit), transparent) !important; }
.energy.has-level #energy-note:not(:focus)::placeholder { color: transparent; }
/* The ⚡ pills look like the small pop-up on Tasks (pillmenu.js) and float
   under the words, starting where they start, so nothing on the line moves. */
.focus-row .energy { position: relative; }
.energy .energy-choose { display: none; position: absolute; top: calc(100% + 4px); left: 0; font-size: 1rem; }
.energy .energy-choose button { padding: 2px 10px; font-size: inherit; }
.energy.editing .energy-choose { display: flex; }
.energy .view-menu { order: 4; margin-left: auto; }

/* Lines on ruled paper (schedule, Day Planner and Tasks page tasks, Day focus,
   Notes) share two faint shades of the text colour: under the pointer, and
   while you're writing in them. */
:root { --line-hover: 3.5%; --line-lit: 5%; }
/* The focus line types like a schedule line: lit up a little under the
   pointer and while typing, no border or rounded box. */
.focus input { border-radius: 0 !important; }
.focus input:hover { background: color-mix(in srgb, var(--text) var(--line-hover), transparent) !important; }
.focus input:focus { border-color: transparent !important; background: color-mix(in srgb, var(--text) var(--line-lit), transparent) !important; box-shadow: none; }

/* Energy: on a narrow screen it follows Day focus and, when there isn't room,
   wraps underneath at the left (not pushed to the right). On a wide screen
   (Tasks and Notes beside the schedule) Day focus and Energy take half each. */
.focus-row .energy { margin-left: 0; }
.planner.docked > .day-head { margin-inline: 0; }
.planner.docked .focus-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 44px; align-items: center; }
.planner.docked .focus-row .focus { padding-left: 4px; }
.planner.docked .focus-row .energy { padding-left: 4px; }
.planner.docked .focus-row .energy .view-menu { margin-left: auto; }

/* Day Planner Tasks: the same as the schedule's lines. Each line lights up a
   little under the pointer; typing on the New task line (or a task's text)
   shows no border or rounded box, just the line lit up. */
.pile-paper .line:hover > .content { background: color-mix(in srgb, var(--text) var(--line-hover), transparent); }
.pile-new .new-task { border-radius: 0; border-color: transparent; background: transparent; box-shadow: none; }
.pile-new .new-task:focus { border-color: transparent; border-radius: 0; background: color-mix(in srgb, var(--text) var(--line-lit), transparent); box-shadow: none; }

.pile-blank { cursor: text; }
.pile-paper .pile-blank { border-bottom: 1px solid var(--rule); }

/* Day Planner Tasks: the tick box (and the ⠿ handle) sit in the margin, left
   of the red line, so the task's text has the whole line. Empty lines and the
   New task line show a faint empty tick box in the same place, so every line
   reads as a task line. */
.pile-paper .line { position: relative; }
.pile-paper .line.has-item > .content > .tick { position: absolute; left: 30px; top: 7px; margin: 0; }
.pile-paper .line.has-item > .content > .drag-grip { position: absolute; left: 6px; top: 6px; }
.pile-paper :is(.pile-new, .pile-blank) > .margin { position: relative; }
.pile-paper :is(.pile-new, .pile-blank) > .margin::after {
  content: ''; position: absolute; left: 30px; top: 7px; width: 18px; height: 18px; box-sizing: border-box;
  border: 1.5px solid color-mix(in srgb, var(--text) 55%, transparent); border-radius: 5px; opacity: .35;
}
.pile-new > .margin { cursor: text; }
.pile-paper .pile-gap-line > .margin::after { content: none; } /* the empty line before done tasks: nothing to tick */
.pile-paper .line.has-item .item-sub { margin-left: 6px; }
/* The name comes first. It starts as wide as its words: a short one keeps its pills beside it, a
   longer one has them on the line under it (⋯ at the right). Over two lines, the rest fades out at
   the end of the second (planner.js clampTitles), and shows while it's being written in. */
.pile-paper .line.has-item > .content > textarea.item-title { flex: 1 1 auto; max-width: 100%; }
.pile-paper .line.has-item > .content > .more { margin-left: auto; }
/* The schedule the same, its ⠿ and tick box staying before the name on its line (the pills that go
   under a long name are moved along to start under it: planner.js clampTitles). */
#lines .line.has-item > .content > textarea.item-title { flex: 1 1 auto; max-width: calc(100% - 49px); }
:is(.pile-paper, #lines) .line.has-item > .content.pills-under > textarea.item-title { flex-basis: 100%; } /* planner.js clampTitles */
#lines .line.has-item > .content > .more { margin-left: auto; }
#lines .line.has-item > .content > textarea.item-title:not(:focus) { max-height: calc(2.6em + 5px); }
#lines .line.has-item > .content > textarea.item-title.clamped:not(:focus) {
  -webkit-mask: linear-gradient(#000 0 0) top / 100% 50% no-repeat, linear-gradient(to left, transparent, #000 4em) bottom / 100% 50% no-repeat;
  mask: linear-gradient(#000 0 0) top / 100% 50% no-repeat, linear-gradient(to left, transparent, #000 4em) bottom / 100% 50% no-repeat;
}
/* ⋯ (shown on hover) floats over the end of the first line, in the middle of it and inside the name's edge, rather than taking room from the name;
   while the name is being written in, its text keeps clear of it. */
@media (hover: hover) {
  :is(.pile-paper, #lines) .line.has-item > .content > .more { position: absolute; right: 11px; top: 18px; transform: translateY(-50%); margin: 0; background: var(--menu-bg, var(--glass-strong)); border-radius: 999px; }
  #lines .line.has-item > .content > textarea.item-title:focus, #lines .line.has-item > .content:has(> .more[aria-expanded="true"]) > textarea.item-title { padding-right: 38px; }
  .pile-paper .line.has-item > .content > textarea.item-title:focus, .pile-paper .line.has-item > .content:has(> .more[aria-expanded="true"]) > textarea.item-title { padding-right: 38px; } /* (its panel open: ⋯ stays) */
}
.pile-paper .line.has-item > .content > textarea.item-title:not(:focus) { max-height: calc(2.6em + 5px); } /* two lines and the padding above them (not below: a third line would show in it) */
.pile-paper .line.has-item > .content > textarea.item-title.clamped:not(:focus) {
  -webkit-mask: linear-gradient(#000 0 0) top / 100% 50% no-repeat, linear-gradient(to left, transparent, #000 4em) bottom / 100% 50% no-repeat;
  mask: linear-gradient(#000 0 0) top / 100% 50% no-repeat, linear-gradient(to left, transparent, #000 4em) bottom / 100% 50% no-repeat;
}

/* Day Planner Notes: just the note, no box around it, and the toolbar only
   while you're writing in it (clicking a toolbar button keeps you in it). */
#notes.rich:not(:focus-within) > .md-bar { display: none; }
#notes .rich-edit, #notes .rich-raw {
  border-color: transparent !important; border-radius: 0; box-shadow: none;
  /* Ruled paper: a line under every line of writing, at least five of them,
     and always a spare line or two below the text. */
  --note-line: 2rem;
  line-height: var(--note-line);
  padding: 0 10px calc(var(--note-line) * 1.5);
  min-height: calc(var(--note-line) * 5 + 2px); background-clip: padding-box; /* + its 1px top and bottom borders, so the fifth line shows; no line peeping into the top border */
  background-color: transparent;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--note-line) - 1px), var(--rule) calc(var(--note-line) - 1px), var(--rule) var(--note-line));
  background-attachment: local;
}
#notes .rich-edit :is(ul, ol, p, div, h3, h4) { margin-top: 0; margin-bottom: 0; line-height: var(--note-line); }
#notes .rich-edit:hover { background-color: color-mix(in srgb, var(--text) var(--line-hover), transparent); }
#notes .rich-edit:focus, #notes .rich-raw:focus { background-color: color-mix(in srgb, var(--text) var(--line-lit), transparent); }

/* Every ⠿ handle (Day Planner items and tasks, and the list rows on Tasks,
   Lists, Find Things, Brain Dump, Contacts, History, Bin and Settings) is
   hidden until the pointer is anywhere on its line, or while it's selected,
   dragged or has the keyboard. Touch screens, which have no hover, keep it faint. */
@media (hover: hover) {
  .line .drag-grip, li[data-id] :is(.drag-handle, .kit-grip), .pin-list .drag-handle { opacity: 0 !important; transition: opacity .12s; }
  .line:hover .drag-grip, .line .drag-grip:focus-visible, .line.dragging .drag-grip, body.is-dragging .line .drag-grip,
  li[data-id]:hover :is(.drag-handle, .kit-grip), li[data-id] :is(.drag-handle, .kit-grip):focus-visible, li[data-id].dragging :is(.drag-handle, .kit-grip),
  .pin-list li:hover .drag-handle, .pin-list .drag-handle:focus-visible, .pin-list li.dragging .drag-handle { opacity: .8 !important; }
  .line.selected .drag-grip, li[data-id].selected :is(.drag-handle, .kit-grip) { opacity: 1 !important; }
}
@media (hover: none) { .line .drag-grip { opacity: .35; } }

/* Laptop top bar: search is just a magnifying glass (no border or background).
   Clicking it opens a search box that makes room for itself: the areas that
   no longer fit move into More while you search (the bar refits as it grows),
   and clicking away or Esc closes it again. */
.top-search { flex: none; width: 40px; height: 40px; position: relative; min-width: 0; transition: width .18s ease; }
.top-search:focus-within { width: 320px; }
.top-search .search-wrap { position: absolute; inset: 0; width: auto; height: 40px; flex: none; }
.top-search .search-wrap > .search { height: 40px; width: 100%; padding: 0 12px 0 36px !important; border-radius: 20px !important; font-size: .9rem; cursor: pointer; }
.top-search:not(:focus-within) .search-wrap > .search { background: transparent !important; border-color: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
.top-search:not(:focus-within) .search-wrap > .search:hover { background: var(--glass-hover) !important; }
.top-search:not(:focus-within) .search-wrap > .search::placeholder { color: transparent; }
.top-search:not(:focus-within) .search-x { display: none; }
.top-search:focus-within .search-wrap > .search { cursor: text; }
.top-search-icon { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; z-index: 2; pointer-events: none; color: var(--text); opacity: .8; }

/* Day Planner Tasks: "New task" is only a faint hint of where to write next. */
.planner .pile-new .new-task::placeholder { color: color-mix(in srgb, var(--text) 22%, transparent) !important; opacity: 1; }

/* "Add note" under a line you're writing or editing (Tasks, the Day Planner's
   schedule and tasks): small capitals, italic and faint, like a pencilled hint. */
.add-note { display: block; width: 100%; box-sizing: border-box; min-height: 1.5em; margin: 0; padding: 2px 6px; border: 0 !important; border-radius: 0; background: transparent; box-shadow: none; resize: none; overflow: hidden; font-family: var(--font); font-size: .85rem; line-height: 1.4; color: var(--text); field-sizing: content; }
.add-note:focus { outline: none; background: color-mix(in srgb, var(--text) var(--line-lit), transparent); }
.add-note::placeholder { font-style: italic; font-variant: small-caps; letter-spacing: .06em; font-size: 1.05em; color: color-mix(in srgb, var(--text) 30%, transparent) !important; opacity: 1; }
/* Day Planner: the note line sits under the title, only while you're on that line. */
.line .content > .add-note { flex-basis: 100%; margin: -2px 0 4px; }
.pile-new .content { flex-wrap: wrap; }
.pile-new:not(.open) #dump-note:placeholder-shown { display: none; }
/* Pills under the Day Planner's New task line while you're on it (like .edit-pills). */
.pile-new .new-pills { display: none; flex-basis: 100%; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px 6px; }
.pile-new.open .new-pills { display: flex; }
.new-pills .pill-more { color: var(--text); }

/* Tasks page: the new-task line is ruled paper, not a box. */
.task-add-line, .task-add-line:focus-within { border: 0; border-bottom: 1px solid var(--glass-border); border-radius: 0; background: transparent; margin: 0; }
.task-add-line:focus-within { background: color-mix(in srgb, var(--text) var(--line-lit), transparent); }
.task-entry.is-empty { display: block; min-height: 0; }
.task-entry.is-empty .entry-plus { display: none; }
.task-entry.is-empty:not(.open) .task-add-line { display: flex; }
/* Tasks page ruled lines start where the text starts, not under the tick box. */
.task-add-line, .task-add-line:focus-within { border-bottom: 0; position: relative; }
.task-add-line::after { content: ''; position: absolute; left: 52px; right: 0; bottom: 0; height: 1px; background: var(--glass-border); }

/* Tasks page as ruled paper, with or without tasks: no cards, a line under
   each task starting where its text starts, a little light under the pointer.
   The new-task line has a faint empty tick box where a task's tick box is,
   and its text starts where a task's text does. */
.task-list > li[data-task] { background: transparent; border: 0; border-radius: 0; box-shadow: none; position: relative; }
.task-list > li[data-task]::after { content: ''; position: absolute; left: 74px; right: 0; bottom: 0; height: 1px; background: var(--glass-border); pointer-events: none; }
.task-list > li[data-task]:hover, .task-list > li[data-task]:focus-within { background-color: color-mix(in srgb, var(--text) var(--line-hover), transparent); border-color: transparent; }
/* Editing a task's name lights its whole line once, as the new-task line does (not the line plus the name's box). */
.task-list > li[data-task]:has(> .task-title:focus) { background-color: color-mix(in srgb, var(--text) var(--line-lit), transparent); }
.task-list > li[data-task] > .task-title:focus { background: transparent; }
.task-list > li.group-top, .task-list > li.group-kid, .task-list > li.group-kid.group-end { border-radius: 0; }
.task-list { gap: 0; }
.task-add-line, .task-add-line:focus-within { padding-left: 40px; gap: 8px; }
.task-add-line .add-mark, .task-entry.is-empty .add-mark { width: 18px; height: 18px; flex: none; box-sizing: border-box; border: 1.5px solid color-mix(in srgb, var(--text) 55%, transparent); border-radius: 5px; opacity: .35; }
.task-add-line::after { left: 74px; }
/* (ruled Tasks: the note and "Add note" start where the title's text starts) */
.task-list .item-sub { margin-left: 67px; max-width: calc(100% - 67px); }
.task-list > li[data-task]::after, .task-add-line::after { left: 73px; }
/* Compact spacing: a task being edited still gets its pills on the line below. */
#main[data-density="tight"] .task-list > li.pills-open { flex-wrap: wrap; }
.task-list > li.pills-open > .edit-pills { order: 9; }
.task-list .item-sub { margin-left: 65px; max-width: calc(100% - 65px); }
.task-list .edit-pills .pill-note { margin-left: 1px; flex-basis: calc(100% - 1px); }
@media (max-width: 700px) { .task-list .edit-pills .pill-note { margin-left: 49px; flex-basis: calc(100% - 49px); } }

/* "New task" is a hint, never mistaken for a task's name: italic and very faint
   (the Tasks page and the Day Planner's Tasks). */
.task-add-line .new-task-line::placeholder, .planner .pile-new .new-task::placeholder { font-style: italic; color: color-mix(in srgb, var(--text) 22%, transparent) !important; opacity: 1; }

/* Tasks page: an open task and its panel are one box across the whole row, its
   tick box and handle (and the margin) inside it, its edges and corners inside
   the page (phones: the screen's full width, below). Closed again, it's back to a
   plain ruled line. */
.task-list > li[data-task]:has(+ li.task-details) { background: transparent !important; z-index: 0; }
.task-list > li[data-task]:has(+ li.task-details)::before { content: ''; position: absolute; z-index: -1; left: 0; right: 0; top: 0; bottom: 0; border: 1px solid var(--glass-border); border-bottom: 0; border-radius: 14px 14px 0 0; background: var(--glass-track); pointer-events: none; }
.task-list > li[data-task]:has(+ li.task-details)::after { display: none; }
.task-list > li.task-details { margin: 0 0 10px 0 !important; border-top: 0; border-radius: 0 0 14px 14px; }

/* Day Planner: done items are faint the same way whether they take one line or
   several (the whole item fades, tick box included). */
.line.has-item.done > .content { opacity: .55; }

/* Day Planner housekeeping: a quiet footer of text links under everything,
   across the whole page. */
.day-housekeeping { margin-top: 40px; padding: 12px 4px 0; border-top: 0; /* no rule: under Notes it read as a stray ruled line */ font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
/* After every row of the layout (a named area would put it in one column). */
.planner.docked > .day-housekeeping { grid-area: auto; grid-column: 1 / -1; grid-row: 99; }
.day-housekeeping .hint { flex-basis: 100%; margin: 0; }

/* Tasks: the lists (Task Dump, Now, Next, Later, Done) as plain text tabs with
   an underline, like the Brain Dump filters, not pills like the main menu. */
#task-views { background: none; padding: 0; gap: 2px; border-radius: 0; border-bottom: 1px solid var(--glass-border); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
#task-views button { flex: none !important; background: none !important; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important; padding: 8px 12px 6px !important; font-size: .95rem; color: var(--muted); white-space: nowrap; }
#task-views button:not(.flash) { box-shadow: none !important; } /* .flash: the pulse when it's chosen (slide.js) */
#task-views button[aria-pressed="true"] { color: var(--text); border-bottom-color: currentColor !important; font-weight: 600; }
#task-views button:hover { color: var(--text); }
/* Tasks' sections (tasksections.js): an icon before the name; a coloured one looks like Batch Book's books (a faint
   underline in its colour, chosen: a wash of it and the full colour). */
#task-views button { display: inline-flex; align-items: center; gap: 6px; }
#task-views button.sec-coloured { border-bottom-color: color-mix(in srgb, var(--sec) 35%, transparent) !important; }
#task-views button.sec-coloured[aria-pressed="true"] { background: color-mix(in srgb, var(--sec) 16%, transparent) !important; border-radius: 8px 8px 0 0 !important; border-bottom-color: var(--sec) !important; }
#task-views .task-sections-edit { letter-spacing: .1em; font-size: 1rem; }
.sec-ico { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sec-shade { fill: currentColor; fill-opacity: .2; stroke: none; }
.sec-emo { flex: none; font-size: .95em; line-height: 1; }
[style*="--sec"] > .sec-ico { color: color-mix(in srgb, var(--sec) 75%, var(--text)); }
.tasks-head { align-items: flex-end; }
.tasks-head #task-views { flex: 1 1 auto !important; max-width: none; }

/* Day Planner schedule: while editing an item, "Add note" and the pills start
   where the item's text starts (after the handle and tick box), as in Tasks. */
.line .content > .edit-pills { margin-left: 56px !important; flex-basis: calc(100% - 56px); }
.line .content > .edit-pills .pill-note { margin-left: 0; flex-basis: 100%; }

/* Link pull-down (📞 📝 ⚠️ in a note) and the chip menu follow the Glass and
   Dark themes: the theme's menu colour with its own fixed light text, so it
   stays readable on every Day Planner paper. The Light theme keeps the white card. */
:root:not([data-theme="light"]) :is(.ref-picker, .ref-menu) {
  --text: #e8eefc;
  --muted: rgba(232, 238, 252, .62);
  --accent: #78c8ff;
  --glass-border: rgba(255, 255, 255, .14);
  --glass-track: rgba(255, 255, 255, .06);
  --active-bg: rgba(100, 180, 255, .24);
  --active-border: rgba(100, 180, 255, .5);
  background: var(--menu-bg, #1a2444);
  color: var(--text);
  border-color: rgba(255, 255, 255, .16);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
:root:not([data-theme="light"]) .ref-picker .ref-q { background: rgba(255, 255, 255, .07); color: var(--text); border-color: rgba(255, 255, 255, .16); }
:root:not([data-theme="light"]) .ref-picker .ref-q::placeholder { color: rgba(232, 238, 252, .45); }
:root:not([data-theme="light"]) :is(.ref-picker, .ref-menu) button { color: var(--text); background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
:root:not([data-theme="light"]) .ref-picker .ref-go { background: #2f6fe0; color: #fff; border-color: #2f6fe0; }
:root:not([data-theme="light"]) .ref-list { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }

/* Day Planner Tasks: like the Tasks page, an open task and its panel are one
   rounded box that starts where the task's text starts (just right of the red
   line); the tick box and handle stay in the margin. */
.pile-paper .line.has-item:has(+ .item-details) { border-bottom: 0; }
.pile-paper .line.has-item:has(+ .item-details) > .content { margin-left: 8px; border: 1px solid var(--glass-border); border-bottom: 0; border-radius: 14px 14px 0 0; background: var(--glass-track); }
.pile-paper .line.has-item + .item-details { position: relative; margin: 0 0 10px 72px; padding: 10px 12px 12px; border: 1px solid var(--glass-border); border-top: 0; border-radius: 0 0 14px 14px; background: var(--glass-track); }
/* The red margin line carries on down beside the panel (and its gap below). */
.pile-paper .line.has-item + .item-details::before { content: ''; position: absolute; left: -11px; top: 0; bottom: -11px; width: 2px; background: var(--margin-rule); pointer-events: none; }

/* Dropdowns (js/dropdown.js): the app's own list instead of the browser's.
   Glass, rounded, joined to the pill or box it hangs from: that side of the
   pill goes square while it's open, the list carries on from it. */
.dd-menu {
  position: fixed; z-index: 1000; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px; min-width: 120px; max-width: min(360px, calc(100vw - 16px));
  background: color-mix(in srgb, var(--menu-bg) 80%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--active-border); border-top: 0; border-radius: 0 0 14px 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
  font-family: var(--font); font-size: .9rem; color: var(--text);
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 25%, transparent) transparent;
}
.dd-menu.in-dialog { position: absolute; }
.dd-menu.wider { border-top-right-radius: 14px; border-top: 1px solid var(--active-border); }
.dd-menu.up { border-top: 1px solid var(--active-border); border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: 0 -14px 34px rgba(0, 0, 0, .3); }
.dd-menu.up.wider { border-bottom: 1px solid var(--active-border); border-bottom-right-radius: 14px; }
.dd-opt { padding: 7px 12px 7px 28px; border-radius: 10px; cursor: pointer; white-space: nowrap; position: relative; line-height: 1.3; }
.dd-opt.active { background: var(--glass-hover, color-mix(in srgb, var(--text) 10%, transparent)); }
.dd-opt[aria-selected="true"] { color: var(--accent, var(--text)); font-weight: 600; }
.dd-opt[aria-selected="true"]::before { content: '✓'; position: absolute; left: 10px; }
.dd-opt[aria-disabled="true"] { opacity: .45; cursor: default; }
.dd-group { padding: 8px 12px 3px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
/* The pill or box it hangs from, while open. */
.dd-open { border-color: var(--active-border) !important; }
.dd-open:not(.dd-up) { border-bottom-color: transparent !important; }
.dd-open.dd-up { border-top-color: transparent !important; }
select.dd-open, .dd-open > select { outline: none; }

/* Day focus and Energy side by side only while both texts fit (planner.js alignHeads). */
.focus-row.stacked .energy { flex-basis: 100%; }
/* Achievements (👁 Layout): its own line under Day focus and Energy, labelled the
   same way, in the page's ink. Day focus and Energy can each be hidden (👁 Layout). */
.focus-row .achieve { flex: 1 1 100%; display: flex; align-items: center; gap: 12px; min-width: 0; }
.focus-row .achieve[hidden] { display: none; }
.planner.docked .focus-row .achieve { grid-column: 1 / -1; padding-left: 4px; }
.achieve .hand-label { flex: none; color: var(--ink); }
.achieve-text { font-weight: 700; font-size: 1.15rem; color: var(--ink); padding: 4px 6px; }
#main[data-area="planner"]:not([data-layout-day-rel]) .day-head > .day-rel, #main[data-area="planner"]:not([data-layout-focus]) .focus-row > .focus, #main[data-area="planner"]:not([data-layout-energy]) .focus-row > .energy { display: none; }
/* Nudges in the Day Planner's 👁 menu: the evening section's name sits under its switch. */
.nudge-opts .nudge-text { margin: 0 0 4px 26px; width: calc(100% - 26px); font-size: .85rem; padding: 3px 8px; }
/* "Keep this device's view separate": last in every 👁 menu, set apart by a line. */
.view-separate { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--vm-line); }

/* The ⋯ (Details) button at the end of a line, like the ⠿ handle: hidden until
   the pointer is anywhere on the line (or you're in it, or its panel is open).
   Phones hide it anyway (body.pills-only). */
@media (hover: hover) {
  :is(.line, li[data-id]) .more:not([aria-expanded="true"]) { opacity: 0 !important; transition: opacity .12s; }
  :is(.line, li[data-id]):hover .more, :is(.line, li[data-id]):focus-within .more, :is(.line, li[data-id]) .more:focus-visible { opacity: 1 !important; }
}

/* Find Things: each thing's grab handle is the Find Things cube, always
   showing (it's the thing's icon as well as its handle). */
.item-list .drag-handle.thing-grip { opacity: .6 !important; }
.item-list .drag-handle.thing-grip .icon { width: 17px; height: 17px; }
.item-list li:hover .drag-handle.thing-grip, .item-list li.dragging .drag-handle.thing-grip { opacity: .9 !important; }
.item-list li.selected .drag-handle.thing-grip { opacity: 1 !important; color: var(--accent); }

/* Find Things: an open thing and its panel are one rounded box (like Tasks):
   Quantity and Tags side by side as proper fields, then Note and Attach,
   then Close on the left and Delete on the right. */
.item-list li[data-id]:has(+ li.thing-panel) { background: var(--glass-track); border: 1px solid var(--glass-border); border-bottom: 0; border-radius: 14px 14px 0 0; }
.item-list li.thing-panel { display: block; margin: -6px 0 4px; padding: 6px 14px 14px 36px; border: 1px solid var(--glass-border); border-top: 0; border-radius: 0 0 14px 14px; background: var(--glass-track); }
.item-list li.thing-panel:hover { background: var(--glass-track); }
.thing-panel .detail-grid { grid-template-columns: 7rem minmax(0, 1fr); gap: 12px; }
.thing-panel .detail-grid .wide { grid-column: 1 / -1; }
.thing-panel label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.item-list .thing-panel input { background: var(--glass-track); border: 1px solid var(--glass-border); padding: 7px 10px; font-size: .95rem; color: var(--text); }
.item-list .thing-panel input:focus { border-color: var(--active-border); }
.thing-panel .tag-box { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 36px; box-sizing: border-box; padding: 3px 6px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: var(--glass-track); }
.thing-panel .tag-box:focus-within { border-color: var(--active-border); }
.thing-panel .tag-edit .tag-list { margin: 0; }
.item-list .thing-panel .tag-box .tag-add { flex: 1 1 8em; width: auto; min-width: 6em; border: 0; background: transparent; padding: 4px; }
.thing-panel .detail-actions { margin-top: 4px; }
@media (max-width: 560px) { .item-list li.thing-panel { padding-left: 14px; } .thing-panel .detail-grid { grid-template-columns: 5.5rem minmax(0, 1fr); } }

/* Brain Dump cards: the main actions as buttons, everything else behind ⋯
   at the end of the row (so a narrow card doesn't turn into a heap of
   buttons); "3 h ago" stays on one line. */
.thought-head > .muted { white-space: nowrap; }
.thought-actions { align-items: center; }
.note-more > summary { padding: 1px 10px; font-size: 1rem; line-height: 1.3; letter-spacing: .05em; }
.note-more .menu { left: auto; right: 0; min-width: 220px; width: max-content; max-width: calc(100vw - 16px); }
.note-more .menu button { display: flex; align-items: center; justify-content: flex-start; text-align: left; white-space: nowrap; gap: 8px; width: 100%; padding: 7px 12px; border: 0; background: transparent; font-size: .85rem; }
.note-more .menu button:hover { background: var(--glass-hover); }
/* The ☆ sits in the card's top-right corner, so the head row has room. */
.thought { position: relative; }
.thought-head { flex-wrap: wrap; row-gap: 4px; gap: 6px; padding-right: 26px; }
.thought-head .pin { position: absolute; top: 9px; right: 8px; }
.thought-head .kind-select { width: auto; flex: none; field-sizing: content; padding-top: 3px; padding-bottom: 3px; padding-left: 10px; }

/* Tasks page: the New task line follows the last task like any other line
   (no extra gap under the list). */
.task-list:has(+ #task-entry) { margin-bottom: 0; }
#task-entry { margin-top: 0; }

/* Day Planner Tasks: the tick box is in the margin, so an item's Add note and
   pills start where its text starts, like the New task line's (not indented
   like the schedule's, which have the tick box in the line). */
.pile-paper .line .content > .edit-pills { margin-left: 6px !important; flex-basis: calc(100% - 6px); }

/* Day Planner Tasks: "Bring in from tasks" is quiet text at the right end of
   the heading, a button only under the pointer; the hint sits right under the lines. */
.pile h2 { display: flex; align-items: baseline; gap: 8px; }
.pile h2 .bring-link { margin-left: auto; align-self: center; padding: 3px 10px; border: 1px solid transparent; border-radius: 999px; background: transparent; box-shadow: none; font-family: var(--font); font-weight: 500; font-size: .82rem; color: var(--muted); white-space: nowrap; cursor: pointer; }
.pile h2 .bring-link:hover, .pile h2 .bring-link:focus-visible { color: var(--text); background: var(--glass-hover, var(--glass-track)); border-color: var(--glass-border); outline: none; }
.pile > .hint { margin-top: 8px; }

/* Notes under tasks (Tasks page and the Day Planner): on their own line under
   the pills. Tasks page in tight spacing: just a 📝 beside the pills. */
.task-list .item-sub .task-note { flex-basis: 100%; }
.planner .item-sub > .item-note { flex-basis: 100%; }
.task-note .note-icon { display: none; }
#main[data-density="tight"] .task-list .item-sub .task-note { flex: none; }
#main[data-density="tight"] .task-note .note-icon { display: inline-block; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; font-size: .85rem; opacity: .8; cursor: pointer; }
#main[data-density="tight"] .task-note :is(.note-medium, .note-loose, .note-more) { display: none !important; }

/* Day Planner notes by spacing, like Tasks: tight = just 📝 on the item's
   line; medium = one line under it; loose = up to three lines. */
.note-tag { display: none; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; cursor: pointer; }
#main[data-density="tight"] .planner .note-tag { display: inline-block; }
#main[data-density="tight"] .planner .item-sub > .plan-note { display: none; }
.planner .plan-note { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
#main[data-density="loose"] .planner .plan-note { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
#main[data-density="tight"] .planner .item-sub:not(:has(> :not(.plan-note))) { display: none; }

/* Brain Dump: the text of saved notes (not while writing) is a little smaller
   in every spacing; compact smallest, medium and expanded a little bigger. */
#main .thought .thought-body { font-size: .95rem; }
#main[data-density="tight"] .thought .thought-body > .thought-flat,
#main[data-density="tight"] .thought .thought-title { font-size: .8rem; }

/* Day Planner ‹ ›: drawn chevrons, so they sit exactly in the middle of their buttons. */
.day-nav .day-step { display: inline-grid; place-items: center; padding: 6px 12px; }
.day-nav .day-step .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.pile h2 .bring-link .bring-arrow { color: var(--energy-ink, #4caf7a); font-weight: 800; font-size: 1.1em; }
.day-nav :is(.day-step, .cal-icon) { align-self: stretch; }

/* Hints (the grey help text under lists and boxes) only when Settings → Show hints is on. */
html:not(.show-hints) #main:not([data-area="settings"]) .hint { display: none; }
/* "Bring in from tasks": a small pill, always, faintly green. */
.pile h2 .bring-link { color: var(--text); border-color: color-mix(in srgb, var(--energy-ink, #4caf7a) 35%, transparent); background: color-mix(in srgb, var(--energy-ink, #4caf7a) 10%, transparent); }
.pile h2 .bring-link:hover, .pile h2 .bring-link:focus-visible { border-color: color-mix(in srgb, var(--energy-ink, #4caf7a) 60%, transparent); background: color-mix(in srgb, var(--energy-ink, #4caf7a) 20%, transparent); }

/* Very wide screens: the day and date on the left; Day focus and Energy on two
   lines to the right of it, centred on the date line (labels lined up as on a
   phone, planner.js alignHeads). */
@media (min-width: 1400px) {
  .planner.docked > .day-head { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 56px; align-items: center; }
  .planner.docked > .day-head > .day-title { grid-column: 1; grid-row: 1; }
  .planner.docked > .day-head > :is(.day-rel, .down-day, .did-things) { grid-column: 1; }
  .planner.docked > .day-head > .focus-row { grid-column: 2; grid-row: 1; align-self: center; display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 6px; margin: 0; }
  .planner.docked > .day-head > .focus-row .energy { padding-left: 4px; }
  /* Google Calendar to the right of the date, Day focus and Energy, above Tasks, while
     each event fits on one line (planner.js: gcal-beside); otherwise its own row. */
  .planner.docked.gcal-beside:not(.tasks-first) { grid-template-areas: "nav nav" "head gcal" "down down" "carry carry" "stitle side" "paper side" "pile side" "hk side"; }
  .planner.docked.gcal-beside > .gcal { align-self: center; margin: 0; }
}

/* Brain Dump: search and kinds stick under the top bar while you scroll the
   notes (same place as Find Things' search); stuck, they get a glass
   background and a soft shadow underneath. */
.dump-bar { position: sticky; top: calc(var(--safe-top) + 62px); z-index: 5; margin: 0 -10px 8px; padding: 0 10px 2px; border-radius: 0 0 16px 16px; transition: box-shadow .15s, background-color .15s; }
.dump-bar-mark { height: 1px; margin-bottom: -1px; }
.dump-bar.stuck { background: var(--glass-strong); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 10px 18px -10px rgba(0, 0, 0, .55); }
@media (min-width: 768px) { .dump-bar { top: 62px; } } /* tucked just under the top bar, no gap */
@media (max-width: 767px) { .dump-bar { top: 0; } }

/* Brain Dump, Look → Multicolour: each note's own soft colour over the glass (colours.js). */
#main[data-shade="colour"] .thought[style*="--tint"] {
  background: linear-gradient(135deg, color-mix(in srgb, var(--tint) 17%, transparent), color-mix(in srgb, var(--tint) 5%, transparent) 70%), var(--glass);
  border-color: color-mix(in srgb, var(--tint) 32%, var(--glass-border));
}

/* Colour swatches and the colour picker (colours.js). */
.swatch { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--sw, transparent); border: 1px solid color-mix(in srgb, var(--text) 35%, transparent); vertical-align: -2px; }
/* Words, not emoji: the app's own font, normal spacing. */
.pill-menu.word-menu button { font-family: inherit; letter-spacing: normal; padding: 4px 12px; font-size: .88rem; }
.pill-menu.colour-menu { flex-wrap: wrap; width: 232px; gap: 4px; padding: 6px; border-radius: 16px; }
.pill-menu.colour-menu button { padding: 5px; line-height: 0; }
.pill-menu.colour-menu .swatch { width: 20px; height: 20px; }
.pill-menu.colour-menu button[aria-checked="true"] .swatch { box-shadow: 0 0 0 2px var(--text); }
.md-colour { display: inline-grid; place-items: center; }

/* Brain Dump, Look → Alternate shading: every other note a touch darker (or lighter). */
#main[data-shade="alt"] .thought-list > .thought:nth-child(even) { background: linear-gradient(color-mix(in srgb, var(--text) 7%, transparent), color-mix(in srgb, var(--text) 7%, transparent)), var(--glass); }

/* The note's colour dot in its heading: Loose spacing only, showing under the pointer. */
.note-dot { display: none; padding: 2px 4px; background: none; border: 0; box-shadow: none; opacity: 0; transition: opacity .12s; cursor: pointer; }
#main[data-density="loose"] .note-dot { display: inline-flex; align-items: center; }
.thought:hover .note-dot, .note-dot:focus-visible { opacity: 1; }
@media (hover: none) { .note-dot { opacity: .7; } }
/* Full-screen writing: a note in Multicolour keeps its colour as the background. */
#main[data-shade="colour"] .thought[style*="--tint"] .rich.is-full { background-image: linear-gradient(135deg, color-mix(in srgb, var(--tint) 20%, transparent), color-mix(in srgb, var(--tint) 9%, transparent)); }

/* Look → Alternate shading on ruled paper: every other line a touch darker
   (or lighter), as an inset shade so the hover and writing shades still show. */
#main[data-shade="alt"] .task-list > li[data-task]:nth-child(even of li[data-task]),
#main[data-shade="alt"] .planner .line.alt-row { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--text) 4.5%, transparent); }
#main[data-shade="alt"] #notes :is(.rich-edit, .rich-raw) {
  background-image:
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--note-line) - 1px), var(--rule) calc(var(--note-line) - 1px), var(--rule) var(--note-line)),
    repeating-linear-gradient(to bottom, transparent 0, transparent var(--note-line), color-mix(in srgb, var(--text) 4.5%, transparent) var(--note-line), color-mix(in srgb, var(--text) 4.5%, transparent) calc(var(--note-line) * 2));
}

/* Find Things, Look → Multicolour: box cards, the open box and each thing in
   its own soft colour (the thing's cube takes it too); Alternate shading:
   every other box card and thing row a touch darker. */
#main[data-shade="colour"] .box-card[style*="--tint"],
#main[data-shade="colour"] .box-page[style*="--tint"] {
  background: linear-gradient(135deg, color-mix(in srgb, var(--tint) 17%, transparent), color-mix(in srgb, var(--tint) 5%, transparent) 70%), var(--glass);
  border-color: color-mix(in srgb, var(--tint) 32%, var(--glass-border));
}
#main[data-shade="colour"] .item-list li[style*="--tint"] { background: color-mix(in srgb, var(--tint) 9%, transparent); }
#main[data-shade="colour"] .item-list li[style*="--tint"] .drag-handle.thing-grip { color: var(--tint); opacity: .95 !important; }
#main[data-shade="alt"] .box-card[data-box]:nth-child(even of .box-card[data-box]),
#main[data-shade="alt"] .item-list > li[data-id]:nth-child(even of li[data-id]) { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--text) 5%, transparent); }
.box-page-head .box-colour { display: inline-flex; opacity: 1; padding: 4px; }
.box-page-head .box-colour .swatch { width: 18px; height: 18px; }
.thing-colour { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; font-size: .9rem; }

/* Lists, Look → Multicolour: each list in its own colour: its card washed in
   it, and in the open list a coloured strip down the left of the items.
   Alternate shading: every other item (and card) a touch darker. */
#main[data-shade="colour"] .list-card[style*="--tint"] {
  background: linear-gradient(135deg, color-mix(in srgb, var(--tint) 17%, transparent), color-mix(in srgb, var(--tint) 5%, transparent) 70%), var(--glass);
  border-color: color-mix(in srgb, var(--tint) 32%, var(--glass-border)); border-top-color: var(--c);
}
#main[data-shade="colour"] .checklist[style*="--tint"] > li[data-id] { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--tint) 75%, transparent); background: color-mix(in srgb, var(--tint) 5%, transparent); }
#main[data-shade="alt"] .checklist:not(.task-list) > li[data-id]:nth-child(even of li[data-id]),
#main[data-shade="alt"] .list-card-li:nth-child(even of .list-card-li) > .list-card { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--text) 5%, transparent); }
.project-head .list-colour { display: inline-flex; opacity: 1; padding: 4px; }
.project-head .list-colour .swatch { width: 18px; height: 18px; }

/* Contacts: cards in a grid, never full-width panels. Spacing: tight = small
   cards with just the name and when; medium = the usual card; loose = roomier
   cards. Look → Multicolour: each contact in its own colour (set from the
   selection bar); Alternate shading: every other card. */
.c-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; align-items: stretch; }
.c-list > :is(.list-head, .empty) { grid-column: 1 / -1; }
.c-card { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 6px; padding: 12px 14px; }
.c-card .c-main { flex: none; }
.c-card .c-when { margin-left: 0; margin-top: auto; }
.c-card { min-width: 0; }
.c-card :is(.c-name, .c-about) { overflow-wrap: anywhere; }
.c-card .c-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-card .c-details { min-width: 0; }
.c-card .c-details .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#main[data-density="tight"] .c-list { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
#main[data-density="tight"] .c-card { padding: 8px 12px; gap: 2px; border-radius: 14px; }
#main[data-density="tight"] .c-card :is(.c-about, .c-details, .what-was-this) { display: none; }
#main[data-density="tight"] .c-card .c-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#main[data-density="loose"] .c-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
#main[data-density="loose"] .c-card { padding: 16px 18px; gap: 10px; border-radius: 22px; }
#main[data-density="loose"] .c-card .c-name { font-size: 1.1rem; }
#main[data-shade="colour"] .c-card[style*="--tint"] {
  background: linear-gradient(135deg, color-mix(in srgb, var(--tint) 17%, transparent), color-mix(in srgb, var(--tint) 5%, transparent) 70%), var(--glass);
  border-color: color-mix(in srgb, var(--tint) 32%, var(--glass-border));
}
#main[data-shade="alt"] .c-card:nth-child(even of .c-card) { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--text) 5%, transparent); }
@media (max-width: 560px) {
  .c-list, #main[data-density="tight"] .c-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-card .c-details { flex-wrap: wrap; }
  #main[data-density="loose"] .c-list { grid-template-columns: minmax(0, 1fr); }
}

/* Tasks on a phone: all five list tabs fit beside 👁 and ⋯ (smaller, closer);
   if renamed ones still don't, the row fades at the edge to show it scrolls. */
@media (max-width: 420px) {
  #task-views button { font-size: .85rem; padding: 8px 5px 6px !important; }
}
#task-views.overflows { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }

/* Settings → Sync: what this device knows about being in step. */
.sync-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 6px 0 12px; font-size: .9rem; }
.sync-facts dt { color: var(--muted); }
.sync-facts dd { margin: 0; }
.sync-top { margin-top: -6px; }
#main .sync-code-hint { display: block; }
/* A file whose details have synced but the file itself hasn't yet. */
.att.att-arriving { position: relative; opacity: .7; }
.att-wait { position: absolute; left: 4px; bottom: 4px; z-index: 1; padding: 1px 6px; border-radius: 999px; font-size: .68rem; background: color-mix(in srgb, var(--bg, #000) 70%, transparent); color: var(--text); pointer-events: none; white-space: nowrap; }
.sync-tick { color: #4cc27a; font-weight: 800; }
/* A small dot that pulses each time the connection is checked. */
.sync-pulse { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #4cc27a; vertical-align: 1px; animation: sync-pulse 1.2s ease-out; }
@keyframes sync-pulse { from { box-shadow: 0 0 0 0 rgba(76, 194, 122, .7); } to { box-shadow: 0 0 0 9px rgba(76, 194, 122, 0); } }

/* Comments on a task (comments.js): a dated record in the task's panel only. */
.comments { margin: 4px 0 10px; }
.comments .field-label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.comment-list { list-style: none; margin: 0 0 4px; padding: 0; }
.comment { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
.comment-when { font-size: .78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.comment-body { min-width: 0; font-size: .9rem; line-height: 1.4; overflow-wrap: anywhere; }
.comment-body > :first-child { margin-top: 0; }
.comment-body > :last-child { margin-bottom: 0; }
.comment-more { background: none; border: 0; padding: 0 4px; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; opacity: .6; }
.comment-more:hover, .comment-more:focus-visible { opacity: 1; }
.comment-add, .comment-edit { display: block; width: 100%; box-sizing: border-box; min-height: 1.6em; margin: 0; padding: 3px 6px; border: 0 !important; border-radius: 0; background: transparent; box-shadow: none; resize: none; overflow: hidden; font-family: var(--font); font-size: .9rem; line-height: 1.4; color: var(--text); field-sizing: content; border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent) !important; }
.comment-add::placeholder { color: var(--muted); opacity: .8; }
.comment-add:focus, .comment-edit:focus { outline: none; background: color-mix(in srgb, var(--text) var(--line-lit), transparent); }
@media (max-width: 700px) { .comment { grid-template-columns: 1fr auto; } .comment-when { grid-column: 1; } .comment-body { grid-column: 1 / -1; grid-row: 2; } .comment-more { grid-column: 2; grid-row: 1; } }
.comment-marks { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.comment-mark { font-size: .78rem; color: var(--muted); text-decoration: none; }
a.comment-mark:hover { color: var(--text); }
.comment-mark.due { color: var(--accent, #f5a66a); }
.comment-body .att-row { margin-top: 4px; }
.comment-pending { font-size: .78rem; padding: 2px 6px; }

/* Notes toolbar shows what's on (155): pressed formatting, size ends greyed. */
.md-bar [data-cmd][aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); }
.md-bar [data-size]:disabled { opacity: .35; cursor: default; }
/* Five text sizes: -# smaller, +# a bit bigger, # big (h3), #+ biggest. */
.rich-edit [data-sz="m"], .thought-body [data-sz="m"], .note-body [data-sz="m"], .item-note [data-sz="m"] { font-size: 1.15em; font-weight: 600; }
.rich-edit [data-sz="xl"], .thought-body [data-sz="xl"], .note-body [data-sz="xl"], .item-note [data-sz="xl"] { font-size: 1.7em; font-weight: 700; line-height: 1.2; margin: .3em 0 .15em; }
.file-drop-hint { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 999px; background: var(--glass); border: 2px dashed var(--active-border, var(--muted)); color: var(--text); font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 50; backdrop-filter: blur(12px); }
.file-drop-hint.show { opacity: 1; transform: translate(-50%, 0); }
/* A comment's ⋯ menu: words, so a plain vertical menu (not the ⚡ pill style). */
.pill-menu:is(.comment-menu, .list-menu) { flex-direction: column; align-items: stretch; gap: 2px; padding: 6px; border-radius: 16px; min-width: 170px; }
.pill-menu:is(.comment-menu, .list-menu) button { font-family: var(--font); letter-spacing: normal; white-space: nowrap; text-align: left; font-size: .9rem; line-height: 1.3; padding: 7px 12px; border-radius: 10px; border-color: transparent; background: transparent; }
.date-quick { display: flex; gap: 10px; margin-top: 2px; }
.date-quick .linklike { font-size: .8rem; padding: 0; }
/* Sub-tasks (174): attached to their task, a little smaller, with an arrow. */
.task-list > li.group-kid::before { content: "↳"; width: auto; background: none; top: .72em; bottom: auto; left: 38px; color: var(--muted); font-size: .9rem; line-height: 1; }
.task-list > li[data-depth="2"].group-kid::before { left: 66px; }
.task-list > li.group-kid .task-title { font-size: .92em; }
.task-list > li.group-kid.done .task-title { color: var(--muted); }
/* Spacing (176): Medium shows one line of the note; Expanded the whole note,
   dates in words and small pictures of attached photos. */
.loose-only { display: none; }
#main[data-density="loose"] .loose-only { display: inline; }
#main[data-density="loose"] .task-pics { display: flex; gap: 6px; flex-basis: 100%; margin-top: 4px; }
.task-pics button { padding: 0; border: 0; background: none; box-shadow: none; border-radius: 8px; line-height: 0; cursor: zoom-in; }
.task-pics img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--glass-border); }
.task-list > li[data-task] > .item-sub .chip:not(a):not(.kids), .task-list .pill-act { cursor: pointer; }

/* Task picker (taskpicker.js): search, then tasks grouped by list. */
.task-picker .tp-q { width: 100%; box-sizing: border-box; margin: 4px 0 8px; font-size: 16px; }
.task-picker .tp-list { max-height: min(55vh, 460px); overflow-y: auto; display: grid; gap: 2px; padding: 2px; }
.task-picker .tp-group { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 10px 4px 2px; }
.task-picker .tp-group:first-child { margin-top: 0; }
.task-picker .tp-row { display: flex; gap: 6px; align-items: baseline; text-align: left; width: 100%; padding: 8px 10px 8px calc(10px + var(--d, 0) * 20px); border-radius: 10px; border: 1px solid transparent; background: transparent; box-shadow: none; color: var(--text); font-size: .95rem; line-height: 1.3; }
.task-picker .tp-row:hover, .task-picker .tp-row.on { background: var(--glass-hover); border-color: var(--glass-border); }
.task-picker .tp-sub { color: var(--muted); }
.task-picker .tp-none { padding: 8px 10px; }
.task-picker { overflow-x: hidden; }
.task-picker .tp-list { overflow-x: hidden; }
.task-picker .tp-row { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; }
/* Day Planner Notes on ruled lines (185): every line, bullets included, exactly
   one rule high (the bullet's own font made list lines a pixel taller, so the
   text drifted off the lines). */
#notes .rich-edit li { line-height: var(--note-line); margin: 0; }
#notes .rich-edit li::marker { font-family: inherit; line-height: 1; }
/* A ⋯ menu with no room below opens above its button (dropdown.js installMenuFlip). */
.tool-menu .menu.up { top: auto; bottom: calc(100% + 8px); }

/* ---------- Themes: fonts (188) ----------
   data-fonts="plain" (Glass – Default, Dark, Light, Auto): notes, lists and
   the rest in the ordinary font; the handwriting stays only for the Day
   Planner's day title and its labels (--hand-keep). "fancy" (Glass – Fancy):
   handwriting everywhere it was. Papers with their own font keep it. */
:root { --hand-keep: "Segoe Print", "Bradley Hand", "Noteworthy", "Chalkboard SE", "Comic Sans MS", cursive; }
:root[data-fonts="plain"] { --hand: var(--font); }
.planner[data-paper="techie"] { --hand-keep: ui-monospace, "Cascadia Code", "SF Mono", Consolas, Menlo, monospace; }
.planner[data-paper="minimal"] { --hand-keep: system-ui, -apple-system, "Segoe UI", sans-serif; }
.day-title .weekday, .focus > span, .hand-label, .pile h2, .day-tasks h2, .day-notes h2, .schedule-title { font-family: var(--hand-keep); }
.planner[data-paper="techie"] .day-title .date { font-family: var(--hand-keep); }
/* Blue themes: the Schedule times (and the evening section's name beside them) keep the handwriting too, even with plain fonts. */
:root[data-theme="blue"] .planner :is(.line .margin, .margin-time, .line.section-label .content) { font-family: var(--hand-keep); }

/* The theme dropdown in Settings → Appearance: each row previews the theme. */
.theme-menu { position: relative; display: block; }
.theme-menu > summary { list-style: none; cursor: pointer; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--glass-border); background: var(--glass); }
.theme-menu > summary::-webkit-details-marker { display: none; }
.theme-menu > summary::after { content: "▾"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.theme-menu .theme-list { left: 0; right: 0; min-width: 0; gap: 2px; }
.theme-list button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; background: transparent; box-shadow: none; }
.theme-list button:hover, .theme-list button[aria-selected="true"] { background: var(--glass-hover); border-color: var(--glass-border); }
.theme-row { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; }
.theme-swatches { grid-row: 1 / 3; display: flex; }
.theme-swatches span { width: 18px; height: 34px; border: 1px solid rgba(255, 255, 255, .25); }
.theme-swatches span:first-child { border-radius: 8px 0 0 8px; }
.theme-swatches span:last-child { border-radius: 0 8px 8px 0; }
.theme-name { font-weight: 600; color: var(--text); }
.theme-sample { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-title { font-family: "Segoe Print", "Bradley Hand", "Noteworthy", "Chalkboard SE", "Comic Sans MS", cursive; font-weight: 700; color: var(--text); }
.theme-row[data-fonts="plain"] .theme-note-font { font-family: var(--font); }
.theme-row[data-fonts="fancy"] .theme-note-font { font-family: "Segoe Print", "Bradley Hand", "Noteworthy", "Chalkboard SE", "Comic Sans MS", cursive; }
.theme-menu .theme-list { background: var(--menu-bg, var(--glass-strong)); z-index: 40; }
.card:has(.theme-menu[open]) { position: relative; z-index: 5; }
/* Brain Dump: search, 👁 and ⋯ on one line that stays at the top (191). */
.dump-search-row { display: flex; align-items: center; gap: 6px; }
.dump-search-row .search { flex: 1; min-width: 0; width: auto; }
.dump-search-row > :not(.search) { flex: none; }
.dump-search-row > .search-wrap { flex: 1 1 auto; min-width: 0; }
.dump-search-row .search-wrap .search { width: 100%; }
.dump-search-row > .page-cog { margin-left: 0; }
/* Archive and ⋯ stay together at the right, wrapping as a pair on a phone. */
.thought-actions .note-end { display: flex; align-items: center; gap: 6px; margin-left: auto; }
/* A file dragged over an item spanning several slots outlines the whole item (192). */
/* 158: the New note box shows its toolbar only once you're writing in it (like
   the day's Notes); in full screen the toolbar always shows. */
#dump-body.rich:not(.in-use):not(.is-full) > .md-bar, #dump-body.rich:not(:focus-within):not(.is-full) > .md-bar { display: none; }
.rich.is-full > .md-bar { display: flex !important; }
/* Settings → Navigation: the grip on the left like everywhere else (193); a
   row that can't move keeps the same space so the icons line up. */
.pin-list li .grip-space { flex: 0 0 40px; }
/* Settings → Brain Dump types: grips hidden until you hover the row, like every other list. */
@media (hover: hover) {
  .types-list .drag-handle { opacity: 0 !important; transition: opacity .12s; }
  .types-list li:hover .drag-handle, .types-list .drag-handle:focus-visible, .types-list li.dragging .drag-handle, .types-list li:focus-within .drag-handle { opacity: .8 !important; }
}
/* Note history (180): 🕘 in the full toolbar; the list of earlier versions. */
.rich .md-versions { display: none; }
.rich.bar-full .md-versions { display: inline-flex; }
.versions-list { display: grid; gap: 4px; max-height: min(55vh, 460px); overflow-y: auto; }
.versions-list button { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; box-shadow: none; }
.versions-list button:hover, .versions-list button[aria-current="true"] { background: var(--glass-hover); border-color: var(--glass-border); }
.versions-list .v-when { font-size: .8rem; color: var(--muted); }
.versions-list .v-text { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 196: a task dragged over the middle of another previews as its sub-task
   (indented, with ↳); the task it will go under is outlined. */
.task-list > li.nest-target { outline: 2px dashed var(--active-border, currentColor); outline-offset: -2px; }
/* The gap a dragged task will drop into (sortable.js): the same dashed outline as dropping onto a task. */
.drop-slot { position: fixed; z-index: 1; pointer-events: none; box-sizing: border-box; border: 2px dashed var(--active-border, currentColor); }
/* A lifted row, or a group as one block (its rows plain inside it): see-through glass in the colour of the
   hold's shading, lightly frosted, with a fine light edge; in Chrome the colours under it split a little (hold.js .glass-lens). */
:is(li[data-id].dragging:not(.group-drag), .drag-ghost.drag-stack) { background: color-mix(in srgb, var(--glass-strong) 50%, transparent) !important; -webkit-backdrop-filter: blur(5px) saturate(1.5) brightness(1.05); backdrop-filter: blur(5px) saturate(1.5) brightness(1.05); box-shadow: var(--shadow), inset 0 0 0 1px color-mix(in srgb, #fff 24%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 40%, transparent), inset 0 -1px 0 color-mix(in srgb, #000 18%, transparent) !important; }
:root .drag-ghost.drag-stack.drag-stack { background: linear-gradient(color-mix(in srgb, var(--accent) 15%, transparent), color-mix(in srgb, var(--accent) 15%, transparent)), color-mix(in srgb, var(--glass-strong) 50%, transparent) !important; border-radius: 14px; overflow: hidden; } /* the held row's shading, so the whole group is one colour */
:root .drag-ghost.drag-stack > li { background: none !important; border-color: transparent !important; box-shadow: none !important; }
.glass-lens :is(li[data-id].dragging:not(.group-drag), .drag-ghost.drag-stack) { -webkit-backdrop-filter: url(#glass-lens) blur(4px) saturate(1.5) brightness(1.05); backdrop-filter: url(#glass-lens) blur(4px) saturate(1.5) brightness(1.05); }
/* Dropping onto a task: room opens under it (and its sub-tasks) for the carried one (sortable.js). */
.task-list > li.dragging.nest-preview { padding-left: calc(var(--nest-pad, 36px) + 28px); position: relative; }
.task-list > li.dragging.nest-preview::before { content: "↳"; position: absolute; left: calc(var(--nest-pad, 36px) + 6px); top: .55em; width: auto; background: none; color: var(--muted); font-size: .9rem; line-height: 1; }
/* A comment's ⋯ menu, and a list of choices from a Selections bar (Assign to…, Move ▸ Project…; .list-menu),
   look like the glass dropdown lists (.dd-menu): one frosted panel, plain rows that light up on hover, no boxes round each item. */
.pill-menu:is(.comment-menu, .list-menu) {
  padding: 4px; gap: 0; border-radius: 14px;
  background: color-mix(in srgb, var(--menu-bg) 80%, transparent) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--active-border) !important; box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
}
.pill-menu:is(.comment-menu, .list-menu) button { border: 0 !important; background: transparent !important; box-shadow: none !important; border-radius: 10px; padding: 7px 12px; font-size: .9rem; color: var(--text); }
.pill-menu:is(.comment-menu, .list-menu) button:hover, .pill-menu:is(.comment-menu, .list-menu) button:focus-visible { background: var(--glass-hover, color-mix(in srgb, var(--text) 10%, transparent)) !important; outline: none; }

/* 201: on Tasks, Alternate shading starts where the ruled line starts (the
   text column), so each shaded band sits exactly between two rules instead
   of running out into the margin past them. */
#main[data-shade="alt"] .task-list > li[data-task]:nth-child(even of li[data-task]) {
  box-shadow: none;
  background-image: linear-gradient(to right, transparent 73px, color-mix(in srgb, var(--text) 4.5%, transparent) 73px);
}
/* 198: "+ New" at the end of the New note's type pills; ⋯ at the end of the type filters. */
.dump-kinds .kind-new { opacity: .7; border-style: dashed; }
.dump-kinds .kind-new:hover, .dump-kinds .kind-new:focus-visible { opacity: 1; }
.dump-filter-row .filter-more { letter-spacing: .1em; }
/* Contacts and Cases' main tabs: Batch Book's coloured book tabs, a little bigger. */
.c-tabs-row #c-tabs button { padding: 8px 14px 7px; font-size: .98rem; border-bottom: 3px solid color-mix(in srgb, var(--bb) 35%, transparent); }
.c-tabs-row #c-tabs button[aria-pressed="true"] { color: var(--text); font-weight: 650; border-bottom-color: var(--bb); background: color-mix(in srgb, var(--bb) 18%, transparent); border-radius: 10px 10px 0 0; }
.c-tabs-row #c-tabs button:hover:not([aria-pressed="true"]) { color: var(--text); background: color-mix(in srgb, var(--bb) 8%, transparent); border-radius: 10px 10px 0 0; }
/* 202: the Schedule's open item and its panel are one rounded box too, like
   the Day Planner's Tasks and the Tasks page (the time stays in the margin). */
#lines .line.has-item:has(+ .item-details) { border-bottom: 0; }
#lines .line.has-item:has(+ .item-details) > .content { margin-left: 8px; border: 1px solid var(--glass-border); border-bottom: 0; border-radius: 14px 14px 0 0; background: var(--glass-track); }
#lines .line.has-item + .item-details { position: relative; margin: 0 0 10px 72px; padding: 10px 12px 12px; border: 1px solid var(--glass-border); border-top: 0; border-radius: 0 0 14px 14px; background: var(--glass-track); }
#lines .line.has-item + .item-details::before { content: ''; position: absolute; left: -10px; top: 0; bottom: -11px; width: 2px; background: var(--margin-rule); pointer-events: none; }
@media (max-width: 560px) { #lines .line.has-item + .item-details { padding-left: 12px; } }
/* 203: Alternate shading: an item spanning several slots is shaded as one
   piece (the ruled lines inside it stay), not striped slot by slot. */
#main[data-shade="alt"] .planner .span-block > .line.alt-row { box-shadow: none; }
#main[data-shade="alt"] .planner .span-block.alt-row { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--text) 4.5%, transparent); }
/* ⋯ menus stay invisible for the moment between opening and being placed
   (above or below), so they never flash the wrong way first. */
.tool-menu[open] > .menu:not(.placed) { visibility: hidden; }

/* 204, 205: sub-tasks on the Tasks page. Every row keeps the same left
   padding, so the grips stay in one column (easy to swipe down to select);
   only the tick box, title and pills move right, one step (28px) per level,
   with the ↳ just before the tick. Sub-tasks have the same text size as tasks
   and no longer tuck up under the row above, so shading and ruled lines agree. */
.task-list > li[data-depth="1"], .task-list > li[data-depth="2"], .task-list > li[data-depth="3"], .task-list > li[data-depth="4"] { padding-left: 8px; }
.task-list > li[data-depth="1"] > .tick { margin-left: 28px; }
.task-list > li[data-depth="2"] > .tick { margin-left: 56px; }
.task-list > li[data-depth="1"] > .item-sub { margin-left: calc(67px + 28px); max-width: calc(100% - 95px); }
.task-list > li[data-depth="2"] > .item-sub { margin-left: calc(67px + 56px); max-width: calc(100% - 123px); }
.task-list > li.group-kid { margin-top: 0; }
.task-list > li.group-kid .task-title { font-size: inherit; }
.task-list > li.group-kid::before { left: 48px; }
.task-list > li[data-depth="2"].group-kid::before { left: 76px; }

/* 207: dragging a task sideways on the Tasks page. Its ::after is the ruled
   line, so the "sub-item" / "top level" label (and the accent bar) aren't used
   there; the row itself shifts right or left to show where it will land. */
.task-list > li.dragging[data-drop-label]::after { content: ''; top: auto; bottom: 0; right: 0; left: 73px; transform: none; padding: 0; height: 1px; border-radius: 0; background: var(--glass-border); }
.task-list > li.dragging[data-drop-depth] { box-shadow: var(--shadow); }

/* 208: sub-tasks hang from their task by fine lines (an L from under the
   task's tick box to each sub-task's), instead of the ↳ arrow. */
.task-list { --tick-top: 16px; --tick-h: 18px; }
.task-list > li.group-kid::before { content: none; }
.task-list .tree-v, .task-list .tree-h { position: absolute; background: color-mix(in srgb, var(--text) 22%, transparent); pointer-events: none; }
.task-list .tree-v { width: 1px; }
.task-list .tree-h { height: 1px; top: calc(var(--tick-top) + var(--tick-h) / 2); }
/* 209: the New task line is as tall as a task (empty, or while typing). */
.task-entry .task-add-line { min-height: var(--task-row-h, 42px); box-sizing: border-box; }
/* 210: a task's note edited in place, under its title. */
.task-list .item-sub .note-in-place { flex-basis: 100%; margin: 4px 0 2px; }
.task-list > li > .tree { display: contents; }
/* A picture opened from a note's files. */
/* The attachment viewer (attachments.js): always on a dark background, so its
   glass buttons are drawn light on dark whatever the theme. */
dialog.att-view { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: transparent; color: #fff; overflow: hidden; }
dialog.att-view::backdrop { background: rgb(0 0 0 / .82); }
.av-stage { position: absolute; inset: calc(56px + env(safe-area-inset-top)) 16px calc(52px + env(safe-area-inset-bottom)); display: grid; place-items: center; touch-action: pan-y; }
.av-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; } /* a definite box (not a grid row sized by the picture), so a tall photo is held to the screen height in Safari too */
.av-slide img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.av-name { position: absolute; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: .9rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-btn { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; color: #fff; background: rgb(255 255 255 / .14); border: 1px solid rgb(255 255 255 / .28); box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), 0 4px 18px rgb(0 0 0 / .35); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); z-index: 1; }
.av-btn:hover:not(:disabled) { background: rgb(255 255 255 / .24); }
.av-btn[hidden] { display: none; }
.av-btn .icon { width: 22px; height: 22px; stroke-width: 2; }
.av-close { top: calc(8px + env(safe-area-inset-top)); right: 12px; }
.av-share { top: calc(8px + env(safe-area-inset-top)); left: 12px; }
.av-btn:disabled { opacity: .4; }
.av-arrow { top: 50%; transform: translateY(-50%); }
.av-prev { left: 12px; }
.av-next { right: 12px; }
.av-doc { display: grid; justify-items: center; gap: 8px; padding: 28px 32px; max-width: min(360px, 86vw); border-radius: 22px; background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .22); text-align: center; }
.av-doc-icon { width: 72px; height: 72px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; opacity: .9; }
.av-doc-name { font-size: 1rem; overflow-wrap: anywhere; }
.av-doc-thumb { display: block; max-width: 100%; max-height: 46vh; border-radius: 6px; background: #fff; box-shadow: 0 4px 18px rgb(0 0 0 / .35); }
.av-doc-size { font-size: .82rem; opacity: .7; }
.av-open { margin-top: 6px; padding: 8px 26px; color: #fff; background: rgb(255 255 255 / .18); border: 1px solid rgb(255 255 255 / .32); }
.av-open:hover:not(:disabled) { background: rgb(255 255 255 / .28); }
.av-missing { max-width: 30ch; text-align: center; font-size: .85rem; opacity: .8; }
@media (max-width: 560px) { .av-arrow { top: auto; bottom: calc(4px + env(safe-area-inset-bottom)); transform: none; } .av-stage { bottom: calc(60px + env(safe-area-inset-bottom)); } .av-name { left: 64px; right: 64px; } }
/* Ticking off (tickwave.js): the name's copy while the wave passes (its letters bob, a line is drawn
   through it), and a band of soft blue light crossing the row. The tick box is never covered for pressing. */
.tw-copy { position: absolute; z-index: 2; margin: 0; overflow: hidden; pointer-events: none; }
.tw-copy > .tw-line { opacity: var(--tw-dim, 1); }
.tw-word { position: relative; display: inline-block; white-space: pre; }
.tw-ch { display: inline-block; white-space: pre; }
.tw-strike { position: absolute; left: 0; right: 0; top: 55%; height: 2px; margin-top: -.5px; border-radius: 1px; background: currentColor; opacity: .85; transform: scaleX(0); transform-origin: left; }
.tw-ring { position: absolute; z-index: 3; width: 28px; height: 28px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent, #6fb0ff) 75%, transparent); pointer-events: none; opacity: 0; }
.tw-sweep { position: absolute; z-index: 1; overflow: hidden; pointer-events: none; border-radius: inherit; }
.tw-band { position: absolute; top: 0; bottom: 0; left: 0; width: 45%; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent, #6fb0ff) 48%, transparent), transparent); }
.task-list > li.ticked-away .task-title { text-decoration: line-through; } /* then fadeFold (tickwave.js) */
/* A Brain Dump note just saved pulses above the dimming while the next is written. */
.thought.flash { z-index: 901; }
/* Brain Dump: Plan it / → Find Things pop up by their button, over the page
   (and over the dimming while a note is being written). */
.thought-pop { position: fixed; z-index: 950; width: min(340px, calc(100vw - 16px)); padding: 4px; border-radius: 16px; box-shadow: 0 12px 34px rgba(0, 0, 0, .45); }
.thought-pop .thought-panel { margin: 0; }
/* Sub-tasks: the ruled line, Alternate shading, and the pills and "Add note"
   line while editing all start where the sub-task's text starts (one step,
   28px, per level), clear of the lines joining it to its task. */
.task-list > li[data-depth="1"] { --ind: 28px; }
.task-list > li[data-depth="2"] { --ind: 56px; }
.task-list > li[data-task]::after { left: calc(73px + var(--ind, 0px)); }
#main[data-shade="alt"] .task-list > li[data-task]:nth-child(even of li[data-task]) {
  background-image: linear-gradient(to right, transparent calc(73px + var(--ind, 0px)), color-mix(in srgb, var(--text) 4.5%, transparent) calc(73px + var(--ind, 0px)));
}
.task-list > li[data-task] > .edit-pills { padding-left: var(--ind, 0px); box-sizing: border-box; }
/* The lines joining sub-tasks to their task: fainter. */
.task-list .tree-v, .task-list .tree-h { background: color-mix(in srgb, var(--text) 13%, transparent); }
/* A task's pills and "Add note" line while editing, and the New task line's,
   start exactly where the task's text starts, at any width (measured:
   --title-x / --entry-x from views/tasks.js). */
.task-list > li[data-task] > .edit-pills { margin-left: var(--title-x, 64px) !important; }
.task-list > li[data-task] > .edit-pills .pill-note { margin-left: 0 !important; flex-basis: 100% !important; padding-left: 0; }
.task-entry-more { padding-left: var(--entry-x, 54px) !important; }
.task-entry-more .entry-note { padding-left: 0; }
/* 218: a task's text sits a little in from the edge of its shaded band, and
   the lit background while editing a name starts where the band (and the
   ruled line) starts, so the two line up. Pills and "Add note" follow the
   text (--title-x / --entry-x are measured from it). */
.task-list > li[data-task] > .task-title { margin-left: 9px; padding-left: 5px; }
.task-add-line .new-task-line { margin-left: 7px; padding-left: 5px; }
/* The New task line as a sub-task ("- " or Tab): indented straight away. */
.task-entry .task-add-line > .add-mark { margin-left: var(--ind, 0px); transition: margin-left .15s; }
.task-entry .task-add-line::after { left: calc(73px + var(--ind, 0px)); }
.task-entry-more { padding-left: calc(var(--entry-x, 54px) + var(--ind, 0px)) !important; }
/* An open task's panel: the ruled line of the row above doesn't run along its top edge. */
.task-list > li[data-task]:has(+ li[data-task] + li.task-details)::after { display: none; }

/* Item panels (217): grouped into sections (a heading and a light box each),
   More as a bar that is plainly a control, and the actions in a shaded footer
   running to the panel's edges. Each kind of panel gives its padding in --pp-*
   so the footer can reach the edges. */
.task-details { --pp-r: 12px; --pp-b: 12px; --pp-l: 12px; padding: 12px var(--pp-r) var(--pp-b) var(--pp-l); }
#lines .line.has-item + .item-details, .pile-paper .line.has-item + .item-details { --pp-r: 12px; --pp-b: 12px; --pp-l: 12px; padding: 10px var(--pp-r) var(--pp-b) var(--pp-l); }
.item-list li.thing-panel { --pp-r: 14px; --pp-b: 14px; --pp-l: 36px; padding: 6px var(--pp-r) var(--pp-b) var(--pp-l); }
@media (max-width: 560px) {
  .task-details { --pp-r: 10px; --pp-b: 10px; --pp-l: 10px; }
  .item-list li.thing-panel { --pp-l: 14px; }
}
.panel-sec, .task-details .comments, .item-details .comments { margin: 0 0 10px; padding: 9px 12px 10px; border-radius: 12px; background: color-mix(in srgb, var(--text) 3.5%, transparent); border: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
.panel-h { display: block; margin: 0 0 8px; font-size: .8rem; font-weight: 600; letter-spacing: .01em; color: var(--muted); }
.panel-sec > :last-child { margin-bottom: 0; }
.detail-sec .energy-pick { margin-bottom: 10px; }
.item-details .detail-sec .energy-pick { margin: 10px 0 0; }
.item-details > .panel-sec, .item-details .comments { margin-bottom: 0; }
.item-details .detail-sec .detail-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 0; }
.task-details .comments .comment-list, .item-details .comments .comment-list { margin-top: -2px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.label-row .date-quick { margin: 0; gap: 8px; flex: none; }
.label-row .date-quick .linklike { font-size: .8rem; line-height: 1; }
.date-quick .date-clear { color: var(--muted); }
.date-quick .date-clear:hover { color: var(--text); }
.detail-more { margin: 0 0 10px; }
.task-details .detail-grid label.is-set { color: var(--text); }
.task-details .detail-grid label.is-set > :is(select, input) { background: var(--active-bg); border-color: var(--active-border); }
.detail-more > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); font-size: .85rem; cursor: pointer; user-select: none; -webkit-user-select: none; }
.detail-more > summary::-webkit-details-marker { display: none; }
.detail-more > summary::before { content: ''; flex: none; width: 6px; height: 6px; margin: 0 3px 2px 1px; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(-45deg); opacity: .7; transition: transform .15s; }
.detail-more[open] > summary::before { transform: rotate(45deg); margin-bottom: 4px; }
.detail-more > summary:hover { background: var(--glass-hover); }
.detail-more > summary .more-what { color: var(--muted); }
.detail-more[open] > summary { margin-bottom: 10px; }
.task-details .detail-actions, .item-details > .detail-actions { margin: 12px calc(-1 * var(--pp-r, 12px)) calc(-1 * var(--pp-b, 12px)) calc(-1 * var(--pp-l, 12px)); padding: 9px var(--pp-r, 12px) 9px var(--pp-l, 12px); background: color-mix(in srgb, var(--text) 6%, transparent); border-top: 1px solid color-mix(in srgb, var(--text) 9%, transparent); border-radius: 0 0 13px 13px; max-width: none; }
/* Tasks in Compact spacing: the name is only as wide as its text, with the 📝
   and the pills straight after it; a long name ends in "…" so they still show.
   (Browsers without field-sizing keep the pills at the far right.) */
#main[data-density="tight"] .task-list > li[data-task] > .item-sub .task-note { order: -1; }
#main[data-density="tight"] .task-list > li[data-task] > .item-sub { justify-content: flex-end; }
#main[data-density="tight"] .task-list > li[data-task] > .task-title { text-overflow: ellipsis; }
@supports (field-sizing: content) {
  #main[data-density="tight"] .task-list > li[data-task] > .task-title { field-sizing: content; width: auto; flex: 0 1 auto; min-width: 4ch; }
  #main[data-density="tight"] .task-list > li[data-task] > .item-sub { flex: 0 1 auto; max-width: 45%; justify-content: flex-start; }
  #main[data-density="tight"] .task-list > li[data-task] > .more { margin-left: auto; }
  #main[data-density="tight"] .task-list > li[data-task] > :is(.drag-handle, .tick) { flex: none; }
}
/* Close in every item panel (220): a glassy green pill with a line-art tick,
   like the Day Planner's "Bring in from tasks". */
.detail-actions .close-details { display: inline-flex; align-items: center; gap: 6px; color: var(--text); border: 1px solid color-mix(in srgb, var(--energy-ink, #4caf7a) 40%, transparent); background: color-mix(in srgb, var(--energy-ink, #4caf7a) 13%, transparent); }
.detail-actions .close-details:hover:not(:disabled), .detail-actions .close-details:focus-visible { border-color: color-mix(in srgb, var(--energy-ink, #4caf7a) 65%, transparent); background: color-mix(in srgb, var(--energy-ink, #4caf7a) 24%, transparent); outline: none; }
.detail-actions .close-details .icon { width: 15px; height: 15px; stroke: var(--energy-ink, #4caf7a); stroke-width: 2.6; }
/* Phones (220): an open task's panel (and the task above it) use the screen's
   full width, still in place among the tasks. */
@media (max-width: 560px) {
  .task-list > li.task-details { margin: 0 -16px 10px !important; max-width: none; border-left: 0; border-right: 0; border-radius: 0; }
  .task-list > li[data-task]:has(+ li.task-details)::before { left: -16px; right: -16px; border-left: 0; border-right: 0; border-radius: 0; }
  .task-list > li.task-details { --pp-l: 16px; --pp-r: 16px; }
  .task-list > li.task-details .detail-actions { border-radius: 0; }
}
/* 222: the New task line under the list, once it's a sub-task, hangs from its
   task by the same fine L as the sub-tasks above it. */
.task-add-line > .tree { display: contents; }
.task-entry .tree-v, .task-entry .tree-h { position: absolute; background: color-mix(in srgb, var(--text) 13%, transparent); pointer-events: none; }
.task-entry .tree-v { width: 1px; }
.task-entry .tree-h { height: 1px; top: calc(var(--tick-top) + var(--tick-h) / 2); }
/* Links in comments (issue 7): 📞 / 📝 beside the box while writing a comment,
   the search opening under it, and web addresses as links. */
.comments { position: relative; }
.comment-add-row { display: flex; align-items: flex-start; gap: 4px; }
.comment-add-row .comment-add { flex: 1; min-width: 0; }
.comment-tools { display: none; gap: 2px; flex: none; }
.comment-add-row:focus-within .comment-tools { display: inline-flex; }
.comment-tools button { padding: 2px 6px; font-size: .85rem; line-height: 1.2; background: transparent; box-shadow: none; border: 1px solid transparent; font-family: var(--emoji-font, inherit); }
.comment-tools button:hover { background: var(--glass-hover); border-color: var(--glass-border); }
.comment-body a.web-link { color: var(--accent, var(--text)); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
/* Scans (#8): a Scan button and the scans as cards with their first page. */
.scans-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.scans-head .scan-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; font-size: 1rem; }
.scans-head .scan-btn .icon { width: 20px; height: 20px; }
.scans-head .scan-photos { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.scans-head .scan-photos .icon { width: 18px; height: 18px; }
.scans-head > .search-wrap { flex: 1 1 12em; }
/* Phones: Scan (or + New contract), Share, 👁 and ⋯ on one line, the search full width under them (as Find Things'). */
@media (max-width: 560px) {
  .scans-head > .search-wrap { order: 1; flex-basis: 100%; }
  .scans-head > .page-share { margin-left: auto; }
  .scans-head .scan-btn { padding: 9px 14px; }
  .scans-head .scan-photos { padding-inline: 12px; }
  .scans-head { gap: 6px; }
}
.scan-kinds { margin: 0 0 8px; }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 10px; }
#main[data-density="tight"] .scan-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
#main[data-density="loose"] .scan-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.scan-grid > .empty { grid-column: 1 / -1; }
.scan-card { display: grid; gap: 6px; padding: 8px 8px 10px; border-radius: 16px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); text-decoration: none; min-width: 0; }
.scan-card:hover { background: var(--glass-hover); }
.scan-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--glass-track); }
.scan-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; } /* cropped: a tall page never sets the card's height */
.scan-doc { width: 44%; height: 44%; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.scan-count { position: absolute; right: 6px; bottom: 6px; padding: 1px 8px; border-radius: 999px; font-size: .72rem; background: color-mix(in srgb, #000 55%, transparent); color: #fff; }
.scan-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: .8rem; }
.chip.expiry-soon { border-color: color-mix(in srgb, #f5a66a 60%, transparent); background: color-mix(in srgb, #f5a66a 18%, transparent); }
.chip.expiry-past { border-color: color-mix(in srgb, #ff8a80 60%, transparent); background: color-mix(in srgb, #ff8a80 18%, transparent); }
.scans.drop-over { outline: 2px dashed var(--active-border, var(--muted)); outline-offset: 6px; border-radius: 16px; }
.scan-page { position: relative; display: grid; gap: 10px; padding: 12px 12px 0; border-radius: 16px; border: 1px solid var(--glass-border); background: var(--glass-track); --pp-r: 12px; --pp-b: 0px; --pp-l: 12px; }
.scan-page .panel-sec { margin: 0; }
.scan-page { grid-template-columns: minmax(0, 1fr); }
.scan-page > * { min-width: 0; }
.scan-page .md-bar { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
@media (max-width: 560px) {
  .scan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #main[data-density="tight"] .scan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #main[data-density="loose"] .scan-grid { grid-template-columns: minmax(0, 1fr); }
}
.scan-page .att-img .att-open img { height: 96px; max-width: 160px; }
.scan-summary { margin-top: 10px; }
.scan-text { white-space: pre-wrap; font-size: .9rem; line-height: 1.45; max-height: 16em; overflow: auto; padding: 8px 10px; border-radius: 10px; background: var(--glass-track); border: 1px solid var(--glass-border); user-select: text; -webkit-user-select: text; }
.scan-text-sec .panel-h .linklike { margin-left: 8px; font-size: .8rem; padding: 0; }
textarea.scan-text-edit { display: block; width: 100%; box-sizing: border-box; max-height: none; resize: vertical; font: inherit; font-size: .9rem; color: inherit; }
.scan-text-acts { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.scan-text-acts .spacer { flex: 1; }
.scan-text-acts .linklike { font-size: .85rem; padding: 0; }
.scan-summary textarea { font-size: .95rem; padding: 6px 8px; color: var(--text); resize: vertical; }
.scan-filed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.scan-filed .field-label { font-size: .8rem; color: var(--muted); }
.filed-chip { display: inline-flex; align-items: center; gap: 4px; }
.filed-chip .linklike { padding: 0; font-size: .85rem; color: var(--text); }
.scan-reminder { margin-top: 8px; font-size: .85rem; }
.scan-actions { margin: 4px -12px 0; padding: 9px 12px; background: color-mix(in srgb, var(--text) 6%, transparent); border-top: 1px solid color-mix(in srgb, var(--text) 9%, transparent); border-radius: 0 0 15px 15px; align-items: center; }
.scan-actions .muted { font-size: .8rem; }
/* Contracts (#9): a table on a laptop, cards by kind on a phone. */
.contract-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 10px; font-size: .92rem; border: 1px solid var(--glass-border); border-radius: 14px; overflow: hidden; background: var(--glass); }
.contract-table th { text-align: left; padding: 0; border-bottom: 1px solid var(--glass-border); background: var(--glass-track); }
.contract-table .th-sort { width: 100%; text-align: left; padding: 8px 10px; border-radius: 0; background: none; box-shadow: none; color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.contract-table .th-sort[aria-pressed="true"] { color: var(--text); }
.contract-table td { padding: 9px 10px; border-bottom: 1px solid color-mix(in srgb, var(--text) 7%, transparent); vertical-align: middle; }
.contract-table tbody tr { cursor: pointer; }
.contract-table tbody tr:hover, .contract-table tbody tr:focus-visible { background: var(--glass-hover); outline: none; }
.contract-table tbody tr:last-child td { border-bottom: 0; }
.contract-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.contract-table .c-name { font-weight: 500; }
#main[data-shade="alt"] .contract-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--text) 4%, transparent); }
#main[data-density="tight"] .contract-table td { padding: 5px 10px; }
#main[data-density="loose"] .contract-table td { padding: 13px 12px; }
.chip.renew-soon { border-color: color-mix(in srgb, #f5a66a 60%, transparent); background: color-mix(in srgb, #f5a66a 18%, transparent); }
.chip.renew-past { border-color: color-mix(in srgb, #ff8a80 60%, transparent); background: color-mix(in srgb, #ff8a80 18%, transparent); }
.contract-cards { display: none; }
.contract-card { display: grid; gap: 4px; margin-bottom: 8px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); text-decoration: none; }
.contract-card .c-name { font-weight: 500; }
.contract-card .c-line { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .9rem; }
.contract-card.renew-soon { border-color: color-mix(in srgb, #f5a66a 55%, transparent); }
.contract-card.renew-past { border-color: color-mix(in srgb, #ff8a80 55%, transparent); }
@media (max-width: 767px) { .contract-table { display: none; } .contract-cards { display: block; margin-top: 6px; } }
.contract-total { margin: 12px 2px 0; font-size: .92rem; }
.contract-page .detail-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.contract-page .detail-grid input, .contract-page .detail-grid select { font-size: .92rem; padding: 6px 8px; color: var(--text); width: 100%; box-sizing: border-box; min-width: 0; }
.ref-field, .cost-field { display: flex; gap: 6px; align-items: center; min-width: 0; }
.cost-field input { flex: 1 1 5em; min-width: 0; }
.cost-field select { flex: 0 1 auto; width: auto !important; }
.ref-field .masked { flex: 1; text-align: left; letter-spacing: .12em; font-variant-numeric: tabular-nums; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: var(--glass-track); box-shadow: none; color: var(--text); }
.check-label { display: flex; flex-direction: row; align-items: center; gap: 8px; align-self: end; padding-bottom: 8px; color: var(--text); font-size: .88rem; }
.check-label input { width: auto !important; }
.contract-year { margin: 8px 0 0; font-size: .85rem; }
.contract-page .detail-rows { margin: 0 0 6px; }
/* ID scans stay blurred until tapped (spec 3.2). */
.scan-card.is-id .scan-thumb img, .scan-pages.is-id .att img { filter: blur(14px) saturate(.6); }
.scan-card.is-id .scan-thumb::after { content: 'ID'; position: absolute; inset: auto auto 6px 6px; padding: 1px 8px; border-radius: 999px; font-size: .72rem; background: color-mix(in srgb, #000 55%, transparent); color: #fff; }
.scan-pages .panel-h .linklike { margin-left: 8px; font-size: .8rem; padding: 0; }
.scan-keep { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted, inherit); cursor: pointer; }
.scan-pages > .panel-h { display: flex; align-items: center; gap: 4px; }
/* Brain Dump: a note's colour can only be picked while the Look is Multicolour,
   the only Look that shows it (the dot on a card, ⋯ → Colour…, the toolbar's
   swatch and the selection bar's Colour…). */
#main[data-area="dump"]:not([data-shade="colour"]) :is(.note-dot, .md-colour, .note-more [data-act="colour"]) { display: none !important; }
body:has(#main[data-area="dump"]:not([data-shade="colour"])) .select-bar [data-kit-action="colour"] { display: none; }
/* A message (e.g. "Attached … · Undo" after pasting a picture into a note on a
   phone) shows, and can be tapped, above a full-screen note. */
.toast { z-index: 1100; }

/* Browsing with the keyboard (browse.js): the item you're on, the same in every area. */
/* Drawn inside the item, so it never reaches the ones beside it. */
.kb-cur { outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); scroll-margin: 16px; }
/* Already at the end of a bar: the highlight flashes (browse.js). */
.kb-flash { animation: kb-flash .5s ease-out; }
@keyframes kb-flash { 0%, 60% { background: color-mix(in srgb, var(--accent) 45%, transparent); } 100% { background: transparent; } }
/* A task's note (medium and expanded spacing) starts where the task's text
   starts, at any width (--title-x from views/tasks.js), sub-tasks included. */
.task-list > li[data-depth="1"] { --sub-ind: 28px; }
.task-list > li[data-depth="2"] { --sub-ind: 56px; }
.task-list > li[data-task] > .item-sub { margin-left: calc(var(--title-x, 64px) + var(--sub-ind, 0px)); max-width: calc(100% - var(--title-x, 64px) - var(--sub-ind, 0px)); }
/* A task's note edited in place: plain text on its own line under the title,
   lined up with it, the same in every spacing and at any width. */
#main .task-list > li[data-task]:has(> .note-in-place) { flex-wrap: wrap; }
.task-list > li[data-task] > .note-in-place:not(.is-full) { order: 8; flex: 0 0 calc(100% - var(--title-x, 64px) - var(--sub-ind, 0px)); margin: -4px 0 6px calc(var(--title-x, 64px) + var(--sub-ind, 0px)); min-width: 0; }
.rich.bare > .md-bar { display: none; }
.rich.bare > .bare-full { display: flex; align-items: center; gap: 5px; width: fit-content; margin: 6px 0 6px auto; padding: 4px 12px; font-size: .78rem; line-height: 1.3; border: 1px solid var(--glass-border); border-radius: var(--radius-pill, 999px); cursor: pointer; }
.rich.is-full > .bare-full { display: none; }
/* Desktop: the Fullscreen button sits on the note's own (first) line, at the right, not a line of its own under it. */
@media (hover: hover) and (pointer: fine) and (min-width: 700px) {
  .rich.bare:not(.is-full):has(> .bare-full) { display: flex; align-items: flex-start; gap: 10px; }
  .rich.bare:not(.is-full):has(> .bare-full) > .rich-edit { flex: 1 1 auto; min-width: 0; }
  .rich.bare:not(.is-full) > .bare-full { flex: none; margin: 0; }
}
/* A task's note being written (in place, or the New task line's): the size of "Add note", a
   little fainter than the task's name (in italics in Glass); "Add note" faint until typed over. */
:is(.task-list > li[data-task] > .note-in-place, #task-new-note):not(.is-full) .rich-edit { min-height: 1.4em; padding: 2px 0; border: 0; border-radius: 0; box-shadow: none; outline: none; background: transparent; font-size: .9rem; line-height: 1.4; color: color-mix(in srgb, var(--text) 85%, transparent); }
:root[data-theme="blue"] :is(.task-list > li[data-task] > .note-in-place, #task-new-note):not(.is-full) .rich-edit { font-style: italic; color: color-mix(in srgb, var(--text) 88%, transparent); }
:is(.task-list > li[data-task] > .note-in-place, #task-new-note):not(.is-full) .rich-edit.is-empty::before { font-style: normal; opacity: .7; }
#task-new-note { margin-bottom: 4px; }

/* iPhone zooms the page into any field whose text is under 16px when it's tapped.
   On touch screens every editable field is at least 16px (the big ones keep their size),
   and the small in-line notes get tighter lines so they stay close to how they look. */
@media (pointer: coarse) {
  :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]), textarea, select, [contenteditable="true"], .rich-raw):not(.box-code-input, .box-name-input, .focus input, #dump-body *, .rich.is-full > *) { font-size: max(16px, 1rem) !important; }
  :is(.task-list > li[data-task] > .note-in-place, #task-new-note):not(.is-full) .rich-edit, .add-note, .pill-note, .comment-add, .comment-edit { line-height: 1.3 !important; }
}
/* 👁 Layout on Tasks (viewcog.js): switches for trying out layouts. */
.layout-opts { display: grid; gap: 2px; }
.layout-opt { display: flex; align-items: center; gap: 8px; padding: 3px 2px; font-size: .85rem; color: var(--vm-text); cursor: pointer; }
.layout-opt input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: #6fb0ff; }
/* New task line at the top: the list follows it straight away. */
#task-entry + .task-list { margin-top: 0; }
/* Show margin: a red margin like the Day Planner's (each theme's own
   --margin-rule). Every tick box sits in it, at the same place whatever the
   level; only the text is indented. Ruled lines start at the margin, a
   sub-task's where the line joining it to its task comes down (treeOf in
   views/tasks.js), so the joining lines are ruled lines too. */
/* --mshift: how much further right the margin (and everything right of it) sits than the plain layout's text. */
#main[data-layout-margin] { --mshift: 24px; --margin-bg: linear-gradient(to right, transparent calc(64px + var(--mshift)), var(--margin-rule) calc(64px + var(--mshift)), var(--margin-rule) calc(66px + var(--mshift)), transparent calc(66px + var(--mshift))); }
@media (max-width: 560px) { #main[data-layout-margin] { --mshift: 8px; } }
#main[data-layout-margin] :is(.task-list > li[data-task], .task-add-line, .task-entry-more) { background-image: var(--margin-bg); }
#main[data-layout-margin] .task-list > li[data-task] > .tick { margin-left: 0; }
#main[data-layout-margin] .task-list > li[data-task] > .task-title { margin-left: calc(9px + var(--mshift) + var(--ind, 0px)); }
#main[data-layout-margin] .task-list > li[data-task]::after, #main[data-layout-margin] .task-entry .task-add-line::after { left: calc(var(--mshift) + max(66px, calc(50px + var(--ind, 0px)))); }
#main[data-layout-margin][data-shade="alt"] .task-list > li[data-task]:nth-child(even of li[data-task]) { background-image: var(--margin-bg), linear-gradient(to right, transparent calc(var(--mshift) + max(66px, calc(50px + var(--ind, 0px)))), color-mix(in srgb, var(--text) 4.5%, transparent) calc(var(--mshift) + max(66px, calc(50px + var(--ind, 0px))))); }
#main[data-layout-margin] .task-list .tree-v, #main[data-layout-margin] .task-entry .tree-v { background: var(--glass-border); }
/* Ruled lines run the full width, as on real paper: past the margin and under the tick boxes. */
#main#main .task-list > li[data-task]::after, #main#main .task-entry .task-add-line::after { left: 0; }
/* New task with its note and pills showing: the ruled line goes under them, as for a task being edited, not between its name and note. */
#main .task-entry.open.typed:not(:has(.task-add-line > .pill-reveal):not(.revealed)) .task-add-line::after { display: none; }
#main[data-layout-lined] .task-entry.open.typed:not(:has(.task-add-line > .pill-reveal):not(.revealed)) .task-entry-more { position: relative; }
#main[data-layout-lined] .task-entry.open.typed:not(:has(.task-add-line > .pill-reveal):not(.revealed)) .task-entry-more::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--glass-border); pointer-events: none; }
#main[data-layout-margin] .task-entry .task-add-line > .add-mark { margin-left: 0; }
#main[data-layout-margin] .task-entry .task-add-line .new-task-line { margin-left: calc(7px + var(--mshift) + var(--ind, 0px)); }
#task-entry:has(+ .task-list) { margin-bottom: 0; }
/* Hide pills behind More (👁 Layout, views/tasks.js): while editing, only a More pill, at the
   far right of the name on the same line (the name scrolls under the cursor), in place of ⋯. Pressed,
   the pills show under the name and it becomes More (full), in the same place (editpills.js .pill-top). */
.edit-pills.pill-top { display: contents; }
.pill-reveal { flex: none; margin-left: auto; padding: 2px 10px; font-size: .78rem; color: var(--text); }
.task-list > li[data-task] > .edit-pills:has(> .pill-reveal) { display: contents; }
.task-list > li[data-task] > .edit-pills > .pill-reveal { order: 2; align-self: center; }
/* ✓ Done beside More, looking the same, and after it. */
.edit-pills:has(> .pill-reveal) > .pill-done { flex: none; padding: 2px 10px; font-size: .78rem; color: var(--text); margin-left: 6px; }
.task-list > li[data-task] > .edit-pills > .pill-done { order: 2; align-self: center; }
/* A task's More (in place of ⋯): with a mouse, shown only while the pointer is over a task that isn't being edited
   (which has its own More at the far right) or has its panel open; like that More, it opens the name and its pills.
   The panel's own button (data-act="details") is hidden: More (full), holding and swiping press it. */
.task-list > li[data-task] > .more { flex: none; align-self: center; margin-left: auto; padding: 2px 10px; font-size: .78rem; color: var(--text); opacity: 1; visibility: hidden; }
@media (hover: hover) { .task-list > li[data-task]:hover > .more { visibility: visible; } }
.task-list > li[data-task]:is(.pills-open, :has(+ li.task-details)) > .more, body.pills-only .task-list > li[data-task] > .more { display: none !important; }
/* One place at the far right of a task's line, going More → More (full) → ✓ Close (its panel open); all green, like
   a panel's Close was. */
.task-list > li[data-task] > .close-top { flex: none; align-self: center; margin-left: auto; padding: 2px 10px; font-size: .78rem; }
#main[data-density="tight"] .task-list > li[data-task] > .close-top { order: 3; }
.close-top kbd { margin-left: 5px; }
/* Find Things' things the same (places.js). */
.item-list > li[data-item] > .more { opacity: 1; margin-left: auto; padding: 2px 10px; font-size: .78rem; visibility: hidden; }
@media (hover: hover) { .item-list > li[data-item]:hover > .more { visibility: visible; } }
.item-list > li[data-item]:is(.pills-open, :has(> .close-top)) > .more { display: none !important; }
.item-list > li[data-item] > .edit-pills.pill-top { display: contents; }
:is(.item-list > li[data-item] > .close-top, .item-list > li[data-item] > .edit-pills.pill-top > .pill-reveal) { flex: none; margin-left: auto; padding: 2px 10px; font-size: .78rem; }
/* The Day Planner the same (planner.js), but with no pills under the name (as Lists): More on hover and while
   editing, both opening the full panel, then ✓ Close; floating at the end of the first line where ⋯ was. */
.line.has-item > .content > .more { opacity: 1; padding: 2px 10px; font-size: .78rem; }
.line.has-item > .content > .edit-pills.pill-top { display: contents; }
:is(.line.has-item > .content > .close-top, .line.has-item > .content > .edit-pills.pill-top > .pill-reveal) { flex: none; margin-left: auto; padding: 2px 10px; font-size: .78rem; }
.line.has-item:is(.pills-open, :has(.close-top)) > .content > .more { display: none !important; }
@media (hover: hover) {
  :is(.pile-paper, #lines) .line.has-item > .content > .more { background: color-mix(in srgb, var(--energy-ink, #4caf7a) 13%, var(--menu-bg, var(--glass-strong))); }
  :is(.pile-paper, #lines) :is(.line.has-item > .content > .close-top, .line.has-item > .content > .edit-pills.pill-top > .pill-reveal) { position: absolute; right: 11px; top: 18px; transform: translateY(-50%); margin: 0; z-index: 1; background: color-mix(in srgb, var(--energy-ink, #4caf7a) 13%, var(--menu-bg, var(--glass-strong))); }
  .pile-paper .line.has-item > .content > :is(.more, .close-top, .edit-pills.pill-top > .pill-reveal) { top: 15px; }
  /* A new line in the schedule: its More the same, once something is typed (planner.js openLine). */
  :is(#lines, .pile-paper) .line .content > .new-line-more[hidden] { display: none; }
  :is(#lines, .pile-paper) .line .content:has(> .new-line-more) { position: relative; }
  :is(#lines, .pile-paper) .line .content > .new-line-more { position: absolute; right: 11px; top: 18px; transform: translateY(-50%); margin: 0; z-index: 1; padding: 2px 10px; font-size: .78rem; }
  :is(#lines, .pile-paper) .line .content:has(> .new-line-more:not([hidden])) > input:is(.new-line, .new-task) { padding-right: 150px; }
  .pile-paper .line.pile-new .content > .new-line-more { top: 15px; }
  :is(.pile-paper, #lines) .line.has-item > .content:has(> .close-top, > .edit-pills.pill-top) > textarea.item-title { padding-right: 96px; }
  :is(.pile-paper, #lines) .line.has-item > .content:has(> .edit-pills.pill-top > .pill-reveal kbd) > textarea.item-title { padding-right: 144px; }
  #lines .line.has-item > .content:has(> .edit-pills.pill-top > .pill-reveal[data-pill-more] kbd) > textarea.item-title { padding-right: 196px; }
  /* The Tasks column beside the schedule is narrow: its More and ✓ Close show no key hints, so the name being written keeps its width. */
  .pile-paper .line > .content :is(.close-top, .pill-reveal) kbd { display: none !important; }
  .pile-paper .line .content:has(> .new-line-more:not([hidden])) > input:is(.new-line, .new-task) { padding-right: 68px !important; }
  .pile-paper .line.has-item > .content:has(> .edit-pills.pill-top) > textarea.item-title { padding-right: 68px !important; }
  .pile-paper .line.has-item > .content:has(> .close-top) > textarea.item-title { padding-right: 84px !important; }
  /* Pills beside a short name keep clear of that spot, as a task's do (always, so nothing moves on hover). */
  :is(.pile-paper, #lines) .line.has-item > .content { --more-room: 59px; }
  :is(.pile-paper, #lines) .line.has-item > .content:has(> .edit-pills.pill-top) { --more-room: 101px; }
  :is(.pile-paper, #lines) .line.has-item > .content:has(> .edit-pills.pill-top > .pill-reveal kbd) { --more-room: 153px; }
  :is(.pile-paper, #lines) .line.has-item > .content:has(> .close-top) { --more-room: 121px; }
  .pile-paper .line.has-item > .content:has(> .edit-pills.pill-top) { --more-room: 73px !important; }
  .pile-paper .line.has-item > .content:has(> .close-top) { --more-room: 89px !important; }
  /* (📝 is a .span-tag too, shown only with Tight spacing: then it is the last one.) */
  :is(.pile-paper, #lines) .line.has-item > .content > .span-tag:not(.note-tag):not(:has(~ .span-tag:not(.note-tag))) { margin-right: var(--more-room); }
  #main[data-density="tight"] :is(.pile-paper, #lines) .line.has-item > .content:has(> .note-tag) > .span-tag:not(.note-tag) { margin-right: 0; }
  #main[data-density="tight"] :is(.pile-paper, #lines) .line.has-item > .content:has(> .span-tag:not(.note-tag)) > .note-tag:not(:has(~ .note-tag)) { margin-right: var(--more-room); } /* the last of 📝 📎 */
  :is(.pile-paper, #lines) .line.has-item > .content:has(> .att-tag) > .span-tag:not(.att-tag) { margin-right: 0; }
  :is(.pile-paper, #lines) .line.has-item > .content:has(> .span-tag:not(.note-tag)) > .att-tag { margin-right: var(--more-room); } /* 📎 shows in every spacing, last (markers alone: far end, below) */
}
@media (hover: none) { #main .line.has-item > .content:has(> .close-top, > .edit-pills.pill-top) > textarea.item-title { max-width: calc(100% - 104px); } } /* phones: beside the name */
/* A schedule item being edited: its time and note pills go (the pills under it say the same), as a task's chips do. */
#lines .line.has-item.pills-open > .content > :is(.span-tag, .note-tag) { display: none; }
:is(.pill-reveal, .task-list > li[data-task] > .more, .line.has-item > .content > .more, .item-list > li[data-item] > .more, .close-top, .md-full, .bare-full, .note-full-done) { color: var(--text); border-color: color-mix(in srgb, var(--energy-ink, #4caf7a) 40%, transparent); background: color-mix(in srgb, var(--energy-ink, #4caf7a) 13%, transparent); }
:is(.pill-reveal, .task-list > li[data-task] > .more, .line.has-item > .content > .more, .item-list > li[data-item] > .more, .close-top, .md-full, .bare-full, .note-full-done):is(:hover, :focus-visible) { border-color: color-mix(in srgb, var(--energy-ink, #4caf7a) 65%, transparent); background: color-mix(in srgb, var(--energy-ink, #4caf7a) 24%, transparent); outline: none; }
#main:not([data-density="tight"]) .task-list > li[data-task]:has(> .edit-pills > .pill-reveal) > .item-sub { order: 4; }
.edit-pills:has(> .pill-reveal) > :not(.pill-reveal, .pill-done) { display: none; }
#main[data-density="tight"] .task-list > li[data-task]:has(> .edit-pills > .pill-reveal):not(:has(> .note-in-place, > .edit-pills:not(.pill-top))) { flex-wrap: nowrap; }
#main[data-density="tight"] .task-list > li[data-task]:has(> .edit-pills > .pill-reveal) > .task-title { flex: 1 1 0; min-width: 0; } /* basis 0: a name never pushes itself onto a line of its own (Safari sized it full width) */
.task-entry:not(.typed) .task-add-line > .pill-reveal, .task-entry.revealed .task-add-line > .pill-reveal, .task-entry:has(.task-add-line > .pill-reveal):not(.revealed) .task-entry-more { display: none; }
.layout-opt[hidden] { display: none; }
/* A switch that goes with the one above: indented under it, joined by an L like a sub-task's. */
.layout-opt.layout-sub { position: relative; padding-left: 30px; }
.layout-opt.layout-sub::before { content: ''; position: absolute; left: 9px; top: -6px; width: 12px; height: calc(50% + 6px); border-left: 1px solid var(--vm-line); border-bottom: 1px solid var(--vm-line); }
.layout-opt.layout-sub:has(+ .layout-sub:not([hidden]))::after { content: ''; position: absolute; left: 9px; top: 50%; bottom: -3px; border-left: 1px solid var(--vm-line); }
/* 👁 Style: a tile per style (skins in viewcog.js), each with a small sample drawn in its own look; the picked style's own options under it. */
.view-settings .skin-opts { gap: 6px; flex-wrap: nowrap; }
.view-settings .skin-opts .skin-pill { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 6px 5px; min-width: 0; white-space: nowrap; }
.skin-sample { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 100%; max-width: 66px; height: 40px; padding: 0 6px; box-sizing: border-box; border-radius: 6px; border: 1px solid var(--vm-line); position: relative; }
.skin-sample i { display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--vm-text) 22%, transparent); }
.skin-sample i:nth-child(2) { width: 75%; } .skin-sample i:nth-child(3) { width: 55%; }
.skin-pill[data-skin="lined"] .skin-sample { gap: 0; padding: 0 6px 0 16px; background: repeating-linear-gradient(to bottom, transparent 0 9px, color-mix(in srgb, #6fa8ff 55%, transparent) 9px 10px); background-position: 0 4px; }
.skin-pill[data-skin="lined"] .skin-sample::before { content: ''; position: absolute; top: 0; bottom: 0; left: 11px; width: 1.5px; background: rgba(230, 90, 100, .7); }
.skin-pill[data-skin="lined"] .skin-sample i { height: 2px; margin: 3.5px 0 4px; border-radius: 1px; background: color-mix(in srgb, var(--vm-text) 55%, transparent); }
.skin-own .layout-opts { position: relative; margin: 4px 0 2px; padding-left: 14px; }
.skin-own .layout-opts::before { content: ''; position: absolute; left: 6px; top: -2px; bottom: 12px; width: 6px; border-left: 1px solid var(--vm-line); border-bottom: 1px solid var(--vm-line); }
.skin-own[hidden] { display: none; }
.skin-pill[data-skin="minimal"] .skin-sample { gap: 0; padding: 0 6px; }
.skin-pill[data-skin="minimal"] .skin-sample i { height: 2px; margin: 4px 0 4px 10px; border-radius: 1px; position: relative; background: color-mix(in srgb, var(--vm-text) 55%, transparent); }
.skin-pill[data-skin="minimal"] .skin-sample i::before { content: ''; position: absolute; left: -10px; top: -2px; width: 5px; height: 5px; border: 1px solid color-mix(in srgb, var(--vm-text) 50%, transparent); border-radius: 1px; box-sizing: border-box; }
/* Lined paper layout (👁 Layout, on unless unticked). Unticked, Tasks look as in
   earlier versions: New task a rounded box at the top with Add, and each task a
   shaded rounded card, its sub-tasks inside the same card. */
.entry-add { display: none; }
#main:is([data-area="tasks"], [data-area="lists"]):not([data-layout-lined]) {
  .task-add-line, .task-add-line:focus-within { margin: 0 0 var(--row-gap, 6px); padding: 2px 3px 2px 14px; min-height: var(--task-row-h, 44px); border: 1px solid var(--glass-border); border-radius: 14px; background: var(--glass-track); }
  .task-add-line:focus-within { border-color: var(--active-border); }
  .task-add-line::after { display: none; }
  .task-add-line > .add-mark { display: none; }
  .task-add-line .new-task-line { margin-left: 0; padding-left: 0; }
  .entry-add { display: inline-flex; align-items: center; flex: none; padding: 3px 12px; } /* slim, so New task is no taller than a task (rows.js --task-row-h) */
  #task-entry + .task-list { margin-top: 0; }
  #task-entry .task-add-line { margin-bottom: 15px; } /* room between New task and the tasks */
  .task-list { gap: var(--row-gap, 6px); }
  .task-list > li[data-task] { background: var(--glass-track); border: 1px solid var(--glass-border); border-radius: 14px; box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 7%, transparent); } /* glass: a faint light along the top edge */
  .task-list > li[data-task]:hover, .task-list > li[data-task]:focus-within { background: var(--glass); border-color: var(--glass-border); }
  .task-list > li[data-task]::after { display: none; }
  .task-list > li[data-task] > .task-title:focus { background: color-mix(in srgb, var(--text) var(--line-lit), transparent); }
  .task-list > li.group-top { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }
  .task-list > li.group-kid { margin-top: calc(-1 * var(--row-gap, 6px)); border-radius: 0; border-top-color: transparent; }
  .task-list > li.group-kid:not(.group-end) { border-bottom-color: transparent; }
  .task-list > li.group-kid.group-end { border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; }
  .task-list > li[data-task]:nth-child(even of li[data-task]) { background-image: none; }
  .task-list > li[data-task]:has(+ li.task-details) { background: var(--glass-track) !important; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }
  .task-list > li[data-task]:has(+ li.task-details)::before { display: none; }
  .task-list > li.task-details { margin: calc(-1 * var(--row-gap, 6px)) 0 2px !important; border: 1px solid var(--glass-border); border-top: 0; border-radius: 0 0 14px 14px; }
  /* A little gap under each card, even in Compact spacing (not inside a card: a task and its sub-tasks, or its open panel). */
  .task-list > li[data-task]:not(.group-top, .group-kid:not(.group-end), :has(+ li.task-details)) { margin-bottom: 2px; }
}
#main:is([data-area="tasks"], [data-area="lists"])[data-shade="alt"]:not([data-layout-lined]) .task-list > li[data-task]:nth-child(even of li[data-task]) { background-color: color-mix(in srgb, var(--text) 7%, var(--glass-track)); }
/* The More pill's shortcut (Hide pills behind More). */
.pill-reveal kbd, .pill-done kbd { margin-left: 5px; }
/* A shortcut of two keys or more: a box each, close together (keys.js). */
kbd + kbd, .pill-reveal kbd + kbd, .pill-done kbd + kbd { margin-left: 3px; }
/* ✓ Done beside More (editpills.js): only with a keyboard and room, where its shortcut is the point. */
.pill-done { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 700px) {
  .pill-done { display: inline-flex; align-items: center; }
  /* ✓ Done before More, so More is always at the far right. */
  .edit-pills.pill-top > .pill-done { margin-left: auto; }
  .edit-pills.pill-top > .pill-done + .pill-reveal { margin-left: 6px; }
}

/* Share pill in every area, left of 👁 and ⋯ (the Day Planner's look). */
.page-share { margin-left: auto; flex: none; }
.page-share + .page-cog { margin-left: 4px; }
.page-share summary { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--glass-border); background: var(--glass); }
.page-share .icon { width: 18px; height: 18px; }
.day-nav .view-menu { margin-left: 2px; }
@media (max-width: 560px) { .page-share summary { padding: 6px 10px; } }
/* More pressed on a task with a note: the note in full under the name; its small preview steps aside. */
.task-list .edit-pills .note-shown { flex: 1 0 100%; order: -1; margin: -4px 0 2px; cursor: text; font-size: .9rem; line-height: 1.4; color: var(--muted); white-space: normal; padding: 2px 0; }
.task-list .edit-pills .note-shown > :first-child { margin-top: 0; }
.task-list .edit-pills .note-shown > :last-child { margin-bottom: 0; }
#main[data-density="tight"] .task-list > li[data-task]:has(.edit-pills .note-shown) > .item-sub .task-note { display: none; }
#main:not([data-density="tight"]) .task-list .edit-pills .note-shown { display: none; } /* medium and loose show the note already */
@media (max-width: 560px) { .page-share summary { font-size: 0; gap: 0; padding: 6px 10px; } .page-share summary .icon { font-size: 1rem; } }
.task-list > li[data-task]:has(> .note-in-place) > .item-sub .task-note { display: none; }

/* ---------- sharing with other people (js/sharing.js) ---------- */
/* Someone else's things on screen: a clear note, not an alarm (amber, not red). */
.theirs-note, .share-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 14px; border-radius: 16px; font-size: .92rem; }
.theirs-note { background: color-mix(in srgb, #f5b642 22%, transparent); border: 1px solid color-mix(in srgb, #f5b642 55%, transparent); }
.share-invite { background: var(--calm, var(--glass)); border: 1px solid var(--active-border); }
.theirs-note .spacer, .share-invite .spacer { flex: 1; }
.theirs-note button, .share-invite button { padding: 4px 12px; }
/* Someone else's recipe or batch (views/recipes.js lockPage): to read, nothing to change */
.bb-readonly :is(.bb-listline, .bb-stock-btn:not([aria-pressed="true"]), .bb-x, .bb-add-field, .bb-foot, .bb-batch-del, .bb-reading-adds, .bb-scale:has([data-rescale]), [data-entry-photo], [data-step-photo], .att-add, .att-x, .drag-handle, .bb-line:has(.bb-ing-add, .bb-step-new, [data-add-entry])) { display: none; }
.bb-readonly .bb-paper :is(input, textarea, select):is([readonly], :disabled) { cursor: default; opacity: 1; }
.bb-readonly :is([data-batch-status], [data-stock], [data-step-view]) { pointer-events: none; }
.share-people { list-style: none; margin: 0 0 12px; padding: 0; }
.share-people li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--glass-border); }
.share-people li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.share-to .share-suggest { position: static; margin-top: -5px; max-width: none; max-height: 220px; box-shadow: none; } /* in the sheet's flow, so it's never cut off */
.share-suggest .dd-opt { padding-left: 12px; white-space: normal; overflow-wrap: anywhere; }
.share-past { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; font-size: .85rem; }
.share-error { color: #e0573a; margin: 0 0 8px; }
/* An open project has its own Share (with 👥 people) in its head, so the area's Share steps aside. */
#main:has(.project-head .page-share) .area-share { display: none; }
#main:has(.project-head .page-share) .area-share + .page-cog { margin-left: auto; } /* 👁 and ⋯ stay at the far right without it */
.project-head .share-btn-people { padding: 4px 12px; font-size: .85rem; white-space: nowrap; }
.share-chip { cursor: pointer; }
.day-people { display: contents; }
.day-shared-with { margin: 0 0 8px; font-size: .85rem; }
.planner.theirs .bring-link, .planner.theirs .day-housekeeping, .planner.theirs .day-nav .page-more, .planner.theirs .carry { display: none; }
.planner.not-shared :is(.day-head, .schedule-title, .paper, .day-bottom) { opacity: .35; }
#main.theirs .dump-find .hint,
#main.theirs .thought-actions > :is([data-act="to-task"], [data-act="plan"], [data-act="store"]),
#main.theirs .archive-pill, #main.theirs .note-more :is([data-act="comment"], [data-act="append"], [data-att-add]) { display: none; }

/* Custom theme editor (Settings → Appearance → Custom…). Its own frame keeps
   fixed colours, so it stays readable whatever is picked; the mockup inside
   (.ct-mock) is drawn by the theme, the picks and the #main rules copied for it. */
dialog.custom-theme { --ct-bg: #182032; --ct-text: #e8edf5; --ct-muted: #9aa6ba; --ct-line: rgba(255, 255, 255, .12); width: min(1200px, calc(100vw - 16px)); max-width: none; height: min(94dvh, 1100px); max-height: none; margin: auto; padding: 0; border-radius: var(--radius-card); border: 1px solid var(--ct-line); background: var(--ct-bg); color: var(--ct-text); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; display: none; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
dialog.custom-theme[open] { display: flex; }
dialog.custom-theme::backdrop { background: rgba(0, 0, 0, .35); }
.ct-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--ct-line); }
.ct-head h2 { margin: 0; font-size: 1.1rem; margin-right: auto; }
.ct-base { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ct-muted); }
.ct-tabs { display: flex; gap: 4px; padding: 8px 12px; overflow-x: auto; border-bottom: 1px solid var(--ct-line); scrollbar-width: thin; }
.ct-tabs button { flex: none; padding: 5px 12px; border-radius: 999px; background: transparent; box-shadow: none; border: 1px solid transparent; color: var(--ct-muted); font: inherit; font-size: .88rem; }
.ct-tabs button[aria-selected="true"] { color: var(--ct-text); border-color: var(--ct-line); background: rgba(255, 255, 255, .08); font-weight: 600; }
.ct-body { flex: 1; overflow: auto; padding: 8px 16px calc(18px + var(--safe-bottom)); }
.ct-intro { color: var(--ct-muted); margin: 6px 0 10px; font-size: .88rem; }
.ct-mock { position: relative; background-color: var(--bg); background-image: var(--bg-image); background-size: cover; color: var(--text); font-family: var(--font); padding: 18px; border-radius: 14px; border: 1px solid var(--ct-line); --tabbar-h: 0px; --safe-bottom: 0px; }
.ct-mock [data-edit] { cursor: pointer; }
.ct-mock .ct-hot { outline: 2px dashed #ffb020; outline-offset: 3px; }
.ct-mock :focus-visible { outline: 2px solid #ffb020; outline-offset: 3px; }
.ct-mock .appbar, .ct-mock .tabbar { position: relative !important; inset: auto !important; display: flex !important; transform: none !important; }
.ct-mock .ct-topnav-links { display: flex; gap: 6px; }
.ct-mock .ct-mock-gap { height: 18px; }
.ct-mock .ct-mock-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin: 16px 0; }
.ct-mock .ct-mock-menu { position: static; display: flex; flex-direction: column; min-width: 220px; }
.ct-mock .ct-mock-sheet { position: static; display: block; margin: 0; padding: 16px 20px; min-width: 240px; max-width: 360px; border-radius: 18px; background: var(--glass-strong); border: 1px solid var(--glass-border); }
.ct-mock .ct-mock-bg { margin: 16px 0 0; padding: 18px 0 4px; }
.ct-mock .ct-mock-note { margin-top: 0; }
.ct-all { margin: 14px 0; }
.ct-all summary { cursor: pointer; color: var(--ct-muted); font-size: .9rem; padding: 6px 0; }
.ct-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(150px, 260px) 32px; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--ct-line); }
.ct-row.is-set .ct-label { font-weight: 600; }
.ct-row input[type="color"] { width: 44px; height: 30px; padding: 2px; border-radius: 8px; cursor: pointer; flex: none; }
.ct-row select { width: 100%; }
.ct-colour, .ct-slide { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ct-slide input[type="range"] { flex: 1; min-width: 60px; }
.ct-num, .ct-num-label { font-size: .75rem; color: var(--ct-muted); white-space: nowrap; }
.ct-num { min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.ct-reset { padding: 2px 6px; background: transparent; box-shadow: none; border-color: transparent; color: var(--ct-text); }
.ct-pop { position: absolute; z-index: 5; width: min(460px, calc(100% - 16px)); padding: 6px 12px 10px; border-radius: 14px; background: var(--ct-bg); color: var(--ct-text); border: 1px solid rgba(255, 255, 255, .22); box-shadow: 0 14px 40px rgba(0, 0, 0, .55); }
.ct-pop .ct-row:last-child { border-bottom: 0; }
.ct-pop-head { display: flex; align-items: center; justify-content: space-between; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ct-muted); padding: 4px 0; }
.ct-pop-x { padding: 2px 8px; background: transparent; box-shadow: none; border-color: transparent; color: var(--ct-text); }
.ct-msg { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 6; width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: #5a1f1f; color: #fff; border: 1px solid #ff8a8a; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: .9rem; }
.ct-msg .swatch { border-color: #fff; }
@media (max-width: 640px) { .ct-row { grid-template-columns: 1fr 32px; } .ct-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; } .ct-head h2 { font-size: 1rem; } }

/* Welcome (the first time Sift is opened): one panel in the middle of an empty page. */
.welcome { min-height: 62vh; display: grid; place-items: center; align-content: center; gap: 18px; padding: 8px 0 24px; }
/* The choice of tours (views/welcome.js): four big cards, each with its own colour. */
.welcome-top { text-align: center; max-width: 620px; }
.welcome-top h2 { font-size: clamp(2rem, 6vw, 2.8rem); margin: 0 0 8px; letter-spacing: -.01em; }
.welcome-top .welcome-lead { margin: 0; }
.tour-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: 100%; max-width: 880px; }
@media (max-width: 640px) { .tour-picks { grid-template-columns: minmax(0, 1fr); gap: 10px; } }
.tour-pick { position: relative; display: grid; align-content: start; gap: 6px; padding: 18px 18px 16px; text-align: left; font: inherit; color: var(--text); border-radius: 22px; border: 1px solid var(--glass-border); border-top: 5px solid var(--c); box-shadow: var(--glass-highlight, none); cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, transparent), transparent 55%), var(--glass); }
button.tour-pick:hover, button.tour-pick:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 55%, var(--glass-border)); outline: none; }
.tour-pick-more { cursor: default; }
.pick-emoji { font-size: 2.2rem; line-height: 1; margin-bottom: 2px; }
.pick-title { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.pick-who { font-size: .88rem; font-weight: 600; color: color-mix(in srgb, var(--c) 60%, var(--text)); }
.pick-why { font-size: .9rem; line-height: 1.4; color: var(--muted); }
.pick-state { justify-self: start; margin-top: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; background: color-mix(in srgb, var(--c) 18%, transparent); }
.pick-state.seen { background: none; padding-left: 0; color: var(--muted); }
/* The tour showing a task's More without hovering, and a green button drawn in its words. */
.task-list > li.tour-more > .more { visibility: visible !important; }
.tour-green { display: inline-block; padding: 0 9px; border-radius: 999px; font-size: .85em; line-height: 1.6; color: var(--text); border: 1px solid color-mix(in srgb, var(--energy-ink, #4caf7a) 40%, transparent); background: color-mix(in srgb, var(--energy-ink, #4caf7a) 13%, transparent); }
/* A quote in a tour step: a callout that stands out from the rest. */
.tour-quote { display: flex; gap: 12px; align-items: flex-start; margin: 2px 0 10px; padding: 10px 14px; border-radius: 12px; border-left: 4px solid #5b9dff; background: color-mix(in srgb, #5b9dff 14%, transparent); }
.tour-quote-icon { font-size: 1.8rem; line-height: 1; flex: none; }
.tour-quote-text { display: block; font-size: 1.08rem; font-style: italic; font-weight: 600; line-height: 1.35; }
.tour-quote-who { display: block; margin-top: 4px; font-size: .82rem; color: var(--muted); }
.tour-body .tour-list { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 4px; }
.tour-body .tour-list li { padding: 5px 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.tour-try::before { content: '➜'; margin-right: 7px; color: #4caf7a; font-weight: 800; } /* every Try it: a green arrow to what to do */
.tour-body .tour-try + .tour-try { margin-top: -4px; }
.tour-handle { display: inline-grid; place-items: center; min-width: 1.5em; padding: 0 3px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .35); color: #fff; font-weight: 700; line-height: 1.35; }
.tour-already { color: #7fd6a0; font-weight: 600; }
.tour-demo { margin: 0 auto 0 10px; padding: 1px 8px; border-radius: 999px; font-size: .72rem; white-space: nowrap; background: color-mix(in srgb, var(--energy-ink, #4caf7a) 16%, transparent); color: var(--text); }
.tour-demo-note { margin: 0 0 8px; padding: 6px 10px; border-radius: 10px; font-size: .88rem; background: color-mix(in srgb, var(--energy-ink, #4caf7a) 12%, transparent); }
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pick-chip { padding: 8px 14px; border-radius: 999px; font-size: .92rem; border-color: color-mix(in srgb, var(--c) 35%, var(--glass-border)); }
.pick-chip:hover, .pick-chip:focus-visible { border-color: color-mix(in srgb, var(--c) 65%, var(--glass-border)); background: color-mix(in srgb, var(--c) 16%, transparent); outline: none; }
.pick-chip.seen { opacity: .8; }
.pick-tick { color: var(--energy-ink, #4caf7a); font-weight: 700; }
.welcome-after { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.welcome-after button { padding: 9px 16px; }
.welcome-card { max-width: 560px; margin: 0; text-align: center; padding: 32px 28px; }
.welcome-card h2 { font-size: clamp(2.2rem, 7vw, 3rem); margin: 0 0 12px; letter-spacing: -.01em; }
.welcome-lead { font-size: 1.1rem; line-height: 1.55; margin: 0 0 24px; }
.welcome-choices { display: grid; gap: 10px; }
.welcome-choices button { padding: 12px 18px; font-size: 1rem; }

/* The tour (tour.js): a ring round what a step points at, everything else dimmed
   (the ring lets clicks through, so things can be tried), and a card saying what
   to do. Fixed colours, so it reads the same on every theme. */
.tour-ring { position: fixed; z-index: 1200; pointer-events: none; border-radius: 14px; outline: 2px solid #ffb020; outline-offset: 0; box-shadow: 0 0 0 200vmax rgba(4, 8, 20, .58); }
.tour-ring.whole { outline: none; border-radius: 0; box-shadow: none; background: rgba(4, 8, 20, .58); }
.touring .toast { z-index: 1250; } /* over the dimming, under the card */
.tour-lift-bar .select-bar { z-index: 1250; } /* a tour step that has the selection bar used: above the dimming, below the card */
.tour-bar-lit.tour-lift-bar .select-bar { outline: 3px solid #ffb020; outline-offset: 3px; box-shadow: 0 0 0 7px rgba(255, 176, 32, .25), var(--shadow); } /* once in use: outlined in the tour's yellow */
.tour-bar-label { position: fixed; z-index: 1260; pointer-events: none; display: flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: #182032; color: #ffd479; font: 700 .85rem/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; border: 1px solid #ffb020; }
.tour-bar-label[hidden] { display: none; }
/* A card kept low, under the list it's about: smaller, so the list shows above it. */
.tour-card.low { font-size: .86rem; line-height: 1.4; padding: 10px 14px 10px; }
.tour-card.low .tour-head { margin: -10px -14px 2px; padding: 12px 14px 2px; }
.tour-card.low h3 { margin: 0 0 4px; font-size: 1rem; }
.tour-card.low p { margin: 0 0 6px; }
.tour-card.low .tour-foot { margin-top: 6px; }
.tour-bar-arrow { font-size: 1.2rem; line-height: 1; color: #ffb020; }
.tour-card { position: fixed; z-index: 1300; width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 12px 18px 14px; border-radius: 16px; background: #182032; color: #e8edf5; border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 16px 50px rgba(0, 0, 0, .6); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: .92rem; line-height: 1.5; }
.tour-card h3 { margin: 2px 0 8px; font-size: 1.1rem; color: #fff; }
.tour-card p { margin: 0 0 8px; }
.tour-card ul { margin: 0 0 8px; padding-left: 1.2em; }
.tour-card b { color: #fff; }
.tour-card kbd { border-color: rgba(255, 255, 255, .35); opacity: 1; margin-left: 0; }
.tour-head { position: relative; display: flex; align-items: center; justify-content: space-between; margin: -12px -18px 4px; padding: 12px 18px 4px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.tour-card.dragging .tour-head { cursor: grabbing; }
.tour-grip { position: absolute; top: 5px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: rgba(255, 255, 255, .28); } /* the card is dragged by its top row */
.tour-count { font-size: .75rem; color: #9aa6ba; letter-spacing: .04em; }
.tour-x { padding: 2px 8px; background: transparent; box-shadow: none; border-color: transparent; color: #e8edf5; }
.tour-try { color: #ffd479; font-weight: 600; }
.tour-keys { border-collapse: collapse; margin: 0 0 8px; width: 100%; }
.tour-keys td { padding: 3px 8px 3px 0; vertical-align: top; }
.tour-keys td:first-child { white-space: nowrap; }
.tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.tour-nice { margin-left: auto; color: #8fdcaa; font-weight: 600; }
.tour-ring.tour-also { box-shadow: none; outline: 2px dashed #ffb020; border-radius: 12px; } /* where the page is in the navigation */
.tour-card kbd { display: inline-block; min-width: 1.6em; text-align: center; padding: 1px 6px; border-radius: 6px; font-size: .8em; background: rgba(255, 255, 255, .08); box-shadow: 0 1px 0 rgba(255, 255, 255, .25); }
.tour-card kbd.tour-arrow { font-size: 1.05em; font-weight: 700; padding: 0 7px; }
.tour-plus { margin: 0 3px; color: #9aa6ba; }
.tour-or { margin: 0 4px; color: #9aa6ba; font-size: .85em; }
.tour-keys td:first-child { line-height: 2; }
.tour-foot { flex-wrap: wrap; }
.tour-foot button kbd { margin-left: 6px; }
/* The tour's buttons: one row (Back, End tour early, Next), each a proper button sharing the width; a step
   offering a tour for later puts its choice (Save for later, Skip) on a row of its own above. */
.tour-foot button { white-space: nowrap; }
.tour-foot > [data-tour="next"] { margin-left: auto; }
.tour-choice { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.tour-choice > button { flex: 1 1 auto; justify-content: center; } /* side by side, or one above the other on a narrow phone */
.welcome-was { margin: -2px 0 4px; font-size: .85rem; }
.tour-pill { font-weight: 600; color: var(--accent); border-color: var(--active-border); background: var(--active-bg); }
.note-full .tour-ring, .note-full .tour-card { display: none; } /* writing in a full-screen note: the tour waits */

/* Phones: a side swipe slides the page (app.js: installSwipe), as a phone's own
   screens do: the old page out, the next one in over it from the side. The bars
   stay put, above it. */
html[data-slide] :is(#task-body, #thoughts, #main .planner, #main .bb-body), html[data-slide] #main:not(:has(#task-body, #thoughts, .planner, .bb-body)) { view-transition-name: sift-page; }
html[data-slide] :is(#task-entry, #main .planner > .day-nav) { view-transition-name: sift-still; } /* inside what slides, but stays */
html[data-slide] :is(#main .tasks-head, #main .dump-bar, #main .bb-sticky, #main .bb-top) { view-transition-name: sift-bar; } /* stays, over the sliding part when it sticks at the top */
html[data-slide] .appbar { view-transition-name: sift-top; }
html[data-slide] #tabbar { view-transition-name: sift-tabs; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(sift-page) { animation: none; }
::view-transition-group(sift-top), ::view-transition-group(sift-tabs), ::view-transition-group(sift-still), ::view-transition-group(sift-bar) { animation: none; z-index: 2; }
::view-transition-old(sift-top), ::view-transition-new(sift-top), ::view-transition-old(sift-tabs), ::view-transition-new(sift-tabs), ::view-transition-new(sift-still), ::view-transition-new(sift-bar) { animation: none; }
::view-transition-old(sift-still), ::view-transition-old(sift-bar) { display: none; } /* shown as they are now, straight away */
/* A tab bar's highlight gliding to the new tab (slide.js); the real one is hidden till it arrives. */
/* …then flashes once (flash.js: WASH), inside the tab, since a tab bar that scrolls clips anything outside it.
   Only its top corners round, so the underline stays straight. */
#main :is([role="tablist"], #dump-filter) button.flash { border-radius: var(--flash-radius, 8px) var(--flash-radius, 8px) 0 0 !important; }
.tab-glide { position: absolute; z-index: 1; pointer-events: none; box-sizing: border-box; }
.glide-on { position: relative; }
#main .glide-on :is([aria-pressed="true"], [aria-selected="true"]) { border-color: transparent !important; background-color: transparent !important; }
::view-transition-old(sift-page) { animation: .3s cubic-bezier(.2, .8, .2, 1) both sift-out-next; }
::view-transition-new(sift-page) { animation: .3s cubic-bezier(.2, .8, .2, 1) both sift-in-next; }
html[data-slide="back"]::view-transition-old(sift-page) { animation-name: sift-out-back; }
html[data-slide="back"]::view-transition-new(sift-page) { animation-name: sift-in-back; }
@keyframes sift-out-next { to { transform: translateX(-30%); opacity: 0; } }
@keyframes sift-in-next { from { transform: translateX(100%); } }
@keyframes sift-out-back { to { transform: translateX(30%); opacity: 0; } }
@keyframes sift-in-back { from { transform: translateX(-100%); } }

/* Phones: a row swiped sideways (rowswipe.js: tasks, Day Planner items). The
   row stays put and its actions slide in over its end (a Day Planner line's
   from its grab bar on, never over the time): ✓ Done and ⋯ More from the
   right, Delete from the left. rowswipe.js places them and rounds their outer corners. */
.swiping { position: relative; }
.row-acts { position: absolute; z-index: 3; width: var(--swipe-w, 0); display: flex; overflow: hidden; }
.swipe-anim > .row-acts { transition: width .22s cubic-bezier(.2, .8, .2, 1); }
/* Once the actions reach the name, the row's contents go along ahead of them,
   cut off at its edge (never over the Day Planner's time). --swipe-p: how far
   they're pushed; --swipe-off: how far a part can go before it's cut off. */
@property --swipe-p { syntax: '<length>'; inherits: true; initial-value: 0px; }
.swipe-anim { transition: --swipe-p .22s cubic-bezier(.2, .8, .2, 1); }
.swipe-push.left > .swipe-mover { transform: translateX(calc(-1 * var(--swipe-p, 0px))); clip-path: inset(-20px 0 -20px max(0px, calc(var(--swipe-p, 0px) - var(--swipe-off, 0px)))); }
.swipe-push.right > .swipe-mover { transform: translateX(var(--swipe-p, 0px)); clip-path: inset(-20px max(0px, calc(var(--swipe-p, 0px) - var(--swipe-off, 0px))) -20px 0); }
.row-acts button { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; border: 0; border-radius: 0; box-shadow: none; margin: 0; color: #fff; font-weight: 600; font-size: .9rem; padding: 0 12px; }
.row-acts .ra-done { background: #2e9e5b; }
.row-acts .ra-more { background: #5a6883; }
.row-acts .ra-delete { background: #d64545; padding: 0 22px; }

/* Day Planner: the day bar stays on one line (container: .day-nav), after its own button rules. */
@container (max-width: 400px) { .day-nav .share-word { display: none; } .day-nav .share-menu summary { padding-inline: 12px; } } /* no room for the word: Share is its icon */
@container (max-width: 340px) { .day-nav .day-step { padding-inline: 7px; } .day-nav .cal-icon { padding-inline: 6px; } .day-nav > button:not(.day-step, .cal-icon) { padding-inline: 6px; } .day-nav .share-menu summary { padding-inline: 8px; } .day-nav .view-menu { margin-left: 0; } .day-nav .tool-menu > .icon-btn { width: 32px; } } /* the smallest phones: tighter still */
@media (max-width: 400px) { .day-nav { gap: 3px; } } /* a container can't query itself */

/* Tasks, compact spacing: beside a task's name only its note (📝; and a tour's ▶ pill), no other pills,
   so the name has room; and none at all while its editing pills are open (they show the same things). */
#main[data-density="tight"] .task-list > li[data-task] > .item-sub > :not(.item-note, .tour-pill, .att-mark) { display: none; }
#main[data-density="tight"] .task-list > li[data-task].pills-open > .item-sub { display: none; }
/* …except, on a wide screen, its 📝: it stays just after the words while the name is written in (moving
   as you type), and pressing it goes into the note, as Shift+Enter does (views/tasks.js). */
@media (min-width: 700px) {
  #main[data-density="tight"] .task-list > li[data-task].pills-open:has(> .item-sub > .task-note) > .item-sub { display: flex; flex: none; margin-left: 11px; } /* 📝 about 25px after the words */
  #main[data-density="tight"] .task-list > li[data-task].pills-open > .item-sub > :not(.task-note) { display: none; }
  #main[data-density="tight"] .task-list > li[data-task].pills-open:has(> .item-sub > .task-note) > .task-title { flex: 0 1 auto; }
}

/* Day Planner, phones: an item a first tap got ready (planner.js: armed). It's
   held still for dragging by any part of it, and its stretch bar shows fully,
   with room around it for a finger. */
.line.has-item.armed { touch-action: none; }
.line.has-item.armed > .content { background: var(--active-bg); box-shadow: inset 0 0 0 1px var(--active-border); border-radius: 10px; }
.line.has-item.armed .resize-grip { opacity: 1; pointer-events: auto; }
.line.has-item.armed .resize-grip::before { content: ''; position: absolute; inset: -14px -24px; }

/* Press and hold anywhere on a task to drag it (sortable.js: anywhere). A
   ripple spreads from the finger or pointer while it's held; when it's done
   the row lifts. */
.hold-pending { position: relative; isolation: isolate; } /* the shading goes under its text */
.hold-ripple { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; z-index: -1; }
.hold-ripple > span { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 19%, transparent) 0%, color-mix(in srgb, var(--accent) 15%, transparent) 85%, color-mix(in srgb, var(--accent) 8%, transparent) 100%);
  animation: hold-ripple 300ms cubic-bezier(.45, 0, .55, 1) forwards; }
.hold-ripple.done { transition: opacity .3s; opacity: 0; }
@keyframes hold-ripple { from { transform: scale(.3); opacity: .9; } to { transform: scale(var(--reach, 22)); opacity: 1; } }
/* Water rings from the press (hold.js): faint, soft rings in the shading's colour, blurring what they pass over. */
.hold-waves { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; z-index: 2; }
.hold-waves > span { position: absolute; border-radius: 50%; opacity: 0; transform: scale(.02); animation: hold-wave 1100ms cubic-bezier(.25, .45, .45, 1) both; filter: blur(9px);
  background: radial-gradient(circle closest-side, transparent calc(100% - 26px), color-mix(in srgb, var(--accent) 16%, transparent) calc(100% - 12px), transparent 100%);
  -webkit-mask-image: radial-gradient(circle closest-side, transparent calc(100% - 28px), #000 calc(100% - 14px), transparent 100%); mask-image: radial-gradient(circle closest-side, transparent calc(100% - 28px), #000 calc(100% - 14px), transparent 100%);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes hold-wave { 0% { transform: scale(.02); opacity: 0; } 15% { opacity: .4; } 100% { transform: scale(1); opacity: 0; } }
/* A sub-task dragged out of its family (listkit.js): it shows as a task of its
   own (whole rounded box), and the row above closes the family off. */
.task-list > li.dragging.coming-out { border-radius: 14px !important; border-color: var(--active-border) !important; margin-top: 0 !important; } /* its own box, apart from the group */
.task-list > li.dragging.coming-out > .tick { margin-left: 0 !important; }
.task-list > li.dragging.coming-out > .item-sub { margin-left: var(--title-x, 67px) !important; }
body.is-dragging .task-list :is(.tree-v, .tree-h) { opacity: 0; } /* the lines joining sub-tasks are redrawn after the drop */
.task-list > li.heal-end { border-bottom-left-radius: 14px !important; border-bottom-right-radius: 14px !important; border-bottom-color: var(--glass-border) !important; }
body.is-dragging [data-hold-drag] { -webkit-user-select: none; user-select: none; }
@media (hover: none) { :is([data-hold-drag] > li :is(.task-title, .item-sub), [data-hold-drag] .line.has-item .item-title):not(:focus) { -webkit-user-select: none; -webkit-touch-callout: none; } }
/* Phones: a hold on Tasks (or a list row's gaps, pills, lines) never starts a page text selection that spreads blue over every row; text being typed still selects. */
@media (hover: none) {
  :is(#task-body, [data-hold-drag] > li) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  :is(#task-body, [data-hold-drag] > li) :is(:is(input, textarea):not(.task-title), .task-title:focus, [contenteditable="true"], [contenteditable="true"] *) { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
  /* Buttons and the bars of areas and tabs: never text to select. */
  :is(button, nav, summary, [role="button"], [role="tab"], .tabbar) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  :is(button, nav, summary, [role="button"], [role="tab"], .tabbar) :is(input, textarea, [contenteditable="true"], [contenteditable="true"] *) { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
}

/* Day Planner: Google Calendar above the schedule (👁 Show Google Calendar; planner.js, gcal.js). */
.gcal { margin: 4px 0 14px; padding: 10px 14px; border-radius: 14px; background: var(--glass-track); border: 1px solid var(--glass-border); }
.gcal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gcal-head h3 { margin: 0; font-size: .95rem; }
.gcal-status { font-size: .8rem; flex: 1 1 auto; }
.gcal-btn { padding: 3px 10px; font-size: .8rem; }
.gcal-link { display: inline-flex; align-items: center; gap: 3px; background: none; border: 0; box-shadow: none; padding: 0; font-size: .75rem; color: var(--muted); text-decoration: underline; }
.gcal-link .icon { width: 13px; height: 13px; }
.gcal-link:hover { color: var(--text); background: none; }
.gcal-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.gcal-event { font-size: .9rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.gcal-when { flex: none; min-width: 6.5em; color: var(--muted); font-variant-numeric: tabular-nums; }
.gcal-title { color: var(--text); text-decoration: none; }
.gcal-title:hover { text-decoration: underline; }
.gcal-where { font-size: .8rem; }
.gcal-empty { margin: 6px 0 0; font-size: .85rem; }
.gcal-add { margin-left: auto; padding: 1px 9px; font-size: .75rem; }
.gcal-added { margin-left: auto; font-size: .75rem; }
.gcal-sample button { pointer-events: none; } /* the tour's example (tour.js): nothing to press */

/* ---------- Batch Book ---------- */
/* The recipes (glass, like the other areas); a recipe and a batch are drawn on the Day Planner's
   papers (the paper's own tokens, see .planner[data-paper] above), tinted by their section's colour (--bb).
   Lines and margin follow 👁 (main[data-layout-lined], [data-layout-margin]). */

.bb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.bb-head > .search-wrap { flex: 1 1 12em; }
/* The top bar stays while the recipes scroll (as Brain Dump's does); stuck, it gets a glass background. */
.bb-sticky { position: sticky; top: calc(var(--safe-top) + 62px); z-index: 5; margin: 0 -10px 6px; padding: 0 10px 4px; border-radius: 0 0 16px 16px; transition: box-shadow .15s, background-color .15s; }
.bb-sticky-mark { height: 1px; margin-bottom: -1px; }
.bb-sticky.stuck { background: var(--glass-strong); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 10px 18px -10px rgba(0, 0, 0, .55); }
@media (min-width: 768px) { .bb-sticky { top: 62px; } }
@media (max-width: 767px) { .bb-sticky { top: 0; } }
/* Books: the same filter bar as Brain Dump's kinds (underlined, in the book's colour). */
.bb-sections-bar { display: flex; align-items: stretch; margin: 6px 0 8px; border-bottom: 1px solid var(--glass-border); }
.bb-sections, .bb-status { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.bb-sections::-webkit-scrollbar, .bb-status::-webkit-scrollbar { display: none; }
.bb-sections button, .bb-status button, .bb-sections-edit { flex: none; width: auto; height: auto; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; box-shadow: none; padding: 6px 9px 5px; font-size: .9rem; line-height: 1.2; color: var(--muted); }
/* Recipes | Batches, at the right of the books bar, just before ⋯ */
/* Recipes / Batches: up with New recipe and the search, so the books have the whole line under them
   (on a phone it starts the second line, which otherwise only has the page's buttons at its end). */
.bb-mode { flex: none; flex-wrap: nowrap; margin-right: auto; padding: 3px; gap: 3px; }
.bb-mode button { padding: 5px 12px; font-size: .88rem; line-height: 1.2; white-space: nowrap; }
.bb-sections { flex-wrap: nowrap; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.bb-sections button { white-space: nowrap; border-bottom-color: color-mix(in srgb, var(--bb, var(--muted)) 35%, transparent); }
.bb-whose { font-size: .78em; opacity: .8; font-weight: 400; margin-left: 2px; }
.bb-sections button[aria-pressed="true"] { background: color-mix(in srgb, var(--bb, var(--muted)) 16%, transparent); border-radius: 8px 8px 0 0; }
.bb-sections button[aria-pressed="true"], .bb-status button[aria-pressed="true"] { color: inherit; font-weight: 600; border-bottom-color: var(--bb, currentColor); }
.bb-status { margin: 0 0 8px; }
.bb-status button { font-size: .85rem; }
.bb-cards { margin: 0; padding: 0; list-style: none; }
.bb-chapter-title { grid-column: 1 / -1; list-style: none; position: sticky; top: var(--bb-stick, 0); z-index: 3; margin-inline: -6px !important; padding-inline: 10px; border-radius: 12px 12px 0 0; background: transparent; display: flex; align-items: baseline; gap: 8px; margin: 12px 4px 0; padding-bottom: 6px; font-family: var(--hand); font-size: 1.5rem; font-weight: 700; color: var(--text); border-bottom: 3px solid var(--bb); }
/* Stuck at the top (recipes.js): a glass background, so the cards scrolling under it don't show through. */
/* It joins the glass bar above: same glass, no seam, the bar's rounded bottom and shadow move down to it, and the book's colour is a thin line. */
.bb-chapter-title.stuck { margin-inline: -10px !important; padding-inline: 14px; border-radius: 0 0 16px 16px; border-bottom: 0; background: var(--glass-strong); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: inset 0 -2px 0 var(--bb), 0 10px 18px -10px rgba(0, 0, 0, .55); }
.bb-sticky.stuck.joined { border-radius: 0; box-shadow: none; }
.bb-chapter-title .muted { font-family: var(--font); font-size: .85rem; font-weight: 400; }
.bb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.bb-card-li { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; list-style: none; border: 1px solid var(--glass-border); background: var(--glass); box-shadow: var(--glass-highlight), var(--shadow-sm); transition: transform .15s; }
.bb-card-li:hover { transform: translateY(-2px); }
.bb-card-li:has(details[open]) { overflow: visible; z-index: 6; transform: none; } /* above the sticky search bar (5) so its menu is never under it */
.bb-card { display: flex; flex-direction: column; flex: 1; min-width: 0; color: var(--text); border-radius: 20px 20px 0 0; overflow: hidden; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.bb-card-acts { display: flex; align-items: center; gap: 6px; padding: 0 10px 10px 14px; }
.bb-pin { width: 32px; height: 32px; padding: 0; background: none; border: 0; box-shadow: none; font-size: 1.15rem; color: var(--muted); }
.bb-pin[aria-pressed="true"] { color: #e5b53a; }
.bb-sections-edit.filter-more { letter-spacing: .1em; font-size: 1rem; }
/* Tags: a pill at the far right of the books bar, its long names cut short (recipes.js tagPick). */
.bb-tag-pick { flex: none; align-self: center; margin: 0 0 4px 8px; padding: 5px 12px; white-space: nowrap; max-width: 11em; }
.bb-tag-pick .chip-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bb-card-menu { margin-left: auto; }
.bb-card-menu > summary { width: 32px; height: 32px; }
.bb-card-menu .menu { min-width: 13em; }
.bb-card-menu .menu > button { display: block; width: 100%; text-align: left; }
.bb-card-menu .menu-label { display: block; padding: 6px 12px 2px; font-size: .78rem; }
.bb-card-menu hr { border: 0; border-top: 1px solid var(--glass-border); margin: 4px 0; }
.bb-shared-title { position: static; margin-top: 22px !important; }
.bb-shared { margin: 10px 0 0; padding: 0; list-style: none; }
.bb-make-btn, .bb-follow { white-space: nowrap; }
/* The recipe's three actions in three colours: ▶ Follow along green (as Done in it), 🧪 Make this light blue, Share plain glass. */
.bb-top .bb-follow, .bb-cooking, .bb-cooking:hover:not(:disabled) { background: rgba(52, 168, 83, .85); border-color: rgba(120, 220, 140, .9); color: #fff; font-weight: 600; }
.bb-top .bb-make-btn { background: color-mix(in srgb, #5aa9ff 32%, transparent); border-color: color-mix(in srgb, #5aa9ff 70%, transparent); }
[data-theme="light"] .bb-top .bb-make-btn { background: color-mix(in srgb, #5aa9ff 22%, white); color: #0b3a66; }
@media (max-width: 560px) { .bb-follow-word { display: none; } }
.bb-listline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 2px 0 8px; font-size: .92rem; }
.bb-listline select { width: auto; max-width: 100%; flex: 0 1 auto; }
.bb-stock-btn { padding: 3px 9px; margin-left: 4px; font-size: .85rem; white-space: nowrap; background: none; border: 1px solid var(--glass-border); box-shadow: none; color: var(--muted); }
.bb-stock-btn[aria-pressed="true"][data-stock="have"] { background: color-mix(in srgb, #4caf7a 22%, transparent); border-color: #4caf7a; color: var(--text); }
.bb-stock-btn[aria-pressed="true"][data-stock="need"] { background: color-mix(in srgb, #e0913a 22%, transparent); border-color: #e0913a; color: var(--text); }
.bb-line[data-got="have"] .bb-ing-text { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 45%, transparent); }
@media (max-width: 640px) { .bb-stock-word { display: none; } .bb-stock-btn { padding: 3px 8px; } }
.bb-card-pic { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--bb) 70%, #fff4d6), color-mix(in srgb, var(--bb) 35%, #fff8e8)); }
.bb-card-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; } /* cropped to the square: a photo never sets the card's height */
.bb-card-emoji { font-size: 3.4rem; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .2)); }
.bb-card-body { display: flex; flex-direction: column; gap: 3px; height: 10em; overflow: hidden; padding: 10px 14px 12px; border-top: 4px solid var(--bb); } /* every card the same height: 2 lines of title, 2 of description, 1 of tags */
.bb-card-body > * { flex: none; }
.bb-card-title { font-size: 1.05rem; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bb-card-desc { font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bb-card-tags { display: flex; flex-wrap: nowrap; gap: 4px; overflow: hidden; }
.bb-card-tags .chip { font-size: .72rem; padding: 0 7px; }
.bb-card-made { font-size: .78rem; }
/* 👁 Spacing on Batch Book's cards: Medium has no tags or Made line, Tight is small cards with just the picture and name (more on screen), Loose shows everything. */
#main[data-area="recipes"]:not([data-density="loose"]) .bb-card-li :is(.bb-card-tags, .bb-card-made) { display: none; }
#main[data-area="recipes"][data-density="medium"] .bb-card-body { height: 6.6em; }
#main[data-area="recipes"][data-density="tight"] .bb-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
#main[data-area="recipes"][data-density="tight"] .bb-card-li { border-radius: 16px; }
#main[data-area="recipes"][data-density="tight"] .bb-card { border-radius: 16px 16px 0 0; }
#main[data-area="recipes"][data-density="tight"] .bb-card-pic { aspect-ratio: 4 / 3; }
#main[data-area="recipes"][data-density="tight"] .bb-card-emoji { font-size: 2.2rem; }
#main[data-area="recipes"][data-density="tight"] .bb-card-desc { display: none; }
#main[data-area="recipes"][data-density="tight"] .bb-card-body { height: 3.4em; padding: 7px 10px 6px; border-top-width: 3px; }
#main[data-area="recipes"][data-density="tight"] .bb-card-title { font-size: .92rem; }
#main[data-area="recipes"][data-density="tight"] .bb-card-acts { gap: 2px; padding: 0 4px 6px 8px; }
#main[data-area="recipes"][data-density="tight"] :is(.bb-pin, .bb-card-menu > summary) { width: 28px; height: 28px; }
@media (max-width: 640px) { #main[data-area="recipes"][data-density="tight"] .bb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bb-batches { display: grid; gap: 6px; }
/* A batch's row (the Batches list, a recipe's batches): the li is the glass box, as a task's in Tasks, with its ⠿ inside on the left and
   the batch's colour down its edge. One line: the name wraps in its own space, the status and Delete pills stay at the right. */
.bb-batch-list { margin: 0; padding: 0; list-style: none; gap: var(--row-gap, 6px); }
.bb-batch-list > li { display: flex; align-items: center; gap: 0; padding-left: 2px; border-radius: 14px; background: color-mix(in srgb, var(--glass) 55%, transparent); border: 1px solid color-mix(in srgb, var(--glass-border) 60%, transparent); border-left: 4px solid var(--bb); }
.bb-batch-list > li:hover, .bb-batch-list > li.kb-cur, .bb-batch-list > li:has(> .bb-batch-row.kb-cur) { background: var(--glass); border-color: var(--glass-border); border-left-color: var(--bb); }
.bb-batch-list > li.selected { box-shadow: 0 0 0 2px var(--accent); }
.bb-batch-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 4px 10px 4px 2px; color: var(--text); cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.bb-batch-emoji { flex: none; font-size: 1.3rem; }
.bb-batch-pic { flex: none; width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.bb-batch-no { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; font-family: var(--hand); font-weight: 700; font-size: 1.1rem; }
.bb-batch-name { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-batch-row > :is(.muted, .chip, button) { flex: none; }
.bb-batch-row button.chip { cursor: pointer; font: inherit; font-size: .8rem; padding: 1px 9px; }
/* Delete: solid red with white words, as the Delete a row shows when swiped on a phone. */
.bb-batch-row button.bb-batch-del, .bb-paper .bb-batch-row button.bb-batch-del { background: #d64545; border-color: transparent; color: #fff; font-weight: 600; }
.bb-batch-row button.bb-batch-del:hover { background: #c23a3a; }
.bb-status-planned { opacity: .7; }
.bb-status-row { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.bb-status-row .bb-status { margin: 0; }
.bb-sort { flex: none; width: auto; max-width: 9em; padding: 4px 8px; font-size: .85rem; }
@media (max-width: 640px) { .bb-batch-name { display: none; } .bb-batch-no { flex: 1 1 auto; font-size: 1rem; } .bb-batch-row { gap: 8px; padding-right: 8px; } }
/* The browser's own Print on a recipe page (Ctrl+P outside Sift's Print screen, printrecipe.js): just the page. */
@media print {
  .appbar, #tabbar, #topnav, .bb-top, .bb-foot, .theirs-note, .toast, .select-bar, .bb-tools, .bb-step-grip, .bb-edit, .bb-scale, .bb-ref-picks, .bb-ref-hint, .bb-add-field, .bb-step-new, .att-row button { display: none !important; }
  body, #main { background: #fff !important; }
  .bb-paper { box-shadow: none !important; }
}

.bb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }

/* The page */
.bb-paper {
  --bb-ink: color-mix(in srgb, var(--bb) 65%, var(--text));
  --bb-soft: color-mix(in srgb, var(--bb) 16%, transparent);
  color: var(--text);
  background: var(--paper-bg, var(--glass));
  background-image: var(--paper-pattern, none);
  background-size: var(--paper-pattern-size, auto);
  border-radius: 22px;
  padding: clamp(14px, 4vw, 32px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.bb-paper[data-paper="glass"] { border: 1px solid var(--glass-border); -webkit-backdrop-filter: var(--blur-strong); backdrop-filter: var(--blur-strong); box-shadow: var(--glass-highlight), var(--shadow); }
.bb-paper a:not(.bb-batch-row) { color: var(--bb-ink); text-decoration: underline; text-underline-offset: 2px; }
.bb-paper :where(input:not([type="checkbox"], [type="radio"], [type="color"]), select, textarea) { background: transparent; border-color: transparent; padding: 4px 6px; color: var(--text); -webkit-backdrop-filter: none; backdrop-filter: none; }
/* Writing on the line: no box, just the line lit a little (as in the Day Planner). */
.bb-paper :where(input:not([type="checkbox"], [type="radio"]), select, textarea):hover { background: color-mix(in srgb, var(--text) var(--line-hover), transparent); }
.bb-paper :where(input, select, textarea):focus { border-color: transparent; outline: none; box-shadow: none; background: color-mix(in srgb, var(--text) var(--line-lit), transparent); }
.bb-paper button { box-shadow: none; }
.bb-paper input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--bb); }
.bb-photos { margin: -4px 0 12px; }
.bb-photos .att-row { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; padding: 8px 8px 6px 2px; margin: 0; scrollbar-width: thin; }
.bb-photos .att { flex: none; scroll-snap-align: start; }
.bb-photos .att-img .att-open img { height: 72px; max-width: 120px; }
.bb-photos .att-x { display: none !important; } /* removed in Photos at the bottom */
.bb-title-row { display: flex; align-items: center; gap: 14px; }
.bb-emoji { font-size: clamp(2.4rem, 8vw, 3.8rem); line-height: 1; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .18)); }
.bb-title { flex: 1; min-width: 0; font-family: var(--hand); font-size: clamp(2rem, 7vw, 3.2rem) !important; font-weight: 700; color: var(--bb-ink) !important; line-height: 1.15; }
textarea.bb-title { resize: none; overflow: hidden; field-sizing: content; }
#main textarea.bb-title.one-line { font-size: clamp(2rem, 7vw, 3.2rem) !important; } /* beats the 16px phone floor on fields (it has an id in it) */
.bb-rule { height: 8px; margin: 8px 0 12px; border-radius: 99px; background: var(--bb); }
.bb-desc { font-family: var(--hand); font-size: 1.15rem; resize: none; field-sizing: content; }
.bb-of { margin: -4px 0 6px 8px; color: var(--muted); }
.bb-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 26px 0 6px; font-family: var(--hand); font-size: clamp(1.35rem, 4.5vw, 1.7rem); font-weight: 700; color: var(--bb-ink); }
.bb-h > span:first-child { flex: 1 1 auto; }
.bb-h button { font-family: var(--font); font-size: .85rem; font-weight: 400; padding: 4px 14px; }
.bb-h-note { flex: none !important; font-family: var(--font); font-size: .82rem; font-weight: 400; }
.bb-h-big { margin-top: 34px; }
.bb-none { margin: 4px 8px; }
.bb-edit { background: var(--glass); }
.bb-scale { flex: none; padding: 2px; }
.bb-scale button { padding: 2px 10px; font-size: .8rem; }
.bb-add-field { margin: 6px 0 0; padding: 3px 10px; font-size: .85rem; background: none; color: var(--muted); }

/* Lines: margin, content, tools. Ruled and with a margin line like the Day Planner's. */
.bb-lines { --bb-margin: 76px; margin: 4px 0; }
#main[data-layout-lined] .bb-lines { border-top: 1px solid var(--rule); }
.bb-line { display: grid; grid-template-columns: var(--bb-margin) minmax(0, 1fr) auto; min-height: 2.5rem; align-items: stretch; }
#main[data-layout-lined] .bb-line { border-bottom: 1px solid var(--rule); }
.bb-margin { display: flex; align-items: center; justify-content: flex-end; padding: 2px 10px 2px 0; font-family: var(--hand); font-size: .95rem; color: var(--ink); text-align: right; overflow-wrap: anywhere; }
#main[data-layout-lined][data-layout-margin] .bb-margin { border-right: 2px solid var(--margin-rule); }
.bb-content { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 2px 4px 2px 10px; }
.bb-tools { display: flex; align-items: center; }
.bb-tools .icon-btn { width: 32px; height: 32px; background: none; border: 0; color: var(--muted); }
.bb-tools .icon-btn .icon { width: 18px; height: 18px; }
.bb-details { --bb-margin: minmax(6.5em, 30%); }
.bb-details .bb-margin { font-weight: 700; }
.bb-details .bb-content > :where(input, select) { font-size: 1.02rem; }
/* Ingredients and steps: one margin down the page, pushed right for long amounts, but only so far (recipes.js workMargin). */
.bb-ings, .bb-steps { --bb-margin: clamp(76px, calc(var(--bb-chars, 0) * .72rem + 28px), 8.5rem); }
.bb-ings .bb-margin { font-weight: 700; font-size: 1.05rem; color: var(--bb-ink); padding-right: 4px; }
/* Written on the paper: amount and ingredient are fields that look like the writing until pressed. */
.bb-ings .bb-margin input { width: 100%; text-align: right; font: inherit; color: inherit; }
.bb-ings .bb-content input { width: 100%; font: inherit; color: var(--text); }
.bb-ings .bb-content { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: 1.02rem; }
.bb-steps .bb-margin { font-size: 1.2rem; font-weight: 700; color: var(--bb-ink); }
/* Steps are listkit rows: the ⠿ sits at the margin's left, the number at its right. */
.bb-step-list { margin: 0; padding: 0; list-style: none; }
.bb-step-grip { width: 22px; margin-right: auto; }
.bb-step-view { padding: 6px 4px; line-height: 1.55; font-size: 1.02rem; cursor: text; border-radius: 6px; }
.bb-step-view:hover { background: var(--glass); }
.bb-step-edit, .bb-step-new { resize: none; field-sizing: content; min-height: 2.2em; line-height: 1.5; font-size: 1.02rem; }
.bb-steps .att-row, .bb-diary .att-row { margin: 2px 4px 6px; }
.bb-ref { padding: 0 4px; border-radius: 5px; background: color-mix(in srgb, var(--bb) 28%, transparent); font-weight: 600; white-space: nowrap; }
.bb-ref-missing { background: rgba(200, 40, 40, .15); font-weight: 400; text-decoration: underline wavy rgba(200, 40, 40, .6); }
.bb-ref-picks { display: flex; visibility: hidden; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0 0 6px; }
.bb-ref-picks .chip { cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; } /* a long ingredient name ends in …, not off the page */
.bb-ref-hint { display: none; margin: 4px 0 0; }
.bb-method:has(.bb-steps :focus) .bb-ref-picks { visibility: visible; }
.bb-method:has(.bb-steps textarea:focus) .bb-ref-hint { display: block; }
@media (pointer: coarse) { .bb-ref-picks { visibility: visible; } }
.bb-diary { --bb-margin: 10em; }
.bb-diary .bb-margin input { font-family: var(--hand); color: var(--ink); text-align: right; padding: 2px 4px; }
.bb-entry-text { resize: none; field-sizing: content; min-height: 2.2em; }

.bb-goals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; padding: 4px 0; }
.bb-goals label { display: flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 6px; background: var(--bb-soft); color: var(--text); font-size: .95rem; }
.bb-goals label > span { flex: none; }
.bb-goals input { min-width: 0; }
.bb-goals .bb-abv b { font-size: 1.15rem; }
.bb-readings { display: flex; flex-wrap: wrap; gap: 10px; }
.bb-reading { position: relative; display: grid; grid-template-columns: 4.5em 1fr; gap: 2px 4px; width: 170px; padding: 8px 8px 10px; border-radius: 6px; background: var(--bb-soft); font-size: .9rem; }
.bb-reading select { font-weight: 600; padding: 3px 4px !important; }
.bb-reading .bb-gravity { font-weight: 600; font-size: 1.05rem; }
.bb-reading-type { grid-column: 1 / -1; align-self: center; font-weight: 600; font-size: .85rem; color: var(--bb-ink); }
.bb-reading .bb-reading-value { grid-column: 1 / -1; font-weight: 600; font-size: 1.05rem; }
.bb-reading-adds { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.bb-reading input[type="date"] { grid-column: 1 / -1; }
.bb-reading textarea { grid-column: 1 / -1; font-size: .85rem; resize: none; field-sizing: content; min-height: 2em; }
.bb-reading-x { position: absolute; top: -8px; right: -8px; width: 26px !important; height: 26px !important; border-radius: 50% !important; background: var(--paper-bg, var(--glass-strong)) !important; opacity: 0; transition: opacity .15s; }
.bb-reading:hover .bb-reading-x, .bb-reading:focus-within .bb-reading-x { opacity: 1; }
@media (pointer: coarse) { .bb-reading-x { opacity: .8; } }
.bb-chart { width: 100%; max-width: 720px; height: auto; margin: 4px 0 10px; }
.bb-chart polyline { fill: none; stroke: var(--bb); stroke-width: 3; stroke-linejoin: round; }
.bb-chart circle { fill: var(--paper-bg, #fff); stroke: var(--bb-ink); stroke-width: 2; }
.bb-chart text { font-size: 13px; fill: var(--muted); text-anchor: middle; }
/* A batch's tasting notes: written like the Day Planner's notes, the toolbar only while writing, ruled with Lined paper (👁). */
.bb-note.rich:not(:focus-within) > .md-bar { display: none; }
.bb-note { --note-line: 2rem; margin: 4px 0; }
.bb-note :is(.rich-edit, .rich-raw) { border-color: transparent !important; border-radius: 0; box-shadow: none; background-color: transparent; line-height: var(--note-line); padding: 0 10px calc(var(--note-line) * 1.5); min-height: calc(var(--note-line) * 4); font-family: var(--hand); font-size: 1.05rem; }
#main[data-layout-lined] .bb-note :is(.rich-edit, .rich-raw) { border-top: 1px solid var(--rule) !important; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--note-line) - 1px), var(--rule) calc(var(--note-line) - 1px), var(--rule) var(--note-line)); background-attachment: local; }
.bb-note .rich-edit :is(ul, ol, p, div, h3, h4, li) { margin-top: 0; margin-bottom: 0; line-height: var(--note-line); }
.bb-note .rich-edit:hover { background-color: color-mix(in srgb, var(--text) var(--line-hover), transparent); }
.bb-note :is(.rich-edit, .rich-raw):focus { background-color: color-mix(in srgb, var(--text) var(--line-lit), transparent); }
.bb-foot { margin-top: 14px; }
@media (max-width: 600px) {
  .bb-paper { padding: 12px 10px; margin: 0 -6px; }
  .bb-lines { --bb-margin: 58px; }
  .bb-details { --bb-margin: minmax(5.5em, 32%); }
  .bb-ings, .bb-steps { --bb-margin: clamp(58px, calc(var(--bb-chars, 0) * .66rem + 26px), 6.8rem); }
  .bb-ings .bb-margin { white-space: nowrap; font-size: .95rem; }
  .bb-diary .bb-line { grid-template-columns: minmax(0, 1fr) auto; }
  .bb-diary .bb-margin { justify-content: flex-start; border-right: 0 !important; padding: 0; }
  .bb-diary .bb-margin input { text-align: left; font-size: .85rem; width: auto; }
  .bb-diary .bb-content { grid-column: 1 / -1; grid-row: 2; padding-left: 4px; }
  .bb-ing-note { grid-column: 1 / 3; }
  .bb-goals { grid-template-columns: 1fr; }
  .bb-reading { width: calc(50% - 5px); box-sizing: border-box; }
}

.bb-sections-sheet { max-width: 560px; }
.bb-import-sheet { max-width: 640px; }
.bb-import-style select { margin-left: 6px; }
.bb-style-help { margin: 4px 0 8px; font-size: 0.9rem; }
.bb-style-help summary { cursor: pointer; color: var(--muted, inherit); }
.bb-style-help p { margin: 6px 0; }
.hs-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.hs-style { width: 100%; box-sizing: border-box; padding: 8px 12px; border: 1px solid var(--line, rgba(127,127,127,.3)); border-radius: 10px; }
.hs-style summary { cursor: pointer; }
.hs-style label { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.hs-style input, .hs-style textarea { width: 100%; box-sizing: border-box; font: inherit; }
pre.hs-rules { white-space: pre-wrap; font: inherit; font-size: 0.9rem; margin: 8px 0; }
.bb-import-text { width: 100%; box-sizing: border-box; margin-top: 12px; font: inherit; font-size: 0.9rem; resize: vertical; }
.bb-sec-list { display: grid; gap: 10px; margin: 8px 0 12px; padding: 0; list-style: none; }
.bb-sec-row { display: grid; grid-template-columns: 28px 3.4em minmax(0, 1fr) 44px 34px; gap: 6px; align-items: center; padding: 8px; border-radius: 14px; background: var(--glass-track); }
.bb-sec-emoji { text-align: center; font-size: 1.2rem; padding: 6px 2px !important; }
.bb-sec-row input[type="color"] { width: 40px; height: 36px; padding: 2px; border-radius: 10px; border: 1px solid var(--glass-border); background: none; }
.bb-sec-grip { grid-row: 1 / span 4; align-self: stretch; width: 28px; height: auto; padding: 0; border: 0; background: none; box-shadow: none; color: var(--muted); cursor: grab; touch-action: none; }
.bb-sec-fields { grid-column: 2 / -1; }
.bb-sec-types { grid-column: 2 / -1; }
.bb-sec-readings { grid-column: 2 / -1; display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text); }
.ts-row { grid-template-columns: 28px 3.4em minmax(0, 1fr) 44px 40px; }
.ts-row .bb-sec-grip { grid-row: auto; height: 36px; }
.ts-look { width: 100%; height: 38px; padding: 0; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--glass-border); background: none; box-shadow: none; color: var(--text); font-size: 1.2rem; }
.ts-look .sec-ico { width: 22px; height: 22px; }
.ts-look.none { color: var(--muted); font-size: .75rem; }
.ts-swatch { width: 40px; height: 36px; padding: 0; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--sec); box-shadow: none; position: relative; }
.ts-swatch.none, .ts-colours .none { background: none; }
.ts-swatch.none::after, .ts-colours .none::after { content: ''; position: absolute; left: 50%; top: 20%; height: 60%; border-left: 2px solid var(--muted); transform: rotate(45deg); }
.ts-lock { text-align: center; font-size: .9rem; color: var(--muted); }
.ts-note { grid-column: 2 / -1; font-size: .82rem; }
.ts-fixed { padding: 8px 10px; }
.ts-end .bb-sec-grip, .ts-end > span:first-child { visibility: hidden; }
.ts-ends-head { margin: 16px 0 0; }
.ts-warn { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, #ffc285 22%, transparent); font-size: .9rem; }
.ts-picker { margin: -4px 0 4px 34px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--glass-border); background: var(--glass-track); display: grid; gap: 8px; }
.ts-pick-head { display: flex; align-items: center; gap: 12px; }
.ts-pick-label { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ts-shade button { padding: 4px 12px; font-size: .85rem; }
.ts-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; }
.ts-icons button { aspect-ratio: 1; width: auto; height: auto; padding: 0; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; box-shadow: none; color: var(--text); }
[style*="--sec"] > .ts-icons button { color: color-mix(in srgb, var(--sec) 75%, var(--text)); }
.ts-icons .sec-ico { width: 22px; height: 22px; }
.ts-icons button[aria-pressed="true"] { background: color-mix(in srgb, var(--sec, var(--text)) 20%, transparent); outline: 2px solid color-mix(in srgb, var(--sec, var(--text)) 75%, var(--text)); }
.ts-colours { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-colours button { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--sw); box-shadow: none; position: relative; }
.ts-colours button[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.ts-emoji { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ts-emoji input { flex: 1 1 140px; min-width: 0; }
.bb-ings .bb-content { justify-content: flex-start; }
/* Placeholders, chips and faint words follow the paper's own ink (not the theme's, e.g. white placeholders of dark themes on yellow paper). */
.bb-paper :is(input, textarea)::placeholder, .bb-paper .rich-edit.is-empty::before { color: color-mix(in srgb, var(--text) 52%, transparent) !important; opacity: 1; }
.bb-paper .chip, .bb-paper .bb-batch-row .muted { color: color-mix(in srgb, var(--text) 78%, transparent); }
.bb-content > .bb-add-field { align-self: flex-start; }

/* The pills under a task being edited and under the New task line (editpills.js, views/tasks.js):
   one tidy row that scrolls sideways rather than wrapping into bits, ending in More… (the full
   panel). On phones a pill with nothing set is just its icon; set ones say what they're set to. */
.edit-pills > .pill-row, .task-entry .pill-row { flex: 1 1 100%; min-width: 0; max-width: 100%; display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 1px; }
.pill-row::-webkit-scrollbar { display: none; }
.pill-row > .entry-chip { flex: none; padding: 5px 11px; white-space: nowrap; }
@media (max-width: 700px), (pointer: coarse) {
  .pill-row > .entry-chip:not(.set, .pill-more, .pill-done) .chip-text { display: none; }
  .pill-row > .entry-chip { padding: 5px 10px; }
}
/* Full screen for a note being written in place: a small ⤢ at the right of its first line. */
.rich.bare:not(.is-full):has(> .bare-full) { display: flex; align-items: flex-start; gap: 8px; }
.rich.bare:not(.is-full):has(> .bare-full) > .rich-edit { flex: 1 1 auto; min-width: 0; }
.rich.bare:not(.is-full) > .bare-full { flex: none; margin: 0; padding: 2px 8px; font-size: .8rem; opacity: .7; }
@media (max-width: 700px), (pointer: coarse) { .rich.bare > .bare-full kbd { display: none; } }

/* An open list (views/lists.js): its name, progress, Reset ticks and Show / hide ticked stay at
   the top while the items scroll (as Brain Dump's bar), with a glass backing once stuck. */
.list-top { position: sticky; top: calc(var(--safe-top) + 62px); z-index: 5; margin: 0 -10px 4px; padding: 0 10px 2px; border-radius: 0 0 16px 16px; transition: box-shadow .15s, background-color .15s; }
.list-top-mark { height: 1px; margin-bottom: -1px; }
.list-top.stuck { background: var(--glass-strong); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 10px 18px -10px rgba(0, 0, 0, .55); }
@media (min-width: 768px) { .list-top { top: 62px; } }
@media (max-width: 767px) { .list-top { top: 0; } }
.list-top .project-head { flex-wrap: nowrap; gap: 6px; margin-bottom: 6px; padding: 6px 8px; }
.list-top .project-head .project-name { min-width: 0; font-size: 1.15rem; padding-inline: 4px; }
.list-top .project-head > :not(.project-name) { flex: none; }
@media (max-width: 560px) { .list-top .share-words { display: none; } }
.list-top .project-head .page-cog { margin-left: auto; }
.list-top .list-actions { flex-wrap: nowrap; margin-bottom: 6px; }
.list-top .list-actions > button { flex: none; padding: 5px 10px; font-size: .85rem; }
.list-top .list-actions > .muted { flex: none; font-size: .85rem; }
@media (max-width: 560px) { .list-top .list-actions { flex-wrap: wrap; } .list-top .list-bar { flex: 1 1 100%; max-width: none; } }
/* The new item line: one line like Tasks' New task, growing with what's pasted; its hint only while typing. */
#list-new { resize: none; overflow: hidden; line-height: 1.4; min-height: 0; font-family: inherit; }
.list-end { margin-top: 18px; }

/* Tasks | Projects, as Batch Book's Recipes | Batches; on phones the list tabs go on the row under it. */
.tasks-head:has(.c-new-btn) .page-share { margin-left: auto; }
.tasks-head .segmented.task-mode { flex: none; flex-wrap: nowrap; padding: 3px; gap: 3px; align-self: center; }
.tasks-head .task-mode button { flex: none; padding: 5px 12px; font-size: .88rem; line-height: 1.2; white-space: nowrap; }
.tasks-head:has(.task-mode) .page-share { margin-left: auto; }
@media (max-width: 480px) { .tasks-head:has(.task-mode) { flex-wrap: wrap; } .tasks-head #task-views { order: 1; flex-basis: 100%; } }
/* A project's page: its top as an open list's (Lists), staying in view as its tasks scroll; milestone headings get a ⋯. */
.pill-menu.ms-menu button { font-family: inherit; letter-spacing: normal; padding: 4px 12px; font-size: .88rem; }
.task-list .list-head .ms-more { margin-left: 6px; padding: 1px 10px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); font-size: .9rem; line-height: 1.2; }
.task-list .list-head .ms-more:hover { border-color: var(--active-border); }
.task-list .list-head[data-done] { opacity: .6; }
.project-card.paused { opacity: .7; }
.project-grid.finished .project-card { opacity: .6; }
.pill-menu.project-pills { z-index: 1200; flex-wrap: wrap; max-width: min(520px, calc(100vw - 16px)); } /* over the toast; wraps when there are many projects */
.pill-menu.project-pills .swatch { width: 12px; height: 12px; }

/* Box page reads as a box: a lid in the box's colour with a stuck-on paper
   label, and the contents sunk into a darker inside with shadowed walls. */
.box-page { padding: 0; overflow: clip; border-width: 2px; border-color: color-mix(in srgb, var(--tint) 45%, var(--glass-border)); }
.box-lid { display: flex; gap: 14px; align-items: flex-start; padding: 16px 22px 12px; background: linear-gradient(to bottom, color-mix(in srgb, var(--tint) 26%, transparent), color-mix(in srgb, var(--tint) 14%, transparent)); border-bottom: 3px solid color-mix(in srgb, var(--tint) 40%, #000); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .55); }
.box-lid-text { flex: 1; min-width: 0; }
.box-lid .box-page-head { margin-bottom: 8px; }
.box-lid .box-fields { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.box-lid .box-fields label { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; min-width: 0; font-size: .8rem; white-space: nowrap; }
.box-lid .box-fields label[hidden] { display: none; }
.box-lid .box-fields input { flex: 1; min-width: 0; padding: 4px 8px; background: color-mix(in srgb, #000 18%, transparent); }
.box-lid-pills { display: flex; gap: 6px; flex: none; }
.box-lid-pills .pill-act { font-size: .78rem; padding: 2px 10px; }
/* The box's photo: small, square, at the lid's left; more than one sit on top of each other, the first showing. */
.box-photo .att-row { display: grid; margin: 0; padding: 0; }
.box-photo .att { grid-area: 1 / 1; }
.box-photo .att:not(:first-child) { visibility: hidden; }
.box-photo .att-open { width: 84px; height: 84px; padding: 0; border-radius: 10px; overflow: hidden; }
.box-photo .att-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Scrolling down a long box, its top stays in view: back and search, then the lid with its label, each with a backing once stuck. */
.box-top { position: sticky; top: calc(var(--safe-top) + 62px); z-index: 6; margin: 0 -10px; padding: 0 10px; border-radius: 0 0 16px 16px; transition: box-shadow .15s, background-color .15s; }
.box-top.stuck { background: var(--glass-strong); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 10px 18px -10px rgba(0, 0, 0, .55); }
.box-lid { position: sticky; top: calc(var(--safe-top) + 62px + var(--box-top-h, 0px)); z-index: 4; }
/* The lid looks the same stuck or not: always solid (the glass over the page, as a colour), so nothing shows through it and it doesn't darken when it sticks. */
.box-lid { background: linear-gradient(to bottom, color-mix(in srgb, var(--tint) 26%, transparent), color-mix(in srgb, var(--tint) 14%, transparent)), color-mix(in srgb, var(--text) 9%, var(--bg)); }
@media (min-width: 768px) { .box-top { top: 62px; } .box-lid { top: calc(62px + var(--box-top-h, 0px)); } }
@media (max-width: 767px) { .box-top { top: 0; } .box-lid { top: var(--box-top-h, 0px); } }
.box-page .box-page-head input.box-code-input { font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif; font-weight: 500; font-size: 1.45rem; max-width: 14ch; text-transform: uppercase; letter-spacing: .16em; padding: 6px 10px 6px 14px; border-radius: 2px; border: 0; color: #eceae4; background: linear-gradient(to bottom, #3a3a3a 0, #121212 18%, #0a0a0a 55%, #161616 100%); text-shadow: 0 1px 0 rgba(255, 255, 255, .35), 0 -1px 0 rgba(0, 0, 0, .9), 0 0 1px rgba(255, 255, 255, .5); box-shadow: 0 2px 3px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -1px 0 rgba(0, 0, 0, .8); transform: rotate(-1.2deg); }
.box-page .box-page-head input.box-code-input::placeholder { color: #8d8b86; opacity: 1; text-shadow: none; }
.box-page .box-page-head input.box-code-input:placeholder-shown { font-size: 1.05rem; min-width: 6.4em; }
.box-inside { margin: 14px 14px 0; padding: 6px 12px 12px; border-radius: 18px; background: color-mix(in srgb, #000 22%, transparent); box-shadow: inset 0 10px 18px -8px rgba(0, 0, 0, .6), inset 0 0 0 1px color-mix(in srgb, var(--tint) 18%, transparent); }
.box-inside > h3 { margin: 6px 4px 4px; }
/* A box's Add items: one line at the top of the contents, in line with its things, with a faint cube where theirs are. */
.box-add { display: flex; gap: 4px; align-items: center; margin-bottom: 2px; }
.box-add .add-cube { width: 28px; height: 30px; cursor: text; opacity: .35 !important; }
.box-add .add-cube .icon { width: 17px; height: 17px; }
.box-add #new-items { flex: 1 1 0%; min-width: 0; resize: none; overflow: hidden; padding: 5px 10px; background: transparent; border-color: transparent; font-size: .95rem; line-height: inherit; box-shadow: none; }
.box-add #new-items:focus { background: var(--glass-track); }
.box-add #new-items::placeholder { font-style: italic; }
.box-page > .hint, .box-page > .sheet-actions { margin-left: 22px; margin-right: 22px; }
.box-page > .sheet-actions { margin-bottom: 18px; }
@media (max-width: 560px) {
  .box-page { padding: 0; }
  .box-lid { gap: 10px; padding: 10px 12px 8px; }
  .box-lid .box-page-head { gap: 6px; margin-bottom: 6px; }
  .box-lid .box-fields label { flex-basis: 100%; }
  .box-lid .box-fields input { padding: 3px 8px; font-size: .9rem; }
  .box-photo .att-open { width: 60px; height: 60px; }
  .box-inside { margin: 10px 8px 0; padding: 4px 6px 10px; }
  .box-page > .hint, .box-page > .sheet-actions { margin-left: 14px; margin-right: 14px; }
}

/* Sticky top bars keep the gap above them (--stick-pad) all the time, pulled up over what's above by as much, so nothing
   moves when they stick or unstick (it used to be added on sticking, so the bar slid up then jumped back down).
   The views watch for sticking --stick-pad further down (stickRoot in app.js). Taps go through that gap until it's glass. */
:is(.find-sticky, .sticky-top, .dump-bar, .bb-sticky, .list-top, .box-top) { --stick-pad: 8px; padding-top: var(--stick-pad); margin-top: calc(-1 * var(--stick-pad)); pointer-events: none; }
:is(.find-sticky, .sticky-top, .dump-bar, .bb-sticky, .list-top, .box-top) > *, :is(.find-sticky, .sticky-top, .dump-bar, .bb-sticky, .list-top, .box-top).stuck { pointer-events: auto; }
@media (min-width: 768px) { :is(.find-sticky, .sticky-top, .dump-bar, .bb-sticky, .list-top, .box-top) { --stick-pad: 14px; } }
@media (max-width: 767px) { :is(.find-sticky, .sticky-top, .dump-bar, .bb-sticky, .list-top, .box-top) { --stick-pad: calc(var(--safe-top) + 8px); } }
/* Phones with the keyboard up (installKeyboard in app.js): no bottom tabs, and stuck bars stay at the top of what's visible. */
html.kb-open .tabbar { display: none; }
html.kb-open :is(.sticky-top, .find-sticky, .dump-bar, .bb-sticky, .list-top, .box-top, .box-lid).stuck { transform: translateY(var(--vv-top, 0px)); }

/* Day Planner: Bring items in (tasks, earlier days, Google Calendar in one sheet). */
.bring-link .bring-count { margin-left: 6px; min-width: 1.5em; padding: 0 6px; border-radius: 999px; background: var(--energy-ink, #4caf7a); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.5; text-align: center; }
.bring-link .bring-count[hidden] { display: none; }
.bring-sheet h2 { margin-bottom: 4px; }
.bring-down { margin: 0 0 8px; padding: 6px 12px; border-radius: 12px; background: var(--calm, var(--glass-track)); font-size: .88rem; }
.bring-tabs { margin: 4px 0 10px; }
.bring-n { display: inline-block; min-width: 1.4em; margin-left: 3px; padding: 0 5px; border-radius: 999px; background: color-mix(in srgb, var(--energy-ink, #4caf7a) 20%, transparent); font-size: .72rem; font-weight: 700; line-height: 1.5; text-align: center; }
.bring-body { min-height: 120px; }
.bring-event.has-cal { border-left: 4px solid var(--cal); }
.bring-event .gcal-when { display: inline-block; min-width: 6.5em; font-size: .9rem; color: var(--muted); font-family: var(--font); font-variant-numeric: tabular-nums; }
.bring-event .gcal-title { color: var(--text); }
.bring-in-plan { font-size: .82rem; }
.bring-skipped-note { margin: 0 0 8px; }
.bring-skipped-head .gcal-link { margin-left: 8px; font-family: var(--font); font-weight: 400; }
.bring-skipped { margin-bottom: 14px; }
.bring-cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 10px; }
.bring-cal-bar .gcal-status { flex: 1 1 auto; }
.bring-cals { margin: 6px 0 8px; padding: 8px 12px; border-radius: 12px; background: var(--glass-track); border: 1px solid var(--glass-border); display: grid; gap: 4px; }
.bring-cals p { margin: 0 0 2px; }
.bring-cals label { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.bring-cal-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--cal); }
.bring-connect { margin: 8px 0; }
.bring-waiting { opacity: .5; pointer-events: none; transition: opacity .2s; }

/* Usage stats (views/stats.js) */
.stats-period { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.stats-period .on { background: var(--active-bg); box-shadow: inset 0 0 0 1px var(--active-border); }
.stats-card h3 { font-size: .95rem; margin: 14px 0 6px; }
.stats-bars { display: grid; gap: 4px; margin: 6px 0 10px; }
.stats-bar { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 10px; align-items: center; font-size: .9rem; }
.stats-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-bar-track { height: 10px; border-radius: 5px; background: var(--glass-track); overflow: hidden; }
.stats-bar-track span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.stats-bar-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.stats-table-wrap { overflow-x: auto; }
.stats-table { border-collapse: collapse; font-size: .85rem; width: 100%; }
.stats-table th, .stats-table td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--glass-border); white-space: nowrap; }
.stats-table th { color: var(--muted); font-weight: 600; }
.stats-cols { display: flex; align-items: flex-end; gap: 2px; height: 90px; margin-top: 8px; }
.stats-cols > span { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.stats-cols > span > span { width: 100%; min-height: 1px; background: var(--accent); border-radius: 3px 3px 0 0; }
.stats-cols-ends { display: flex; justify-content: space-between; font-size: .8rem; margin-top: 4px; }
.pill-menu.comment-menu { z-index: 1200; } /* over View case */
.pill-menu.list-menu { z-index: 1200; flex-wrap: nowrap; min-width: 180px; max-height: min(60vh, 420px); overflow-y: auto; } /* over the toast and the Selections bar; long lists scroll */
.pill-menu.list-menu button[aria-checked="true"] { font-weight: 600; }
/* Medium and Extended spacing: every task's whole name and note show, wrapping onto as many lines as they
   need (Tasks, projects, Lists, the Day Planner); Compact keeps one line, cut short. */
#main:not([data-density="tight"]) .task-list > li[data-task] > textarea.task-title { white-space: pre-wrap; overflow-wrap: anywhere; }
#main:not([data-density="tight"]):not([data-density="loose"]) .task-note .note-medium { display: block; -webkit-line-clamp: none; overflow: visible; overflow-wrap: anywhere; }
#main:not([data-density="tight"]) :is(.pile-paper, #lines) .line.has-item > .content > textarea.item-title:not(:focus) { max-height: none; -webkit-mask: none; mask: none; }
#main:not([data-density="tight"]) .planner .plan-note { white-space: normal; display: block; -webkit-line-clamp: none; overflow: visible; overflow-wrap: anywhere; }
/* Day Planner: a task whose only pills are its markers (📝 in Compact, 📎 in every spacing) keeps them on its line, at the far end,
   the name wrapping before them. On a laptop, More (and ✓ Close) float just before them, over the end of the name as on a row
   with no pills, so they never cover 📎 and pressing 📎 opens the files (1.62.04). */
:is(.pile-paper, #lines) .line.has-item > .content:has(> .note-tag):not(:has(> .span-tag:not(.note-tag))) > textarea.item-title { flex: 1 1 0; }
:is(.pile-paper, #lines) .line.has-item > .content:not(:has(> .span-tag:not(.note-tag))) > .note-tag { margin: 4px 4px 0 6px; align-self: flex-start; }
@media (hover: hover) {
  :is(.pile-paper, #lines) .line.has-item:not(.pills-open) > .content:has(> .att-tag):not(:has(> .span-tag:not(.note-tag))) { --marks: 45px; }
  #main[data-density="tight"] :is(.pile-paper, #lines) .line.has-item:not(.pills-open) > .content:not(:has(> .span-tag:not(.note-tag))):has(> .note-tag) { --marks: 45px; }
  #main[data-density="tight"] :is(.pile-paper, #lines) .line.has-item:not(.pills-open) > .content:not(:has(> .span-tag:not(.note-tag))):has(> .note-tag ~ .note-tag) { --marks: 82px; }
  :is(.pile-paper, #lines) .line.has-item > .content > :is(.more, .close-top, .edit-pills.pill-top > .pill-reveal) { right: calc(11px + var(--marks, 0px)) !important; }
}

/* Advanced day tasks (views/daytasks.js), laid out like an IT ticket queue: the day at a glance (counts), then one card
   holding the queue (column heads, To do and Done group bars, one compact row per task: status, name with its note
   beside it, latest update, when it was last updated), and the day's schedule as a card on the right. */
.pile .advanced-link { display: inline-block; margin: 6px 0 0 4px; font-size: .85rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.pile .advanced-link:hover { color: var(--text); }
.adv-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.adv-top .back { padding: 6px 14px 6px 10px; }
.adv-top .adv-nav { margin: 0; flex: none; width: auto; container-type: normal; }
@media (max-width: 520px) { .adv-top .share-word { display: none; } .adv-top .back kbd { display: none; } }
.adv-top .spacer { flex: 1; }
.adv-top .share-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; }
.adv-top .share-btn .icon { width: 18px; height: 18px; }
.adv-day { margin: 6px 0 10px; font-size: 1.5rem; }
.adv-word { font-size: .95rem; font-weight: 500; }
/* At a glance: four small count tiles. */
.adv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; max-width: 640px; }
.adv-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); border-left: 3px solid var(--glass-border); background: var(--glass); }
.adv-stat b { font-size: 1.35rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.adv-stat b small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.adv-stat span { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.adv-stat.open { border-left-color: var(--accent); }
.adv-stat.closed { border-left-color: #4caf7a; }
.adv-stat.updates { border-left-color: #d9a441; }
@media (max-width: 520px) { .adv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.adv-body { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .adv-body { grid-template-columns: 1fr; } .adv-schedule { order: -1; } }
.adv-card { border-radius: 14px; border: 1px solid var(--glass-border); background: var(--glass); overflow: visible; }
.adv-main { padding: 0 0 6px; }
.adv-h { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
/* The New task line across the top of the queue. */
.adv-new { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--glass-border); }
.adv-new-plus { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; background: var(--active-bg); border: 1px solid var(--active-border); font-weight: 700; line-height: 1; }
.adv-new input { flex: 1; min-width: 0; box-sizing: border-box; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; box-shadow: none; color: var(--text); font: inherit; }
.adv-new input:focus { outline: none; border-color: var(--active-border); background: var(--glass-track); }
/* A row's columns (the heads use the same): ⠿ tick | task | latest update | updated | ⋯ */
.adv-cols, .adv-row { display: grid; grid-template-columns: 20px 24px minmax(0, 1fr) minmax(0, 38%) 74px 30px; gap: 0 8px; }
.adv-cols { padding: 6px 10px 5px; border-bottom: 1px solid var(--glass-border); font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.adv-cols > :first-child { grid-column: span 2; }
.adv-cols > :nth-child(4) { text-align: right; }
.adv-group { padding: 7px 12px; background: var(--glass-track); border-bottom: 1px solid var(--glass-border); }
.adv-count { padding: 0 7px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-border); font-size: .72rem; letter-spacing: 0; color: var(--text); }
.adv-count:empty { display: none; }
.adv-list { list-style: none; margin: 0; padding: 0; }
.adv-row { position: relative; align-items: start; padding: 5px 10px; border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
.adv-row:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.adv-row.selected { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.adv-row .drag-handle { width: 20px; height: 30px; }
.adv-row .tick { margin: 7px 0 0 2px; }
/* Status: a small badge, as a ticket's state (View case). */
.adv-status { justify-self: start; margin-top: 6px; padding: 1px 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; border: 1px solid; }
.adv-status.open { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.adv-status.closed { color: #4caf7a; border-color: color-mix(in srgb, #4caf7a 50%, transparent); background: color-mix(in srgb, #4caf7a 10%, transparent); }
.adv-text { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding-top: 3px; }
.adv-title { width: auto; flex: 0 1 auto; max-width: 100%; min-width: 4ch; padding: 2px 0; border: 0; background: transparent; box-shadow: none; resize: none; overflow: hidden; color: var(--text); font: inherit; font-weight: 600; line-height: 1.4; field-sizing: content; }
.adv-title:focus { outline: none; }
.adv-row.done .adv-title { text-decoration: line-through; opacity: .5; }
.adv-row.done :is(.adv-note-peek, .adv-side, .adv-updated) { opacity: .6; }
.adv-note-peek { min-width: 0; max-width: 100%; padding: 0; border: 0; background: none; box-shadow: none; color: var(--muted); font-style: italic; font-size: .86rem; text-align: left; cursor: text; overflow-wrap: anywhere; }
.adv-note-peek:hover { color: var(--text); background: none; }
.adv-note-peek.empty { opacity: 0; font-style: normal; }
.adv-row:hover .adv-note-peek.empty, .adv-note-peek.empty:focus-visible { opacity: .7; }
.adv-row.noting .adv-note-peek { display: none; }
.adv-note { flex-basis: 100%; font-size: .9rem; }
.adv-note .rich { display: block; }
.adv-note .rich-edit, .adv-note .rich-raw { min-height: 1.5em; padding: 3px 8px; font-size: .9rem; line-height: 1.4; }
.adv-note .md-bar, .adv-note .md-full { display: none; }
.adv-from { flex: none; font-size: .7rem; color: var(--muted); text-decoration: none; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--glass-border); max-width: 10em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adv-from:hover { color: var(--text); }
/* Latest update: the newest comments, then a line to add one. */
.adv-side { position: relative; min-width: 0; padding: 3px 0 0 10px; border-left: 1px solid var(--glass-border); }
.adv-latest { list-style: none; margin: 0 0 2px; padding: 0; cursor: pointer; }
.adv-latest li { display: flex; gap: 8px; font-size: .83rem; line-height: 1.35; padding: 1px 0; min-width: 0; }
.adv-at { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .76rem; }
.adv-said { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adv-files { color: var(--muted); }
.adv-quick { display: flex; align-items: center; gap: 4px; }
.adv-quick-add { flex: 1; min-width: 0; padding: 2px 4px; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; box-shadow: none; color: var(--text); font: inherit; font-size: .83rem; }
.adv-quick-add::placeholder { color: var(--muted); opacity: .7; }
.adv-quick-add:focus { outline: none; border-bottom-color: var(--active-border); }
.adv-attach, .adv-more, .adv-all { flex: none; padding: 2px 6px; background: none; border: 0; box-shadow: none; color: var(--muted); cursor: pointer; font-size: .8rem; }
.adv-attach .icon { width: 15px; height: 15px; }
.adv-all { text-decoration: underline; text-underline-offset: 3px; }
.adv-more { font-size: 1rem; padding: 4px 6px; }
.adv-attach:hover, .adv-more:hover, .adv-all:hover { color: var(--text); background: none; }
.adv-quick .att-count { font-size: .75rem; padding: 1px 6px; }
.adv-updated { padding-top: 7px; text-align: right; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* All of a case's comments, over the page under its row, scrolling. */
.adv-pop { position: absolute; z-index: 30; top: 100%; right: -36px; width: min(520px, 92vw); max-height: min(60vh, 520px); overflow: auto; padding: 8px 14px 6px; border-radius: 16px; border: 1px solid var(--glass-border); background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.adv-pop.up { top: auto; bottom: 100%; }
.adv-pop .comments { margin: 0; }
.adv-row.popped { z-index: 31; }
@media (max-width: 760px) {
  .adv-cols { display: none; }
  .adv-row { grid-template-columns: 20px 24px minmax(0, 1fr) auto 30px; }
  .adv-text { grid-column: 3; grid-row: 1; }
  .adv-side { grid-column: 3 / 5; grid-row: 2; margin: 2px 0 4px; }
  .adv-updated { grid-column: 4; grid-row: 2; display: none; }
  .adv-more { grid-column: 5; grid-row: 1; }
  .adv-pop { right: auto; left: -60px; }
}
.adv-empty { margin: 0; padding: 10px 12px; border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
.adv-done-h { list-style: none; }
.adv-done-h .adv-group { border-top: 1px solid var(--glass-border); }
.adv-drop-hint { margin: 0; padding: 8px 12px; font-size: .85rem; border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
/* The day's schedule: its own card, time then what. */
.adv-schedule { position: sticky; top: 12px; padding: 0 0 4px; }
.adv-card-h { padding: 9px 12px; border-bottom: 1px solid var(--glass-border); }
.adv-sched { list-style: none; margin: 0; padding: 0; }
.adv-sched li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 6px 12px; border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent); font-size: .88rem; }
.adv-sched li:last-child { border-bottom: 0; }
.adv-sched li.adv-sched-empty { display: block; }
.adv-sched .adv-when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.adv-sched li.done .adv-what, .adv-sched li.dropped .adv-what { text-decoration: line-through; opacity: .55; }
.adv-choices { display: grid; gap: 8px; margin: 4px 0 14px; }
.adv-choices label { display: flex; gap: 8px; align-items: center; }
.adv-export-actions { flex-wrap: wrap; }
.bring-move { display: flex; gap: 8px; align-items: baseline; margin: 2px 0 10px; font-size: .9rem; }
.bring-move .muted { font-size: .82rem; }
/* View case beside the name; ⋯ opens the Day Planner's full panel under the row (daypanel.js). */
.adv-case-chip { display: inline-flex; margin: 4px 0 0 6px; padding: 2px 10px; flex: none; align-self: flex-start; font-size: .78rem; }
.adv-row:has(+ .adv-panel-li) { border-bottom: 0; background: var(--glass-track); }
.adv-panel-li { list-style: none; margin: 0 0 6px; padding: 10px 12px 12px; border-bottom: 1px solid var(--glass-border); background: var(--glass-track); }
.adv-panel-li .item-details { padding: 0; border: 0; margin: 0; background: none; }

/* A task as a case (casepage.js): one task on a screen of its own, in Advanced's ticket look (its .adv-status, .adv-stat, .adv-card, .adv-group, .adv-h). */
html.case-open, html.case-open body { overflow: hidden; }
.case-page { position: fixed; inset: 0; z-index: 1000; overflow-y: auto; overscroll-behavior: contain; background: var(--bg-image), var(--bg); background-attachment: fixed; color: var(--text); outline: none; }
.case-wrap { max-width: 900px; margin: 0 auto; padding: calc(14px + var(--safe-top)) 16px calc(40px + var(--safe-bottom)); }
.case-top { display: flex; align-items: center; gap: 8px; }
.case-top .back { padding: 6px 14px 6px 10px; }
.case-where { margin: 14px 0 2px; font-size: .9rem; }
.case-head { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 12px; }
.case-title { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; font-size: 1.55rem; line-height: 1.25; }
.case-title .adv-status { margin: 0; align-self: center; }
.case-title .adv-status.gone { color: var(--muted); }
.case-head .case-tick { flex: none; margin-top: 2px; }
.case-name { overflow-wrap: anywhere; }
.case-name.done { text-decoration: line-through; opacity: .6; }
.case-stats { max-width: none; }
.case-stats .adv-stat b { font-size: 1.15rem; }
.case-sec { margin: 0 0 14px; }
.case-notes { padding: 10px 14px; border-bottom: 1px solid var(--glass-border); overflow-wrap: anywhere; }
.case-notes :is(ul, ol) { margin: 4px 0; padding-left: 22px; text-align: left; }
.case-notes > :first-child, .case-said > :first-child { margin-top: 0; }
.case-notes > :last-child, .case-said > :last-child { margin-bottom: 0; }
.case-add { display: flex; gap: 6px; align-items: center; padding: 8px 10px; }
.case-add-box { flex: 1; min-width: 0; box-sizing: border-box; padding: 9px 14px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: var(--glass-track); color: var(--text); font: inherit; }
.case-attach { padding: 8px 10px; }
.case-attach .icon { width: 18px; height: 18px; }
.case-sec .ctl-head .comment-more { margin-left: auto; }
.ctl-edit .ctl-head b { font-weight: 500; color: var(--muted); }
.case-said { margin-top: 2px; overflow-wrap: anywhere; }
.case-edits { margin: 2px 0 0; padding-left: 18px; font-size: .9rem; overflow-wrap: anywhere; }
.case-pics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.case-pic { padding: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--glass-border); background: none; }
.case-pic img { display: block; width: 96px; height: 96px; object-fit: cover; }
.case-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; }
.case-file .icon { width: 16px; height: 16px; }
.case-attached { padding: 4px 10px; }
.case-props { margin: 0; }
.case-props > div { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 7px 12px; border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
.case-props > div:last-child { border-bottom: 0; }
.case-props dt { font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.case-props dd { margin: 0; overflow-wrap: anywhere; }
.case-changed { font-size: .75rem; white-space: nowrap; }
.case-honest { margin: 14px 0 0; font-size: .8rem; }
@media (max-width: 520px) {
  .case-top .back kbd { display: none; }
  .case-head { flex-direction: column; }
  .case-title { font-size: 1.25rem; }
  .case-props > div { grid-template-columns: 110px minmax(0, 1fr); }
  .case-props .case-changed { grid-column: 2; white-space: normal; }
}
.adv-order { grid-auto-flow: column; justify-content: start; gap: 18px; }

/* ---------- Details tables (detailtable.js; Cases) ---------- */
.dt-wrap { max-width: 100%; overflow-x: auto; margin-top: 10px; border: 1px solid var(--glass-border); border-radius: 14px; background: var(--glass); }
.dt { table-layout: fixed; border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: .92rem; }
.dt th { position: relative; text-align: left; padding: 0; border-bottom: 1px solid var(--glass-border); background: var(--glass-track); }
.dt-th { display: flex; align-items: center; min-width: 0; }
.dt .dt-sort { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; padding: 8px 4px 8px 10px; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.dt th[aria-sort] .dt-sort { color: var(--text); }
.dt-arrow { margin-left: 4px; }
.dt .dt-menu-btn { flex: none; width: 24px; height: 24px; margin-right: 8px; padding: 0; border: 0; border-radius: 6px; background: none; box-shadow: none; color: var(--muted); font-size: .75rem; opacity: .55; }
.dt th:hover .dt-menu-btn, .dt .dt-menu-btn:focus-visible { opacity: 1; background: var(--glass-hover); }
.dt .dt-menu-btn.on { opacity: 1; color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.dt-resize { position: absolute; top: 0; right: -4px; bottom: 0; width: 9px; z-index: 2; cursor: col-resize; touch-action: none; }
.dt-resize::after { content: ''; position: absolute; top: 25%; bottom: 25%; left: 4px; width: 1px; background: var(--glass-border); }
.dt-resize:hover::after, .dt-resizing .dt-resize::after { top: 0; bottom: 0; width: 2px; left: 3px; background: var(--accent); }
.dt-resizing { cursor: col-resize; -webkit-user-select: none; user-select: none; }
.dt td { padding: 9px 10px; border-bottom: 1px solid color-mix(in srgb, var(--text) 7%, transparent); vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt tbody tr { cursor: pointer; }
.dt tbody tr:hover, .dt tbody tr:focus-visible { background: var(--glass-hover); outline: none; }
.dt tbody tr:last-child td { border-bottom: 0; }
.dt .num { text-align: right; font-variant-numeric: tabular-nums; }
.dt .dt-date { font-variant-numeric: tabular-nums; }
.dt .dt-name b { font-weight: 650; }
.dt-none td { cursor: default; text-align: center; padding: 18px; }
#main[data-shade="alt"] .dt tbody tr:nth-child(even) { background: color-mix(in srgb, var(--text) 4%, transparent); }
.dt-pop { position: fixed; z-index: 950; width: 230px; max-height: min(420px, 70vh); overflow-y: auto; display: grid; gap: 6px; padding: 8px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .16); background: #172033; box-shadow: 0 12px 34px rgba(0, 0, 0, .45); color: #e8eefc; font-family: var(--font); } /* as the 👁 menu */
.dt-pop .muted { color: #9aa7bd; }
.dt-pop button { text-align: left; padding: 5px 10px; font-size: .88rem; box-shadow: none; background: rgba(255, 255, 255, .07); color: inherit; border: 1px solid rgba(255, 255, 255, .16); }
.dt-pop-sort { display: grid; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--glass-border); }
.dt-pop-sort button[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-border); font-weight: 600; }
.dt-pop-h { font-size: .75rem; padding: 0 4px; }
.dt-pop-filter { display: grid; gap: 2px; }
.dt-check { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; font-size: .9rem; cursor: pointer; }
.dt-check:hover { background: rgba(255, 255, 255, .07); }
.dt-check .muted { margin-left: auto; font-size: .8rem; }
.dt-all { border-bottom: 1px solid var(--glass-border); border-radius: 8px 8px 0 0; }
.dt-pop .dt-q { margin: 0; }
.dt-pop-foot { display: grid; gap: 4px; }
.dt-pop-foot:empty { display: none; }

/* ---------- Cases list (Contacts and Cases) ---------- */
.case-badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 650; color: var(--st); background: color-mix(in srgb, var(--st) 16%, transparent); border: 1px solid color-mix(in srgb, var(--st) 45%, transparent); white-space: nowrap; }
.case-badge::before { content: ''; width: 7px; height: 7px; border-radius: 99px; background: var(--st); }
.case-show-row { align-items: center; }
.case-unfilter { flex: none; margin-left: 6px; padding: 3px 10px !important; border: 1px solid var(--active-border) !important; border-radius: 999px !important; color: var(--text) !important; font-size: .8rem !important; }
.case-cards { margin-top: 12px; }
.case-cards .bb-chapter-title { position: static; }
.case-card .bb-card-pic { aspect-ratio: 16 / 7; }
.case-card .bb-card-emoji { font-size: 2.4rem; }
.case-card .bb-card-pic .case-badge { position: absolute; top: 8px; right: 8px; color: #fff; background: rgba(12, 18, 30, .62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.case-card .bb-card-body { height: auto; min-height: 8.6em; } /* cards in a row still match: the grid stretches them */
.case-card .bb-card-made { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-card-when { font-size: .8rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-card .bb-card-menu .kase-dot { display: inline-block; width: 9px; height: 9px; box-shadow: none; margin-right: 4px; }
@media (max-width: 640px) {
  .case-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .case-card .bb-card-emoji { font-size: 1.8rem; }
  .case-card .bb-card-body { padding: 8px 10px 10px; }
  .case-card .bb-card-title { font-size: .95rem; }
  .case-card .bb-card-acts { padding: 0 6px 8px 10px; }
}

/* Minimal style (👁 Style, Tasks and Lists): flat rows like a plain to-do app, set close together on one faint
   panel with thin dividers; New task a plain underlined line set apart above them. Compact spacing:
   35px rows (37px on iPad), 14px text, ⠿ always showing. Built on Lined paper's flat rows (it sets data-layout-lined). */
#main[data-skin="minimal"] {
  --row-pad: 3px;
  .task-list { background: color-mix(in srgb, var(--text) 3.5%, transparent); border-radius: 0; }
  .task-list > li[data-task]:has(+ li.task-details)::before { border-radius: 0; } /* the open task's frame: square, as everything in Minimal */ /* no overflow clip: a row dragged past the ends must stay visible */
  /* Dividers are borders, not the ruled ::after lines: a border snaps to whole screen pixels, so each is the same 1px at any zoom. */
  .task-list > li[data-task] { border-width: 0 0 1px; border-style: solid; border-color: transparent transparent color-mix(in srgb, #000 28%, transparent); border-radius: 0; }
  .task-list > li[data-task]::after { display: none; }
  .task-list > li[data-task]:last-of-type { border-bottom-color: transparent; }
  .task-list > li[data-task] > .task-title { font-weight: 400; }
  :is(#task-entry, #list-entry) { max-width: 700px; margin-bottom: 26px; }
  :is(#task-entry, #list-entry) .task-add-line { border: 0; border-radius: 0; background: transparent; padding-left: 2px; }
  :is(#task-entry, #list-entry) .task-add-line::after { left: 0 !important; background: var(--glass-border); }
  :is(#task-entry, #list-entry) .task-add-line > .add-mark { display: none; }
  :is(#task-entry, #list-entry) .task-add-line .new-task-line { margin-left: 0; }
}
#main[data-skin="minimal"][data-density="tight"] {
  .task-list > li[data-task] { min-height: 35px; font-size: 14px; padding-top: 1px; padding-bottom: 1px; }
  .task-list > li[data-task] > .tick { width: 14px; height: 14px; }
  .task-list > li[data-task] > .drag-handle { height: 24px; }
  .task-list > li[data-task] > .task-title { font-size: 14px; line-height: 20px; padding-top: 3px; padding-bottom: 3px; }
  .task-add-line { min-height: 35px; box-sizing: border-box; }
  .task-add-line .new-task-line { font-size: 14px; line-height: 20px; padding-top: 2px; padding-bottom: 2px; } /* New task as tall as a row, its words as big */
}
@media (pointer: coarse) and (min-width: 700px) { #main[data-skin="minimal"][data-density="tight"] :is(.task-list > li[data-task], .task-add-line) { min-height: 37px; } } /* iPad: a touch more room for fingers */
/* A row's markers (📅 📎 ...) as line drawings in Minimal, emoji elsewhere (mark() in views/tasks.js); 📝 a line drawing everywhere (below). */
.line-ico { display: none; }
#main[data-skin="minimal"] .task-list :is(.emo) { display: none; }
#main[data-skin="minimal"] .task-list .line-ico { display: inline-block; width: 13px; height: 13px; vertical-align: middle; stroke-width: 1.8; opacity: .75; }
/* Centred on the row whatever the font's baseline (a baseline offset sat low with Windows fonts). */
#main[data-density="tight"] .task-list .task-note { display: flex; align-items: center; align-self: stretch; }
#main[data-density="tight"] .task-list .note-icon { display: flex; font-family: inherit; }
/* A note's mark is the line drawing in every style (1.61.75): rows' 📝 and the Day Planner's. */
:is(.task-list .note-icon, .planner .note-tag) .emo { display: none; }
:is(.task-list .note-icon, .planner .note-tag) .line-ico { display: inline-block; width: 13px; height: 13px; vertical-align: middle; stroke-width: 1.8; opacity: .75; }
/* Files attached: 📎 as the same line drawing. Tasks: compact only (the other spacings have the 📎 n chip); the Day Planner: every spacing. */
.task-list .att-mark { display: none; }
#main[data-density="tight"] .task-list .att-mark { display: flex; align-items: center; align-self: stretch; flex: none; padding: 0 2px; margin: 0; border: 0; background: none; box-shadow: none; color: inherit; cursor: pointer; }
.task-list .att-mark .emo { display: none; }
.task-list .att-mark .line-ico { display: inline-block; width: 13px; height: 13px; vertical-align: middle; stroke-width: 1.8; opacity: .75; }
.planner .att-tag { display: inline-block; }
#main[data-skin="minimal"] .task-list .chip:has(> .line-ico) { display: inline-flex; align-items: center; gap: 4px; }
/* Minimal: every row's ⠿ shows (faint) all the time, not only under the pointer. */
@media (hover: hover) { #main[data-skin="minimal"] .task-list > li[data-task]:not(:hover, .selected, .dragging) > .drag-handle { opacity: .35 !important; } }

/* A task's or list item's notes toolbar (every style): one square bar joined to the top of the notes box, its
   buttons side by side in it rather than each in its own bubble. Full screen keeps its own bar. */
.task-details :is(.task-notes, .list-notes).rich:not(.is-full) > .md-bar { margin: 0; gap: 0; padding: 2px; border: 1px solid var(--glass-border); border-bottom: 0; border-radius: 8px 8px 0 0; background: color-mix(in srgb, var(--text) 4%, transparent); }
.task-details :is(.task-notes, .list-notes).rich:not(.is-full) > .md-bar button { border-radius: 5px; border-color: transparent; background: transparent; box-shadow: none; padding: 3px 8px; }
.task-details :is(.task-notes, .list-notes).rich:not(.is-full) > .md-bar button:hover:not(:disabled) { background: var(--glass-hover); }
.task-details :is(.task-notes, .list-notes).rich:not(.is-full) > .md-bar :is(button[aria-pressed="true"], [data-cmd][aria-pressed="true"]) { background: var(--active-bg); border-color: transparent; }
.task-details :is(.task-notes, .list-notes).rich:not(.is-full) > .md-bar .md-sep { margin: 4px 3px; }
.task-details :is(.task-notes, .list-notes).rich:not(.is-full) > :is(.rich-edit, .rich-raw) { border-radius: 0 0 8px 8px; }

/* Minimal (👁 Style): a task's quick-edit pills and full panel flat and compact, like its rows:
   small square-ish controls, no boxed sections (thin lines between them instead), smaller fields. */
#main[data-skin="minimal"] {
  .task-list .entry-chip { padding: 2px 8px; gap: 4px; border-radius: 5px; font-size: 12.5px; background: transparent; box-shadow: none; filter: grayscale(1); }
  .task-list .entry-chip:hover { background: var(--glass-hover); }
  .task-list .entry-chip.set { filter: none; background: color-mix(in srgb, var(--text) 8%, transparent); border-color: color-mix(in srgb, var(--text) 30%, transparent); }
  .task-list .edit-pills .pill-row { gap: 4px; }
  .task-list .entry-chip kbd { font-size: .62rem; padding: 0 3px; }
  .task-list > li.task-details { margin: 0; padding: 8px 12px 10px; border: 0; border-radius: 0; border-bottom: 1px solid color-mix(in srgb, #000 28%, transparent); background: color-mix(in srgb, var(--text) 2.5%, transparent); font-size: 13px; }
  .task-details :is(.task-notes, .list-notes) { margin-bottom: 6px; }
  .task-details :is(.task-notes, .list-notes) .rich-edit, .task-details :is(.task-notes, .list-notes) .rich-raw { min-height: 3.2em; padding: 6px 9px; font-size: 14px; line-height: 1.45; }
  .task-details :is(.task-notes, .list-notes).rich:not(.is-full) > .md-bar { padding: 1px; border-radius: 0; }
  .task-details :is(.task-notes, .list-notes).rich:not(.is-full) > .md-bar button { padding: 2px 7px; font-size: 12px; border-radius: 3px; }
  .task-details :is(.task-notes, .list-notes).rich:not(.is-full) > :is(.rich-edit, .rich-raw) { border-radius: 0; }
  .task-details .att-row { margin: 0 0 6px; }
  .task-details .att-add { padding: 2px 8px; font-size: 12px; border-radius: 5px; }
  .task-details :is(.panel-sec, .comments) { margin: 0; padding: 7px 0; border: 0; border-top: 1px solid var(--glass-border); border-radius: 0; background: none; }
  .task-details .panel-h { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
  .task-details .comment-add { font-size: 13px; }
  .task-details .energy-pick { margin-bottom: 6px; gap: 4px; font-size: 12px; }
  .task-details .energy-pick button { padding: 1px 8px; font-size: 12px; border-radius: 5px; box-shadow: none; }
  .task-details .detail-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 10px; margin-bottom: 0; font-size: 12px; color: var(--muted); }
  .task-details .detail-grid :is(input, select) { height: 28px; min-height: 0; padding: 2px 6px; font-size: 13px; line-height: 22px; border-radius: 5px; box-shadow: none; }
  .task-details .label-row .date-quick .linklike { font-size: 11.5px; }
  .task-details .detail-grid .linklike { font-size: 12px; }
  .task-details .detail-more { margin: 0; border-top: 1px solid var(--glass-border); }
  .task-details .detail-more > summary { padding: 6px 0; border: 0; border-radius: 0; background: none; font-size: 12.5px; }
  .task-details .detail-more > summary:hover { background: none; color: var(--text); }
  .task-details .detail-more[open] > .detail-grid { padding-bottom: 8px; }
  .task-details .detail-actions { margin: 6px 0 0; padding: 8px 0 0; border-top: 1px solid var(--glass-border); background: none; gap: 6px; }
  .task-details .detail-actions button { padding: 3px 10px; font-size: 12.5px; border-radius: 5px; box-shadow: none; }
  .task-list > li[data-task] :is(.pill-reveal, .pill-done, .more, .close-details) { padding: 1px 8px; font-size: 12px; border-radius: 5px; box-shadow: none; }
}

/* Minimal in Brain Dump (👁 Style): a grid of equal, square-edged notes drawn like a small Notepad window: the
   note's kind as the open tab at the top (underlined in its colour with Look Multicolour), clean text in the app's
   font, and a quiet bar along the bottom with Archive and ⋯. 4 across on a computer, 3 on an iPad, 2 on a phone
   (Compact one more, Loose one fewer). A long note fades out at the bottom; clicking one opens it full screen. */
#main[data-skin="minimal"] {
  --bd-cols: 2;
  --np-sheet: color-mix(in srgb, var(--text) 6%, var(--bg));
  --np-strip: color-mix(in srgb, var(--text) 2.5%, var(--bg));
  --np-line: color-mix(in srgb, var(--text) 14%, transparent);
  --np-mark: color-mix(in srgb, var(--text) 45%, transparent);
  .thought-list { grid-template-columns: repeat(var(--bd-cols), minmax(0, 1fr)); gap: 12px; grid-auto-flow: row; align-items: stretch; }
  .thought, .thought.size-m, .thought.size-l { grid-column: auto !important; aspect-ratio: 4 / 3; display: flex; flex-direction: column; overflow: hidden; border-radius: 0; border: 1px solid var(--np-line); background: var(--np-sheet); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .55); padding: 0; box-sizing: border-box; }
  .thought.zoomed { grid-column: 1 / -1 !important; aspect-ratio: auto; display: block; overflow: visible; }
  .thought-head { flex: none; align-items: flex-end; gap: 4px; padding: 6px 30px 0 6px; background: var(--np-strip); font-size: 12px; }
  .thought-head .kind-select { position: relative; font-size: 12px; color: var(--text); background-color: var(--np-sheet); border: 1px solid var(--np-line); border-bottom: 0; border-radius: 0 !important; margin-bottom: -1px; padding: 5px 24px 6px 12px !important; box-shadow: inset 0 -2px 0 var(--np-mark); } /* !important: over .kind-select's pill */
  .thought-head > .muted { font-size: 11px; padding-bottom: 6px; margin-left: 6px; }
  .thought-head .chip { border-radius: 0; margin-bottom: 4px; font-size: 11px; }
  .thought-head .pin { top: 8px; }
  .thought .thought-body { flex: 1; min-height: 0; display: block; overflow: hidden; margin: 0; padding: 10px 14px 0; border-top: 1px solid var(--np-line); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent); mask-image: linear-gradient(to bottom, #000 75%, transparent); }
  .thought .thought-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
  .thought-actions { flex: none; margin: 0; padding: 3px 6px 3px 12px; border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent); background: var(--np-strip); }
  .thought-actions .note-end > button, .thought-actions .note-more > summary { padding: 1px 8px; font-size: 11px; border-radius: 0; border-color: transparent; background: transparent; box-shadow: none; color: color-mix(in srgb, var(--text) 70%, transparent); }
  .thought-actions .note-end > button:hover, .thought-actions .note-more > summary:hover { background: var(--glass-hover); color: var(--text); }
  .thought.pinned .thought-head { box-shadow: inset 0 2px 0 var(--active-border); }
  .thought-edit :is(.rich-edit, .rich-raw) { border-radius: 0; }
  .thought-edit .md-bar button { border-radius: 0; box-shadow: none; }
}
#main[data-skin="minimal"][data-density="tight"] { --bd-cols: 3; }
@media (max-width: 699px) { #main[data-skin="minimal"]:not([data-density="loose"]) .thought:not(.zoomed, :has(> .thought-edit)) { aspect-ratio: 1; } } /* phones: square, room for the words under the tab */
#main[data-skin="minimal"][data-density="loose"] { --bd-cols: 1; }
@media (min-width: 700px) {
  #main[data-skin="minimal"] { --bd-cols: 3; }
  #main[data-skin="minimal"][data-density="tight"] { --bd-cols: 4; }
  #main[data-skin="minimal"][data-density="loose"] { --bd-cols: 2; }
}
@media (min-width: 1100px) {
  #main[data-skin="minimal"] { --bd-cols: 4; }
  #main[data-skin="minimal"][data-density="tight"] { --bd-cols: 5; }
  #main[data-skin="minimal"][data-density="loose"] { --bd-cols: 3; }
}
#main[data-skin="minimal"][data-zoom] .thought-list { grid-template-columns: 1fr; }
/* A note's open ⋯ menu reaches out of the note (it clips its own words, not its menus) and over its neighbours. */
#main[data-skin="minimal"] .thought:has(details[open]) { overflow: visible; z-index: 30; }
/* Not Medium's 6-line clamp: in a box it drew the hidden lines on top of each other (the fade cuts the note off instead). */
#main[data-skin="minimal"]:not([data-density="loose"]):not([data-density="tight"]) .thought .thought-body { display: block; -webkit-line-clamp: none; line-clamp: none; }
/* Look Multicolour: the writing area a light wash of the note's own colour and its tab underlined in it; the tab strip and bottom bar stay as they are. */
#main[data-skin="minimal"][data-shade="colour"] .thought[style*="--tint"] { --np-mark: var(--tint); background: color-mix(in srgb, var(--tint) 12%, var(--np-sheet)); border-color: var(--np-line); }
:root[data-theme="light"] #main[data-skin="minimal"][data-shade="colour"] .thought[style*="--tint"] { background: color-mix(in srgb, var(--tint) 14%, var(--np-sheet)); }
#main[data-skin="minimal"][data-shade="alt"] .thought-list > .thought:nth-child(even) { --np-sheet: color-mix(in srgb, var(--text) 9%, var(--bg)); background: var(--np-sheet); }
:root[data-theme="light"] #main[data-skin="minimal"] { --np-sheet: #fff; --np-strip: #f3f4f6; }
@media (hover: hover) { #main[data-skin="minimal"] .thought:not(:hover, :focus-within, .selected) .thought-head .pin:not([aria-pressed="true"]) { opacity: 0; } }
#main[data-skin="minimal"][data-density="tight"] .thought:not(.zoomed, :has(> .thought-edit)) { aspect-ratio: 1; }
#main[data-skin="minimal"][data-density="tight"] .thought .thought-body { padding: 6px 10px 0; }
#main[data-skin="minimal"][data-density="tight"] .thought .kind-select { display: inline-block; }
@media (max-width: 699px) { #main[data-skin="minimal"] .thought-head > .muted { display: none; } } /* phones: the tab only, on one line */
#main[data-skin="minimal"][data-density="tight"] .thought-head > .muted { display: none; }
/* Bring items in: compact rows, buttons on the right that never wrap (1.61.99); headings, panels and the rest keep their room (1.62.01) */
.bring-sheet h2 .bring-day { margin-left: 6px; font-size: .8em; font-weight: 400; color: var(--muted); }
.bring-sheet .review-list { gap: 3px; }
.bring-sheet .review-list li { flex-wrap: nowrap; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 10px; }
/* a long name takes two lines at most (a tap shows it all); its icons and notes run on after it */
.bring-sheet .bring-main { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; flex: 1 1 auto; min-width: 0; overflow: hidden; line-height: 1.25; cursor: pointer; }
.bring-sheet .bring-main.full { display: block; }
.bring-sheet .bring-main .review-title { font-size: .95rem; }
.bring-sheet .bring-main .review-about { font-size: .76rem; }
.bring-sheet .review-actions { flex: none; flex-wrap: nowrap; gap: 3px; align-items: center; }
.bring-sheet .review-actions button { padding: 3px 8px; font-size: .78rem; line-height: 1.3; white-space: nowrap; }
.bring-sheet .review-actions .bring-icon { padding: 3px 6px; min-width: 26px; }
.bring-sheet .bring-icon .icon { width: 14px; height: 14px; vertical-align: -2px; }
.bring-sheet .bring-event .gcal-when { min-width: 0; margin-right: 2px; font-size: .8rem; }
.bring-proj { margin: 14px 0 0; }
.bring-proj > summary { list-style: none; cursor: pointer; margin: 0 0 4px; padding: 6px 4px; font-size: 1rem; font-weight: 500; }
.bring-sheet .review-all { margin-top: 18px; }
.bring-proj > summary::-webkit-details-marker { display: none; }
.bring-proj > summary::before { content: '▸'; display: inline-block; width: 1em; color: var(--muted); transition: transform .15s; }
.bring-proj[open] > summary::before { transform: rotate(90deg); }

/* Advanced and View case in 👁 Style (viewcog.js; View case has no #main, so its marks are its own). Cards is their plain look, above. */
:is(#main, .case-page)[data-skin="lined"] {
  .adv-card { border-width: 1px 0; border-color: var(--rule); border-radius: 0; background: transparent; }
  .adv-stat { border-width: 0 0 0 3px; border-radius: 0; background: transparent; }
  :is(.adv-new, .adv-cols, .adv-group, .adv-card-h, .adv-sched li, .adv-empty, .adv-drop-hint, .adv-row, .case-notes) { border-bottom: 1px solid var(--rule); }
  :is(.adv-group, .adv-count) { background: transparent; }
  .adv-done-h .adv-group { border-top: 0; }
  .adv-side { border-left-color: var(--rule); }
  .adv-row:nth-child(even of .adv-row) { background-color: transparent; }
  .ctl-card { border-width: 0 0 1px; border-color: var(--rule); border-radius: 0; background: transparent; padding-inline: 2px; }
  .ctl-card::before { display: none; }
  .ctl-icon { background: transparent; }
}
:is(#main, .case-page)[data-skin="lined"][data-layout-alt] {
  .adv-row:nth-child(even of .adv-row) { background-color: color-mix(in srgb, var(--text) 5%, transparent); }
  .ctl-item:nth-child(even of .ctl-item) .ctl-card { background: color-mix(in srgb, var(--text) 5%, transparent); }
}
#main[data-skin="lined"][data-layout-margin] .adv-row { background-image: linear-gradient(to right, transparent 67px, var(--margin-rule) 67px, var(--margin-rule) 68.5px, transparent 68.5px); }
:is(#main, .case-page)[data-skin="minimal"] {
  .adv-card { border: 0; border-radius: 0; background: transparent; }
  .adv-stats { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 12px; max-width: none; }
  /* The counts: square tints in the colours of Cards' and Lined paper's bars. */
  .adv-stat { --stat: var(--muted); flex-direction: row; align-items: baseline; gap: 5px; padding: 3px 10px; border: 0; border-radius: 0; background: color-mix(in srgb, var(--stat) 16%, transparent); }
  .adv-stat.open { --stat: var(--accent); }
  .adv-stat.closed { --stat: #4caf7a; }
  .adv-stat.updates { --stat: #d9a441; }
  .adv-stat b { font-size: .95rem; font-weight: 600; color: var(--stat); }
  .adv-cols { display: none; }
  /* Rows as in Tasks' Minimal: one faint square panel, split by the same thin dark dividers. */
  :is(.adv-tasks, .adv-sched) { background: color-mix(in srgb, var(--text) 3.5%, transparent); border-radius: 0; }
  :is(.adv-row, .adv-sched li) { border-width: 0 0 1px; border-style: solid; border-color: transparent transparent color-mix(in srgb, #000 28%, transparent); border-radius: 0; }
  .adv-row { padding: 3px 10px; }
  .adv-row > .drag-handle { width: 26px; height: 24px; }
  .adv-title { font-weight: 400; }
  .adv-new { max-width: 700px; margin-bottom: 26px; padding: 0 2px; border-bottom: 1px solid var(--glass-border); }
  .adv-new-plus { display: none; }
  .adv-side { border-left: 0; }
  :is(.adv-group, .adv-count) { background: transparent; border-color: transparent; }
  :is(.adv-card-h, .adv-done-h .adv-group) { border-color: transparent; }
  .adv-sched li { padding-block: 5px; }
  .ctl { padding: 2px 12px 10px; }
  :is(.ctl-month, .ctl-item)::before { display: none; }
  .ctl-month { padding: 10px 0 2px; }
  .ctl-item { grid-template-columns: 20px minmax(0, 1fr); gap: 8px; padding: 5px 8px; background: color-mix(in srgb, var(--text) 3.5%, transparent); border-bottom: 1px solid color-mix(in srgb, #000 28%, transparent); }
  .ctl-icon { width: 20px; height: 20px; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: .9rem; }
  .ctl-card { padding: 0; border: 0; border-radius: 0; background: transparent; }
  .ctl-card::before { display: none; }
  .case-notes { border-bottom: 0; }
}
/* View case's items: the time, then the words on the same line and lined up; a comment's icon says what it is, so no word for it. */
:is(#main, .case-page)[data-skin="minimal"] {
  .ctl-item { padding: 9px 12px; margin-bottom: 3px; border-bottom: 0; }
  .ctl-card { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; }
  .ctl-head { display: contents; }
  .ctl-head time { grid-column: 1; grid-row: 1; white-space: nowrap; }
  .ctl-head b { grid-column: 2; grid-row: 1; }
  .ctl-head .comment-more { grid-column: 3; grid-row: 1; margin: 0; }
  .ctl-body { grid-column: 2; margin: 0; }
  .ctl-item.is-said .ctl-head b { display: none; }
  .ctl-item.is-said .ctl-body { grid-row: 1; }
  .case-said { margin: 0; }
}
@media (max-width: 520px) { :is(#main, .case-page)[data-skin="minimal"] {
  .ctl-card { grid-template-columns: minmax(0, 1fr) auto; }
  .ctl-head .comment-more { grid-column: 2; }
  .ctl-head b, .ctl-body, .ctl-item.is-said .ctl-body { grid-column: 1 / -1; grid-row: auto; }
} }
@media (min-width: 761px) { #main[data-skin="minimal"] .adv-row { grid-template-columns: 26px 20px minmax(0, 1fr) minmax(0, 38%) 74px 30px; } }
@media (hover: hover) { #main[data-skin="minimal"] .adv-row:not(:hover, :focus-within) .adv-case-chip { opacity: 0; } }
/* Every row's ⠿ shows (faint) all the time, as in Tasks' Minimal. */
#main[data-skin="minimal"] .adv-row > .drag-handle { opacity: .35; }
@media (hover: hover) { #main[data-skin="minimal"] .adv-row:not(:hover, .selected, .dragging) > .drag-handle { opacity: .35 !important; } }
/* Tight: one line a row. 35px rows (37px on iPad), 14px text; the note a mark (it opens as before); one comment's line, or Add a comment while pointing at the row or typing. */
#main[data-skin="minimal"][data-density="tight"] {
  .adv-row { align-items: center; min-height: 35px; padding-block: 1px; font-size: 14px; }
  .adv-row:has(+ .adv-panel-li), .adv-row.noting { align-items: start; }
  .adv-row .tick { width: 14px; height: 14px; margin: 0 0 0 2px; }
  .adv-text { align-items: center; flex-wrap: nowrap; padding-top: 0; }
  .adv-row.noting .adv-text { flex-wrap: wrap; }
  .adv-title { font-size: 14px; line-height: 20px; padding: 3px 0; field-sizing: content; }
  .adv-case-chip { margin: 0 0 0 6px; padding: 0 8px; }
  .adv-note-peek { flex: none; }
  .adv-note-peek.empty { display: none; }
  .adv-note-words { display: none; }
  .adv-note-peek .line-ico { display: inline-block; width: 13px; height: 13px; vertical-align: middle; stroke-width: 1.8; opacity: .75; }
  .adv-side { padding-top: 0; }
  .adv-latest { margin: 0; }
  .adv-latest li:not(:last-child) { display: none; }
  .adv-side:has(.adv-latest) .adv-quick { display: none; }
  .adv-row:is(:focus-within, :hover) .adv-side:has(.adv-latest) .adv-latest { display: none; }
  .adv-row:is(:focus-within, :hover) .adv-side .adv-quick { display: flex; }
  .adv-updated, .adv-more { padding-block: 0; }
}
@media (pointer: coarse) and (min-width: 700px) { #main[data-skin="minimal"][data-density="tight"] .adv-row { min-height: 37px; } }
@media (hover: none) { #main[data-skin="minimal"][data-density="tight"] .adv-row:not(:focus-within) .adv-side:has(.adv-latest) .adv-latest { display: block; } }
@media (hover: none) { #main[data-skin="minimal"][data-density="tight"] .adv-row:not(:focus-within) .adv-side:has(.adv-latest) .adv-quick { display: none; } }
@media (max-width: 760px) { #main[data-skin="minimal"][data-density="tight"] .adv-side { display: none; } }
/* 👁 Spacing, in any style. */
#main[data-density="tight"] .adv-row { padding-block: 1px; }
:is(#main, .case-page)[data-density="tight"] .ctl-item { padding-block: 2px; }
:is(#main, .case-page)[data-density="loose"] { .adv-row { padding-block: 10px; } .ctl-item { padding-block: 9px; } }
:is(#main, .case-page)[data-skin="minimal"][data-density="tight"] .ctl-item { padding-block: 6px; }
:is(#main, .case-page)[data-skin="minimal"][data-density="loose"] .ctl-item { padding-block: 13px; }
/* New task in Lined paper and Minimal: as Tasks' line. No box, focused or not; its words a faint italic until typed in. */
#main:is([data-skin="lined"], [data-skin="minimal"]) #adv-new, #main:is([data-skin="lined"], [data-skin="minimal"]) #adv-new:focus { padding: 4px 5px; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none; font-size: 1rem; }
#main:is([data-skin="lined"], [data-skin="minimal"]) #adv-new::placeholder { font-style: italic; color: color-mix(in srgb, var(--text) 22%, transparent); opacity: 1; }
#main:is([data-skin="lined"], [data-skin="minimal"])[data-density="tight"] .adv-new { min-height: 35px; box-sizing: border-box; }
#main:is([data-skin="lined"], [data-skin="minimal"])[data-density="tight"] #adv-new { padding-block: 2px; font-size: 14px; line-height: 20px; }

/* Wide windows: a task's panel in two columns, on the left: the words at a readable width (--read), details beside them. One column below 1300px, in the same order as ever (the wrappers step aside). A later full-width choice only has to change --read. */
.td-main, .td-side { display: contents; }
@media (min-width: 1300px) {
  :root { --read: 800px; }
  .task-list > li.task-details { display: grid; grid-template-columns: minmax(0, var(--read)) 340px; justify-content: start; column-gap: 24px; align-items: start; }
  .task-details > :is(.td-main, .td-side) { display: block; min-width: 0; }
  .task-list > li.task-details .detail-actions { margin: 12px 0 0; padding: 0; border: 0; background: none; }
}
/* View case's note, edited where it's shown. */
.case-notes[data-case="note"] { cursor: text; }
.case-notes[data-case="note"]:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }
.case-note-edit { padding: 6px 4px; border-bottom: 1px solid var(--glass-border); }
.case-note-edit .rich { display: block; }
.case-note-edit :is(.md-bar, .md-full) { display: none; }
.case-note-edit :is(.rich-edit, .rich-raw) { min-height: 3em; padding: 4px 10px; border-radius: var(--radius-sm); }
/* In Minimal nothing here is a rounded box: Add a comment is a plain line, as New task is. */
.case-page[data-skin="minimal"] {
  .case-add { padding: 0 2px; }
  .case-add-box, .case-add-box:focus { padding: 7px 5px; border: 0; border-bottom: 1px solid var(--glass-border); border-radius: 0; background: transparent; box-shadow: none; outline: none; }
  .case-add-box::placeholder { font-style: italic; color: color-mix(in srgb, var(--text) 22%, transparent); opacity: 1; }
  .case-attach { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .comment-edit, .case-note-edit :is(.rich-edit, .rich-raw) { border-radius: 0; }
}

/* Advanced and View case in Minimal: no curves at all, including what floats over the page (menus, sheets, the bars, the drop marks). Only the press-and-hold splash stays round. */
:root:has(#main[data-skin="minimal"] .adv, .case-page[data-skin="minimal"]) {
  :is(#main, .case-page, .pill-menu, .select-bar, .toast, .drop-box, .drop-slot, .drag-ghost, .file-drop-hint, dialog),
  :is(#main, .case-page, .pill-menu, .select-bar, .toast, .drag-ghost, dialog) *:not(.hold-ripple > span, .hold-waves > span),
  :is(#main, .case-page, .pill-menu, .select-bar, .toast, .drag-ghost, dialog) *:not(.hold-ripple > span, .hold-waves > span)::before,
  :is(#main, .case-page, .pill-menu, .select-bar, .toast, .drag-ghost, dialog) *:not(.hold-ripple > span, .hold-waves > span)::after { border-radius: 0 !important; }
  input[type="radio"] { appearance: none; -webkit-appearance: none; flex: none; width: 14px; height: 14px; margin: 0; border: 1px solid var(--glass-border); background: transparent; }
  input[type="radio"]:checked { border: 4px solid var(--accent); }
}
/* Help hints (hints.js): a small friendly callout, each with its own ✕. */
.hint-callout { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; padding: 7px 8px 7px 10px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--text); font-size: .8rem; line-height: 1.4; transition: opacity .18s; }
.hint-callout.hint-going { opacity: 0; }
.hint-bulb { flex: none; font-size: .9rem; line-height: 1.3; }
.hint-words { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hint-x { flex: none; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: var(--muted); font-size: .72rem; line-height: 1; cursor: pointer; }
.hint-x:hover, .hint-x:focus-visible { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); }
.task-entry-more .hint-callout { margin: 0; flex-basis: 100%; }
.hint-callout.bb-ref-hint { display: none; }
.bb-method:has(.bb-steps textarea:focus) .hint-callout.bb-ref-hint { display: flex; }
@media print { .hint-callout { display: none !important; } }
.hint-settings { margin-top: 12px; }
.hint-settings h3 { margin: 0 0 4px; font-size: 1rem; }
.hint-settings-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
