/* My Hearth's look (docs/DESIGN.md, docs/brand/BRAND.md): Parchment paper, Harbor Blue for navigation and actions, Hearth Red only for the logo, Charcoal ink (never straight black). Headings are set
   narrow, heavy and in capitals ("Hearth Display"); what you read is Inter ("Hearth"). Buttons and
   chips are pills, cards have a soft 14px corner, and things arrive with a small spring. Blue is
   for primary actions and active states, red for the logo, recording and map pins; text on either is Warm White. Always light, like the homepage (no dark mode). */
:root {
  /* My Hearth's official palette (docs/brand/BRAND.md). Every colour below is one of these or a
     semantic state colour (success, warning, error). Harbor Blue is primary actions and active states;
     Hearth Red is the logo, recording and map pins only. */
  --hearth-red: #E00019; --hearth-red-hover: #BD0015; --hearth-red-pressed: #A00012; --hearth-red-subtle: #FCECEF;
  --hearth-parchment: #FAF7F2; --hearth-white: #FFFEFC; --hearth-charcoal: #282524; --hearth-sage: #A8B5A2;
  --hearth-rose: #EEDADD; --hearth-linen: #E8DFD4; --hearth-blue: #A6B6C5; --hearth-taupe: #756B65;
  /* Harbor Blue (owner, 2026-11-28): navigation and primary actions. The cool opposite of Parchment and a
     deeper Slate Blue. Red is now only the logo, recording, map pins and errors. */
  --hearth-harbor: #34506E; --hearth-harbor-hover: #2A4259; --hearth-harbor-pressed: #21354A; --hearth-harbor-subtle: #E9EEF4;
  --hearth-harbor-light: #9DBEDD;   /* Harbor Blue on Charcoal, where the deep blue would not show (1.8:1); Charcoal words on it are 7.9:1 */
  /* The journal's working tokens, mapped onto the palette. */
  --page: var(--hearth-parchment); --surface: var(--hearth-white); --rule: var(--hearth-linen);
  --hair: color-mix(in srgb, var(--hearth-linen) 60%, var(--hearth-white)); --blush: var(--hearth-rose);
  --ink: var(--hearth-charcoal); --body: var(--hearth-charcoal); --muted: var(--hearth-taupe); --night: var(--hearth-charcoal);
  --link: var(--hearth-harbor); --fill: var(--hearth-harbor); --fill-hover: var(--hearth-harbor-hover);
  --fill-pressed: var(--hearth-harbor-pressed); --on-fill: var(--hearth-white); --tint: var(--hearth-harbor-subtle);
  --brand: var(--hearth-red);   /* the logo */
  --rec: var(--hearth-red); --rec-tint: var(--hearth-red-subtle);   /* recording, as every recorder shows it */
  --met: #1b7f5a; --attention: #b42318; --note: var(--hearth-blue);
  --pm-1: var(--hearth-charcoal); --pm-2: var(--hearth-taupe); --pm-3: var(--hearth-taupe);
  --shadow: 40 37 36;   /* Charcoal as r g b, for shadows and scrims */
  --r: 14px; --pill: 999px;
  --font: "Hearth", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Hearth Display", "Hearth", "Arial Narrow", system-ui, sans-serif;
  --spring: cubic-bezier(.68, -.18, .32, 1.22); --ease: cubic-bezier(.65, 0, .35, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--body);
       font: 400 14px/20px var(--font); font-synthesis: none;
       -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { list-style: none; padding: 0; }
h1, h2, h3, strong { font-weight: 700; color: var(--ink); }
h2 { font-size: 18px; line-height: 24px; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
code { font: 13px/20px ui-monospace, SFMono-Regular, Menlo, monospace; }
time, .num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Buttons: one primary per region (the fill), secondary is the tint, tertiary the label alone. */
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 8px 14px;
       border-radius: var(--r); border: 1px solid transparent; font-weight: 500; text-decoration: none; }
.btn-primary { background: var(--fill); color: var(--on-fill); }
.btn-primary:hover { background: var(--fill-hover); } .btn-primary:active { background: var(--fill-pressed); }
.btn-secondary { background: var(--tint); border-color: var(--fill); color: var(--link); }
.btn-tertiary { background: none; color: var(--link); padding-left: 0; padding-right: 0; }
.btn:disabled { opacity: .6; cursor: progress; }

/* Date bar: 56px, title 18px. */
.dayhead { position: sticky; top: 0; z-index: 1000; display: grid; grid-template-columns: 44px 1fr 44px;
           align-items: center; min-height: 56px; padding: env(safe-area-inset-top) 8px 0;
           background: color-mix(in srgb, var(--page) 86%, transparent); backdrop-filter: blur(16px);
           -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--hair); text-align: center; }
.dayhead .nav { font-size: 26px; line-height: 44px; text-decoration: none; color: var(--muted); border-radius: var(--r); }
.dayhead .jump label, .dayhead div.jump { position: relative; display: inline-grid; cursor: pointer; }
.dayhead .weekday { font-size: 12px; line-height: 16px; color: var(--muted); }
.dayhead .date { font-size: 18px; line-height: 24px; font-weight: 900; color: var(--ink); }
.dayhead input[type=date] { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }

.day { max-width: 680px; margin: 0 auto; padding: 16px 16px 8px; display: grid; gap: 32px; }
/* Grid children default to min-width:auto, which lets a long command line widen the page. */
.day > *, .sources > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 12px 14px; }

/* Photo mosaic */
.hero { position: relative; display: grid; gap: 2px; border-radius: var(--r); overflow: hidden;
        aspect-ratio: 4 / 3; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; }
/* Tiles are photos or videos (a.hero-video), so the layout counts both. */
.hero > :first-child { grid-column: span 2; grid-row: span 2; }
.hero-1 > :first-child { grid-column: 1 / -1; }
.hero-2 > :not(.more) { grid-column: span 2; grid-row: span 2; }
.hero-3 > :not(:first-child):not(.more) { grid-column: span 2; }
.hero-4 > :nth-child(2) { grid-column: span 2; }
.hero .more { position: absolute; right: 8px; bottom: 8px; padding: 4px 10px; border-radius: var(--r);
              font-size: 12px; line-height: 16px; font-weight: 500; text-decoration: none; color: var(--hearth-white);
              background: rgba(29, 29, 31, .72); backdrop-filter: blur(8px); }

/* Summary */
.eyebrow { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.summary h1 { font-size: 26px; line-height: 30px; letter-spacing: -.01em; text-wrap: balance; margin-bottom: 12px; }
.prose { font-size: 14px; line-height: 24px; color: var(--ink); max-width: 68ch; }
.prose + .prose { margin-top: 12px; }
.pending h1 { color: var(--muted); }
.places { margin-top: 12px; font-size: 12px; line-height: 16px; color: var(--muted); }
.notice.error { padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--attention);
                color: var(--attention); background: var(--surface); }

.write { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -16px;
         color: var(--muted); }
.write p { flex: 1; }
.write .btn { margin-left: auto; }

/* Highlights: a ruled list on one surface, not a stack of raised cards. */
.highlights ol { margin-top: 10px; background: var(--surface); border: 1px solid var(--hair);
                 border-radius: var(--r); overflow: hidden; }
.highlights li + li { border-top: 1px solid var(--hair); }
.highlight { display: grid; gap: 12px; align-items: start; padding: 12px 14px; text-decoration: none; }
.highlight.has-photo { grid-template-columns: minmax(0, 1fr) 72px; }
a.highlight:hover { background: var(--tint); }
.highlight img { width: 72px; height: 72px; margin-top: 2px; object-fit: cover; border-radius: var(--r); display: block; }
.highlight h3 { font-size: 14px; line-height: 20px; margin: 2px 0; }
.highlight p { color: var(--body); }
.highlight .when { font-size: 12px; line-height: 16px; color: var(--muted); }

/* Source marks: the source's line icon (icons.css) in its mark colour; never red. */
.ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; background: var(--muted); }
.ico-photo, .ico-calendar { background: var(--pm-1); }
.ico-message { background: var(--pm-2); }
.ico-email { background: var(--pm-3); }
.ico-note { background: var(--ink); }
.ico-video { background: var(--attention); }

.people ul, .otd ul { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: var(--r); font-weight: 500;
        color: var(--ink); background: var(--surface); border: 1px solid var(--hair); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.chip-family::before { background: var(--hearth-sage); }
.chip-team::before { background: var(--hearth-blue); }
.otd a { display: block; padding: 6px 10px; border-radius: var(--r); background: var(--surface);
         border: 1px solid var(--hair); text-decoration: none; color: var(--ink); font-weight: 500; }
.otd a span { color: var(--muted); font-weight: 400; margin-left: 6px; }

.map-card { padding: 0; overflow: hidden; }
.map-wrap { position: relative; }
#map { height: 240px; z-index: 0; }
.map-expand { position: absolute; z-index: 500; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: var(--r); border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer;
  box-shadow: 0 2px 8px rgb(var(--shadow) / .12); }
.map-card.full { position: fixed; inset: 0; z-index: 1200; border-radius: 0; display: flex; flex-direction: column; border: 0; }
.map-card.full .map-wrap { flex: 1; }
.map-card.full #map { height: 100%; }
.map-card.full .map-expand { top: calc(10px + env(safe-area-inset-top)); }
.map-card.full .stops { max-height: 34vh; overflow-y: auto; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

/* The record */
.timeline { display: grid; gap: 8px; }
.timeline-head { display: grid; gap: 10px; margin-bottom: 4px; }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.filters button { flex: none; border: 1px solid var(--hair); background: var(--surface); color: var(--body);
                  border-radius: var(--r); padding: 6px 10px; font-weight: 500; }
.filters button span { color: var(--muted); margin-left: 2px; font-weight: 400; font-variant-numeric: tabular-nums; }
.filters button[aria-pressed=true] { background: var(--tint); border-color: var(--fill); color: var(--link); }
.filters button[aria-pressed=true] span { color: inherit; }

.row { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 10px; align-items: start; scroll-margin-top: 72px; }
.row > time { font-size: 12px; line-height: 16px; color: var(--muted); padding-top: 14px; text-align: right; white-space: nowrap; }
.kind { font-size: 12px; line-height: 16px; color: var(--muted); display: flex; align-items: center; gap: 0 4px; flex-wrap: wrap; }
.kind strong { font-size: 14px; line-height: 20px; }
.kind .ico { margin-right: 2px; }
.title { font-weight: 900; color: var(--ink); margin-top: 2px; }
.body { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }

.thread summary { list-style: none; cursor: pointer; }
.thread summary::-webkit-details-marker { display: none; }
.preview { margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2;
           -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.thread[open] .preview { display: none; }
.thread[open] summary { padding-bottom: 10px; border-bottom: 1px solid var(--hair); }
.bubbles { display: grid; gap: 4px; margin-top: 12px; }
.bubbles li { max-width: 85%; justify-self: start; scroll-margin-top: 90px; }
.bubbles li p { padding: 6px 10px; border-radius: var(--r); background: var(--hair); color: var(--ink);
                line-height: 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubbles li time { font-size: 12px; line-height: 16px; color: var(--muted); padding: 0 4px; }
.bubbles li.out { justify-self: end; text-align: right; }
.bubbles li.out p { background: var(--fill); color: var(--on-fill); text-align: left; }
/* What came with a text: photos, videos, voice notes, files and links. */
.thread-shots { display: flex; gap: 4px; margin-top: 8px; }
.thread-shots img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; display: block; }
.thread-shots span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 8px; background: var(--hair);
                     color: var(--body); font-weight: 600; font-size: 13px; }
.thread[open] .thread-shots { display: none; }
.bubbles li:has(.att), .bubbles li:has(.link-card) { width: 85%; }
.att { display: grid; gap: 3px; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; max-width: 280px; margin-bottom: 3px; }
.att-0, .att-1 { grid-template-columns: 1fr; }
.att-img { display: block; border-radius: 14px; overflow: hidden; background: var(--hair); }
.att-img img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.att-1 .att-img img { aspect-ratio: auto; max-height: 340px; }
.att-video { grid-column: 1 / -1; width: 100%; max-height: 360px; border-radius: 14px; background: var(--night); }
.att-audio { grid-column: 1 / -1; width: 100%; height: 40px; }
.att-file { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 14px;
            background: var(--hair); color: var(--ink); font-size: 13px; overflow-wrap: anywhere; text-align: left; }
.att-file em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.bubbles li.out .att { margin-left: auto; }
.link-card { display: flex; flex-direction: column; width: 100%; max-width: 280px; margin: 3px 0; border-radius: 14px; overflow: hidden;
             border: 1px solid var(--hair); background: var(--surface); color: var(--ink); text-decoration: none; text-align: left; }
.bubbles li.out .link-card { margin-left: auto; }
.link-card img { width: 100%; aspect-ratio: 1.91; object-fit: cover; display: block; background: var(--hair); }
.link-card > span { display: grid; gap: 1px; padding: 8px 12px; }
.link-card strong { font-size: 14px; line-height: 19px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.link-card .meta { font-size: 12px; }
.link-card:hover { border-color: var(--rule); }

.burst { display: grid; gap: 2px; border-radius: var(--r); overflow: hidden; grid-template-columns: repeat(3, 1fr); }
.burst-1 { grid-template-columns: 1fr; max-width: 320px; } .burst-2 { grid-template-columns: 1fr 1fr; }
.burst img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.burst-1 img { aspect-ratio: 4 / 3; }

.filtered { margin-left: 70px; color: var(--muted); }
.filtered summary { cursor: pointer; padding: 6px 0; font-weight: 500; }
.filtered li { padding: 6px 0; border-top: 1px solid var(--hair); overflow-wrap: anywhere; }
.filtered li strong { font-weight: 500; color: var(--body); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

.foot { display: flex; justify-content: center; align-items: center; gap: 20px; padding: 24px 16px 40px;
        border-top: 1px solid var(--hair); margin-top: 24px; }
.foot a, .foot button { color: var(--link); background: none; border: 0; text-decoration: none; font-weight: 500; padding: 6px; }

/* Sources page */
.sources { display: grid; gap: 8px; }
.sources h2 { margin-bottom: 4px; }
.sources pre { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--r); background: var(--page);
               border: 1px solid var(--hair); overflow-x: auto; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--rule); }
.dot.on { background: var(--met); }

/* Login */
.login { max-width: 320px; margin: 20vh auto; padding: 0 16px; display: grid; gap: 16px; }
.login h1 { font-size: 26px; line-height: 30px; }
.login form { display: grid; gap: 8px; }
.login label { font-weight: 500; color: var(--ink); }
.login input { font: inherit; font-size: 16px; padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--rule);
               background: var(--surface); color: var(--ink); }
.login .btn { justify-content: center; }
.error { color: var(--attention); }

@media (min-width: 700px) {
  .day { padding-top: 24px; }
  .hero { aspect-ratio: 2 / 1; }
}

.notice { padding: 10px 12px; border-radius: var(--r); background: var(--tint); color: var(--ink); }
.connect-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.connect-actions form { margin: 0; }
.steps { margin: 8px 0 0; padding-left: 20px; list-style: decimal; color: var(--body); }
.steps li { margin: 6px 0; }
.steps pre { margin: 6px 0 0; }
.connect-link { margin-bottom: 12px; }
.claude .btn { margin-top: 10px; }

/* Settings: hidden people and places */
.hidden-list { list-style: none; margin: 8px 0 0; padding: 0; }
.hidden-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; border-top: 1px solid var(--rule); }
.hidden-list li:first-child { border-top: 0; }
.hidden-list li > span { display: flex; flex-direction: column; font-size: 14px; line-height: 20px; color: var(--ink); }
.meta { font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 400; }
.search, .place-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.search input, .place-form input[type=text], .place-form select { font: inherit; font-size: 16px; padding: 8px 10px;
  border-radius: var(--r); border: 1px solid var(--rule); background: var(--surface); color: var(--ink); min-height: 44px; }
.search input { flex: 1; min-width: 0; }
.place-form input[type=text] { flex: 1; min-width: 140px; }
#placemap { height: 300px; margin-top: 12px; border-radius: var(--r); z-index: 0; }
.btn:disabled { opacity: .4; cursor: default; }

/* Photo metadata from Apple Photos, under each group of photos */
.burst-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 0; font-size: 12px; line-height: 16px; color: var(--muted); }
.burst-meta span:first-child { color: var(--ink); font-weight: 500; }
.burst-meta .labels { flex-basis: 100%; }
.burst-caption { margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--ink); }
.burst a.fav { position: relative; }
.burst a.fav::after { content: "\2665"; position: absolute; right: 6px; bottom: 4px; color: #fff; font-size: 14px;
  text-shadow: 0 1px 2px rgb(var(--shadow) / .5); }

/* Named stops under the day map */
.stops { list-style: none; margin: 0; padding: 8px 12px 12px; }
.stops li { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; color: var(--ink); }
.stops .stop { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 4px; border: 0;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--r); }
.stops .stop:hover, .stops .stop[aria-current] { background: var(--tint); }
.stops .pin-num { position: static; transform: none; flex: none; }
.stops .pin-num.active { transform: none; }
.stop-text { display: flex; flex-direction: column; min-width: 0; }
.stop-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stops time { color: var(--muted); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; }
.stop-name-it { flex: none; color: var(--link); font-size: 13px; padding: 8px 4px; }

/* ---------- App navigation: bottom tabs (every journal app has one) ---------- */
body.has-tabs { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--hair); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center;
  font-size: 11px; line-height: 14px; font-weight: 500; color: var(--muted); text-decoration: none; border-radius: var(--r); }
.tabs a[aria-current] { color: var(--fill); }
.tab-ico { width: 24px; height: 24px; }

/* ---------- Week strip under the date bar ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 680px; margin: 0 auto; padding: 8px 12px 0; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 56px;
  border-radius: var(--r); text-decoration: none; color: var(--ink); }
.wk .wd { font-size: 11px; line-height: 14px; color: var(--muted); }
.wk .wn { font-size: 16px; line-height: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.wk.sel { background: var(--fill); color: var(--on-fill); }
.wk.sel .wd { color: rgba(255,255,255,.8); }
.wk.future { opacity: .35; pointer-events: none; }
.dots { display: flex; gap: 3px; height: 6px; justify-content: center; }
.dots i, .legend i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; }
.d-photo { background: var(--hearth-rose); box-shadow: inset 0 0 0 1px var(--hearth-taupe); } .d-text { background: var(--ink); } .d-place { background: var(--hearth-sage); } .d-mail { background: var(--hearth-blue); }
.wk.sel .dots i { background: #fff; }

/* ---------- Calendar: month grid with the day's cover photo ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats div { display: flex; flex-direction: column; padding: 10px 12px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); }
.stats .num { font-size: 20px; line-height: 28px; font-weight: 900; color: var(--ink); }
.stats span:last-child { font-size: 12px; line-height: 16px; color: var(--muted); }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mh { text-align: center; font-size: 11px; line-height: 16px; color: var(--muted); padding-bottom: 4px; }
.mc { position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: var(--r); background: var(--surface) center / cover no-repeat; border: 1px solid var(--hair);
  text-decoration: none; color: var(--ink); overflow: hidden; }
.mc.empty { background: none; border: 0; }
.mc .mn { font-size: 14px; line-height: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.mc.has-cover { border: 0; color: #fff; justify-content: flex-end; align-items: flex-start; padding: 4px 6px; }
.mc.has-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgb(var(--shadow) / .55)); }
.mc.has-cover .mn { position: relative; font-weight: 900; }
.mc.today { outline: 2px solid var(--fill); outline-offset: 1px; }
.mc.future { opacity: .35; }
.mc .hl { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--fill);
  box-shadow: 0 0 0 1.5px var(--surface); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; line-height: 16px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.hl-key { width: 6px; height: 6px; border-radius: 50%; background: var(--fill); display: inline-block; }
.center { text-align: center; }
@media (max-width: 420px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Places: full-width map of everywhere you've been ---------- */
.worldmap { height: 56vh; min-height: 320px; z-index: 0; border-bottom: 1px solid var(--hair); }

/* ---------- Maps: real-estate style (pills, clusters, map + list in sync, a card for the pick) ---------- */
.leaflet-container { font: inherit; background: var(--hair); }
.leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--surface) 80%, transparent) !important; }
.leaflet-bar { border: 1px solid var(--rule) !important; box-shadow: 0 2px 8px rgb(var(--shadow) / .12) !important; border-radius: var(--r) !important; overflow: hidden; }
.leaflet-bar a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--hair) !important; width: 36px !important; height: 36px !important; line-height: 36px !important; }
.pin-wrap { background: none; border: 0; }
.map-tiles { filter: saturate(.55) contrast(.92) brightness(1.04); }
.pin { position: absolute; transform: translate(-50%, -100%); display: inline-flex; align-items: center; white-space: nowrap;
  height: 28px; padding: 0 10px; border-radius: 14px; font-size: 12px; line-height: 16px; font-weight: 600;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule); box-shadow: 0 2px 6px rgb(var(--shadow) / .18);
  cursor: pointer; transition: transform .12s ease, background .12s ease, color .12s ease; }
.pin::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; margin-left: -4px;
  background: inherit; border: inherit; border-top: 0; border-left: 0; transform: rotate(45deg); }
.pin.unnamed { color: var(--muted); font-weight: 500; }
.pin.big { font-weight: 800; }
.pin.named.big { background: var(--ink); color: var(--page); border-color: var(--ink); }
.pin.cluster { background: var(--fill); color: var(--on-fill); border-color: var(--fill); font-weight: 700; }
.pin.cluster::after { display: none; }
.pin.cluster { transform: translate(-50%, -50%); }
.pin:hover, .pin.active { transform: translate(-50%, -100%) scale(1.08); z-index: 10; }
.pin.pin.active { background: var(--fill); color: var(--on-fill); border-color: var(--fill); }
.leaflet-marker-icon:has(.pin.active) { z-index: 100000 !important; }
.pin-num { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; font-size: 12px; font-weight: 700; background: var(--surface); color: var(--ink);
  border: 2px solid var(--fill); box-shadow: 0 1px 4px rgb(var(--shadow) / .25); cursor: pointer; transition: transform .12s ease; }
.pin-num.start { border-color: var(--met); }
.pin-num.end { background: var(--ink); color: var(--page); border-color: var(--ink); }
.pin-num.active { background: var(--fill); color: var(--on-fill); border-color: var(--fill); transform: translate(-50%, -50%) scale(1.2); }

/* Places: the map fills the screen between the filter bar and the tabs; the list is a sheet. */
body.places-page { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.places-app { position: relative; flex: 1; min-height: 0; }
body.places-page .desk-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.places-page .worldmap { position: absolute; inset: 0; height: auto; min-height: 0; border: 0; }
.map-range { position: absolute; z-index: 500; top: 10px; left: 12px; }
.map-range select { appearance: none; -webkit-appearance: none; min-height: 34px; padding: 0 30px 0 12px; border-radius: 17px;
  font: 600 13px/1 var(--font); color: var(--ink); border: 1px solid var(--rule); cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center / 12px;
  box-shadow: 0 2px 6px rgb(var(--shadow) / .12); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pin.dot { width: 10px; height: 10px; padding: 0; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--muted); border: 2px solid var(--surface); box-shadow: 0 1px 3px rgb(var(--shadow) / .3); }
.pin.dot::after { display: none; }
.pin.dot:hover, .pin.dot.active { transform: translate(-50%, -50%) scale(1.5); }
.cluster-dot { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center;
  width: var(--s); height: var(--s); border-radius: 50%; font-size: 12px; font-weight: 700; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink);
  border: 1.5px solid var(--rule); box-shadow: 0 1px 6px rgb(var(--shadow) / .18); }
.once-toggle { display: flex; align-items: center; gap: 10px; padding: 4px 16px 14px; font-size: 13px; cursor: pointer; }
.once-toggle input { width: 18px; height: 18px; accent-color: var(--fill); }
.sheet[data-state="peek"] .once-toggle { display: none; }
.map-tools { position: absolute; z-index: 500; right: 12px; top: 92px; display: grid; gap: 8px; }
.map-tools button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--r); cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule); box-shadow: 0 2px 8px rgb(var(--shadow) / .12); }
.map-tools button.busy { color: var(--fill); animation: pulse 1s ease-in-out infinite; }
.map-tools button.on { color: var(--fill); }
.map-tools button.on svg path { fill: currentColor; }
.me-dot { position: absolute; transform: translate(-50%, -50%); width: 18px; height: 18px; border-radius: 50%;
  background: var(--fill); border: 3px solid #fff; box-shadow: 0 1px 6px rgb(var(--shadow) / .35); }
.me-dot::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--fill);
  animation: me-pulse 2s ease-out infinite; }
.me-dot.stale { background: var(--muted); }
.me-dot.stale::before { display: none; }
@keyframes me-pulse { from { transform: scale(1); opacity: .8; } to { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .me-dot::before, .map-tools button.busy { animation: none; } }
.locate-status { position: absolute; z-index: 640; left: 12px; top: 54px; max-width: calc(100% - 72px); margin: 0;
  display: flex; align-items: flex-start; gap: 6px; padding: 7px 6px 7px 12px;
  border-radius: var(--r); background: var(--surface); color: var(--ink); border: 1px solid var(--hair);
  box-shadow: 0 4px 14px rgb(var(--shadow) / .16); font-size: 13px; line-height: 18px; animation: status-in .18s ease-out; }
.locate-status > span { padding-top: 1px; }
.locate-status .status-x { flex: none; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0;
  border-radius: 11px; background: none; color: var(--muted); cursor: pointer; }
.locate-status .status-x:hover { background: var(--tint); color: var(--ink); }
.locate-status[hidden] { display: none; }
@keyframes status-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .locate-status { animation: none; } }
@keyframes pulse { 50% { opacity: .4; } }
.places-page .leaflet-top.leaflet-right { top: 0; }
.places-page .leaflet-control-zoom { margin-top: 10px !important; }
@media (hover: none) { .places-page .leaflet-control-zoom { display: none; } .map-tools { top: 54px; } }

.sheet { position: absolute; z-index: 600; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column;
  max-height: 64%; background: var(--surface); border-top: 1px solid var(--hair); border-radius: 14px 14px 0 0;
  box-shadow: 0 -4px 18px rgb(var(--shadow) / .12); transition: max-height .25s ease; }
.sheet[data-state="peek"] { max-height: 68px; }
.sheet-handle { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; min-height: 68px;
  padding: 8px 16px 10px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; touch-action: none; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--rule); }
.sheet-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; }
.sheet-title strong { font-size: 16px; line-height: 22px; }
.spot-list { overflow-y: auto; overscroll-behavior: contain; padding: 0 8px; }
.sheet[data-state="peek"] .spot-list, .sheet[data-state="peek"] .sheet-foot { display: none; }
.spot-list button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px; border: 0;
  border-bottom: 1px solid var(--hair); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--r); }
.spot-list button:hover, .spot-list button[aria-current] { background: var(--tint); }
.spot-list .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); }
.spot-list .dot.named { background: var(--ink); border-color: var(--ink); }
.spot-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.spot-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--muted); font-size: 20px; }
.more-note { padding: 12px 8px; }
.sheet-foot { padding: 10px 16px calc(12px); }
.sheet-foot a { color: var(--link); }

.spot-card { position: absolute; z-index: 650; left: 12px; right: 12px; bottom: 80px; display: grid; gap: 8px;
  padding: 14px 16px 16px; background: var(--surface); border: 1px solid var(--hair); border-radius: 12px;
  box-shadow: 0 8px 28px rgb(var(--shadow) / .22); animation: card-in .18s ease-out; }
@keyframes card-in { from { transform: translateY(12px); opacity: 0; } }
.spot-card[hidden] { display: none; }
.spot-card h2 { padding-right: 32px; }
.card-x { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.spot-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; }
.spot-facts strong { color: var(--ink); }
.spot-days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.spot-days a { flex: none; display: inline-flex; min-height: 30px; align-items: center; padding: 0 10px; border-radius: var(--r);
  border: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-size: 13px; white-space: nowrap; }
.name-spot { display: flex; gap: 8px; }
.name-spot input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--page); color: var(--ink); }
.spot-card .btn-primary { text-align: center; text-decoration: none; }
body.places-page .fab { bottom: calc(64px + 80px + env(safe-area-inset-bottom)); }
body.places-page.sheet-open .fab, body.places-page.card-open .fab { display: none; }
@media (min-width: 900px) {   /* wide screens: list on the left, map on the right */
  .sheet, .sheet[data-state="peek"] { top: 0; bottom: 0; right: auto; width: 360px; max-height: none; border-radius: 0;
    border-top: 0; border-right: 1px solid var(--hair); }
  .sheet[data-state="peek"] .spot-list, .sheet[data-state="peek"] .sheet-foot { display: block; }
  .sheet[data-state="peek"] .once-toggle { display: flex; }
  .grabber { display: none; }
  .places-page .worldmap { left: 360px; }
  .map-range { left: 372px; }
  .locate-status { left: 372px; max-width: calc(100% - 372px - 64px); }   /* over the map, not the list */
  .spot-card { left: auto; right: 64px; width: 360px; bottom: 24px; }
  body.places-page .fab { bottom: calc(72px + env(safe-area-inset-bottom)); }
}
.places-list { padding-top: 12px; gap: 12px; }
.places-list a, .pop a { color: var(--link); }
.pop { list-style: none; margin: 6px 0 0; padding: 0; }
.burst-wrap { min-width: 0; }
.mc .hl, .hl-key { background: none; border: 1.5px solid var(--fill); width: 8px; height: 8px; box-shadow: none; }
.mc.has-cover .hl { border-color: #fff; }

/* Person filter: a row of chips under the header. Blue only on the active filter. */
.with-bar { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px;
            background: var(--page); border-bottom: 1px solid var(--hair); scrollbar-width: none; }
.with-bar::-webkit-scrollbar { display: none; }
.with-bar a { flex: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
              border-radius: var(--r); border: 1px solid var(--rule); background: var(--surface);
              color: var(--ink); font-weight: 500; text-decoration: none; white-space: nowrap; }
.with-bar .with-add .i { margin-right: 6px; color: var(--muted); }
.with-chip { flex: none; display: inline-flex; border-radius: var(--r); background: var(--fill); }
.with-bar .with-chip a { border: 0; background: none; color: #fff; }
.with-bar .with-chip .with-x { padding: 0 12px 0 4px; }
.with-bar a:focus-visible { outline: 2px solid var(--fill); outline-offset: 2px; }
.with-label { flex: none; align-self: center; margin-left: 4px; font-size: 12px; }
.with-recent { flex: none; display: inline-flex; align-items: center; border: 1px dashed var(--rule); border-radius: var(--r); }
.with-bar .with-recent a { border: 0; background: none; color: var(--body); font-weight: 500; }
.with-bar .with-recent a:first-child { padding-right: 4px; }
.with-bar .with-recent .with-forget { padding: 0 10px 0 4px; color: var(--muted); }
.people a.chip { text-decoration: none; }
.hidden-list a.pick { display: flex; flex-direction: column; flex: 1; padding: 4px 0; text-decoration: none; color: var(--ink); }
.hidden-list a.pick.sel strong { color: var(--fill); }

/* New entry: one ember + bottom right, above the tab bar. */
.fab { position: fixed; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 1100;
       width: 56px; height: 56px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
       padding: 0; background: var(--fill); color: var(--on-fill); box-shadow: 0 4px 14px rgb(var(--shadow) / .18); }
.fab:focus-visible { outline: 2px solid var(--fill); outline-offset: 3px; }
.fab:hover { background: var(--fill-hover); } .fab:active { background: var(--fill-pressed); }
.mic-ico { display: block; }
body.has-tabs main.day { padding-bottom: 150px; }

/* Quick add: a raised card that floats above the page, Save pinned to the bottom under the thumb. */
.entry-sheet { width: calc(100% - 16px); max-width: 640px; margin: auto auto calc(8px + var(--kb, 0px)); padding: 0;
               border: 1px solid var(--rule); border-radius: 24px; background: var(--surface); color: var(--body);
               max-height: calc(100dvh - 24px - var(--kb, 0px)); overflow: hidden;
               box-shadow: inset 0 3px 0 var(--fill), 0 24px 64px rgb(var(--shadow) / .35), 0 2px 8px rgb(var(--shadow) / .12); }
.entry-sheet[open] { display: flex; animation: sheet-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .entry-sheet[open] { animation: none; } }
.entry-sheet::backdrop { background: rgb(var(--shadow) / .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.entry-sheet form { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.entry-body-scroll { display: grid; gap: 12px; padding: 8px 16px 12px; overflow-y: auto; min-height: 0; }
.sheet-grab { justify-self: center; width: 36px; height: 5px; border-radius: 3px; background: var(--rule); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-heading { display: grid; gap: 6px; justify-items: start; }
.sheet-heading h2 { margin: 0; font: 800 22px/28px var(--font); color: var(--ink); letter-spacing: -.01em; }
.sheet-x { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0;
           background: var(--hair); color: var(--body); cursor: pointer; }
.sheet-x:hover { background: var(--rule); }
.date-label { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--hair); background: var(--page);
              color: var(--link); border-radius: 999px; padding: 4px 10px 4px 12px; font: 600 14px var(--font); cursor: pointer; }
.date-label::after { content: ""; width: 14px; height: 14px; background: currentColor;
                     -webkit-mask: var(--i-chevron) center / contain no-repeat; mask: var(--i-chevron) center / contain no-repeat; }
.date-label[aria-expanded=true]::after { transform: rotate(180deg); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.entry-foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
              border-top: 1px solid var(--hair); background: var(--surface); }
.entry-keys { display: none; }
.sheet-save { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px;
              border: 0; border-radius: 999px; background: var(--fill); color: var(--on-fill); font: 700 17px var(--font); cursor: pointer;
              box-shadow: 0 6px 18px rgb(224 0 25 / .35); transition: transform .1s, opacity .15s; }
.sheet-save:active { transform: scale(.98); }
.sheet-save[disabled] { opacity: .45; box-shadow: none; cursor: default; }
.sheet-save:focus-visible { outline: 2px solid var(--fill); outline-offset: 3px; }
.date-pick { display: grid; gap: 8px; }
.sheet-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sheet-week button { display: grid; gap: 2px; padding: 6px 0; border: 1px solid var(--hair); border-radius: var(--r);
                     background: var(--surface); color: var(--ink); font: 400 12px var(--font); cursor: pointer; }
.sheet-week button strong { font-size: 15px; }
.sheet-week button[aria-pressed=true] { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
.sheet-week button[aria-pressed=true] strong { color: #fff; }
.row-fields { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-fields input { font: 500 15px var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--hair);
                    border-radius: var(--r); padding: 6px 8px; }
.text-wrap { position: relative; }
.entry-sheet textarea, .entry-edit textarea { width: 100%; resize: vertical; min-height: 130px; padding: 12px; border-radius: var(--r);
                        border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font: 400 16px/24px var(--font); }
.entry-sheet textarea { min-height: 120px; padding: 14px; border-radius: 16px; background: var(--page); font-size: 17px; line-height: 26px; }
.at-menu { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2; background: var(--page); border: 1px solid var(--rule);
           border-radius: var(--r); box-shadow: 0 6px 18px rgb(var(--shadow) / .15); max-height: 200px; overflow: auto; }
.at-menu li { display: flex; justify-content: space-between; padding: 10px 12px; cursor: pointer; border-top: 1px solid var(--hair); }
.at-menu li:first-child { border-top: 0; }
.at-menu li:hover, .at-menu li:focus { background: var(--tint); outline: none; }
.entry-sheet .partial { min-height: 20px; color: var(--muted); font-style: italic; }
.sheet-tools { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr; gap: 8px; }
.sheet-tools .dictate, .sheet-tools .tool { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
                        border-radius: 999px; border: 1px solid var(--rule); background: var(--page); color: var(--link);
                        font: 600 14px var(--font); cursor: pointer; text-decoration: none; padding: 0 8px; }
.dictate .level { display: none; gap: 2px; align-items: center; height: 18px; }
.dictate .level i { width: 3px; height: 16px; border-radius: 2px; background: currentColor; transform: scaleY(.2); transition: transform 60ms; }
.entry-sheet.listening .dictate { background: var(--fill); color: var(--on-fill); border-color: var(--fill); grid-column: 1 / -1; }
.entry-sheet.listening .dictate .level { display: inline-flex; }
.entry-sheet.listening .sheet-tools .tool { display: none; }
@media (prefers-reduced-motion: reduce) { .dictate .level i { transition: none; } }
.sheet-mood { display: flex; justify-content: center; align-items: center; gap: 4px; }
.sheet-mood > .meta { margin-right: auto; }
.sheet-mood button, .faces button { display: grid; place-items: center; border: 1px solid transparent; background: none; border-radius: 50%;
                                    width: 40px; height: 40px; cursor: pointer; color: var(--muted); }
.sheet-mood button:hover, .faces button:hover { color: var(--ink); }
.sheet-mood button[aria-pressed=true], .faces button.sel { color: var(--link); border-color: var(--fill); background: var(--tint); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(140px + env(safe-area-inset-bottom)); z-index: 1200;
         display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r); background: var(--ink); color: var(--page);
         font-weight: 500; animation: toast 6s forwards; }
.toast button { background: none; border: 0; color: var(--fill); font: 700 14px var(--font); cursor: pointer; padding: 4px; }
@keyframes toast { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

.card.entry .body { white-space: pre-wrap; }
.entry-audio { width: 100%; margin-top: 8px; height: 36px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.links li { display: inline-flex; align-items: center; border: 1px solid var(--hair); border-radius: var(--r); background: var(--surface); }
.link-chip { padding: 4px 4px 4px 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 13px; }
.link-chip.guessed { font-style: italic; }
.link-place::before { content: "⌖ "; color: var(--muted); }
.link-term::before { content: "# "; color: var(--muted); }
.links form button { border: 0; background: none; color: var(--muted); font-size: 16px; padding: 2px 8px; cursor: pointer; }
.entry-edit { margin-top: 8px; }
.entry-edit summary { color: var(--link); cursor: pointer; font-weight: 600; font-size: 13px; }
.entry-edit form { display: grid; gap: 8px; margin-top: 8px; }
.btn.danger { color: var(--attention); }
i.d-note { background: var(--ink); border-radius: 2px; }
i.d-video { background: var(--attention); border-radius: 1px; clip-path: polygon(0 0, 100% 50%, 0 100%); }

/* Mood: five faces at the top of each day, a second tap for feeling words. */
.mood { display: grid; gap: 8px; margin: 0 0 14px; }
.mood-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mood-q { font-weight: 600; color: var(--ink); font-size: 14px; }
.faces { display: flex; gap: 2px; }
.faces button { width: 36px; height: 36px; }
.faces .i-lg { width: 22px; height: 22px; }
.feelings { display: flex; flex-wrap: wrap; gap: 6px; }
.feel input { position: absolute; opacity: 0; pointer-events: none; }
.feel span { display: inline-block; padding: 4px 10px; border-radius: var(--r); border: 1px solid var(--hair); background: var(--surface);
             font-size: 13px; color: var(--ink); cursor: pointer; }
.feel input:checked + span { background: var(--tint); border-color: var(--fill); color: var(--link); font-weight: 600; }
.feel input:focus-visible + span { outline: 2px solid var(--fill); }
.suggest { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc.mood-1, .ml.mood-1 { box-shadow: inset 0 -4px 0 var(--m1); }
.mc.mood-2, .ml.mood-2 { box-shadow: inset 0 -4px 0 var(--m2); }
.mc.mood-3, .ml.mood-3 { box-shadow: inset 0 -4px 0 var(--m3); }
.mc.mood-4, .ml.mood-4 { box-shadow: inset 0 -4px 0 var(--m4); }
.mc.mood-5, .ml.mood-5 { box-shadow: inset 0 -4px 0 var(--m5); }
.ml { display: inline-block; width: 14px; height: 10px; vertical-align: middle; margin: 0 2px 0 8px; }

/* Review list and entity pages */
.with-bar .with-review { border-color: var(--attention); color: var(--attention); }
.review .quote { border-left: 3px solid var(--hair); padding-left: 10px; font-style: italic; }
.choices { display: grid; gap: 8px; margin-top: 10px; }
.choices .btn { display: flex; justify-content: space-between; text-align: left; gap: 12px; }

/* Video diary: recorder, cards, player, upload bar (PRD 9b, 9c). */
.recorder { position: fixed; inset: 0; background: var(--night); color: #fff; display: grid; grid-template-rows: auto 1fr auto; }
.recorder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.recorder .live { transform: scaleX(-1); }
.recorder .review { object-fit: contain; background: var(--night); }
.rec-top, .rec-bottom, .rec-msg { position: relative; z-index: 1; }
.rec-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.rec-cancel { color: #fff; background: rgb(var(--shadow) / .35); border: 0; justify-self: start; }
.rec-timer { font: 600 16px var(--font); background: rgb(var(--shadow) / .35); padding: 4px 10px; border-radius: var(--r); }
.recorder.recording .rec-timer { background: var(--rec); }
.rec-msg { align-self: center; text-align: center; padding: 0 24px; }
.rec-bottom { display: grid; justify-items: center; gap: 12px; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.rec-btn { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; background: none; display: grid; place-items: center; cursor: pointer; }
.rec-btn span { width: 58px; height: 58px; border-radius: 50%; background: var(--rec); transition: all .2s; }
.recorder.recording .rec-btn span { width: 30px; height: 30px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { .rec-btn span { transition: none; } }
.rec-save { width: 100%; max-width: 480px; display: grid; gap: 8px; background: rgb(var(--shadow) / .6); padding: 12px; border-radius: var(--r); }
.rec-save input[type=text] { font: 400 16px var(--font); padding: 10px; border-radius: var(--r); border: 1px solid var(--muted); background: var(--night); color: #fff; }
.rec-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rec-progress { min-height: 20px; font-size: 13px; }
.video-thumb, .hero-video { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--night); border-radius: var(--r);
                            overflow: hidden; cursor: pointer; margin-top: 8px; aspect-ratio: 16 / 10; }
.hero-video { margin: 0; aspect-ratio: auto; }
.video-thumb img, .hero-video img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%;
              background: rgb(var(--shadow) / .55); color: #fff; display: grid; place-items: center; padding-left: 2px; }
.play-badge .i { width: 20px; height: 20px; }
.hero-video .play-badge .i { width: 14px; height: 14px; }
.hero-video .play-badge { width: 32px; height: 32px; left: auto; right: 6px; top: auto; bottom: 6px; transform: none; }
.transcript-preview { color: var(--body); }
.caption-in { font: 400 15px var(--font); padding: 8px; border-radius: var(--r); border: 1px solid var(--rule); background: var(--surface); color: var(--ink); }
.player { width: 100%; max-width: 720px; padding: 0; border: 0; border-radius: 14px 14px 0 0; margin: auto auto 0; background: var(--page);
          max-height: 94vh; }
.player::backdrop { background: rgb(var(--shadow) / .6); }
.player-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; }
.player video { width: 100%; max-height: 60vh; background: var(--night); display: block; }
.transcript { padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 30vh; overflow: auto; }
.transcript button { display: flex; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 6px 4px; border-radius: var(--r);
                     color: var(--body); font: 400 15px/22px var(--font); cursor: pointer; }
.transcript button time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; }
.transcript button.now { background: var(--tint); color: var(--ink); }
.upload-bars { position: fixed; left: 12px; right: 12px; top: calc(8px + env(safe-area-inset-top)); z-index: 1300; display: flex; flex-direction: column; gap: 8px; }
.upload-bar { display: flex; align-items: center;
              gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r); background: var(--ink); color: var(--page); font-weight: 500; }
.upload-bar.failed { background: var(--attention); }
.upload-bar button, .upload-bar a { background: none; border: 0; color: var(--fill); font: 700 14px var(--font); cursor: pointer; text-decoration: none; }
.upload-bar.failed button { color: #fff; text-decoration: underline; }
.upload-bar > span:first-child { flex: 1 1 60%; }
.upload-bar .close { margin-left: auto; font-size: 22px; line-height: 1; padding: 0 2px; text-decoration: none !important; }
.upload-bar .track { flex-basis: 100%; height: 4px; background: rgb(255 255 255 / .25); border-radius: 2px; overflow: hidden; }
.upload-bar .track i { display: block; height: 100%; width: 0; background: var(--fill); }


/* Photo review and cleanup (PRD 9i) */
.seg { display: flex; gap: 6px; margin: 10px 0 12px; overflow-x: auto; }
.seg a { flex: none; padding: 6px 12px; border-radius: var(--r); border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
         text-decoration: none; font-weight: 500; font-size: 13px; }
.seg a[aria-current=page] { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.pg { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 4px; background: var(--hair); }
.pg > a img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg.deleting img, .pg.hidden-in-photos img { opacity: .35; }
.pg .pick { position: absolute; top: 4px; right: 4px; }
.pg .pick input { position: absolute; opacity: 0; width: 28px; height: 28px; margin: 0; cursor: pointer; }
.pg .pick span { display: block; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgb(var(--shadow) / .25); }
.pg .pick input:checked + span { background: var(--fill); box-shadow: inset 0 0 0 3px #fff; }
.pg .pick input:focus-visible + span { outline: 2px solid var(--fill); outline-offset: 2px; }
.pg .badges { position: absolute; left: 4px; bottom: 4px; display: flex; gap: 3px; }
.pg .badges i { display: inline-flex; align-items: center; font-style: normal; font-size: 11px; font-weight: 700; background: rgb(var(--shadow) / .55); color: #fff; padding: 1px 5px; border-radius: 4px; }
.pg .badges i.sug { background: var(--attention); }
.pg .state { position: absolute; inset: auto 0 0 0; padding: 3px 4px; background: rgb(var(--shadow) / .6); color: #fff; font-size: 11px; text-align: center; }
.pg .state.err { background: var(--attention); top: 0; bottom: auto; }
.bulk-bar { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; gap: 8px;
            margin-top: 12px; padding: 8px; background: var(--page); border-top: 1px solid var(--hair); }
.danger-fill { background: var(--attention) !important; border-color: var(--attention) !important; }
.review-photos { font-weight: 600; font-size: 13px; color: var(--link); text-decoration: none; }
.viewer { min-height: 100vh; background: var(--night); color: #fff; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer-top { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; font-size: 13px; }
.viewer-top span:nth-child(2) { text-align: center; }
.viewer-top .btn { color: #fff; border: 0; background: rgb(255 255 255 / .12); }
.viewer-img { position: relative; display: grid; place-items: center; min-height: 50vh; }
.viewer-img img { max-width: 100%; max-height: 62vh; object-fit: contain; }
.vnav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 56px; display: grid; place-items: center;
        color: #fff; text-decoration: none; font-size: 30px; background: rgb(var(--shadow) / .3); border-radius: var(--r); }
.vprev { left: 6px; } .vnext { right: 6px; }
.viewer-info { background: var(--page); color: var(--body); padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 8px;
               border-radius: 14px 14px 0 0; }
.sug-line { color: var(--attention); font-weight: 500; }
.viewer-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.viewer-actions .act { width: 100%; display: grid; justify-items: center; gap: 2px; padding: 8px 0; border-radius: var(--r);
                       border: 1px solid var(--hair); background: var(--surface); color: var(--ink); font: 600 12px var(--font); cursor: pointer; }
.viewer-actions .act .i { width: 22px; height: 22px; }
.viewer-actions .act.on { background: var(--tint); border-color: var(--fill); color: var(--link); }
.viewer-actions .act.danger { color: var(--attention); }
.photo-edit { display: grid; gap: 8px; }
.photo-edit input, .photo-edit textarea { font: 400 15px var(--font); padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--rule);
                                          background: var(--surface); color: var(--ink); }

/* Shape the write-up: who the day's summary leans on (PRD 9j) */
.focus { margin-top: 16px; }
.focus > summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; min-height: 24px; }
.focus > summary::-webkit-details-marker { display: none; }
.focus form { display: grid; gap: 12px; margin-top: 12px; }
.focus-list { display: grid; gap: 8px; }
.focus-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.focus-name { color: var(--ink); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 8px 10px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); }
.seg label + label span { border-left: 1px solid var(--rule); }
.seg input:checked + span { background: var(--tint); color: var(--link); }
.seg input:focus-visible + span { outline: 2px solid var(--fill); outline-offset: -2px; }
.focus-add { display: grid; gap: 4px; }
.focus-add input { font: inherit; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); color: var(--ink); }
.chip.weighted-more { box-shadow: inset 0 0 0 1.5px var(--fill); }
.chip.weighted-more::after { content: "▲"; font-size: 9px; margin-left: 6px; color: var(--link); }
.chip.weighted-less { opacity: .6; }
.chip.weighted-less::after { content: "▼"; font-size: 9px; margin-left: 6px; color: var(--muted); }
.map-card.full .map-expand svg { display: none; }
.map-card.full .map-expand::after { content: "×"; font-size: 24px; line-height: 1; }

/* =====================================================================================
   Desktop (1100 px and up): a writing app's layout, after Day One, Bear, Ulysses and
   iA Writer. Sidebar | day list | reading pane (with a details rail on wide screens).
   Phones and tablets keep the tab layout above untouched.
   ===================================================================================== */
.desk-side, .desk-panel { display: none; }
.day-read, .day-rail { display: grid; gap: 32px; min-width: 0; }
kbd { font: 600 11px/1 var(--font); padding: 2px 5px; border-radius: 4px; border: 1px solid var(--rule);
  background: var(--surface); color: var(--muted); }
.desk-new kbd { background: rgb(255 255 255 / .18); color: #fff; border-color: rgb(255 255 255 / .35); margin-left: 6px; }

@media (min-width: 1100px) {
  :root { --side: 236px; --list: 320px; --serif: var(--font); }
  body.desk { display: grid; grid-template-columns: var(--side) 1fr; padding-bottom: 0; }
  body.desk:has(.desk-panel > *) { grid-template-columns: var(--side) 1fr var(--list); }
  body.desk .tabs, body.desk .fab { display: none; }
  .desk-main { min-width: 0; }

  /* Sidebar */
  .desk-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--hair); }
  .desk-brand { font: 900 20px/1 var(--font); color: var(--ink); text-decoration: none; padding: 4px 8px; }
  .desk-new { width: 100%; justify-content: center; display: inline-flex; align-items: center; }
  .desk-nav { display: grid; gap: 2px; }
  .desk-nav a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 8px; border-radius: var(--r);
    color: var(--ink); text-decoration: none; font-weight: 500; }
  .desk-nav a:hover { background: var(--hair); }
  .desk-nav a[aria-current] { background: var(--tint); color: var(--link); }
  .desk-nav .tab-ico { width: 18px; height: 18px; }
  .desk-ico { width: 18px; text-align: center; font-size: 14px; color: var(--muted); }
  .desk-count { margin-left: auto; font-size: 12px; color: var(--muted); }
  .mini-cal { padding: 18px 16px 14px; }
  .mini-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
  .mini-head strong { font-size: 13px; }
  .mini-head a { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r); color: var(--muted); text-decoration: none; font-size: 18px; }
  .mini-head a:hover { background: var(--hair); }
  .mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
  .mini-wd { font-size: 10px; color: var(--muted); padding-bottom: 2px; }
  .mini-day { position: relative; display: grid; place-items: center; height: 28px; border-radius: 50%; font-size: 12px;
    color: var(--muted); text-decoration: none; font-variant-numeric: tabular-nums; }
  .mini-day.out { opacity: .4; }
  .mini-day.has { color: var(--ink); font-weight: 600; }
  .mini-day.sum::after { content: ""; position: absolute; bottom: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--fill); }
  .mini-day.m1::after, .mini-day.m2::after { background: var(--attention); }
  .mini-day.m4::after, .mini-day.m5::after { background: var(--met); }
  .mini-day.today { box-shadow: inset 0 0 0 1.5px var(--fill); }
  .mini-day.sel { background: var(--fill); color: var(--on-fill); }
  .mini-day:hover:not(.sel) { background: var(--hair); }
  .desk-keys { margin-top: auto; padding: 0 8px; display: grid; gap: 6px; }
  .desk-keys span { display: flex; align-items: center; gap: 4px; }
  .desk-lock { padding: 0 8px; }

  /* Day list, like a journal's entry list */
  .desk-days { display: flex; flex-direction: column; flex: 1; min-height: 0; border-top: 1px solid var(--hair); }
  .desk-days-head { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 18px 8px; }
  .desk-days-head strong { font-size: 18px; }
  .desk-days ol { overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
  .desk-days li a { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: start; padding: 10px;
    border-radius: 10px; color: inherit; text-decoration: none; }
  .desk-days li a:hover { background: var(--hair); }
  .desk-days li a[aria-current] { background: var(--tint); }
  .dd-date { display: grid; justify-items: center; line-height: 1.1; }
  .dd-wd, .dd-mo { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .dd-n { font-size: 20px; font-weight: 800; color: var(--ink); }
  .desk-days li a[aria-current] .dd-n { color: var(--link); }
  .dd-text { display: grid; gap: 2px; min-width: 0; }
  .dd-text strong { font-size: 14px; line-height: 19px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .dd-snip { font-size: 12.5px; line-height: 17px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; }
  .dd-cover { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
  .dd-mood { font-size: 20px; }
  .dd-empty { padding: 16px; }

  /* Reading pane: a book's measure and a serif for what you read */
  .desk-main .dayhead { background: color-mix(in srgb, var(--page) 90%, transparent); }
  .desk-main .week { display: none; }   /* the sidebar's month calendar does this job */
  .desk-main .with-bar { max-width: 1180px; margin: 0 auto; }
  .desk-main .with-bar { border-bottom: 0; padding-top: 12px; }
  main.day { max-width: 760px; padding: 32px 40px 80px; gap: 40px; }
  body.has-tabs main.day { padding-bottom: 80px; }
  .summary h1 { font-family: var(--serif); font-weight: 700; font-size: 34px; line-height: 40px; letter-spacing: -.015em; }
  .summary .prose { font-family: var(--serif); font-size: 19px; line-height: 31px; max-width: 64ch; color: var(--ink); }
  .summary .prose + .prose { margin-top: 16px; }
  .highlights li { font-size: 15px; }
  .card.entry .body { font-family: var(--serif); font-size: 17px; line-height: 28px; }

  /* Quick add: a centered writing window, Save at its bottom right */
  .entry-sheet { width: 100%; max-width: 760px; margin: 8vh auto auto; max-height: 84vh; }
  .entry-body-scroll { padding: 20px 28px 16px; gap: 14px; }
  .sheet-grab { display: none; }
  .entry-sheet textarea { min-height: 42vh; font-family: var(--serif); font-size: 19px; line-height: 31px; padding: 16px 4px;
    border: 0; border-radius: 0; background: transparent; resize: none; outline: none; }
  .entry-sheet textarea:focus { box-shadow: none; }
  .entry-sheet .text-wrap { border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
  .entry-foot { padding: 14px 28px; justify-content: space-between; }
  .entry-keys { display: inline; }
  .sheet-save { flex: none; min-width: 200px; }

  /* Places fills the reading pane */
  body.places-page { height: auto; display: grid; overflow: visible; }
  body.places-page .desk-main { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body.places-page .fab { display: none; }
}

/* Wide desktop: what the day was about on the left, its details on the right. */
/* Only the day page has a details rail; other pages stay one column. From 1600 px, so the reading
   column keeps a comfortable measure beside the sidebar and the day list. */
@media (min-width: 1600px) {
  main.day:has(> .day-rail) { max-width: 1120px; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 48px;
    grid-template-areas: "read rail" "hero rail" "timeline rail" "otd rail"; align-items: start; }
  main.day > .hero { grid-area: hero; }
  .day-read { grid-area: read; }
  .day-rail { grid-area: rail; position: sticky; top: 72px; gap: 20px; max-height: calc(100dvh - 90px); overflow-y: auto;
    padding-left: 24px; border-left: 1px solid var(--hair); }
  main.day > .timeline { grid-area: timeline; }
  main.day > .otd { grid-area: otd; }
  .day-rail .map-card #map { height: 220px; }
}

/* ---------- The entry as an editable document (PRD 9k) ---------- */
.entry-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.entry-edit-btn { font-weight: 600; }
.entry-doc .s { cursor: pointer; border-radius: 3px; transition: background .12s ease, box-shadow .12s ease;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.entry-doc .s:hover, .entry-doc .s:focus-visible { background: var(--tint); outline: none; }
.entry-doc .s.picked { background: var(--tint); box-shadow: 0 2px 0 var(--fill); }
.entry-doc .s.yours { text-decoration: underline dotted var(--rule); text-underline-offset: 4px; }
.entry-doc .s[contenteditable="true"], .entry-doc .s[contenteditable="plaintext-only"] {
  background: var(--surface); box-shadow: 0 0 0 2px var(--fill); cursor: text; padding: 1px 2px; }
.entry-hint { margin-top: 8px; }
.entry-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip-btn { min-height: 32px; padding: 0 12px; border-radius: 16px; border: 1px dashed var(--rule); background: none;
  color: var(--link); font: 500 13px var(--font); cursor: pointer; }
.chip-btn:hover { background: var(--tint); border-style: solid; }
.embed { position: relative; margin: 16px 0; padding: 12px 40px 12px 16px; border-left: 3px solid var(--note);
  background: var(--surface); border-radius: 0 var(--r) var(--r) 0; display: grid; gap: 8px; }
.embed blockquote { margin: 0; font-size: 16px; line-height: 26px; color: var(--ink); white-space: pre-wrap; }
.embed figcaption { font-size: 12px; color: var(--muted); display: flex; align-items: center; }
.embed-thumb { position: relative; width: 160px; aspect-ratio: 16 / 10; padding: 0; border: 0; border-radius: var(--r);
  overflow: hidden; background: var(--hair); cursor: pointer; }
.embed-thumb img { width: 100%; height: 100%; object-fit: cover; }
.embed-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.embed-x:hover { background: var(--hair); color: var(--ink); }
.entry-history { margin-top: 12px; }
.entry-history summary { cursor: pointer; }
.entry-history ol { display: grid; gap: 4px; margin-top: 8px; }
.entry-history li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--hair); }
.entry-history li > span { display: grid; min-width: 0; }
.write-own { margin-top: 10px; }

.sentence-pop { position: absolute; z-index: 1150; width: 420px; max-height: 60vh; overflow-y: auto; display: grid; gap: 10px;
  padding: 12px 14px 14px; background: var(--surface); border: 1px solid var(--hair); border-radius: 12px;
  box-shadow: 0 10px 34px rgb(var(--shadow) / .22); }
.sentence-pop[hidden] { display: none; }
.pop-head { display: flex; justify-content: space-between; align-items: center; }
.pop-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.pop-sources ul { display: grid; gap: 6px; margin-top: 6px; }
.pop-sources a { display: flex; gap: 10px; align-items: flex-start; padding: 6px; border-radius: var(--r); color: var(--ink); text-decoration: none; }
.pop-sources a:hover { background: var(--hair); }
.pop-sources img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; }
.pop-sources .ico { margin-top: 6px; }
.src-text { display: grid; gap: 2px; min-width: 0; font-size: 13px; line-height: 18px; }
.src-text > span:last-child { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pop-rewrite { display: grid; gap: 8px; }
.pop-rewrite input { font: inherit; padding: 9px 11px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--page); color: var(--ink); }
.pop-proposal { margin: 0; padding: 10px 12px; border-radius: var(--r); background: var(--tint); color: var(--ink);
  font-family: var(--serif, inherit); font-size: 16px; line-height: 25px; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.pop-actions .meta { margin-right: auto; }
@media (max-width: 700px) {   /* phones: the sentence panel is a bottom sheet above the tabs */
  .sentence-pop { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); top: auto; width: auto;
    border-radius: 14px 14px 0 0; max-height: 55vh; }
}

.entry-editor { display: grid; gap: 10px; margin-top: 4px; }
.ee-headline { font: 900 24px/30px var(--font); color: var(--ink); border: 0; border-bottom: 1px solid var(--hair);
  background: none; padding: 6px 0; outline: none; }
.ee-text { font: inherit; font-size: 16px; line-height: 26px; color: var(--ink); min-height: 240px; resize: none; padding: 12px;
  border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); outline: none; }
.ee-text:focus { border-color: var(--fill); box-shadow: 0 0 0 3px var(--tint); }
.ee-partial { min-height: 18px; font-style: italic; }
.ee-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ee-gap { flex: 1; }
.ee-dictate[aria-pressed="true"] { background: var(--attention); border-color: var(--attention); color: #fff; }
.entry-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 1300; }
.entry-toast[hidden] { display: none; }
@media (min-width: 1100px) {
  .ee-headline { font-family: var(--serif); font-weight: 700; font-size: 34px; line-height: 40px; }
  .ee-text { font-family: var(--serif); font-size: 19px; line-height: 31px; padding: 18px 20px; }
  .embed blockquote { font-family: var(--serif); font-size: 18px; line-height: 29px; }
  .entry-toast { bottom: 28px; }
}

/* Add a place: a pin fixed at the map's center; the map slides under it. */
.drop-pin { position: absolute; z-index: 560; left: 50%; top: 36%; pointer-events: none; }
.drop-pin[hidden] { display: none; }
.drop-pin span { position: absolute; left: -14px; top: -36px; width: 28px; height: 28px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); background: var(--attention); border: 3px solid #fff; box-shadow: 0 3px 10px rgb(var(--shadow) / .35); }
.drop-pin::after { content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: rgb(var(--shadow) / .35); }
.add-place { display: grid; gap: 10px; }
.add-place input[name="label"] { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--rule);
  border-radius: var(--r); background: var(--page); color: var(--ink); }
.add-radius { display: flex; align-items: center; gap: 8px; }
.add-radius select { font: inherit; padding: 6px 8px; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--page); color: var(--ink); }
.add-actions { display: flex; justify-content: flex-end; gap: 8px; }
.link-btn { border: 0; background: none; padding: 0 0 0 4px; color: var(--link); font: 600 13px var(--font); cursor: pointer; }
.map-tools button.on { color: var(--fill); }
.entry-sheet .partial:empty, .entry-sheet .dictate-err:empty { display: none; }

/* Place on entries and videos (_place.html) */
.place-field { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 6px 0 12px; margin: 8px 0;
  border: 1px solid var(--rule); border-radius: 20px; background: var(--surface); color: var(--muted); }
.place-field:focus-within { border-color: var(--link); }
.place-field.located { color: var(--link); }
.place-field input[name=place] { flex: 1; min-width: 0; border: 0; background: none; padding: 8px 0; font: inherit; color: var(--ink); outline: none; box-shadow: none; }
.place-here { flex: none; min-height: 30px; padding: 0 12px; border-radius: 15px; border: 0; background: var(--tint);
  color: var(--link); font: 600 13px var(--font); cursor: pointer; }
.place-here:disabled { opacity: .6; cursor: progress; }
.entry-place { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; }
.entry-place .i { color: var(--muted); }

/* ============ The full-page writer (write.html, write.js) ============
   A quiet page like Medium or Substack: serif title and body in one centred column, ideas on the
   left, a + beside an empty line that opens into embeds, and a dark toolbar over selected words. */
.fab { text-decoration: none; }
body.writing { background: var(--surface); }
.writing .desk-main { max-width: none; padding: 0; margin: 0; }
.writer { --serif: var(--font);
  min-height: 100vh; min-height: 100dvh; }
.w-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 60px;
  padding: 0 max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--hair); }
.w-back { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 18px; color: var(--ink); }
.w-back .i { transform: rotate(90deg); }
.w-back:hover { background: var(--hair); }
.w-kind { font-weight: 600; color: var(--ink); }
.w-count { white-space: nowrap; }
.w-spacer { flex: 1; }
.w-ideas-btn { display: none; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 17px;
  border: 1px solid var(--rule); background: none; color: var(--ink); font: 500 14px var(--font); cursor: pointer; }
.w-publish, .w-done { min-height: 36px; padding: 0 18px; border-radius: 18px; border: 0; background: var(--fill); color: var(--on-fill);
  font: 600 14px var(--font); cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.w-publish:disabled { opacity: .4; cursor: default; }
.w-more { position: relative; }
.w-more summary { list-style: none; cursor: pointer; padding: 6px 8px; color: var(--muted); letter-spacing: 1px; border-radius: 8px; }
.w-more summary::-webkit-details-marker { display: none; }
.w-menu { position: absolute; right: 0; top: 38px; min-width: 170px; padding: 6px; background: var(--surface);
  border: 1px solid var(--hair); border-radius: 12px; box-shadow: 0 10px 30px rgb(var(--shadow) / .14); }
.w-menu button { width: 100%; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 8px;
  color: var(--attention); font: 500 14px var(--font); cursor: pointer; }
.w-menu button:hover { background: var(--hair); }

/* Saving status (Light-Lux): three dots while saving, then a check that draws itself. */
.save-status { display: inline-flex; align-items: center; gap: 6px; min-height: 20px; font-size: 13px; color: var(--muted); }
.save-status .ss-dots, .save-status .drawn-check, .save-status .ss-retry { display: none; }
.save-status[data-state=saving] .ss-dots { display: inline-flex; gap: 3px; }
.ss-dots i { width: 4px; height: 4px; border-radius: 1px; background: var(--link); animation: ss-dot 1s infinite ease-in-out; }
.ss-dots i:nth-child(2) { animation-delay: .15s; } .ss-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ss-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.save-status[data-state=saved] .drawn-check { display: block; }
.drawn-check { width: 14px; height: 14px; fill: none; stroke: var(--met); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 16; stroke-dashoffset: 16; animation: draw-check .46s ease-out forwards; }
@keyframes draw-check { to { stroke-dashoffset: 0; } }
.save-status[data-state=error] { color: var(--attention); }
.save-status[data-state=error] .ss-retry { display: inline; border: 0; background: none; color: var(--link); font: 600 13px var(--font); cursor: pointer; padding: 0; }
@media (prefers-reduced-motion: reduce) { .ss-dots i, .drawn-check { animation: none; stroke-dashoffset: 0; } }
form.autosaving .btn-primary, form.autosaving .btn-secondary { display: none; }
form.autosaving .save-status { margin-top: 6px; }

/* Ideas: left column on wide screens, a sliding panel on phones. */
.w-side { position: fixed; z-index: 20; top: 60px; left: 0; bottom: 0; width: 300px; overflow-y: auto;
  padding: 24px 20px 40px; border-right: 1px solid var(--hair); background: var(--surface); }
.w-side-head { display: flex; align-items: center; justify-content: space-between; }
.w-side h2 { margin: 0; font: 800 13px/18px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.w-side-x { display: none; border: 0; background: none; color: var(--muted); cursor: pointer; width: 30px; height: 30px; border-radius: 15px; }
.w-side-note { margin: 6px 0 14px; }
.w-ideas, .w-drafts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.w-idea { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 12px; border-radius: 12px;
  border: 1px solid var(--hair); background: var(--page); color: var(--body); font: 400 14px/20px var(--font); cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s; }
.w-idea .i { margin-top: 2px; color: var(--muted); }
.w-idea:hover { border-color: var(--fill); background: var(--tint); }
.w-idea:hover .i { color: var(--link); }
.w-idea:active { transform: scale(.98); }
.w-ideas li.used .w-idea { opacity: .5; }
.w-idea.k-person .i, .w-idea.k-place .i, .w-idea.k-calendar .i, .w-idea.k-photos .i { color: var(--link); }
.w-drafts-h { margin-top: 28px !important; margin-bottom: 10px !important; }
.w-drafts a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.w-drafts a:hover { background: var(--hair); }
.w-drafts strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The page. */
.w-page { position: relative; max-width: 700px; margin: 0 auto; padding: 40px 24px 40vh; }
@media (min-width: 1000px) { .w-page { margin-left: max(340px, calc(50% - 350px + 150px)); } }
.w-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 28px; }
.w-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border-radius: 17px;
  background: var(--page); border: 1px solid var(--hair); color: var(--muted); }
.w-chip input[type=date], .w-chip input[type=time] { border: 0; background: none; color: var(--ink); font: 500 13px var(--font); padding: 0; min-height: 30px; }
.w-chip.w-place { padding: 0; border: 0; background: none; }
.w-chip .place-field { margin: 0; min-height: 34px; border-radius: 17px; border-color: var(--hair); background: var(--page); width: 260px; }
.w-chip .place-field input[name=place] { font-size: 13px; padding: 6px 0; }
.w-title { display: block; width: 100%; resize: none; overflow: hidden; border: 0; outline: none; background: none; padding: 0;
  margin: 0 0 18px; color: var(--ink); font: 700 42px/1.18 var(--writer-serif, Georgia, serif); font-family: inherit; }
.writer .w-title { font-family: var(--serif); letter-spacing: -.012em; }
.w-title::placeholder { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.w-body { outline: none; min-height: 50vh; color: var(--ink); font: 400 21px/1.62 var(--serif); letter-spacing: -.003em; caret-color: var(--fill); }
.w-body > * { margin: 0 0 22px; }
.w-body { position: relative; }
.w-body.is-empty::before { content: attr(data-placeholder); position: absolute; top: 0; left: 0; color: var(--muted); opacity: .55; pointer-events: none; }
.w-body h3 { font: 700 30px/1.25 var(--serif); margin-top: 36px; color: var(--ink); }
.w-body h4 { font: 700 22px/1.35 var(--font); margin-top: 28px; color: var(--ink); letter-spacing: -.01em; }
.w-body blockquote { padding-left: 20px; border-left: 3px solid var(--ink); font-style: italic; color: var(--body); }
.w-body hr { border: 0; height: 30px; margin: 28px 0; text-align: center; }
.w-body hr::before { content: "· · ·"; letter-spacing: .8em; color: var(--muted); font: 400 24px/30px var(--serif); }
.w-body a { color: inherit; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.w-fig { position: relative; margin: 30px 0; user-select: none; }
.w-fig img { display: block; width: 100%; border-radius: 6px; }
.w-fig-video img { aspect-ratio: 16 / 9; object-fit: cover; }
.w-fig .play-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.w-fig-ph { display: grid; place-items: center; aspect-ratio: 16/9; border-radius: 6px; background: var(--hair); color: var(--muted); font: 500 14px var(--font); }
.w-fig.uploading { min-height: 200px; border-radius: 6px; background: linear-gradient(90deg, var(--hair), var(--page), var(--hair));
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.w-fig-x { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 15px;
  border: 0; background: rgb(var(--shadow) / .6); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; }
.w-fig:hover .w-fig-x, .w-fig:focus-within .w-fig-x { opacity: 1; }
@media (hover: none) { .w-fig-x { opacity: 1; } }

.w-at { position: absolute; z-index: 10; min-width: 240px; list-style: none; margin: 0; padding: 4px; background: var(--surface);
  border: 1px solid var(--hair); border-radius: 12px; box-shadow: 0 10px 30px rgb(var(--shadow) / .14); font: 400 14px var(--font); }
.w-at li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.w-at li:hover, .w-at li:focus { background: var(--tint); outline: none; }

/* Dictation pill. */
.w-listen { position: fixed; z-index: 40; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100% - 32px)); padding: 8px 8px 8px 16px; border-radius: 24px;
  background: var(--ink); color: var(--hearth-white); box-shadow: 0 8px 28px rgb(var(--shadow) / .3); font: 400 14px var(--font); }
.w-listen[hidden] { display: none; }
.w-listen-dot { width: 10px; height: 10px; border-radius: 5px; background: var(--fill); animation: pulse 1.2s infinite; flex: none; }
.w-listen-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: italic; }
.w-listen button { border: 0; border-radius: 16px; padding: 6px 14px; background: var(--hearth-white); color: var(--ink); font: 600 13px var(--font); cursor: pointer; }
.w-err { color: var(--attention); font: 400 14px var(--font); }

/* Narrow screens: ideas slide in from the left. */
@media (max-width: 999px) {
  .w-ideas-btn { display: inline-flex; }
  .w-side { transform: translateX(-102%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); width: min(320px, 86vw);
    box-shadow: 10px 0 30px rgb(var(--shadow) / .12); }
  .writer.ideas-open .w-side { transform: none; }
  .w-side-x { display: grid; place-items: center; }
  .w-count, .w-kind { display: none; }
  .w-page { padding-top: 24px; }
  .w-title { font-size: 32px; }
  .w-body { font-size: 19px; }
  .w-chip .place-field { width: 200px; }
}

/* Entries written in the writer, on the day page. */
.note-title { margin: 4px 0 6px; font: 800 24px/1.05 var(--display); font-stretch: 75%; }
.rich > * { margin: 0 0 10px; }
.rich > *:last-child { margin-bottom: 0; }
.rich h3 { font-size: 18px; } .rich h4 { font-size: 15px; }
.rich blockquote { margin-left: 0; padding-left: 12px; border-left: 3px solid var(--rule); font-style: italic; }
.rich hr { border: 0; text-align: center; } .rich hr::before { content: "· · ·"; color: var(--muted); letter-spacing: .6em; }
.rich figure { margin: 10px 0; } .rich figure img { max-width: 100%; border-radius: 8px; display: block; }
.rich .rt-video a { position: relative; display: block; } .rich .rt-video .play-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.note-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.note-actions form { margin: 0; }
@media (max-width: 520px) {
  .w-bar { gap: 6px; padding: 0 10px; }
  .w-ideas-btn .i, .save-status .ss-text { display: none; }   /* one word, no icon: "Ideas" */
  .save-status[data-state=error] .ss-text { display: inline; }
  .w-ideas-btn { padding: 0 12px; }
  .w-publish, .w-done { padding: 0 14px; }
}


/* Mood: one chip. Tapped, the five faces pop out of it into a pill underneath, one after another. */
.w-mood { position: relative; padding: 0; transition: background .2s, border-color .2s; }
.w-mood-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px 0 10px; border: 0; background: none;
  border-radius: 17px; color: var(--muted); font: 500 13px var(--font); cursor: pointer; }
.w-mood-btn:hover { color: var(--ink); }
.w-mood.chosen { background: var(--tint); border-color: transparent; }
.w-mood.chosen .w-mood-btn { color: var(--link); }
.w-mood.open { border-color: var(--fill); }
.w-mood-faces { position: absolute; z-index: 15; top: calc(100% + 8px); right: 0; display: flex; gap: 2px; padding: 5px;
  border-radius: 22px; background: var(--surface); border: 1px solid var(--rule); box-shadow: 0 12px 30px rgb(var(--shadow) / .14);
  opacity: 0; transform: translateY(-6px) scale(.9); transform-origin: top right; visibility: hidden; pointer-events: none;
  transition: opacity .16s, transform .24s cubic-bezier(.2, .9, .3, 1.2), visibility 0s .24s; }
.w-mood.open .w-mood-faces { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.w-mood-faces button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 19px; background: none;
  color: var(--muted); cursor: pointer; opacity: 0; transform: translateY(6px) scale(.6);
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1) calc(var(--n) * 40ms), opacity .2s calc(var(--n) * 40ms), color .15s, background .15s; }
.w-mood.open .w-mood-faces button { opacity: 1; transform: none; }
.w-mood-faces button:hover { color: var(--ink); background: var(--hair); }
.w-mood-faces button[aria-pressed=true] { color: var(--link); background: var(--tint); }
@media (max-width: 520px) { .w-mood-faces { right: auto; left: 0; transform-origin: top left; } }

/* Insert: a rounded square in the margin; opens a card of things to add, sliding in one by one. */
.w-ins { position: absolute; left: -46px; z-index: 6; transform: translateY(-50%); }
.w-ins-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--rule);
  background: var(--surface); color: var(--muted); cursor: pointer;
  transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), background .15s, color .15s, border-color .15s; }
.w-ins-btn:hover { color: var(--link); border-color: var(--fill); background: var(--tint); }
.w-ins.open .w-ins-btn { transform: rotate(135deg); color: var(--on-fill); background: var(--fill); border-color: var(--fill); }
.w-ins-menu { position: absolute; left: 0; top: 38px; width: 248px; padding: 6px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--hair); box-shadow: 0 16px 40px rgb(var(--shadow) / .14), 0 2px 6px rgb(var(--shadow) / .06);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top left; pointer-events: none; visibility: hidden;
  transition: opacity .16s, transform .22s cubic-bezier(.2, .8, .2, 1), visibility 0s .22s; }
.w-ins.open .w-ins-menu { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.w-ins-head { margin: 4px 8px 4px; font: 700 11px/16px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.w-ins-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 8px; border: 0; border-radius: 10px;
  background: none; text-align: left; cursor: pointer; color: var(--ink); opacity: 0; transform: translateX(-10px);
  transition: opacity .18s, transform .26s cubic-bezier(.2, .9, .3, 1.2), background .12s; }
.w-ins.open .w-ins-menu button { opacity: 1; transform: none; }
.w-ins.open .w-ins-menu button:nth-of-type(1) { transition-delay: .02s; } .w-ins.open .w-ins-menu button:nth-of-type(2) { transition-delay: .05s; }
.w-ins.open .w-ins-menu button:nth-of-type(3) { transition-delay: .08s; } .w-ins.open .w-ins-menu button:nth-of-type(4) { transition-delay: .11s; }
.w-ins.open .w-ins-menu button:nth-of-type(5) { transition-delay: .14s; } .w-ins.open .w-ins-menu button:nth-of-type(6) { transition-delay: .17s; }
.w-ins-menu button:hover, .w-ins-menu button:focus-visible { background: var(--tint); outline: none; }
.w-ins-ico { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--page);
  border: 1px solid var(--hair); color: var(--link); }
.w-ins-menu strong { display: block; font: 600 14px/18px var(--font); color: var(--ink); }
.w-ins-menu small { display: block; font: 400 12px/16px var(--font); color: var(--muted); }
@media (max-width: 760px) { .w-ins { left: -4px; } .w-ins:not(.open) .w-ins-btn { opacity: .8; } }

/* Format: a light bar under the selected words, with a small notch pointing up at them. */
.w-format { position: absolute; z-index: 10; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--rule); box-shadow: 0 10px 28px rgb(var(--shadow) / .14); }
.w-format.pop { animation: fmt-pop .18s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes fmt-pop { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
.w-format::before { content: ""; position: absolute; top: -6px; left: var(--tip, 50%); width: 10px; height: 10px; margin-left: -5px;
  background: var(--surface); border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); transform: rotate(45deg); }
.w-format button { position: relative; display: grid; place-items: center; width: 34px; height: 32px; border: 0; border-radius: 8px;
  background: none; color: var(--body); cursor: pointer; transition: background .12s, color .12s; }
.w-format button .i { width: 18px; height: 18px; }
.w-format button:hover { background: var(--hair); color: var(--ink); }
.w-format button.on { background: var(--tint); color: var(--link); }
.w-sep { width: 1px; height: 20px; background: var(--hair); margin: 0 3px; }
@media (prefers-reduced-motion: reduce) { .w-ins-btn, .w-ins-menu, .w-ins-menu button, .w-mood-faces, .w-mood-faces button { transition: none; } .w-format.pop { animation: none; } }

/* Images that failed to load (base.html): gone, with a frame that held only them. */
img.img-broken, .img-broken-box { display: none !important; }

/* Beta testers (owner's page) */
.testers .card { display: grid; gap: 8px; }
.tester-invite { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; }
.tester-invite input, .tester-link { font: inherit; min-height: 40px; padding: 6px 10px; border-radius: var(--r);
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); min-width: 0; width: 100%; }
.tester-list { list-style: none; margin: 0; padding: 0; display: grid; }
.tester-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0;
  border-top: 1px solid var(--hair); }
.tester-list li:first-child { border-top: 0; }
.tester-who { display: grid; gap: 2px; min-width: 0; }
.tester-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; flex: none; max-width: 60%; }
.tester-delete summary { list-style: none; }
.tester-delete summary::-webkit-details-marker { display: none; }
.tester-delete[open] { flex-basis: 100%; }
.tester-delete form { display: grid; gap: 6px; margin-top: 6px; }
.tester-delete input { font: inherit; min-height: 40px; padding: 6px 10px; border-radius: var(--r);
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); }
.tester-danger { color: var(--attention); }
.tester-answers dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 13px; }
.tester-answers dt { color: var(--muted); }
.tester-answers dd { margin: 0; }
@media (max-width: 560px) {
  .tester-invite { grid-template-columns: 1fr; }
  .tester-list li { flex-direction: column; }
  .tester-actions { max-width: none; justify-content: flex-start; }
}

/* Week and month summaries (period.html) and their list on the calendar. A report, not a pile of
   cards: small-caps labels, hairline dividers, numbers set large, colour only where it carries mood. */
/* Mood, from Awful to Great. Bold on purpose (owner, 2026-11-27): the one place the palette steps aside. */
:root { --m1: #E5232B; --m2: #F97316; --m3: #EAB308; --m4: #22A559; --m5: #2563EB; }

.dayhead .seg { justify-self: center; }
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--hair); }
.seg a { padding: 5px 16px; border-radius: 7px; font: 500 14px var(--font); color: var(--ink); text-decoration: none; }
.seg a[aria-selected=true] { background: var(--surface); box-shadow: 0 1px 2px rgb(var(--shadow) / .12); font-weight: 600; }

.rpt { max-width: 640px; gap: 0; }   /* sections space themselves, divided by hairlines */
.rpt-when { margin: 4px 0 2px; font: 500 13px var(--font); color: var(--muted); }
.rpt-title { margin: 0 0 24px; font: 700 28px/1.2 Georgia, serif; letter-spacing: -.01em; color: var(--ink); }
.rpt h2 { margin: 0 0 10px; font: 600 12px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rpt-sec { padding: 20px 0; border-top: 1px solid var(--hair); }
.rpt-note { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

.rpt-mood { padding-bottom: 20px; }
.rpt-avg { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.rpt-avg .num { font: 700 44px/1 var(--font); letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.rpt-avg .of { font-size: 15px; color: var(--body); }
.rpt-avg .vs { flex-basis: 100%; font-size: 13px; color: var(--muted); }
.rpt-shape { margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: var(--body); }
.rpt-shape strong { color: var(--ink); }

.rpt-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin: 20px 0 14px; }
.rpt-days.is-month { grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 4px; }
.rd { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; }
.rd-col { position: relative; width: 100%; max-width: 22px; height: 64px; }
.rpt-days.is-month .rd-col { height: 48px; }
.rd-col::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--hair); }
.rd-bar { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px; background: var(--m3); }
.rd.m1 .rd-bar { background: var(--m1); } .rd.m2 .rd-bar { background: var(--m2); }
.rd.m4 .rd-bar { background: var(--m4); } .rd.m5 .rd-bar { background: var(--m5); }
.rd.sug .rd-bar { opacity: .4; }
.rd-n { font: 500 11px var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.rpt-days.is-month .rd-n { font-size: 9px; }

.rpt-dist { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 0; }
.rpt-dist div { display: flex; flex-direction: column; gap: 2px; }
.rpt-dist dt { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.rpt-dist dd { margin: 0; font: 600 15px var(--font); color: var(--ink); font-variant-numeric: tabular-nums; }
.rpt-dist .zero dd { color: var(--muted); font-weight: 400; }
.sw { width: 8px; height: 8px; border-radius: 2px; background: var(--m3); flex: none; }
.sw.m1 { background: var(--m1); } .sw.m2 { background: var(--m2); } .sw.m4 { background: var(--m4); } .sw.m5 { background: var(--m5); }

.rpt-story p { margin: 0 0 14px; font: 400 17px/1.65 Georgia, serif; color: var(--ink); }
.rpt-story p:last-child { margin-bottom: 0; }
.rpt-themes { font: 400 13px var(--font) !important; color: var(--muted) !important; }

.rpt-events, .rpt-rows, .rpt-infl ul { list-style: none; margin: 0; padding: 0; }
.rpt-events li, .rpt-rows li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 9px 0; font-size: 15px; line-height: 1.45; color: var(--ink); }
.rpt-events li + li, .rpt-rows li + li { border-top: 1px solid var(--hair); }
.rpt-events .when, .rpt-rows .when { font-size: 13px; color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.rpt-rows a.when { color: var(--link); text-decoration: none; }
.rpt-rows span { color: var(--body); }
.rpt-rows strong { color: var(--ink); }
.tone { font-size: 12px; color: var(--muted); font-weight: 400; }

.rpt-infl { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 640px) { .rpt-infl { grid-template-columns: 1fr; gap: 18px; } }
.rpt-infl h3 { margin: 0 0 4px; font: 600 15px var(--font); color: var(--ink); }
.rpt-infl li { padding: 9px 0; font-size: 15px; line-height: 1.45; color: var(--ink); }
.rpt-infl li + li { border-top: 1px solid var(--hair); }
.rpt-infl p { margin: 2px 0 0; color: var(--body); }
.rpt-infl .src { font-size: 13px; color: var(--muted); }

.rpt-buttons { display: flex; gap: 10px; margin-top: 12px; }
.rpt-buttons form { margin: 0; }

.sum-list { margin: 24px 0 8px; }
.sum-list h2 { margin: 0 0 6px; font: 600 12px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sum-list ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.sum-list li { border-bottom: 1px solid var(--hair); }
.sum-list a { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: baseline; padding: 12px 2px; text-decoration: none; color: var(--ink); }
.sum-list .sl-when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sum-list .sl-what { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-list em { font-style: normal; color: var(--muted); }
.sum-list .sl-mood { font-size: 13px; color: var(--muted); }

/* Bullet-point day entries (summary style "bullets"). */
.entry-body .prose.as-list { padding-left: 1.2em; }
.entry-body .prose.as-list .s { display: list-item; list-style: disc; margin: 0 0 6px; }
.sum-prefs fieldset { border: 0; margin: 0 0 6px; padding: 0; }
.sum-prefs .pick { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.sum-prefs .pick input { margin-top: 3px; }
.sum-prefs .pick span { display: flex; flex-direction: column; }
.sum-prefs .pick small { color: var(--muted); font-size: 13px; }

/* Flourishes (static/flourish.js): hand-drawn animations for what was just done. Each drawing is
   a sprite sheet used as a mask, so its ink is the page's ember. */
:root { --fl-ink: var(--ink); }
.fl-art { display: block; flex: none; width: var(--fl-size, 96px); aspect-ratio: 1; }
.fl-art.fl-ready { background: var(--fl-ink); cursor: pointer;
  -webkit-mask: var(--fl-src) var(--fl-x, 0%) var(--fl-y, 0%) / 800% 600% no-repeat;
  mask: var(--fl-src) var(--fl-x, 0%) var(--fl-y, 0%) / 800% 600% no-repeat; }
.flourish { position: fixed; z-index: 1400; width: 188px; padding: 12px 14px 14px; display: grid; justify-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 12px 30px rgb(var(--shadow) / .14);
  pointer-events: none; opacity: 0; transform: scale(.2); }
.flourish .fl-art { --fl-size: 132px; cursor: default; }
.flourish.in { animation: fl-in .56s cubic-bezier(.68, -.18, .32, 1.22) forwards; }
.flourish.out { animation: fl-out .32s cubic-bezier(.65, 0, .35, 1) forwards; }
@keyframes fl-in { to { opacity: 1; transform: none; } }
@keyframes fl-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.2); } }
.fl-cap { margin: 0; display: grid; gap: 2px; text-align: center; font-size: 12px; line-height: 16px; color: var(--muted); }
.fl-cap strong { font-size: 14px; line-height: 20px; color: var(--ink); }
.period-feel .fl-art { --fl-size: 88px; margin: -10px -4px -10px auto; }
.review-clear { display: flex; align-items: center; gap: 14px; }
.review-clear .fl-art { --fl-size: 84px; margin: -4px 0; }
.sound-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 14px; cursor: pointer; }
.sound-row input { width: 18px; height: 18px; accent-color: var(--fill); }

/* ================= The Hearth look: shapes, display type and motion over everything above ================= */

/* Display type: narrow, heavy capitals for headings the journal writes; your own titles keep their case. */
.dayhead .date, h2, .summary h1, .period-headline, .desk-brand, .stats .num, .pf-label, .desk-days-head strong,
.login h1, .ee-headline, .w-side h2, .driver-col h2, .period-people h2 {
  font-family: var(--display); font-stretch: 75%; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
.title, .note-title, .writer .w-title, .w-body h3, .highlight h3, .dd-n, .pub-day-title {
  font-family: var(--display); font-stretch: 75%; font-weight: 800; letter-spacing: 0; }
.dayhead .date { font-size: 24px; line-height: 24px; }
h2 { font-size: 26px; line-height: 26px; }
.summary h1 { font-size: 40px; line-height: 36px; margin-bottom: 14px; color: var(--ink); }
.pending h1 { color: var(--ink); }
.title { font-size: 22px; line-height: 23px; }
.highlight h3 { font-size: 19px; line-height: 20px; }
.period-headline { font-size: 36px; line-height: 34px; }
.pf-label { font-size: 24px !important; line-height: 24px; }
.stats .num { font-size: 30px; line-height: 30px; color: var(--ink); }
.desk-brand { font-size: 22px !important; color: var(--ink) !important; white-space: nowrap; }
.desk-brand { display: inline-flex; align-items: center; gap: 10px; }
.desk-logo { width: 28px; height: 28px; flex: none; color: var(--brand); }
.writer .w-title { font-size: 54px; line-height: .98; }
.w-body h3 { font-size: 34px; line-height: 1.02; }
@media (min-width: 1100px) {
  .summary h1 { font-family: var(--display); font-weight: 800; font-size: 60px; line-height: 52px; letter-spacing: 0; }
  .ee-headline { font-family: var(--display); font-weight: 800; }
}
@media (max-width: 520px) { .writer .w-title { font-size: 40px; } }

/* Stickers: small labels set a little askew, as if stuck on by hand. */
.eyebrow { display: inline-block; width: fit-content; padding: 4px 10px; margin-bottom: 10px; border-radius: var(--pill);
  background: var(--ink); color: var(--page); font-size: 11px; line-height: 14px; font-weight: 500; transform: rotate(-2.5deg);
  transform-origin: left center; animation: stick .5s var(--spring) both .15s; }
.dayhead .weekday { justify-self: center; padding: 1px 9px; border-radius: var(--pill); background: var(--fill); color: var(--on-fill);
  font-size: 11px; line-height: 15px; font-weight: 500; transform: rotate(-2deg); margin-bottom: 3px; }
@keyframes stick { from { opacity: 0; transform: rotate(8deg) scale(.4); } }

/* Buttons are pills. The primary one is ink with an ember dot that floods it when you point at it. */
.btn { border-radius: var(--pill); padding: 8px 16px; font-weight: 500; transition: transform .16s var(--ease), background .32s var(--ease), color .32s var(--ease), border-color .32s var(--ease); }
.btn:active { transform: scale(.96); }
.btn-primary, .w-publish, .w-done, .sheet-save { position: relative; isolation: isolate; overflow: hidden; gap: 10px; padding-right: 8px;
  background: var(--fill); color: var(--on-fill); border: 1px solid var(--fill); }
.btn-primary::after, .w-publish::after, .w-done::after, .sheet-save::after { content: ""; flex: none; order: 2; width: 22px; height: 22px; border-radius: 50%;
  background: var(--fill); margin-left: auto;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M8 14l6-6M9 8h5v5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M8 14l6-6M9 8h5v5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .32s var(--spring); }
.btn-primary::before, .w-publish::before, .w-done::before, .sheet-save::before { content: ""; position: absolute; z-index: -1; right: 8px; top: 50%; width: 22px; height: 22px;
  margin-top: -11px; border-radius: 50%; background: var(--on-fill); transition: transform .5s var(--ease); }
.btn-primary:hover, .w-publish:hover, .w-done:hover, .sheet-save:hover { color: var(--fill); background: var(--fill); }
.btn-primary:hover::before, .w-publish:hover::before, .w-done:hover::before, .sheet-save:hover::before { transform: scale(40); }
.btn-primary:hover::after, .w-publish:hover::after, .w-done:hover::after, .sheet-save:hover::after { transform: rotate(45deg); }
.btn-primary:disabled::before, .w-publish:disabled::before { background: var(--muted); }
.w-publish, .w-done { border-radius: var(--pill); padding: 0 8px 0 16px; }
.btn-secondary { background: var(--surface); border-color: var(--rule); color: var(--ink); }
.btn-secondary:hover { background: var(--ink); border-color: var(--ink); color: var(--page); }
.btn-tertiary { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.desk-new kbd { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 40%, transparent); margin-left: 2px; }
.desk-new { border-radius: var(--pill); padding: 0 8px 0 16px; min-height: 40px; justify-content: space-between !important; }
.desk-new kbd { display: none; }   /* N still opens it; the button reads like Publish */

/* Pills for everything you pick from. */
.chip, .filters button, .otd a, .feel span, .seg a, .w-chip, .theme, .pub-day-chips li { border-radius: var(--pill); }
.filters button, .feel span, .seg a { transition: transform .32s var(--spring), background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease); }
.filters button[aria-pressed=true], .seg a[aria-current=page] { background: var(--ink); border-color: var(--ink); color: var(--page); }
.feel input:checked + span { background: var(--fill); border-color: var(--fill); color: var(--on-fill); transform: rotate(-2deg) scale(1.04); }
.feel span:hover { transform: rotate(-2deg); }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select { border-radius: var(--pill); }
.search input, .place-form input[type=text], .place-form select, .login input, .auth-form input { padding-left: 16px; padding-right: 16px; }
textarea { border-radius: var(--r); }

/* The date bar and navigation. */
.dayhead { border-bottom: 0; min-height: 64px; }
.dayhead .nav { width: 40px; height: 40px; line-height: 36px; justify-self: center; border-radius: 50%; background: var(--surface); color: var(--ink);
  transition: transform .32s var(--spring), background .16s var(--ease), color .16s var(--ease); }
.dayhead .nav:hover { background: var(--fill); color: var(--on-fill); transform: scale(1.1); }
.dayhead .jump label, .dayhead div.jump { justify-items: center; }
.wk { border-radius: 16px; transition: transform .32s var(--spring), background .16s var(--ease); }
.wk:hover { transform: translateY(-2px); background: var(--surface); }
.wk.sel, .wk.sel:hover { background: var(--fill); color: var(--on-fill); transform: rotate(-3deg); }
.wk.sel .wd { color: var(--on-fill); } .wk.sel .dots i { background: var(--on-fill); }
.wk .wn { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 22px; }
.tabs { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 5px; border: 0; border-radius: var(--pill);
  background: var(--surface); border: 1px solid var(--rule); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 10px 30px rgb(var(--shadow) / .16); }
body.has-tabs { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 1100px) { body.has-tabs.desk { padding-bottom: 0; } }   /* the phone bar is hidden on desktop: no room kept for it */
.tabs a { color: var(--muted); border-radius: var(--pill); min-height: 46px; transition: background .32s var(--ease), color .16s var(--ease); }
.tabs a[aria-current] { background: var(--fill); color: var(--on-fill); }
.tabs a[aria-current] .tab-ico { animation: pop .5s var(--spring) both; }
.tabs a:active .tab-ico { transform: scale(.85); }
@keyframes pop { from { transform: scale(.4) rotate(-20deg); } }
.fab { background: var(--fill); color: var(--on-fill); bottom: calc(82px + env(safe-area-inset-bottom)); transition: transform .5s var(--spring); }
.fab:hover { transform: rotate(90deg) scale(1.06); }
/* No pulsing ring around + (owner, 2026-11-27). */
@keyframes ring { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.5); opacity: 0; } }
.toast { border-radius: var(--pill); padding: 10px 10px 10px 18px; bottom: calc(150px + env(safe-area-inset-bottom)); }
.toast button { background: var(--hearth-harbor-light); color: var(--hearth-charcoal); border-radius: var(--pill); padding: 4px 12px; font-weight: 600; }
.desk-nav a { border-radius: var(--pill); padding: 0 12px; transition: background .16s var(--ease), color .16s var(--ease), transform .32s var(--spring); }
.desk-nav a:hover { transform: translateX(3px); }
.desk-nav a[aria-current] { background: var(--tint); color: var(--ink); font-weight: 600; }
.desk-nav a[aria-current] .tab-ico { background: var(--fill); }
.mini-day.sel, .mini-day.today.sel { background: var(--fill); color: var(--on-fill); }

/* Cards and lists: soft corners, a lift when you point at what opens. */
.card { border-radius: 18px; padding: 14px 16px; }
.highlights ol, .hero, .burst { border-radius: 18px; }
a.highlight { transition: background .16s var(--ease), padding .32s var(--ease); }
a.highlight:hover { background: var(--tint); padding-left: 20px; }
.mc { border-radius: 12px; transition: transform .32s var(--spring); }
a.mc:hover { transform: scale(1.08) rotate(-2deg); z-index: 1; }
.mc.today { outline-color: var(--fill); }
.bubbles li p { border-radius: 18px; padding: 8px 14px; }
.bubbles li.out p, .turn.you p { color: var(--on-fill); }
.desk-days li a { border-radius: 16px; transition: background .16s var(--ease), transform .32s var(--spring); }
.desk-days li a:hover { transform: translateX(3px); }
.desk-days li a[aria-current] .dd-n { color: var(--fill); }
.notice { border-radius: 18px; }
.period-feel, .period-card, .week-row, .driver-col li { border-radius: 18px; }
.ms-bar { border-radius: 8px; }

/* Mood faces: they lean in when pointed at, and the picked one is an ember. */
.sheet-mood button, .faces button, .w-mood-faces button { transition: transform .32s var(--spring), color .16s var(--ease), background .16s var(--ease); }
.sheet-mood button:hover, .faces button:hover, .w-mood-faces button:hover { transform: scale(1.2) rotate(-8deg); }
.sheet-mood button[aria-pressed=true], .faces button.sel, .w-mood-faces button[aria-pressed=true], .mood-pick input:checked + span {
  color: var(--on-fill); background: var(--fill); border-color: var(--fill); }
.mood-q { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 24px; line-height: 24px; text-transform: uppercase; }
.w-mood.chosen { background: var(--fill); } .w-mood.chosen .w-mood-btn { color: var(--on-fill); }
.w-mood-faces { border-radius: var(--pill); }
.w-ins.open .w-ins-btn { color: var(--on-fill); }
.w-idea { border-radius: 16px; }

/* A page arrives: its parts rise in one after another. */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
main.day > *, .day-read > * { animation: rise .5s var(--ease) both; }
main.rpt > * { animation: none; }   /* the week and month summaries sit still (owner, 2026-11-27) */
main.day > :nth-child(2), .day-read > :nth-child(2) { animation-delay: .06s; } main.day > :nth-child(3), .day-read > :nth-child(3) { animation-delay: .12s; }
main.day > :nth-child(4), .day-read > :nth-child(4) { animation-delay: .18s; } main.day > :nth-child(n+5), .day-read > :nth-child(n+5) { animation-delay: .24s; }
.day-read { animation: none !important; }
.week .wk { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.month .mc { animation: stick-in .4s var(--spring) both; }
@keyframes stick-in { from { opacity: 0; transform: scale(.7); } }

/* Flourishes in the ember, on a rounder card with its caption as a sticker. */
:root { --fl-ink: var(--ink); }
.flourish { border-radius: 24px; border-color: var(--ink); border-width: 1.5px; box-shadow: 6px 6px 0 var(--ink); }
.fl-cap strong { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 22px; line-height: 22px; text-transform: uppercase; }

/* The week and month report, and the summary settings, in the Hearth look. */
.rpt-title { font: 800 44px/.92 var(--display); font-stretch: 75%; text-transform: uppercase; letter-spacing: 0; }
@media (min-width: 1100px) { .rpt-title { font-size: 60px; } }
.rpt-story p { font: 400 17px/1.65 var(--font); }
.rpt-avg { align-items: center; }
.rpt-avg .num { font: 800 72px/.8 var(--display); font-stretch: 75%; color: var(--ink); }
.rpt-avg .fl-art { --fl-size: 84px; margin: -8px 0 -8px -6px; order: 3; margin-left: auto; }
.rpt-avg .vs { order: 4; }
.rpt-infl h3 { font: 800 22px/1 var(--display); font-stretch: 75%; text-transform: uppercase; }
.rd-bar { border-radius: 6px; }
.seg { border-radius: var(--pill); padding: 3px; background: var(--surface); }
.seg a { border: 0; background: none; }
.seg a[aria-selected=true] { background: var(--ink); color: var(--page); box-shadow: none; }
.sum-list a { transition: padding .32s var(--ease), background .16s var(--ease); border-radius: 12px; }
.sum-list a:hover { padding-left: 10px; background: var(--tint); }
.sum-prefs .pick input { accent-color: var(--fill); }

/* You: a round photo, or your initial on one of eight warm colours (as in Your Roster chat). */
.av { --av: #9a5b34; position: relative; flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  overflow: hidden; background: var(--av); color: var(--hearth-white); font: 700 13px/1 var(--font); user-select: none; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av[data-tone="1"] { --av: #5f6b2e; } .av[data-tone="2"] { --av: #8c2f5a; } .av[data-tone="3"] { --av: #3a4f9a; }
.av[data-tone="4"] { --av: #2f6f6a; } .av[data-tone="5"] { --av: #8a6816; } .av[data-tone="6"] { --av: #6b4a8c; } .av[data-tone="7"] { --av: #a2433a; }
.av-xl { width: 88px; height: 88px; font-size: 36px; }
.av-lg { width: 64px; height: 64px; font-size: 26px; }
.av-xxl { width: 132px; height: 132px; font-size: 52px; }

/* ---- People: the index (.pp) and one person (.ps). Each part opens with what it is and what it is for. ---- */
main.day.pp, main.day.ps { max-width: 780px; gap: 36px; }
.pp-search { margin: 0; }
.pp-search input { flex: 1; min-width: 0; }
.pp-part, .ps-part { display: grid; gap: 12px; scroll-margin-top: 90px; }
.pp-part > header, .ps-part > header { display: grid; gap: 2px; }
.pp-part > header h2 { font-size: 26px; line-height: 1.05; }
.ps-part > header h3 { font-size: 22px; line-height: 1.1; }
.pp-part > header p, .ps-part > header p { font-size: 14px; line-height: 21px; color: var(--muted); }
.pp-part > header { display: flex !important; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pp-part > header > div { display: grid; gap: 2px; min-width: 0; }
.pp-part > header .btn { flex: none; font-size: 13px; }
.pp-story { display: grid; gap: 10px; }
.pp-story h2 { font-size: 40px; line-height: 1.02; }
.pp-story p { font-size: 19px; line-height: 30px; color: var(--ink); max-width: 62ch; }
.pp-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pp-card { position: relative; }
.pp-card-open { height: 100%; display: grid; justify-items: center; align-content: start; gap: 3px; padding: 20px 12px 16px; text-align: center; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hair); border-radius: 18px; transition: transform .32s var(--spring), border-color .16s var(--ease); }
.pp-card-open:hover { transform: translateY(-3px) rotate(-1deg); border-color: var(--ink); }
.pp-card.sel .pp-card-open { border-color: var(--fill); }
.pp-card .av { margin-bottom: 8px; }
.pp-card strong { font-size: 15px; line-height: 20px; overflow-wrap: anywhere; }
.pp-card small { font-size: 12.5px; line-height: 17px; color: var(--muted); }
.pp-card .pp-card-tags { color: var(--ink); font-weight: 500; }
.pp-star { position: absolute; top: 6px; right: 6px; margin: 0; }
.pp-star button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--rule); transition: transform .32s var(--spring), color .16s var(--ease); }
.pp-star button:hover { color: var(--ink); transform: scale(1.15); }
.pp-star [aria-pressed=true] { color: var(--fill); }
.pp-all { display: flex; justify-content: center; }
/* Find someone: a search and a grid of first letters, in the right panel (and at the top of the page on phones). */
.pf { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.pf-search .btn { flex: none; padding: 0 14px; }
.pf-search input { width: 0; }
.pf-search { margin: 0; flex-wrap: nowrap; }
.pf-search input { flex: 1; min-width: 0; }
.pf-letters { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.pf-letters a, .pf-letters span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; }
.pf-letters a { color: var(--ink); background: var(--page); border: 1px solid var(--hair); transition: background .16s var(--ease), color .16s var(--ease); }
.pf-letters a:hover { background: var(--ink); border-color: var(--ink); color: var(--page); }
.pf-letters a[aria-current] { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
.pf-letters span { color: var(--rule); }
.pf.panel-twin .pf-letters { display: flex; overflow-x: auto; scrollbar-width: none; }
.pf.panel-twin .pf-letters a, .pf.panel-twin .pf-letters span { flex: none; width: 34px; }
.pp-list, .ps-days { list-style: none; margin: 0; padding: 2px 16px; background: var(--surface); border: 1px solid var(--hair); border-radius: 18px; }
.pp-row { display: flex; align-items: center; gap: 8px; }
.pp-row + .pp-row, .ps-days li + li { border-top: 1px solid var(--hair); }
.pp-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 0; text-decoration: none; color: var(--ink); }
.pp-open .av { width: 40px; height: 40px; font-size: 17px; }
.pp-name { flex: 1; min-width: 0; display: grid; }
.pp-name strong { font-size: 15px; line-height: 20px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-name small, .pp-when { font-size: 13px; line-height: 18px; color: var(--muted); }
.pp-when { flex: none; }
.pp-open:hover strong { text-decoration: underline; }
.pp-row.sel strong { color: var(--fill); }
.pp-only { flex: none; font-size: 13px; }
.pp-none { padding: 14px 0; color: var(--muted); font-size: 14px; }

.ps-hero { display: flex; align-items: flex-start; gap: 24px; position: relative; z-index: 6; }
.ps-circle { display: inline-flex; width: fit-content; margin: 2px 0 0; padding: 3px; gap: 2px; border-radius: var(--pill); background: var(--hair); }
.ps-circle button { border: 0; background: none; padding: 5px 14px; border-radius: var(--pill); font: inherit; font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease); }
.ps-circle button:hover { color: var(--ink); }
.ps-circle [aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(var(--shadow) / .14); }
.ps-id p:empty { display: none; }
.ps-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.ps-star { margin: 0; } .ps-star .btn { font-size: 13px; padding: 5px 12px; min-height: 0; }
.ps-star [aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--page); }
.ps-face { position: relative; display: grid; justify-items: center; gap: 10px; flex: none; }
.ps-pick > summary { list-style: none; cursor: pointer; font-size: 13px; padding: 5px 12px; min-height: 0; }
.ps-pick > summary::-webkit-details-marker { display: none; }
.ps-pick-box { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: min(330px, 86vw); display: grid; gap: 12px; padding: 16px;
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: 18px; box-shadow: 0 14px 40px rgb(var(--shadow) / .18); }
.ps-pick-box form { margin: 0; }
.ps-pick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ps-pick-grid button { padding: 0; border: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--hair); }
.ps-pick-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.ps-pick-grid button:hover img, .ps-pick-grid button:focus-visible img { transform: scale(1.08); }
.ps-pick-grid button:focus-visible { outline: 2px solid var(--fill); outline-offset: 2px; }
.ps-tags { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ps-tags li { display: inline-flex; align-items: center; height: 30px; border-radius: var(--pill); background: var(--blush); color: var(--ink); font-size: 13.5px; font-weight: 500; }
.ps-tags li > span { padding: 0 4px 0 13px; }
.ps-tags form { margin: 0; display: inline-flex; align-items: center; }
.ps-tags button { display: grid; place-items: center; width: 26px; height: 26px; margin-right: 2px; border: 0; border-radius: 50%; background: none; color: var(--ink);
  font-size: 16px; line-height: 1; cursor: pointer; }
.ps-tags button:hover { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.ps-tags .ps-tag-add { background: var(--surface); border: 1px dashed var(--rule); }
.ps-tag-add input { width: 9.5em; border: 0; background: none; font: inherit; font-size: 13.5px; padding: 0 2px 0 13px; color: var(--ink); outline: none; }
.ps-tag-add:focus-within { border-style: solid; border-color: var(--ink); }
.btn.is-busy { cursor: progress; opacity: 1; }
.btn.is-busy .i { animation: ps-spin 1.6s linear infinite; }
@keyframes ps-spin { to { transform: rotate(360deg); } }
.ps-card.is-writing { position: relative; overflow: hidden; }
.ps-card.is-writing::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--fill), transparent); background-size: 40% 100%; background-repeat: no-repeat;
  animation: ps-run 1.4s var(--ease) infinite; }
@keyframes ps-run { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.ps-working { font-size: 14px; line-height: 21px; color: var(--muted); }
.ps-id { display: grid; gap: 6px; min-width: 0; }
.ps-id h2 { font-size: 40px; line-height: 1; overflow-wrap: anywhere; }
.ps-id p { font-size: 14px; line-height: 21px; color: var(--muted); }
.ps-do { margin-top: 6px; }
.ps-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: -12px 0 0; }
.ps-stats div { display: grid; gap: 4px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--hair); }
.ps-stats dt { font-size: 13px; color: var(--muted); }
.ps-stats dd { margin: 0; font-size: 28px; line-height: 1; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ps-stats .ps-word { font-size: 18px; line-height: 28px; }
.ps-card { display: grid; gap: 14px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--hair); border-radius: 18px; }
.ps-summary { font-size: 18px; line-height: 28px; color: var(--ink); }
.ps-lately { font-size: 15px; line-height: 23px; color: var(--body); }
.ps-lately b { display: inline-block; margin-right: 6px; padding: 1px 9px; border-radius: var(--pill); background: var(--blush); color: var(--ink); font-size: 12.5px; font-weight: 600; }
.ps-themes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ps-themes li { padding: 5px 13px; border-radius: var(--pill); border: 1px solid var(--rule); background: var(--page); font-size: 13.5px; font-weight: 500; color: var(--ink); }
.ps-themes small { color: var(--muted); font-weight: 400; margin-left: 2px; }
.ps-says { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--hair); }
.ps-says h4 { font-family: var(--font); font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.ps-says blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--blush); font-size: 16px; line-height: 24px; color: var(--ink); }
.ps-says blockquote::before { content: "“"; } .ps-says blockquote::after { content: "”"; }
.ps-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0; padding-top: 14px; border-top: 1px solid var(--hair); }
.ps-empty p { font-size: 15px; line-height: 23px; color: var(--body); max-width: 62ch; }
.ps-empty form { margin: 0; }
.ps-feel p { font-size: 15px; line-height: 23px; color: var(--body); }
.ps-mood { display: flex; gap: 28px; }
.ps-mood span { display: grid; gap: 2px; }
.ps-mood b { font-size: 34px; line-height: 1; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ps-mood span + span b { color: var(--muted); }
.ps-mood small { font-size: 13px; color: var(--muted); }
.ps-photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ps-photos a { position: relative; display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--hair); }
.ps-photos img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.ps-photos a:hover img { transform: scale(1.04); }
.ps-photos span { position: absolute; left: 8px; bottom: 8px; padding: 2px 9px; border-radius: var(--pill); background: color-mix(in srgb, var(--surface) 88%, transparent);
  font-size: 12px; font-weight: 500; color: var(--ink); }
.ps-photos .ps-texted { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); }
.ps-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ps-thread li { display: grid; gap: 3px; max-width: 80%; justify-items: start; }
.ps-thread li.mine { justify-self: end; justify-items: end; }
.ps-thread p { padding: 9px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--hair); font-size: 15px; line-height: 22px; color: var(--ink); overflow-wrap: anywhere; }
.ps-thread li.mine p { background: var(--ink); border-color: var(--ink); color: var(--page); }
.ps-thread a { font-size: 12px; color: var(--muted); text-decoration: none; padding: 0 6px; }
.ps-thread a:hover { text-decoration: underline; }
.ps-days a { display: grid; gap: 2px; padding: 12px 0; text-decoration: none; color: var(--ink); }
.ps-days strong { font-size: 15px; line-height: 21px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ps-days small { font-size: 13px; line-height: 18px; color: var(--muted); }
.ps-days a:hover strong { text-decoration: underline; }
.ps-card .links { margin-top: 0; }
@media (max-width: 640px) {
  main.day.pp, main.day.ps { gap: 28px; }
  .ps-hero { gap: 16px; } .av-xxl { width: 92px; height: 92px; font-size: 38px; } .ps-id h2 { font-size: 30px; }
  .ps-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pp-only { display: none; }
  .pp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; } .ps-photos span { display: none; }
  .ps-card { padding: 16px; }
}

/* The foot of the sidebar: your photo and name, which open Settings. No menu. */
.desk-me { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0 -4px; padding: 8px 12px 8px 8px; border-top: 1px solid var(--hair);
  border-radius: 0 0 var(--r) var(--r); color: var(--ink); font-weight: 600; text-decoration: none; transition: background .16s var(--ease); }
.desk-me:hover { background: var(--hair); }
.desk-me[aria-current] { background: var(--tint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fill) 60%, transparent); border-radius: var(--r); }
.desk-me-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-me .tab-ico { width: 18px; height: 18px; color: var(--muted); }
.desk-me .av { width: 32px; height: 32px; }

/* The phone's Settings tab shows you instead of a gear. */

/* Settings, in sections: a row of links to each, then each section under its heading. */
.set-nav { position: sticky; top: calc(64px + env(safe-area-inset-top)); z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; margin: -8px 0 4px;
  background: var(--page); scrollbar-width: none; }
.set-nav a { flex: none; padding: 6px 14px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--hair); color: var(--ink);
  font-weight: 500; text-decoration: none; transition: background .16s var(--ease), color .16s var(--ease); }
.set-nav a:hover { background: var(--ink); color: var(--page); }
.set-nav a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--page); }

/* ---- Settings: six short pages. Each is a few cards; a card is rows; a row is what the setting is
   (left) and what you change (right, or under it on phones and for anything wide). ---- */
main.day.set-page { max-width: 760px; gap: 16px; }
.set-page > .set-head { margin-bottom: 8px; }
.set-head { display: grid; gap: 4px; margin: 6px 0 2px; }
.set-head h2 { font-size: 34px; line-height: 1; }
.set-head p { color: var(--muted); font-size: 15px; line-height: 22px; }
.set-card { background: var(--surface); border: 1px solid var(--hair); border-radius: 18px; padding: 4px 22px; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 28px; padding: 18px 0; }
.set-row + .set-row, .set-row + .set-foot, form + .set-row { border-top: 1px solid var(--hair); }
.set-row-stack { grid-template-columns: minmax(0, 1fr); align-items: start; }
.set-what { display: grid; gap: 3px; min-width: 0; }
.set-what h3 { font-family: var(--font); font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.set-what p { font-size: 14px; line-height: 21px; color: var(--body); max-width: 60ch; }
.set-do { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; min-width: 0; }
.set-row-stack > .set-do { display: block; }
.set-do form { margin: 0; }
.set-do textarea { width: 100%; font: inherit; font-size: 16px; line-height: 24px; padding: 10px 14px; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--page); color: var(--ink); resize: vertical; }
.set-do textarea + .btn { margin-top: 10px; }
.set-do .hidden-list { margin-top: 0; }
.set-do .search { margin: 0 0 6px; }
.set-do .map { margin: 0; border-radius: 14px; }
.set-empty { font-size: 14px; color: var(--muted); }
.set-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 16px 0; }
.set-foot .meta { flex: 1; min-width: 220px; }
.set-card .profile-form { padding: 18px 0; }
.profile-photo { gap: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--hair); margin-bottom: 4px; }
.profile-photo-do { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.profile-label { font-weight: 500; color: var(--ink); margin-top: 8px; }
.profile-fixed { display: grid; gap: 2px; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.profile-fixed small { font-size: 13px; color: var(--muted); }
.sum-prefs .choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; border: 0; margin: 0; padding: 0; }
.sum-prefs .choice .pick { padding: 14px 16px; border: 1px solid var(--rule); border-radius: 14px; background: var(--page);
  transition: border-color .16s var(--ease), background .16s var(--ease); }
.sum-prefs .choice .pick:has(input:checked) { border-color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--ink); }
/* A switch: a checkbox that reads as on or off at a glance. */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { flex: none; position: relative; width: 46px; height: 28px; border-radius: var(--pill); background: var(--rule); transition: background .2s var(--ease); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 2px rgb(var(--shadow) / .25); transition: transform .32s var(--spring); }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--fill); outline-offset: 2px; }
.switch input:disabled + span { opacity: .45; }
.switch b { font-weight: 500; }
.set-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.set-stats div { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--page); border: 1px solid var(--hair); }
.set-stats dt { font-size: 13px; color: var(--muted); }
.set-stats dd { margin: 0; display: flex; align-items: baseline; gap: 6px; font-size: 26px; line-height: 1; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.set-stats small { font-size: 13px; font-weight: 400; color: var(--muted); }
@media (max-width: 640px) {
  .set-card { padding: 2px 16px; }
  .set-row { grid-template-columns: minmax(0, 1fr); }
  .set-row:has(> .set-do > .switch:only-child) { grid-template-columns: minmax(0, 1fr) auto; }
  .set-stats { grid-template-columns: 1fr; }
  .set-head h2 { font-size: 28px; }
}
/* The menu of pages, in the right panel. */
.set-menu { list-style: none; display: grid; gap: 2px; margin: 0 -8px; padding: 0; }
.set-menu a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; color: var(--ink); text-decoration: none;
  transition: background .16s var(--ease); }
.set-menu a:hover { background: var(--hair); }
.set-menu a[aria-current] { background: var(--hair); }
.set-menu a[aria-current] strong { font-weight: 700; }
.set-menu .i { flex: none; color: var(--muted); }
.set-menu a[aria-current] .i { color: var(--ink); }
.set-menu span { display: grid; min-width: 0; }
.set-menu strong { font-size: 15px; line-height: 20px; font-weight: 500; }
.set-menu small { font-size: 12.5px; line-height: 17px; color: var(--muted); }
.set-group { display: grid; gap: 12px; scroll-margin-top: calc(148px + env(safe-area-inset-top)); }
.set-group + .set-group { margin-top: 20px; }
.set-group > h2 { font-size: 28px; line-height: 1; }
.profile-form { display: grid; gap: 8px; }
.profile-form label[for] { font-weight: 500; color: var(--ink); margin-top: 8px; }
.profile-form input[type=text] { font: inherit; font-size: 16px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--page); color: var(--ink); }
.profile-form .btn-primary { justify-self: start; margin-top: 6px; }
.profile-photo { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--fill); outline-offset: 2px; }

/* The phone's bottom bar, in one line: Today, Calendar, Places and Settings (your photo) in the pill,
   and New Entry (+) in its own circle on the right, not part of the pill. */
.tabs { left: 12px; right: 76px; grid-template-columns: repeat(4, 1fr); }
.fab, body.places-page .fab { right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); }
.tabs .tab-av { width: 24px; height: 24px; font-size: 11px; }
.tabs a[aria-current] .tab-av { box-shadow: 0 0 0 2px var(--on-fill); }
/* Icons only: the words stay for screen readers. */
.tabs .tab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabs .tab-ico { width: 26px; height: 26px; } .tabs .tab-av { width: 28px; height: 28px; font-size: 12px; }

/* ---- The right panel (desktop). Each main section fills it with what helps there: the calendar
   and the days on Today and Calendar, the filter on People, the index on Settings. Places keeps
   its list of places there. Phones have no panel; `.panel-twin` is the same thing in the page. ---- */
@media (min-width: 1100px) {
  .desk-panel:has(> *) { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; overflow: hidden;
    min-width: 0; background: var(--surface); border-left: 1px solid var(--hair); }
  .desk-panel:not(:has(.desk-days)) { overflow-y: auto; }
  .panel-twin { display: none !important; }
  .panel-block { display: grid; gap: 8px; padding: 20px 18px; border-bottom: 1px solid var(--hair); }
  .panel-block h2 { font-size: 20px; line-height: 22px; }
  .panel-list { display: grid; gap: 2px; margin: 0 -8px; }
  .panel-list li { display: flex; align-items: center; }
  .panel-list a { flex: 1; min-height: 34px; display: flex; align-items: center; padding: 0 8px; border-radius: 8px;
    color: var(--ink); text-decoration: none; font-weight: 500; }
  .panel-list a:hover { background: var(--hair); }
  .panel-list .panel-x { flex: none; width: 34px; justify-content: center; color: var(--muted); }

  /* Places: the map is the page, and the list of places is the panel. */
  .sheet, .sheet[data-state="peek"] { left: auto; right: 0; width: var(--list); border-right: 0; border-left: 1px solid var(--hair);
    background: var(--surface); }
  .places-page .worldmap { left: 0; right: var(--list); }
  .map-range { left: 12px; }
  .locate-status { left: 12px; max-width: calc(100% - var(--list) - 88px); }
  .map-tools { right: calc(var(--list) + 12px); }
  .places-page .leaflet-top.leaflet-right { right: 0; }
  .spot-card { right: calc(var(--list) + 64px); }
}

/* The small calendar: calm, square days. The picked day is a soft clay, never the ember; today is
   an ink outline. The month's name opens the month's summary. */
.mini-head { gap: 4px; }
.mini-head .mini-step { flex: none; }
.mini-head .mini-month { flex: 1; width: auto; height: auto; min-height: 28px; padding: 0 8px; text-align: center; font-size: 14px; font-weight: 700;
  color: var(--ink); border-radius: 6px; display: grid; place-items: center; }
.mini-head .mini-month:hover { background: var(--hair); text-decoration: underline; text-underline-offset: 3px; }
.mini-grid { gap: 3px; }
.mini-day, .mini-head a { border-radius: 5px; }
.mini-day { height: 32px; font-size: 13px; }
.mini-day.sum::after { background: var(--muted); }
.mini-day.today { box-shadow: inset 0 0 0 1.5px var(--muted); }
.mini-day.sel, .mini-day.today.sel { background: var(--hearth-linen); color: var(--ink); font-weight: 700; box-shadow: none; }
.mini-day.today.sel { box-shadow: inset 0 0 0 1.5px var(--muted); }
.mini-day:hover:not(.sel) { background: var(--hair); }

/* Calendar: the month and its arrows sit in the page, where the bar used to be. */
.month-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; }
.month-head h1 { text-align: center; font: 800 30px/1 var(--display); font-stretch: 75%; text-transform: uppercase; }
.month-head h1 a { text-decoration: none; }
.month-head h1 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.month-head .nav { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface);
  color: var(--ink); text-decoration: none; font-size: 24px; border: 1px solid var(--hair); }
.month-head .nav:hover { background: var(--ink); color: var(--page); }
.set-filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---- Type (Nov 27): headings are Your Roster Black, as in One Roster; Inter is what the journal
   says; a serif (Literata, "Hearth Hand") is what you wrote, so your own words read apart. ---- */
:root { --display: "Your Roster", "Hearth", -apple-system, system-ui, sans-serif; --hand: "Hearth Hand", "Iowan Old Style", Georgia, serif; }
.dayhead .date, h2, .summary h1, .period-headline, .desk-brand, .stats .num, .pf-label, .desk-days-head strong,
.login h1, .ee-headline, .w-side h2, .driver-col h2, .period-people h2,
.title, .note-title, .writer .w-title, .w-body h3, .highlight h3, .dd-n, .pub-day-title, .mood-q, .month-head h1, .wk .wn,
.fl-cap strong, .rpt-title, .rpt-avg .num, .rpt-infl h3, .panel-block h2 {
  font-family: var(--display); font-stretch: normal; font-weight: 900; letter-spacing: -.01em; }
/* Yours: notes, dictation, video words, sentences you wrote or changed, and an entry you wrote. */
.card.entry .body, .embed blockquote, .entry-doc .s.yours, .entry-doc .s.edited, .entry-doc.by-you .prose,
.w-body, .entry-sheet textarea, .ee-text, .note-body { font-family: var(--hand); }
.entry-doc .s.yours { text-decoration: none; }

/* ---- The day page, quieter: the day's words and pictures lead, with room between the parts.
   No stickers or small labels over headings; headings keep their own case. ---- */
.dayhead .date { font-size: 20px; line-height: 24px; text-transform: none; }
.dayhead .date-year { color: var(--muted); }
.dayhead .nav { background: none; border: 0; color: var(--muted); }
.dayhead .nav:hover { background: var(--hair); color: var(--ink); transform: none; }
main.day { gap: 56px; }
.day-read, .day-rail { gap: 48px; }
main.day h2 { font-size: 20px; line-height: 24px; text-transform: none; }
.summary h1 { font-size: 34px; line-height: 1.08; text-transform: none; text-wrap: balance; margin-bottom: 20px; }
.pending h1 { color: var(--ink); }
.prose { font-size: 16px; line-height: 27px; }
.prose + .prose { margin-top: 16px; }
.entry-hint { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 20px; }
.entry-hint .entry-edit-btn { flex: none; min-height: 0; padding: 0; }
.highlights ol { margin-top: 14px; }
.highlight h3 { font-size: 17px; line-height: 22px; text-transform: none; }
.mood-q { text-transform: none; font-size: 20px; }
.card.entry .body { font-size: 17px; line-height: 28px; }
@media (min-width: 1100px) {
  main.day { gap: 80px; padding-top: 48px; }
  .day-read, .day-rail { gap: 64px; }
  .summary h1 { font-family: var(--display); font-weight: 900; font-size: 46px; line-height: 1.05; margin-bottom: 28px; }
  .summary .prose { font-family: var(--font); font-size: 18px; line-height: 31px; max-width: 66ch; }
  .entry-doc .s.yours, .entry-doc .s.edited, .entry-doc.by-you .prose { font-family: var(--hand); font-size: 19px; }
  .summary .prose + .prose { margin-top: 20px; }
  .card.entry .body { font-family: var(--hand); font-size: 19px; line-height: 31px; }
  .embed blockquote { font-family: var(--hand); }
}

/* The day list in the panel: calm rows, the open day in soft clay like the calendar's. */
.desk-days-head strong { font-size: 20px; text-transform: none; }
.desk-days li a { border-radius: 8px; }
.desk-days li a:hover { transform: none; }
.desk-days li a[aria-current] { background: var(--hearth-linen); }
.desk-days li a[aria-current] .dd-n { color: var(--ink); }
.dd-n { font-size: 19px; }
.dd-text strong { font-weight: 600; }

/* Keyboard shortcuts: hidden until ? is pressed (or the small key at the sidebar's foot). */
.keys-btn, .keys-pop { display: none; }
@media (min-width: 1100px) {
  .keys-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; align-self: flex-start; padding: 6px 8px;
    border: 0; background: none; border-radius: 8px; color: var(--muted); font-size: 12px; }
  .keys-btn:hover, .keys-btn[aria-expanded="true"] { background: var(--hair); color: var(--ink); }
  .keys-pop:not([hidden]) { display: block; position: fixed; left: 14px; bottom: 112px; z-index: 2000; width: 264px; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
    box-shadow: 0 12px 32px -12px rgb(var(--shadow) / .35); animation: rise .18s var(--ease) both; }
  .keys-pop dl { display: grid; gap: 10px; margin: 0; }
  .keys-pop dl div { display: flex; align-items: center; gap: 12px; }
  .keys-pop dt { display: flex; gap: 4px; min-width: 58px; }
  .keys-pop dd { margin: 0; color: var(--body); }
}
::selection { background: var(--hearth-rose); color: var(--ink); }
.desk-panel h2 { text-transform: none; font-size: 18px; line-height: 22px; }
@media (max-width: 520px) { .dayhead .date { font-size: 17px; white-space: nowrap; } }
/* The phone's week strip picks its day in the same soft clay as the small calendar. */
.wk.sel, .wk[aria-current] { background: var(--hearth-linen); color: var(--ink); box-shadow: none; }
.wk.sel .wd, .wk.sel .wn { color: var(--ink); }
.wk.sel:hover { background: var(--hearth-linen); color: var(--ink); }
.wk.sel .dots i { background: var(--muted); }
/* A note or video of yours set into the entry: a quiet surface, no coloured edge; the serif says it's yours. */
.embed { border: 1px solid var(--hair); border-radius: 12px; background: var(--surface); padding: 14px 40px 14px 16px; }

/* ---------- The shared header (_pagehead.html), laid out like Light-Lux's: the section and its range on the
   left, then the arrows and Today, then Day / Week / Month. It replaces the date bar on Today, Calendar,
   Places, People, Settings and the summaries. ---------- */
.topbar { position: sticky; top: 0; z-index: 1000; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  min-height: 64px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--page) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule); }
.topbar-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1 1 auto; }
.page-title { margin: 0; font: 800 24px/1.1 var(--display); color: var(--ink); white-space: nowrap; }
.topbar-sub { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; text-decoration: none; }
a.topbar-sub:hover, .topbar-sub label:hover { color: var(--ink); }
.topbar-quiet .topbar-sub, .topbar-quiet .topbar-sub .date { font: 800 24px/1.1 var(--display); color: var(--ink); }
.topbar-quiet a.topbar-sub:hover { text-decoration: underline; text-underline-offset: 4px; }
.topbar .jump { min-width: 0; }
.topbar .jump label { position: relative; display: inline-flex; cursor: pointer; }
.topbar .jump input[type=date] { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.topbar-nav { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none; border-radius: var(--r);
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); text-decoration: none; }
.icon-btn:hover { background: var(--hair); }
.icon-btn[aria-disabled=true] { color: var(--rule); pointer-events: none; }
.chev-l { transform: rotate(90deg); } .chev-r { transform: rotate(-90deg); }
.today-btn { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font-weight: 500; text-decoration: none; }
.today-btn:hover { background: var(--hair); }
.today-btn[aria-disabled=true] { color: var(--muted); pointer-events: none; }
.segmented { display: inline-flex; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface); }
.segmented a { display: inline-flex; align-items: center; height: 28px; padding: 0 13px; border-radius: calc(var(--r) - 3px);
  color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.segmented a:hover { color: var(--ink); }
.segmented a[aria-current] { background: var(--fill); color: var(--on-fill); font-weight: 600; }
.topbar + .with-bar, .topbar + .week { margin-top: 0; }
@media (max-width: 699px) {
  .topbar { min-height: 0; }
  .topbar-title { flex-basis: 100%; flex-wrap: wrap; row-gap: 0; }
  .page-title, .topbar-quiet .topbar-sub, .topbar-quiet .topbar-sub .date { font-size: 22px; }
  .segmented { margin-left: auto; }
  .topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .topbar-nav { gap: 4px; } .today-btn { padding: 0 10px; } .segmented a { padding: 0 10px; }
}
@media (min-width: 1100px) {
  .topbar { min-height: 72px; padding: 12px 32px; flex-wrap: nowrap; }
  .page-title, .topbar-quiet .topbar-sub, .topbar-quiet .topbar-sub .date { font-size: 28px; }
}

/* ---------- The calendar (calendar.html), like Light-Lux's month: a row of weekday names, then weeks of days.
   Each day shows its number, how much it holds and its first lines (the write-up first); busier days take a
   little Rose. The week is seven columns. The right panel holds the summary. ---------- */
main.cal { padding: 0 0 24px; }
.cal-month { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule); background: var(--surface); }
.cal-month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); }
.cal-month-head span { padding: 10px 8px 8px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); }
.cal-month-body { display: grid; grid-template-rows: repeat(var(--rows), minmax(84px, auto)); }
.cal-week-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--hair); }
.cal-week-row:last-child { border-bottom: 0; }
.cal-day { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 6px 4px 8px;
  border-left: 1px solid var(--hair); overflow: hidden;
  background: var(--surface); transition: background .15s ease; }
.cal-day:first-child { border-left: 0; }
.cal-day.out { background: var(--page); }
.cal-day.out .cal-day-num, .cal-day.future .cal-day-num { color: var(--muted); }
.cal-day.future { background: var(--page); }
.cal-day-num { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 6px; color: var(--ink);
  font: 600 16px/26px var(--serif, var(--font)); text-decoration: none; white-space: nowrap; }
a.cal-day-num:hover { background: var(--hair); }
.cal-day.today .cal-day-num, .cal-col.today .cal-day-num { background: var(--fill); color: var(--on-fill); }
.cal-day.sel .cal-day-num { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal-day-load { position: absolute; top: 10px; right: 8px; font-size: 11px; line-height: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-day-list { display: flex; flex-direction: column; gap: 1px; min-width: 0; color: inherit; text-decoration: none; }
.cal-line { display: flex; align-items: center; gap: 5px; min-width: 0; height: 20px; padding: 0 4px; border-radius: 6px;
  font-size: 12px; line-height: 16px; color: var(--ink); }
.cal-day-list:hover .cal-line { background: color-mix(in srgb, var(--hair) 60%, transparent); }
.cal-line-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--muted); }
.cal-hl .cal-dot { background: var(--ink); box-shadow: none; }
.cal-hl .cal-line-t { font-weight: 600; }
.cal-photo .cal-dot { background: var(--hearth-rose); box-shadow: inset 0 0 0 1.5px var(--muted); }
.cal-text .cal-dot { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal-place .cal-dot, .cal-note .cal-dot { background: var(--hearth-sage); box-shadow: none; }
.cal-mail .cal-dot, .cal-event .cal-dot { background: var(--hearth-blue); box-shadow: none; }
.cal-photo .cal-line-t, .cal-text .cal-line-t, .cal-note .cal-line-t, .cal-video .cal-line-t,
.cal-mail .cal-line-t, .cal-event .cal-line-t { color: var(--muted); }
.cal-more { padding: 0 4px; font-size: 12px; line-height: 18px; font-weight: 600; color: var(--link); }
.cal-day.mood-1 { box-shadow: inset 0 -4px 0 var(--m1); } .cal-day.mood-2 { box-shadow: inset 0 -4px 0 var(--m2); }
.cal-day.mood-3 { box-shadow: inset 0 -4px 0 var(--m3); } .cal-day.mood-4 { box-shadow: inset 0 -4px 0 var(--m4); }
.cal-day.mood-5 { box-shadow: inset 0 -4px 0 var(--m5); }
.cal-col.mood-1 .cal-col-head { box-shadow: inset 0 -4px 0 var(--m1); } .cal-col.mood-2 .cal-col-head { box-shadow: inset 0 -4px 0 var(--m2); }
.cal-col.mood-3 .cal-col-head { box-shadow: inset 0 -4px 0 var(--m3); } .cal-col.mood-4 .cal-col-head { box-shadow: inset 0 -4px 0 var(--m4); }
.cal-col.mood-5 .cal-col-head { box-shadow: inset 0 -4px 0 var(--m5); }
.cal-week-row.sel .cal-day:not(.out) { background-image: linear-gradient(var(--tint), var(--tint)); background-size: 100% 2px; background-repeat: no-repeat; }
/* Phones: the number and dots only; the lines live in the panel below and on the day. */
@media (max-width: 699px) {
  .cal-month-head span { padding: 8px 4px 6px; text-align: center; }
  .cal-month-body { grid-template-rows: repeat(var(--rows), minmax(64px, auto)); }
  .cal-day { align-items: center; padding: 6px 2px; }
  .cal-day-num { align-self: center; font-size: 15px; }
  .cal-day-load { position: static; }
  .cal-day-list { flex-direction: row; justify-content: center; gap: 3px; }
  .cal-line { height: auto; padding: 0; } .cal-line-t, .cal-more { display: none; }
}

/* The week: seven columns. */
.cal-weekcols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); background: var(--surface); }
.cal-col { display: flex; flex-direction: column; min-width: 0; min-height: 60vh; border-left: 1px solid var(--hair); }
.cal-col:first-child { border-left: 0; }
.cal-col.future { background: var(--page); }
.cal-col-head { display: flex; align-items: baseline; gap: 6px; padding: 10px 8px 8px; border-bottom: 1px solid var(--hair); }
.cal-col-wd { font-size: 12px; font-weight: 600; color: var(--muted); }
.cal-col-mood { margin-left: auto; align-self: center; display: inline-grid; color: var(--mc); }
.cal-col-mood .i { width: 20px; height: 20px; }
.cal-col-body { display: flex; flex-direction: column; gap: 6px; padding: 8px; color: inherit; text-decoration: none; }
.cal-col-body:hover { background: color-mix(in srgb, var(--hair) 50%, transparent); }
.cal-col-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; }
.cal-col-hl { font-size: 13px; line-height: 17px; color: var(--ink); }
.cal-col-snip { font-size: 12px; line-height: 17px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.cal-col-lines { display: flex; flex-direction: column; gap: 1px; }
.cal-col-lines .cal-line { padding: 0; }
@media (max-width: 899px) {
  .cal-weekcols { grid-template-columns: 1fr; }
  .cal-col { min-height: 0; border-left: 0; border-bottom: 1px solid var(--hair); flex-direction: row; }
  .cal-col-head { flex-direction: column; align-items: center; gap: 0; width: 56px; flex: none; border-bottom: 0; border-right: 1px solid var(--hair); }
  .cal-col-mood { margin: 2px 0 0; }
  .cal-col-body { flex: 1; min-width: 0; }
  .cal-col-cover { max-width: 160px; }
}

/* The panel: the summary card, then the month's weeks or the week's days. */
.cal-card { padding: 18px 16px 16px; border-bottom: 1px solid var(--hair); display: grid; gap: 10px; }
.cal-card-head { display: grid; gap: 2px; }
.cal-card-head h2 { font-size: 13px !important; line-height: 16px !important; font-family: var(--font) !important;
  font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.cal-card-head .meta { font: 800 20px/24px var(--display); color: var(--ink); }
.cal-card-hl { font: 700 17px/23px var(--font); color: var(--ink); }
.cal-card-hl a { text-decoration: none; }
.cal-card-hl a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cal-card-lead { font-size: 13px; line-height: 20px; color: var(--body); display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.cal-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.cal-facts div { padding: 8px 10px; border: 1px solid var(--hair); border-radius: var(--r); background: var(--surface); }
.cal-facts dt { font-size: 11px; line-height: 14px; color: var(--muted); }
.cal-facts dd { margin: 2px 0 0; font-size: 16px; line-height: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cal-facts dd .meta { font-size: 12px; font-weight: 500; }
.cal-weeks { padding: 14px 8px 18px; }
.cal-weeks h2 { padding: 0 8px 6px; }
.cal-weeks li { position: relative; border-radius: var(--r); }
.cal-weeks li.sel { background: var(--tint); }
.cal-wk { display: grid; gap: 2px; padding: 8px 72px 8px 8px; color: inherit; text-decoration: none; border-radius: var(--r); }
.cal-wk:hover { background: var(--hair); }
.cal-wk-when { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); }
.cal-wk-what { font-size: 13px; line-height: 18px; color: var(--ink); }
.cal-wk-what em { font-style: normal; color: var(--muted); }
.cal-wk-mood { font-size: 11px; }
.cal-wk-sum { position: absolute; top: 8px; right: 8px; font-size: 12px; font-weight: 600; color: var(--link); text-decoration: none; padding: 2px 6px; border-radius: 6px; }
.cal-wk-sum:hover { background: var(--tint); }
.cal-twin { margin-top: 8px; }
.cal-twin .desk-days li a { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; padding: 10px 16px; text-decoration: none; color: inherit; }
@media (min-width: 1100px) {
  .desk-panel:has(.cal-card), .desk-panel:has(.cal-weeks) { overflow-y: auto; }
  .desk-main main.cal { max-width: none; }
  body.cal-page .desk-main { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body.cal-page .desk-main > .topbar, body.cal-page .desk-main > .with-bar { flex: none; }
  body.cal-page main.cal { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 0; }
  body.cal-page .cal-month { flex: 1; min-height: 0; border-bottom: 0; }
  body.cal-page .cal-month-body { flex: 1; min-height: 0; grid-template-rows: repeat(var(--rows), minmax(108px, 1fr)); }
  body.cal-page .cal-weekcols { flex: 1; min-height: 0; border-bottom: 0; }
  body.cal-page .cal-col { min-height: 0; overflow-y: auto; }
}

/* ---------- Month: rolling over a day lifts it and shows its card (calendar.html, .cal-pop). ---------- */
.cal-day { overflow: visible; }
.cal-day > .cal-day-list, .cal-day > .cal-day-num { position: relative; z-index: 1; }
.cal-day-list { overflow: hidden; }
@media (hover: hover) and (min-width: 700px) {
  .cal-day:not(.future):hover { background: var(--hearth-linen); z-index: 5; }
  .cal-day.out:not(.future):hover { background: color-mix(in srgb, var(--hearth-linen) 70%, var(--page)); }
  .cal-pop { position: absolute; z-index: 20; top: calc(100% - 6px); left: 6px; width: 280px; display: grid; gap: 6px; padding: 12px 14px;
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 12px 30px rgb(var(--shadow) / .16);
    opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none;
    transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s; }
  .cal-day:hover .cal-pop { opacity: 1; visibility: visible; transform: none; transition-delay: .25s, .25s, .25s; }
  .cal-day.pop-left .cal-pop { left: auto; right: 6px; }
  .cal-day.pop-up .cal-pop { top: auto; bottom: calc(100% - 6px); transform: translateY(4px); }
  .cal-day.pop-up:hover .cal-pop { transform: none; }
}
@media (hover: none), (max-width: 699px) { .cal-pop { display: none; } }
.cal-pop p { margin: 0; }
.cal-pop-when { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); }
.cal-pop-mood { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); }
.cal-pop-mood::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mc, var(--muted)); }
.cal-pop-hl { font-size: 14px; line-height: 19px; font-weight: 700; color: var(--ink); }
.cal-pop-snip { font-size: 12px; line-height: 18px; color: var(--body); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cal-pop-lines { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.cal-pop-lines .cal-line { padding: 0; height: 18px; }
.cal-pop-open { font-size: 12px; font-weight: 600; color: var(--link); }
.m1 { --mc: var(--m1); } .m2 { --mc: var(--m2); } .m3 { --mc: var(--m3); } .m4 { --mc: var(--m4); } .m5 { --mc: var(--m5); }

/* The mood line's key, in the month's panel. */
.mood-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--hair);
  font-size: 12px; line-height: 16px; color: var(--muted); }
.mood-key-t { flex-basis: 100%; font-weight: 600; color: var(--ink); }
.mood-key span { display: inline-flex; align-items: center; gap: 5px; }
.mood-key i { width: 14px; height: 3px; border-radius: 2px; background: var(--mc); }

/* ---------- The small calendar: the dot is the day's mood in the same colours as the month's line;
   Charcoal when it's written but has no mood; a Taupe ring when it only has a record. ---------- */
.mini-day.has::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
  background: none; box-shadow: inset 0 0 0 1.2px var(--muted); }
.mini-day.sum::after { background: var(--ink); box-shadow: none; }
.mini-day.m1::after, .mini-day.m2::after, .mini-day.m3::after, .mini-day.m4::after, .mini-day.m5::after {
  content: ""; position: absolute; bottom: 3px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; box-shadow: none; }
.mini-day.m1::after { background: var(--m1); } .mini-day.m2::after { background: var(--m2); } .mini-day.m3::after { background: var(--m3); }
.mini-day.m4::after { background: var(--m4); } .mini-day.m5::after { background: var(--m5); }
.mini-key { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 10px 0 0; font-size: 11px; line-height: 14px; color: var(--muted); }
.mini-key span { display: inline-flex; align-items: center; gap: 4px; }
.mini-key i { width: 6px; height: 6px; border-radius: 50%; }
.k-m1 { background: var(--m1); } .k-m2 { background: var(--m2); } .k-m3 { background: var(--m3); } .k-m4 { background: var(--m4); } .k-m5 { background: var(--m5); }
.k-sum { background: var(--ink); } .k-has { box-shadow: inset 0 0 0 1.2px var(--muted); }

/* ---------- Editing the day's entry in the writer (/write/entry/<d>) ---------- */
/* The day's entry has the whole writer: every insert and the format bar (it once had only Dictate). */
.w-fixed { color: var(--ink); font-weight: 500; }
.w-entry-note { margin: -4px 0 14px; max-width: 60ch; }
.w-cancel { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; color: var(--muted); text-decoration: none; font-weight: 500; border-radius: var(--pill); }
.w-cancel:hover { color: var(--ink); background: var(--hair); }

/* ---------- A holiday's icon after the date in the header ---------- */
.holiday { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; margin-left: 2px; border-radius: 50%;
  background: var(--hearth-rose); color: var(--hearth-red-pressed); align-self: center; cursor: default; }
.holiday .i { width: 18px; height: 18px; }
@media (max-width: 699px) { .holiday { width: 26px; height: 26px; } .holiday .i { width: 16px; height: 16px; } }

/* ---------- The month's summary, condensed, fixed at the foot of the calendar (calendar.html, .cal-sumbar).
   The full summary is one click away. ---------- */
.cal-sumbar { display: flex; align-items: center; gap: 24px; padding: 18px 28px 20px; background: var(--surface); border-top: 1px solid var(--rule);
  box-shadow: 0 -6px 20px rgb(var(--shadow) / .06); }
.csb-text { flex: 1 1 auto; min-width: 220px; display: grid; gap: 6px; }
.csb-label { font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csb-hl { font-size: 15px; line-height: 21px; font-weight: 700; color: var(--ink); overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.csb-hl em { font-style: normal; font-weight: 500; color: var(--muted); }
.csb-mood { flex: none; display: inline-flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 13px; }
.csb-mood b { font: 800 24px/1 var(--display); color: var(--ink); }
.csb-mood i { width: 10px; height: 10px; border-radius: 50%; background: var(--mc); align-self: center; }
.csb-strip { flex: none; display: flex; align-items: flex-end; gap: 1px; height: 26px; }
.csb-strip i { width: 4px; height: 100%; border-radius: 2px; background: var(--hair); }
.csb-strip i.m1, .csb-strip i.m2, .csb-strip i.m3, .csb-strip i.m4, .csb-strip i.m5 { background: var(--mc); }
.csb-facts { flex: none; font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; }
.csb-go { flex: none; white-space: nowrap; }
@media (min-width: 1100px) { body.cal-page .cal-sumbar { flex: none; } }
@media (max-width: 1099px) { .csb-strip, .csb-facts { display: none; } }
@media (max-width: 1599px) { .csb-facts { display: none; } }
@media (max-width: 699px) {
  .cal-sumbar { flex-wrap: wrap; gap: 12px; padding: 14px 16px 16px; }
  .csb-text { flex-basis: 100%; }
  .csb-hl { white-space: normal; }
}

/* ---------- The phone's bar folds into one circle while you scroll down (static/tabbar.js) ----------
   The tabs are a flex row; folding takes the other tabs' share to nothing while the bar narrows to a
   circle, both eased in and out, so the section you're in slides into place. */
@media (max-width: 1099px) {
  .tabs { display: flex; transition: right .55s var(--bounce), padding .55s var(--bounce); }
  .tabs a { flex: 1 1 0; min-width: 0; overflow: hidden;
    transition: flex-grow .55s var(--bounce), opacity .25s var(--ease), background .32s var(--ease), color .16s var(--ease); }
  body.tabs-min .tabs { right: calc(100% - 12px - 58px); cursor: pointer; }
  body.tabs-min .tabs a:not(.keep) { flex-grow: 0; opacity: 0; pointer-events: none; }
  body.tabs-min .tabs a.keep { background: var(--fill); color: var(--on-fill); }
  body.tabs-min .tabs a.keep .tab-ico { animation: none; }
}
@media (prefers-reduced-motion: reduce) { .tabs, .tabs a { transition: none !important; } }

/* ---------- The sidebar's foot: you (to Settings) and (?) for Help, on one line ---------- */
.desk-foot { display: flex; align-items: center; gap: 4px; margin-top: auto; border-top: 1px solid var(--hair); padding-top: 4px; }
.desk-foot .desk-me { flex: 1; min-width: 0; border-top: 0; margin: 0; }
.help-btn { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--rule);
  background: var(--surface); color: var(--muted); font: 700 15px/1 var(--font); cursor: pointer; }
.help-btn:hover { color: var(--ink); background: var(--hair); }
.help-btn:focus-visible { outline: 2px solid var(--fill); outline-offset: 2px; }

/* ---------- Help: shortcuts and legend, a modal over the page ---------- */
.help-dlg { width: min(640px, calc(100vw - 32px)); max-height: min(720px, calc(100dvh - 48px)); padding: 0; border: 1px solid var(--rule);
  border-radius: 18px; background: var(--surface); color: var(--body); box-shadow: 0 24px 64px rgb(var(--shadow) / .28); overflow: hidden; }
.help-dlg[open] { display: flex; flex-direction: column; }
.help-dlg::backdrop { background: rgb(var(--shadow) / .45); }
.help-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--hair); }
.help-head h2 { margin: 0; font: 800 22px/1.1 var(--display); color: var(--ink); text-transform: none; }
.help-x { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.help-x:hover { background: var(--hair); color: var(--ink); }
.help-body { overflow-y: auto; padding: 8px 20px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
.help-body section { padding-top: 12px; }
.help-body section:first-child { grid-column: 1 / -1; }
.help-body h3 { margin: 0 0 8px; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.help-body .meta { margin: -2px 0 8px; font-size: 12px; line-height: 17px; }
.help-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin: 0; }
.help-keys div { display: flex; align-items: center; gap: 12px; }
.help-keys dt { display: flex; gap: 4px; min-width: 120px; }
.help-keys dd { margin: 0; font-size: 13px; color: var(--body); }
.help-keys kbd { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 6px; border: 1px solid var(--rule);
  border-bottom-width: 2px; border-radius: 6px; background: var(--page); color: var(--ink); font: 600 12px/1 var(--font); }
.help-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink); }
.help-legend li { display: inline-flex; align-items: center; gap: 8px; }
.help-rows { display: grid; gap: 8px; }
.help-rows .cal-line { padding: 0; height: auto; width: 14px; justify-content: center; }
.lg-line { width: 22px; height: 4px; border-radius: 2px; background: var(--mc); }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; margin: 0 3px; background: var(--mc, transparent); }
.lg-dot.k-sum { background: var(--ink); } .lg-dot.k-has { background: none; box-shadow: inset 0 0 0 1.4px var(--muted); }
.lg-today { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--fill); color: var(--on-fill); font-weight: 700; font-size: 12px; }
.lg-num { min-width: 26px; font-size: 11px; color: var(--muted); text-align: center; }
.lg-hol { width: 24px; height: 24px; margin: 0; } .lg-hol .i { width: 14px; height: 14px; }
@media (max-width: 599px) { .help-body, .help-keys { grid-template-columns: 1fr; } }
.csb-strip.is-week i { width: 10px; }

/* ---------- Create (as Substack's): the menu from the sidebar's button and the phone's + ---------- */
.desk-create::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M7 9.5l4 4 4-4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M7 9.5l4 4 4-4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.desk-create:hover::after, .desk-create[aria-expanded=true]::after { transform: rotate(180deg); }
.desk-create { cursor: pointer; font: inherit; font-weight: 500; }
.create-menu { position: fixed; z-index: 2500; min-width: 220px; display: grid; padding: 6px; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 14px; box-shadow: 0 16px 40px rgb(var(--shadow) / .18); }
.create-menu.is-closed { display: none; }
.create-menu.from-fab { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); width: min(280px, calc(100vw - 24px)); }
.create-menu [role=menuitem] { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 9px;
  background: none; color: var(--ink); font: 500 14px var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.create-menu [role=menuitem]:hover, .create-menu [role=menuitem]:focus-visible { background: var(--hair); outline: none; }
.create-menu [role=menuitem] .i { color: var(--muted); }
.create-menu [role=menuitem] span:not(.i) { flex: 1; }
.create-menu [role=menuitem] .i { flex: none; }
.create-menu kbd { font: 600 11px var(--font); color: var(--muted); border: 0; background: none; }
.create-menu hr { width: 100%; height: 1px; margin: 4px 0; border: 0; background: var(--hair); }
@media (max-width: 1099px) { .create-menu kbd { display: none; } }
.fab { border: 0; cursor: pointer; }
.fab[aria-expanded=true] .i { transform: rotate(45deg); }
.fab .i { transition: transform .3s var(--ease); }

/* ---------- The quick Note ---------- */
.qn-dlg { width: min(520px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--rule); border-radius: 18px; background: var(--surface);
  color: var(--body); box-shadow: 0 24px 64px rgb(var(--shadow) / .28); }
.qn-dlg::backdrop { background: rgb(var(--shadow) / .45); }
.qn-form { display: grid; gap: 12px; padding: 16px 18px 18px; }
.qn-head { display: flex; align-items: baseline; gap: 10px; }
.qn-head h2 { margin: 0; font: 800 22px/1.1 var(--display); color: var(--ink); text-transform: none; }
.qn-head .help-x { margin-left: auto; align-self: center; }
.qn-text { width: 100%; min-height: 110px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--page);
  color: var(--ink); font: 400 16px/1.5 var(--serif, var(--font)); resize: vertical; }
.qn-text:focus { outline: none; border-color: var(--fill); box-shadow: 0 0 0 3px var(--tint); }
.qn-partial { min-height: 0; margin: -6px 0 0; } .qn-partial:empty { display: none; }
.qn-places { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qn-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--pill);
  background: var(--surface); color: var(--ink); font: 500 13px var(--font); cursor: pointer; }
.qn-chip:hover { background: var(--hair); }
.qn-chip[aria-pressed=true], .qn-here.on { background: var(--tint); border-color: var(--fill); color: var(--link); }
.qn-tag[hidden] { display: none; }
.qn-tag[aria-pressed=true]::after { content: "×"; font-size: 16px; line-height: 1; margin-left: 2px; }
.qn-where-name { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qn-where[aria-pressed=true]::after { content: "×"; font-size: 16px; line-height: 1; margin-left: 2px; }
.qn-pick { display: grid; gap: 8px; }
.qn-pick[hidden] { display: none; }
.qn-pick .ci-list { max-height: min(40vh, 320px); }
.qn-place-in { flex: 1 1 140px; min-width: 120px; height: 32px; padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--pill);
  background: var(--page); font: 400 13px var(--font); color: var(--ink); }
.qn-foot { display: flex; align-items: center; gap: 8px; }
.qn-gap { flex: 1; }
.qn-mic { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 50%; background: var(--surface);
  color: var(--ink); cursor: pointer; }
.qn-mic[aria-pressed=true] { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
@media (max-width: 699px) { .qn-dlg { margin: auto auto 0; width: 100vw; max-width: none; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); } }

/* ---------- Voice Note and Video Note: Light-Lux's recorder, in a sheet (capture.js) ---------- */
.cap-dlg { width: min(720px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--rule); border-radius: 18px; background: var(--surface);
  color: var(--body); box-shadow: 0 24px 64px rgb(var(--shadow) / .28); }
.cap-dlg::backdrop { background: rgb(var(--shadow) / .5); }
.cap-form { display: grid; gap: 14px; padding: 18px 20px 20px; }
.vn-words { position: relative; }
.vn-text { width: 100%; min-height: 220px; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 12px; background: var(--page);
  color: var(--ink); font: 400 18px/1.6 var(--serif, var(--font)); resize: vertical; }
.vn-text:focus { outline: none; border-color: var(--fill); box-shadow: 0 0 0 3px var(--tint); }
.vn-partial { margin: 6px 2px 0; min-height: 22px; font: italic 400 16px/1.4 var(--serif, var(--font)); color: var(--muted); }
.cap-msg { margin: 0; color: var(--attention); font-size: 13px; } .cap-msg:empty { display: none; }
/* The bar at the foot, outlined in red while it records. */
.cap-bar { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1.5px solid var(--rule); border-radius: 14px; background: var(--page);
  transition: border-color .2s ease, box-shadow .2s ease; }
.cap-bar[data-state=recording] { border-color: var(--rec); box-shadow: 0 0 0 4px var(--rec-tint); }
.cap-rec { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: 10px;
  background: var(--rec); color: var(--on-fill); font: 600 14px var(--font); cursor: pointer; }
.cap-rec i { width: 12px; height: 12px; border-radius: 50%; background: var(--on-fill); }
.cap-bar[data-state=recording] .cap-rec i, .cap-bar[data-state=paused] .cap-rec i { border-radius: 2px; }
.cap-rec:disabled { opacity: .5; cursor: default; }
.cap-time { display: inline-flex; align-items: center; gap: 6px; font: 600 15px var(--font); color: var(--ink); font-variant-numeric: tabular-nums; }
.cap-time i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.cap-bar[data-state=recording] .cap-time i { background: var(--rec); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.cap-wave { display: flex; align-items: center; gap: 2px; height: 28px; flex: 0 1 220px; min-width: 60px; overflow: hidden; }
.cap-wave i { flex: none; width: 3px; height: calc(var(--h, .12) * 100%); border-radius: 2px; background: var(--muted); transition: height .1s linear; }
.cap-bar[data-state=recording] .cap-wave i { background: var(--rec); }
.cap-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: 500 14px var(--font); cursor: pointer; }
.cap-btn:hover { background: var(--hair); }
.cap-gap { flex: 1; }
.cap-save { white-space: nowrap; }
.cap-save:disabled { opacity: .45; cursor: default; }
.vd-stage { position: relative; border-radius: 12px; overflow: hidden; background: var(--night); aspect-ratio: 16 / 10; }
.vd-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vd-review { object-fit: contain !important; }
.vd-caption { height: 40px; padding: 0 14px; border: 1px solid var(--rule); border-radius: var(--pill); background: var(--page); font: 400 15px var(--font); color: var(--ink); }
@media (max-width: 699px) {
  .cap-dlg { margin: auto auto 0; width: 100vw; max-width: none; max-height: 100dvh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .cap-bar { flex-wrap: wrap; }
  .cap-wave { order: 5; flex-basis: 100%; }
  .vd-stage { aspect-ratio: 3 / 4; max-height: 52dvh; }
}
/* ---------- The day's bar (_daybar.html, Nov 28, 2026) ----------
   Anchored at the bottom middle of the page, as in Light-Lux: how the day felt, then its tags, and a
   quick milestone. One floating pill that changes in place. */
.daybar { position: sticky; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 900; width: fit-content;
  max-width: calc(100% - 24px); margin: 0 auto 16px; padding: 5px; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--pill); box-shadow: 0 10px 30px rgb(var(--shadow) / .16), 0 1px 3px rgb(var(--shadow) / .08); }
@media (min-width: 1100px) { .daybar { bottom: 20px; margin-bottom: 20px; max-width: min(760px, calc(100% - 48px)); } }
.db-pane { display: none; align-items: center; gap: 4px; min-height: 40px; min-width: 0; }
.daybar[data-view=mood] .db-mood, .daybar[data-view=tags] .db-tags, .daybar[data-view=milestone] .db-milestone {
  display: flex; animation: db-in .32s var(--spring) both; }
@keyframes db-in { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.db-q { padding: 0 8px 0 12px; font-weight: 600; font-size: 14px; white-space: nowrap; color: var(--ink); }
.db-q .meta { font-weight: 500; }
.daybar .faces { display: flex; gap: 2px; }
.daybar .faces button { width: 38px; height: 38px; }
.daybar .faces button.sug { border: 1.5px dashed var(--muted); }
.db-sep { flex: none; width: 1px; height: 24px; margin: 0 4px; background: var(--rule); }
.db-ms, .db-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 12px; border-radius: var(--pill);
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font: 600 13px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .16s var(--ease), transform .32s var(--spring); }
.db-ms:hover, .db-pill:hover { background: var(--hair); }
.db-ms:active, .db-pill:active { transform: scale(.95); }
.db-ms { background: var(--blush); border-color: transparent; margin-right: 2px; }
.db-ms:hover { background: color-mix(in srgb, var(--blush) 80%, var(--hearth-taupe)); }
.db-ghost { border-color: transparent; color: var(--muted); }
/* Tags: the picked face, then the day's tags in a row that scrolls, then one of your own. */
.db-face { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--fill); color: var(--on-fill); transition: transform .32s var(--spring); }
.db-face:hover { transform: scale(1.1) rotate(-8deg); }
.db-chips { display: flex; gap: 6px; flex: 1 1 auto; min-width: 0; max-width: 440px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 16px), transparent);
          mask: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 16px), transparent); }
.db-chips::-webkit-scrollbar { display: none; }
.db-chips .feel { flex: none; position: relative; }
.db-chips .feel span { padding: 6px 12px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.db-add { display: flex; align-items: center; flex: none; height: 32px; border: 1px dashed var(--rule); border-radius: var(--pill); padding-left: 10px; }
.db-add:focus-within { border-style: solid; border-color: var(--ink); }
.db-add input { width: 74px; border: 0; background: none; font: 500 13px/1 var(--font); color: var(--ink); outline: 0; padding: 0; transition: width .2s var(--ease); }
.db-add input:focus { width: 120px; }
.db-add-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 50%; }
.db-add-btn:hover { color: var(--ink); }
/* Milestone: one line, in the bar. */
.db-milestone { width: min(560px, calc(100vw - 48px)); padding-left: 10px; }
.db-flag { color: var(--fill); display: grid; place-items: center; }
.db-milestone input { flex: 1; min-width: 0; height: 36px; border: 0; background: none; font: 400 15px/1 var(--hand, var(--font)); color: var(--ink); outline: 0; padding: 0 6px; }
.db-save { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
.db-save:hover { background: var(--fill-hover); }
.db-x { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.db-x:hover { background: var(--hair); color: var(--ink); }
.db-said { position: absolute; left: 50%; bottom: calc(100% + 10px); margin: 0; padding: 6px 12px; border-radius: var(--pill); white-space: nowrap;
  background: var(--ink); color: var(--page); font-size: 13px; font-weight: 600; pointer-events: none; opacity: 0;
  transform: translate(-50%, 6px); transition: opacity .2s var(--ease), transform .32s var(--spring); }
.db-said.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 560px) {
  .daybar { border-radius: 24px; }
  .db-mood { flex-wrap: wrap; justify-content: center; row-gap: 2px; }
  .db-q { flex-basis: 100%; text-align: center; padding: 4px 0 0; }
  .db-ms span:not(.i) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .db-ms { width: 34px; padding: 0; justify-content: center; }
  .db-add input { width: 52px; } .db-add input:focus { width: 96px; }
}
@media (prefers-reduced-motion: reduce) { .daybar .db-pane { animation: none !important; } }

/* Milestones: the day's big moments, at the top of the day. */
.milestones ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.milestones li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--blush);
  color: var(--ink); font: 500 16px/22px var(--hand, var(--font)); }
.milestones li > .i { color: var(--fill); }
.milestones li > span:not(.i) { flex: 1; }
.milestones form { margin: 0; }
.ms-x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 50%; cursor: pointer; opacity: .5; }
.milestones li:hover .ms-x, .ms-x:focus-visible { opacity: 1; }

/* No entry yet: three ways to start it, grouped as one choice. */
.start-entry h1 { margin: 0 0 6px; }
.start-entry .prose { margin: 0 0 16px; color: var(--muted); }
.start-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.start-opts form { margin: 0; display: grid; }
.start-opt { display: grid; grid-template-rows: auto auto 1fr; align-content: start; gap: 6px; padding: 16px; text-align: left;
  border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none;
  font: inherit; cursor: pointer; transition: transform .32s var(--spring), border-color .16s var(--ease), box-shadow .16s var(--ease); }
.start-opt:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 6px 18px rgb(var(--shadow) / .1); }
.start-opt:focus-visible { outline: 2px solid var(--fill); outline-offset: 2px; }
.start-opt:disabled { cursor: default; opacity: .55; }
.so-ico { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 4px; border-radius: 12px; background: var(--page); color: var(--ink); }

.start-opt strong { font-size: 15px; line-height: 20px; }
.so-what { font-size: 13px; line-height: 18px; color: var(--muted); }
@media (max-width: 640px) {
  .start-opts { grid-template-columns: 1fr; }
  .start-opt { grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: center; padding: 12px 14px; }
  .so-ico { grid-row: 1 / span 2; margin: 0; }
}

/* ---------- Map pins, one look (Nov 28, 2026) ----------
   Every pin on every map is the same: Hearth Red with Warm White type. Named places are pills with a
   point, crowded areas a round count, spots without a name a small dot, the day's stops numbered
   circles. The pin you picked turns Charcoal. Change --pin to recolour them all. */
:root { --pin: var(--hearth-red); --pin-ink: var(--hearth-white); --pin-on: var(--hearth-charcoal); }
.pin, .pin.named, .pin.named.big, .pin.cluster, .pin.unnamed {
  background: var(--pin); color: var(--pin-ink); border: 1.5px solid var(--pin-ink); font-weight: 600;
  box-shadow: 0 2px 8px rgb(var(--shadow) / .28); }
.pin.big, .pin.named.big { font-weight: 700; }
.pin.pin.active, .pin:hover { background: var(--pin-on); color: var(--pin-ink); }
.pin.dot { background: var(--pin); border: 2px solid var(--pin-ink); width: 12px; height: 12px; }
.pin.dot.active { background: var(--pin-on); }
.cluster-dot { background: var(--pin); color: var(--pin-ink); border: 2px solid var(--pin-ink); box-shadow: 0 2px 8px rgb(var(--shadow) / .28); }
.cluster-dot:hover { background: var(--pin-on); }
.pin-num, .pin-num.start, .pin-num.end { background: var(--pin); color: var(--pin-ink); border: 2px solid var(--pin-ink); box-shadow: 0 2px 6px rgb(var(--shadow) / .28); }
.pin-num.active { background: var(--pin-on); color: var(--pin-ink); border-color: var(--pin-ink); }
.spot-list .dot, .spot-list .dot.named { background: var(--pin); border: 2px solid var(--pin); }
.spot-list .dot:not(.named) { width: 8px; height: 8px; margin: 0 1px; }

/* ---------- The day bar, darker: Charcoal with Warm White words, red when picked; the pills stay put ---------- */
.daybar { background: var(--hearth-charcoal); border-color: var(--hearth-charcoal); color: var(--hearth-white);
  box-shadow: 0 12px 32px rgb(var(--shadow) / .3); }
.daybar .db-q { color: var(--hearth-white); }
.daybar .db-q .meta { color: color-mix(in srgb, var(--hearth-white) 70%, transparent); }
.daybar .faces button { color: color-mix(in srgb, var(--hearth-white) 80%, transparent); }
.daybar .faces button:hover { color: var(--hearth-white); background: rgb(255 255 255 / .1); }
.daybar .faces button.sel { color: var(--on-fill); background: var(--fill); }
.daybar .faces button.sug { border-color: color-mix(in srgb, var(--hearth-white) 55%, transparent); }
.daybar .db-sep { background: rgb(255 255 255 / .2); }
.db-sug { height: 32px; padding: 0 12px; border: 1px solid var(--fill); border-radius: var(--pill); background: var(--fill); color: var(--on-fill);
  font: 600 14px var(--font); cursor: pointer; }
.db-sug:hover { background: var(--fill-hover); }
.daybar .db-ms, .daybar .db-pill { background: rgb(255 255 255 / .12); border-color: transparent; color: var(--hearth-white); }
.daybar .db-ms:hover, .daybar .db-pill:hover { background: rgb(255 255 255 / .2); }
.daybar .db-ghost { color: color-mix(in srgb, var(--hearth-white) 75%, transparent); }
.daybar .db-face { background: var(--fill); color: var(--on-fill); }
.daybar .db-face:hover { transform: none; }
.daybar .db-chips .feel span { background: transparent; border-color: rgb(255 255 255 / .28); color: var(--hearth-white); }
.daybar .db-chips .feel span:hover { background: rgb(255 255 255 / .1); transform: none; }
.daybar .db-chips .feel input:checked + span { background: var(--fill); border-color: var(--fill); color: var(--on-fill); transform: none; }
.daybar .db-add { border-color: rgb(255 255 255 / .3); }
.daybar .db-add:focus-within { border-color: var(--hearth-white); }
.daybar .db-add input { color: var(--hearth-white); }
.daybar .db-add input::placeholder { color: color-mix(in srgb, var(--hearth-white) 60%, transparent); }
.daybar .db-add-btn { color: color-mix(in srgb, var(--hearth-white) 70%, transparent); }
.daybar .db-add-btn:hover, .daybar .db-x:hover { color: var(--hearth-white); background: rgb(255 255 255 / .1); }
.daybar .db-milestone input { color: var(--hearth-white); }
.daybar .db-milestone input::placeholder { color: color-mix(in srgb, var(--hearth-white) 55%, transparent); }
.daybar .db-flag { color: #FF6B78; }
.daybar .db-x { color: color-mix(in srgb, var(--hearth-white) 70%, transparent); }
.daybar.db-still .db-pane { animation: none !important; }
/* Done, and the folded bar: how the day felt | Milestone. */
.db-done { display: grid; place-items: center; flex: none; width: 34px; height: 34px; margin-left: 2px; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / .12); color: var(--hearth-white); cursor: pointer; }
.db-done:hover { background: rgb(255 255 255 / .22); }
.daybar[data-view=min] .db-min { display: flex; animation: db-in .32s var(--spring) both; }
.db-min-mood, .db-min-ms { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 6px; border: 0; border-radius: var(--pill);
  background: none; color: var(--hearth-white); font: 600 14px var(--font); cursor: pointer; white-space: nowrap; }
.db-min-ms { padding: 0 14px; }
.db-min-mood:hover, .db-min-ms:hover { background: rgb(255 255 255 / .1); }
.db-min-face { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--mc, var(--fill)); color: #fff; }
.db-min-face.f1 { --mc: var(--m1); } .db-min-face.f2 { --mc: var(--m2); } .db-min-face.f3 { --mc: var(--m3); } .db-min-face.f4 { --mc: var(--m4); } .db-min-face.f5 { --mc: var(--m5); }
.db-min-tags { font-weight: 500; color: color-mix(in srgb, var(--hearth-white) 65%, transparent); }
.db-min-ms .i { color: #FF6B78; }

/* Milestones lead Highlights, with their flag. */
.highlights .is-milestone { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  background: var(--tint); border-color: color-mix(in srgb, var(--fill) 35%, transparent); }
.highlights .is-milestone .when { color: var(--link); font-weight: 600; }
.highlights .is-milestone .when .i { color: var(--fill); }
.highlights .is-milestone .ms-x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.highlights .is-milestone .ms-x:hover { background: color-mix(in srgb, var(--fill) 12%, transparent); color: var(--ink); }

/* ---------- No delight motion after you press things (owner, 2026-11-28): buttons, pills, faces and
   tabs don't spin, wobble, tilt or pop when tapped, picked or pointed at. A small press-in stays. ---------- */
.tabs a[aria-current] .tab-ico { animation: none; }
.fab:hover { transform: none; }
.feel input:checked + span, .feel span:hover { transform: none; }
.wk.sel, .wk.sel:hover, .wk:hover { transform: none; }
a.mc:hover { transform: none; }
.sheet-mood button:hover, .faces button:hover, .w-mood-faces button:hover, .db-face:hover { transform: none; }
.desk-nav a:hover { transform: none; }
.dayhead .nav:hover { transform: none; }

/* ---------- Month: one spacing system inside every day (desktop and tablet) ----------
   Everything sits 12px in from the day's edges: the number, each line's dot, "N More" and the
   count on the right. The number and the count share one row, lines are 20px on a 2px gap, "N More"
   keeps 4px clear of the last line, and 12px stay free at the foot (8px when a mood line takes 4px).
   Rows grow to fit their day, so nothing spills over the line below. */
@media (min-width: 700px) {
  .cal-day { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto; align-content: start;
    column-gap: 8px; row-gap: 6px; padding: 6px 6px 12px; min-height: 108px; }
  .cal-day.mood-1, .cal-day.mood-2, .cal-day.mood-3, .cal-day.mood-4, .cal-day.mood-5 { padding-bottom: 16px; }
  .cal-day-num { grid-column: 1; grid-row: 1; align-self: center; justify-self: start; }
  .cal-day-load { position: static; grid-column: 2; grid-row: 1; align-self: center; padding-right: 6px; line-height: 26px; }
  .cal-day-list { grid-column: 1 / -1; gap: 2px; }
  .cal-line { padding: 0 6px; height: 20px; }
  .cal-more { display: block; margin-top: 4px; padding: 0 6px; line-height: 20px; }
  .cal-pop { grid-column: 1 / -1; }
  .cal-month-body { grid-template-rows: repeat(var(--rows), minmax(max-content, auto)); }
}
@media (min-width: 1100px) {
  body.cal-page .cal-month-body { grid-template-rows: repeat(var(--rows), minmax(max-content, 1fr)); }
}

/* ---------- Mood faces in their colours (Awful red to Great blue), wherever you pick one ---------- */
.faces button.f1, .w-mood-faces [data-mood="1"], .db-face.f1 { --mc: var(--m1); }
.faces button.f2, .w-mood-faces [data-mood="2"], .db-face.f2 { --mc: var(--m2); }
.faces button.f3, .w-mood-faces [data-mood="3"], .db-face.f3 { --mc: var(--m3); }
.faces button.f4, .w-mood-faces [data-mood="4"], .db-face.f4 { --mc: var(--m4); }
.faces button.f5, .w-mood-faces [data-mood="5"], .db-face.f5 { --mc: var(--m5); }
.faces button, .w-mood-faces button { color: var(--mc, var(--ink)); }
.daybar .faces button { color: var(--mc); }
.daybar .faces button:hover { color: var(--mc); background: color-mix(in srgb, var(--mc) 18%, transparent); }
.daybar .faces button.sel, .faces button.sel, .w-mood-faces button[aria-pressed=true] { background: var(--mc); color: #fff; }
.daybar .faces button.f3.sel, .faces button.f3.sel, .w-mood-faces [data-mood="3"][aria-pressed=true] { color: var(--hearth-charcoal); }
.daybar .faces button.sug { border-color: var(--mc); }
.daybar .db-face { background: var(--mc, var(--fill)); color: #fff; }
.daybar .db-face.f3 { color: var(--hearth-charcoal); }
/* The suggestion, in its mood's colour. */
.db-sug.f1 { --mc: var(--m1); } .db-sug.f2 { --mc: var(--m2); } .db-sug.f3 { --mc: var(--m3); } .db-sug.f4 { --mc: var(--m4); } .db-sug.f5 { --mc: var(--m5); }
.daybar .db-sug { background: transparent; border-color: var(--mc); color: var(--hearth-white); }
.daybar .db-sug:hover, .daybar .db-sug.on { background: var(--mc); color: #fff; }
.daybar .db-sug.f3:hover, .daybar .db-sug.f3.on { color: var(--hearth-charcoal); }

/* The writer's mood chip wears its mood's colour too, never the red of a button. */
.w-mood[data-level="1"] { --mc: var(--m1); } .w-mood[data-level="2"] { --mc: var(--m2); } .w-mood[data-level="3"] { --mc: var(--m3); }
.w-mood[data-level="4"] { --mc: var(--m4); } .w-mood[data-level="5"] { --mc: var(--m5); }
.w-mood.chosen { background: var(--mc, var(--fill)); border-color: transparent; }
.w-mood.chosen .w-mood-btn { color: #fff; }
.w-mood[data-level="3"].chosen .w-mood-btn { color: var(--hearth-charcoal); }
.w-mood.open { border-color: var(--mc, var(--fill)); }

/* The entry on its day shows what the writer made: headings, quotes, pictures and breaks. */
.entry-body .prose.is-h3 { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.08; margin-top: 28px; max-width: none; }
.entry-body .prose.is-h4 { font-family: var(--font); font-weight: 700; font-size: 20px; line-height: 1.3; letter-spacing: -.01em; margin-top: 22px; }
.entry-body .prose.is-quote { padding-left: 18px; border-left: 3px solid var(--ink); font-style: italic; color: var(--body); }
.entry-body .entry-img { margin: 18px 0; } .entry-body .entry-img img { width: 100%; border-radius: 14px; display: block; }
.entry-body .entry-hr { border: 0; height: 1px; background: var(--rule); margin: 26px auto; width: 40%; }
.entry-body .s a { color: var(--link); }

/* ---------- Shape the Write-up: a card above With ---------- */
.shape { display: grid; gap: 14px; padding: 16px; margin: 0 0 16px; }
.shape-head { display: flex; align-items: flex-start; gap: 12px; }
.shape-ico { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--page); color: var(--ink); }
.shape-head h2 { margin: 0; font-size: 16px; line-height: 20px; }
.shape-head .meta { margin: 2px 0 0; font-size: 13px; line-height: 18px; }
.shape-form { display: grid; gap: 12px; }
.shape-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.shape-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--hair); }
.shape-row:first-child { border-top: 0; }
.shape-av { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--hearth-linen); color: var(--ink); font: 700 12px/1 var(--font); }
.shape-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ink); }
.shape-seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--rule); border-radius: var(--pill); background: var(--page); }
.shape-seg label { position: relative; }
.shape-seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.shape-seg span { display: block; padding: 4px 10px; border-radius: var(--pill); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); }
.shape-seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(var(--shadow) / .14); }
.shape-seg .w2 input:checked + span { background: var(--fill); color: var(--on-fill); }
.shape-seg .w0 input:checked + span { background: var(--hearth-linen); color: var(--ink); }
.shape-seg input:focus-visible + span { outline: 2px solid var(--fill); outline-offset: 1px; }
.shape-add { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px dashed var(--rule); border-radius: var(--pill); color: var(--muted); }
.shape-add:focus-within { border-style: solid; border-color: var(--ink); color: var(--ink); }
.shape-add input { flex: 1; min-width: 0; border: 0; background: none; font: 400 14px var(--font); color: var(--ink); outline: 0; padding: 0; }
.shape-go { justify-self: stretch; justify-content: center; }

/* ---------- Bars that move with a little give (owner, 2026-11-28) ----------
   One curve for the day bar and the phone's tab bar: eased in and out, overshooting a touch and settling. */
:root { --bounce: cubic-bezier(.6, -0.28, .32, 1.32); }
.daybar[data-view] .db-pane { animation-duration: .42s; animation-timing-function: var(--bounce); }
@keyframes db-in { from { opacity: 0; transform: translateY(8px) scale(.94); } }
.daybar.db-moving { overflow: hidden; }
/* Phones: when the tab bar folds into its circle, the day bar drops into that row, between the circle
   and +, and sheds the words it has no room for (the tags, the word Milestone). */
@media (max-width: 1099px) {
  /* Pinned to the screen, not stuck to the page: Safari's toolbar and the scroll no longer drag it about.
     It rides above the tab bar, and slides down into the tab bar's row when that folds. */
  .daybar { position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); margin: 0;
    transform: translate(-50%, -68px); transition: transform .42s cubic-bezier(.65, 0, .35, 1); will-change: transform; }
  body.tabs-min .daybar { transform: translate(-50%, 0); max-width: calc(100% - 156px); }
  body.tabs-min .daybar .db-min-tags, body.tabs-min .daybar .db-min-ms span:not(.i) { display: none; }
  body.tabs-min .daybar .db-min-ms { padding: 0 12px; }
  body.has-tabs main.day { padding-bottom: 190px; }   /* room to read past the bar */
}
@media (prefers-reduced-motion: reduce) { .daybar, .daybar .db-pane { transition: none !important; animation: none !important; } }

/* The day bar's morph (daybar.js) does all of its moving; the panes' own entrance stays off once it runs. */
.daybar.db-still .db-pane { animation: none !important; }
.daybar.db-moving { overflow: hidden; }

/* ---------- Phones: the day bar is always one line ----------
   Pinned at left 50%, the bar could only be half the screen wide and wrapped onto three lines. It sizes
   to what it holds, up to the screen's width less a margin, and on a narrow screen the first step keeps
   only what matters: My Hearth's suggestion (if any), the five faces and the milestone flag. */
@media (max-width: 1099px) {
  .daybar { width: max-content; max-width: calc(100vw - 24px); }
  body.tabs-min .daybar { max-width: calc(100vw - 156px); }
  .daybar .db-pane { flex-wrap: nowrap; }
}
@media (max-width: 699px) {
  .daybar .db-mood .db-q { display: none; }
  .daybar .db-mood .db-ms span:not(.i), .daybar .db-tags .db-ms span:not(.i) { display: none; }
  .daybar .db-mood .db-ms, .daybar .db-tags .db-ms { padding: 0 11px; }
  .daybar .faces { gap: 0; }
  .daybar .faces button { width: 36px; height: 36px; }
  .daybar .db-sug-form { margin-left: 4px; }
}
@media (max-width: 699px) {
  /* Add Tag is just its + until tapped (the field is required, so + with nothing typed opens it). */
  .daybar .db-add { padding-left: 0; border-style: solid; border-color: rgb(255 255 255 / .22); }
  .daybar .db-add input { width: 0; padding: 0; }
  .daybar .db-add:focus-within { padding-left: 10px; }
  .daybar .db-add input:focus { width: 110px; }
}

/* Swipe paging slides the content sideways; don't let it open a sideways scroll. */
.desk-main { overflow-x: clip; }

/* ---------- Week and month summaries, across the page (Nov 28) ----------
   The headline beside how it felt; the days as one chart the full width; then the story, with the
   events, emotional days and people in a column beside it on wide screens. One column on phones. */
main.rpt { max-width: 1200px; padding: 40px 48px 96px; gap: 0; }
.rpt-top { display: grid; gap: 28px; padding-bottom: 36px; }
.rpt-top .rpt-title { margin: 0; text-wrap: balance; }
.rpt-mood { display: grid; gap: 14px; align-content: start; padding: 20px 22px 22px; border: 1px solid var(--rule); border-radius: 18px; background: var(--surface); }
.rpt-mood .rpt-shape { margin: 0; font-size: 15px; line-height: 22px; }
.rpt-mood .rpt-avg { display: flex; align-items: flex-end; gap: 12px; }
.rpt-mood .rpt-avg .num { font-size: 64px; line-height: .78; }
.rpt-mood .rpt-avg .of { font-size: 14px; line-height: 19px; color: var(--body); }
.rpt-mood .rpt-avg .vs { display: block; font-size: 13px; color: var(--muted); }
.rpt-split { display: flex; gap: 2px; height: 10px; border-radius: var(--pill); overflow: hidden; background: var(--hair); }
.rpt-split i { display: block; min-width: 4px; background: var(--m3); }
.rpt-split .m1 { background: var(--m1); } .rpt-split .m2 { background: var(--m2); } .rpt-split .m4 { background: var(--m4); } .rpt-split .m5 { background: var(--m5); }
.rpt-mood .rpt-dist { gap: 4px; }
.rpt-mood .rpt-dist dt { font-size: 11px; gap: 4px; }
.rpt-mood .rpt-dist dd { font-size: 16px; }

.rpt-chart { padding: 24px 0 20px; margin-bottom: 48px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.rpt-chart .rpt-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; gap: 8px; margin: 0; }
.rpt-chart .rpt-days.is-month { gap: 6px; }
.rpt-chart .rd-col, .rpt-chart .rpt-days.is-month .rd-col { height: 136px; max-width: none; }
.rpt-chart .rpt-days:not(.is-month) .rd-col { max-width: 72px; }
.rpt-chart .rd-bar { border-radius: 6px; }
.rpt-chart .rd:hover .rd-col::before { background: var(--rule); }
.rpt-chart .rd:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.rpt-chart .rd-n, .rpt-chart .rpt-days.is-month .rd-n { font-size: 11px; }
.rpt-chart .rpt-note { margin-top: 12px; }

.rpt-body { display: grid; gap: 8px; }
.rpt-main { display: grid; gap: 0; align-content: start; min-width: 0; }
.rpt-story p { max-width: 66ch; font-size: 18px; line-height: 1.7; color: var(--ink); }
.rpt-story p:first-child { font-size: 21px; line-height: 1.55; }
.rpt-themes { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0 !important; padding: 0; list-style: none; }
.rpt-themes li { padding: 4px 12px; border: 1px solid var(--rule); border-radius: var(--pill); font: 500 13px/18px var(--font); color: var(--body); }
.rpt-moved { margin-top: 40px; padding-top: 28px; }
.rpt-moved .rpt-infl { gap: 40px; }
.rpt-infl h3 { display: flex; align-items: center; gap: 8px; }
.rpt-infl h3::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--m4); flex: none; }
.rpt-infl-down h3::before { background: var(--m1); }

.rpt-side { display: grid; align-content: start; min-width: 0; }
.rpt-side .rpt-sec { padding: 22px 0; }
.rpt-events li, .rpt-rows li { grid-template-columns: 56px 1fr; font-size: 14px; }
.rpt-people { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.rpt-people li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; font-size: 14px; line-height: 1.45; color: var(--body); }
.rpt-people strong { color: var(--ink); }
.rp-av { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--hearth-linen); color: var(--ink); font: 700 13px/1 var(--font); }
.rpt .tone { display: inline-block; padding: 1px 8px; border-radius: var(--pill); background: var(--hair); font: 600 11px/16px var(--font); color: var(--body); vertical-align: 1px; }
.rpt .tone.t-high, .rpt .tone.t-lift { background: color-mix(in srgb, var(--m4) 16%, transparent); color: #17663a; }
.rpt .tone.t-low, .rpt .tone.t-drag { background: color-mix(in srgb, var(--m1) 12%, transparent); color: #a3121a; }
.rpt-lead { margin: 0 0 4px; font-size: 17px; line-height: 1.55; color: var(--body); max-width: 60ch; }
.rpt-actions .rpt-buttons { flex-wrap: wrap; }

@media (min-width: 900px) {
  .rpt-top { grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); gap: 56px; align-items: end; }
}
@media (min-width: 1180px) {
  .rpt-body { grid-template-columns: minmax(0, 1fr) 340px; gap: 72px; align-items: start; }
  .rpt-side > .rpt-sec:first-child { padding-top: 0; border-top: 0; }
}
@media (max-width: 899px) { main.rpt { padding: 28px 24px 120px; } }
@media (max-width: 699px) {
  main.rpt { padding: 20px 16px 150px; }
  .rpt-top { gap: 20px; padding-bottom: 24px; }
  .rpt-top .rpt-title { font-size: 38px; }
  .rpt-chart { padding: 18px 0 14px; margin-bottom: 32px; }
  .rpt-chart .rpt-days.is-month { gap: 2px; }
  .rpt-chart .rd-col, .rpt-chart .rpt-days.is-month .rd-col { height: 84px; }
  .rpt-chart .rd-bar { border-radius: 3px; }
  .rpt-chart .rpt-days.is-month .rd-n { font-size: 9px; }
  .rpt-chart .rpt-days.is-month .rd:nth-child(even) .rd-n { visibility: hidden; }
  .rpt-story p { font-size: 17px; } .rpt-story p:first-child { font-size: 19px; }
  .rpt-moved { margin-top: 28px; }
}
/* In the summary, a full date sits on its own line above the row; the side column is too narrow beside it. */
.rpt-rows li { grid-template-columns: 1fr; gap: 2px; }
.rpt-rows .when { padding-top: 0; }
/* "Raised it" and "Lowered it" sit under "What moved the mood", so they are smaller than it. */
.rpt-infl h3 { margin: 0 0 6px; font: 600 15px/20px var(--font); font-stretch: normal; letter-spacing: 0; text-transform: none; color: var(--ink); }

/* The name is always written My Hearth, never in capitals (owner, Nov 28). */
.desk-brand, .wordmark, .pub-brand { text-transform: none !important; }

/* ---------- Highlights, one block (Nov 28) ----------
   The heading sits close over one card; milestones and highlights are rows in it, and its foot says
   whether the write-up is up to date, with Update (or Rewrite) Summary beside it. */
.highlights { display: grid; gap: 12px; }
.highlights h2 { margin: 0; }
.hl-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; overflow: hidden; }
.highlights .hl-card ol { margin: 0; padding: 0; list-style: none; background: none; border: 0; border-radius: 0; }
.hl-card li + li { border-top: 1px solid var(--hair); }
.hl-card .highlight { gap: 16px; padding: 14px 18px; }
.hl-card .highlight.has-photo { grid-template-columns: minmax(0, 1fr) 60px; align-items: center; }
.hl-card .highlight img { width: 60px; height: 60px; margin: 0; border-radius: 12px; }
.hl-card .highlight .when { display: flex; align-items: center; gap: 6px; margin: 0; }
.hl-card .highlight h3 { margin: 4px 0 2px; }
.hl-card .highlight p:not(.when) { margin: 0; font-size: 15px; line-height: 21px; }
.hl-card a.highlight:hover { padding-left: 18px; background: var(--tint); }
.hl-card a.highlight:not([href]) { cursor: default; } .hl-card a.highlight:not([href]):hover { background: none; }
.hl-card .is-milestone { padding: 14px 18px; }
.hl-card .write { margin: 0; padding: 10px 12px 10px 18px; border-top: 1px solid var(--hair);
  background: color-mix(in srgb, var(--page) 60%, var(--surface)); font-size: 13px; line-height: 18px; }
.hl-card .write p { margin: 0; color: var(--muted); }
.hl-card .write.is-outdated p { color: var(--ink); display: flex; align-items: center; gap: 8px; }
.hl-card .write.is-outdated p::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fill); flex: none; }
.write .btn-sm { min-height: 34px; padding-top: 0; padding-bottom: 0; font-size: 13px; }

/* ---------- The day's rhythm (Nov 28) ----------
   One spacing scale for the day page: 40px between sections on phones, 56px on wide screens (48px inside a
   column), 12px from a section's heading to what it heads. No section adds a margin of its own on top. */
main.day { gap: 40px; }
.day-read, .day-rail { gap: 40px; }
main.day .shape { margin: 0; }
main.day .people h2 { margin: 0 0 12px; }
main.day .people ul { margin-top: 0; }
.timeline-head { margin-bottom: 0; }
@media (min-width: 1100px) {
  main.day { gap: 56px; padding-top: 40px; }
  .day-read, .day-rail { gap: 48px; }
}
@media (min-width: 1600px) {
  .day-rail { gap: 32px; }
}

/* Bullets in the writer and in notes, the same as an entry's bullets on the day. */
.w-body ul, .rich ul, blockquote.rich ul { margin: 0 0 1em; padding-left: 1.3em; list-style: disc; }
.w-body li, .rich li, blockquote.rich li { margin: 0 0 .35em; padding-left: .1em; }
.w-body li::marker, .rich li::marker, .entry-body .prose.as-list .s::marker { color: var(--muted); }

/* ---------- The day in one column (Nov 28) ----------
   The day reads top to bottom at every width: the entry and highlights, then With and the map, then the
   photos and the record. No side rail; Shape the Write-up lives in the writer now. */
@media (min-width: 1600px) {
  main.day:has(> .day-rail) { max-width: 760px; grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
  main.day > .hero, .day-read, .day-rail, main.day > .timeline, main.day > .otd { grid-area: auto; }
  .day-rail { position: static; max-height: none; overflow: visible; padding-left: 0; border-left: 0; gap: 48px; }
  .day-rail .map-card:not(.full) #map { height: 240px; }
}

/* Small buttons: the same pills, less tall. */
.btn-sm { min-height: 32px; padding: 5px 14px; font-size: 13px; line-height: 18px; gap: 6px; }
.btn-primary.btn-sm { padding-right: 6px; }
.btn-primary.btn-sm::after, .btn-primary.btn-sm::before { width: 20px; height: 20px; }

/* Edit Entry: a real button under the entry, quieter than the page's main actions. */
.entry-hint { align-items: center; }
.entry-hint .entry-edit-btn { flex: none; min-height: 34px; padding: 6px 14px 6px 12px; background: var(--surface); border: 1px solid var(--rule);
  color: var(--ink); font-weight: 600; text-decoration: none; }
.entry-hint .entry-edit-btn:hover { border-color: var(--ink); background: var(--surface); }
.entry-hint .entry-edit-btn .i { color: var(--ink); }

/* Starting the entry: two short cards side by side, the icon beside the words. */
.start-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.start-opt { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px;
  align-items: center; align-content: center; padding: 12px 14px; border-radius: 14px; }
.start-opt .so-ico { grid-row: 1 / span 2; width: 36px; height: 36px; margin: 0; border-radius: 10px; }
.start-opt:hover:not(:disabled) { transform: none; box-shadow: none; }
@media (max-width: 599px) { .start-opts { grid-template-columns: 1fr; } }

/* Shape the Write-up, in the writer: a small button in the bar opens it as a sheet. */
.shape-dlg { width: min(460px, calc(100vw - 24px)); max-height: min(640px, calc(100dvh - 48px)); padding: 0; border: 1px solid var(--rule);
  border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 18px 50px rgb(var(--shadow) / .18); }
.shape-dlg::backdrop { background: rgb(40 37 36 / .32); }
.shape-dlg .shape { margin: 0; padding: 18px; border: 0; background: none; }
.shape-dlg .shape-head { justify-content: space-between; }
.shape-x { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--page); color: var(--ink); cursor: pointer; }
.shape-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 599px) {
  .shape-dlg { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
/* Shape sits in the pills over the headline, beside the mood: the same pill, quieter than the mood. */
.w-chip.w-shape-btn { padding: 0 14px 0 12px; color: var(--ink); font: 500 14px var(--font); cursor: pointer; }
.w-chip.w-shape-btn:hover { border-color: var(--ink); }
.w-chip.w-shape-btn:focus-visible { outline: 2px solid var(--fill); outline-offset: 2px; }

/* ---------- The tab bar: Today, Calendar, Places, People (Nov 28) ----------
   Settings left the tab bar; on phones and tablets it's your photo at the end of each page's title row. */
.topbar-me { display: inline-grid; place-items: center; flex: none; margin-left: auto; align-self: center; width: 36px; height: 36px;
  border-radius: 50%; text-decoration: none; }
.topbar-me .av { width: 32px; height: 32px; font-size: 13px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--rule); }
.topbar-me:hover .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--ink); }
.topbar-me:focus-visible { outline: 2px solid var(--fill); outline-offset: 2px; }
@media (min-width: 1100px) { body.desk .topbar-me { display: none; } }

/* ---------- Red buttons while they work, or can't be used (Nov 28) ----------
   A pressed red button stays red with white words: no grey flood, no red-on-grey. While it works
   ("Writing…") its arrow gives way to its own icon turning, in white. Disabled is the same red, fainter. */
.btn-primary:disabled, .w-publish:disabled, .btn-primary.is-busy {
  background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
.btn-primary:disabled::before, .w-publish:disabled::before { background: var(--on-fill); transform: none; }
.btn-primary:disabled::after, .w-publish:disabled::after { transform: none; }
.btn-primary:disabled:not(.is-busy), .w-publish:disabled { opacity: .55; cursor: default; }
.btn-primary.is-busy { opacity: 1; padding-right: 16px; cursor: progress; }
.btn-primary.is-busy::before, .btn-primary.is-busy::after { display: none; }
.btn-primary.is-busy .i { color: var(--on-fill); }
/* The flood on pointing only where there is a pointer: a tap on a phone mustn't leave it half-filled. */
@media (hover: none) {
  .btn-primary:hover, .w-publish:hover, .w-done:hover, .sheet-save:hover { color: var(--on-fill); background: var(--fill); }
  .btn-primary:hover::before, .w-publish:hover::before, .w-done:hover::before, .sheet-save:hover::before { transform: none; }
  .btn-primary:hover::after, .w-publish:hover::after, .w-done:hover::after, .sheet-save:hover::after { transform: none; }
}

/* ---------- A person's cards open everything they count (Nov 28) ---------- */
.ps-stats a { position: relative; display: grid; gap: 4px; padding: 14px 16px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--hair); text-decoration: none; color: var(--ink); transition: border-color .16s var(--ease); }
.ps-stats a::after { content: ""; position: absolute; top: 14px; right: 14px; width: 16px; height: 16px; background: var(--muted);
  -webkit-mask: var(--i-chevron) center / contain no-repeat; mask: var(--i-chevron) center / contain no-repeat; transform: rotate(-90deg); }
.ps-stats a:hover { border-color: var(--ink); }
.ps-stats a:focus-visible { outline: 2px solid var(--fill); outline-offset: 2px; }
.ps-st-l { font-size: 13px; color: var(--muted); }
.ps-st-v { font-size: 28px; line-height: 1; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ps-st-v.ps-word { font-size: 18px; line-height: 28px; }
.ps-all-link { display: inline-flex; align-items: center; gap: 2px; width: fit-content; margin-top: 4px; font-size: 14px; font-weight: 600;
  color: var(--link); text-decoration: none; }
.ps-all-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ps-all-head { display: grid; gap: 4px; }
.ps-all-head h2 { margin: 0; }
.ps-all-head .meta { margin: 0; font-size: 14px; line-height: 21px; }
.ps-thread .ps-thread-day { justify-self: center; max-width: none; margin: 10px 0 2px; }
.ps-thread .ps-thread-day a { font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.ps-pager { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ps-guess { margin: 0; font-size: 12px; line-height: 16px; text-align: center; max-width: 16ch; }

/* ---------- Voice and Video Note: one line of controls, and a voice note to listen back to (Nov 28) ---------- */
.vn-play { display: grid; gap: 8px; }
.vn-take { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 6px 6px 12px;
  border: 1px solid var(--rule); border-radius: 14px; background: var(--page); }
.vn-take span { font: 600 13px var(--font); color: var(--muted); white-space: nowrap; }
.vn-take audio { width: 100%; height: 36px; }
@media (max-width: 699px) {
  .cap-bar { flex-wrap: nowrap; gap: 8px; padding: 6px; }
  .cap-wave { order: 0; flex: 1 1 24px; min-width: 0; }
  .cap-rec { padding: 0 12px; gap: 6px; }
  .cap-btn { padding: 0 11px; }
  .cap-time { font-size: 14px; gap: 5px; }
  .cap-save { padding-left: 14px; }
}
@media (max-width: 380px) {
  .cap-save.btn-primary { padding-right: 14px; } .cap-save.btn-primary::before, .cap-save.btn-primary::after { display: none; }
}
/* The sheet is as wide as the screen: its rows shrink to fit, never push it wider. */
.cap-form { grid-template-columns: minmax(0, 1fr); }
.cap-form > * { min-width: 0; }
.cap-bar > * { flex-shrink: 0; } .cap-bar > .cap-wave, .cap-bar > .cap-gap { flex-shrink: 1; min-width: 0; }

/* A text's photos and videos in a person's message lists (Nov 28). */
.ps-atts { display: flex; flex-wrap: wrap; gap: 4px; }
.ps-thread li.mine .ps-atts { justify-content: flex-end; }
.ps-atts a { display: block; width: 168px; max-width: 100%; border-radius: 16px; overflow: hidden; background: var(--hair); }
.ps-atts img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.ps-atts video { width: 220px; max-width: 100%; border-radius: 16px; background: var(--night); }
.ps-atts audio { width: 240px; max-width: 100%; height: 40px; }
.ps-att-missing { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 16px; border: 1px dashed var(--rule);
  font-size: 13px; color: var(--muted); }

/* ---------- The day's entry reads the same where you edit it as where you read it ----------
   One voice per entry: the journal's face when Claude wrote it, your serif when you did. The editor
   (.writer[data-entry]) takes the day page's sizes, so nothing shifts between the two screens. */
.writer[data-entry] .w-title { font-size: 34px; line-height: 1.08; letter-spacing: -.01em; }
.writer[data-entry] .w-body { font: 400 16px/27px var(--font); letter-spacing: normal; }
.writer[data-entry][data-by="you"] .w-body { font-family: var(--hand); font-size: 17px; }
.writer[data-entry] .w-body h3 { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.08; margin-top: 28px; }
.writer[data-entry] .w-body h4 { font: 700 18px/1.3 var(--font); letter-spacing: -.01em; margin-top: 22px; }
.entry-body .prose.is-h3 { font-size: 26px; }
.entry-body .prose.is-h4 { font-size: 18px; }
.entry-doc.by-you .prose { font-family: var(--hand); font-size: 17px; }
.entry-doc.by-you .prose.is-h3 { font-family: var(--display); font-size: 26px; } .entry-doc.by-you .prose.is-h4 { font-family: var(--font); font-size: 18px; }
/* A sentence you wrote or changed inside Claude's entry keeps the entry's face and carries no mark of its own
   (a dotted line under it read as a stray highlight); tapping it says "Your words". */
.entry-doc:not(.by-you) .s.yours, .entry-doc:not(.by-you) .s.edited { font-family: inherit; font-size: inherit; text-decoration: none; }
@media (min-width: 1100px) {
  .writer[data-entry] .w-title { font-size: 46px; line-height: 1.05; }
  .writer[data-entry] .w-body { font-size: 18px; line-height: 31px; }
  .writer[data-entry][data-by="you"] .w-body, .entry-doc.by-you .prose { font-size: 19px; }
  .writer[data-entry] .w-body h3, .entry-body .prose.is-h3, .entry-doc.by-you .prose.is-h3 { font-size: 30px; }
  .writer[data-entry] .w-body h4, .entry-body .prose.is-h4, .entry-doc.by-you .prose.is-h4 { font-size: 20px; }
}

/* ---------- The day's bar, white again; the face above the + opens it on phones (Nov 28) ---------- */
.daybar { background: var(--surface); border-color: var(--rule); color: var(--ink); box-shadow: 0 10px 30px rgb(var(--shadow) / .16), 0 1px 3px rgb(var(--shadow) / .08); }
.daybar .db-q { color: var(--ink); }
.daybar .db-q .meta { color: var(--muted); }
.daybar .faces button:hover { background: color-mix(in srgb, var(--mc) 14%, transparent); }
.daybar .db-sep { background: var(--rule); }
.daybar .db-pill { background: var(--surface); border-color: var(--rule); color: var(--ink); }
.daybar .db-pill:hover { background: var(--hair); }
.daybar .db-ghost { color: var(--muted); }
.daybar .db-sug { color: var(--ink); }
.daybar .db-chips .feel span { border-color: var(--rule); color: var(--ink); }
.daybar .db-chips .feel span:hover { background: var(--hair); }
.daybar .db-add { border-color: var(--rule); }
.daybar .db-add:focus-within { border-color: var(--ink); }
.daybar .db-add input { color: var(--ink); }
.daybar .db-add input::placeholder { color: var(--muted); }
.daybar .db-add-btn, .daybar .db-x { color: var(--muted); }
.daybar .db-add-btn:hover, .daybar .db-x:hover { color: var(--ink); background: var(--hair); }
.db-done { background: var(--hair); color: var(--ink); }
.db-done:hover { background: var(--rule); }
.db-min-mood { color: var(--ink); }
.db-min-mood:hover { background: var(--hair); }
.db-min-tags { color: var(--muted); }



/* ---------- Phones: the + and the mood bar move the way the tab bar does (Nov 28) ----------
   One motion for all three bars: a pill whose free edge slides (left or right) with the bounce curve while
   its buttons grow from nothing or shrink to nothing, so whatever stays slides into place. Icons only, as
   in the tab bar; the words stay for screen readers. */
.db-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--muted); cursor: pointer; transition: background .16s var(--ease); }
.db-icon:hover { background: var(--hair); color: var(--ink); }
.db-cap { display: none; }
@media (max-width: 1099px) {
  /* + opens leftwards into a bar of icons; the tab bar folds into its circle to make room (create.js). */
  .create-menu, .create-menu.from-fab, .create-menu.is-closed { display: flex; align-items: center; gap: 0; position: fixed; z-index: 1101;
    top: auto; left: 80px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto; min-width: 0; height: 58px;
    padding: 5px 66px 5px 5px; border: 1px solid var(--rule); border-radius: var(--pill); background: var(--surface);
    box-shadow: 0 10px 30px rgb(var(--shadow) / .16); overflow: hidden; transition: left .55s var(--bounce), visibility 0s; }
  .create-menu.is-closed { left: calc(100% - 12px - 58px); visibility: hidden; pointer-events: none; transition: left .55s var(--bounce), visibility 0s .55s; }
  .create-menu [role=menuitem] { flex: 1 1 0; min-width: 0; justify-content: center; gap: 0; padding: 0; min-height: 46px; border-radius: var(--pill);
    overflow: hidden; transition: flex-grow .55s var(--bounce), opacity .25s var(--ease), background .16s var(--ease); }
  .create-menu [role=menuitem] .i { color: var(--ink); width: 24px; height: 24px; }
  .create-menu.is-closed [role=menuitem] { flex-grow: 0; opacity: 0; }
  .create-menu [role=menuitem] span:not(.i) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; flex: none; }
  .create-menu hr, .create-menu kbd { display: none; }
  .fab { z-index: 1102; }

  /* The mood bar: over the + row, the screen's width, until it folds into the circle above + (daybar.js). */
  .daybar, body.tabs-min .daybar { display: flex; align-items: center; position: fixed; left: 12px; right: 12px; width: auto; max-width: none;
    height: 58px; bottom: calc(76px + env(safe-area-inset-bottom)); margin: 0; padding: 5px; transform: none; z-index: 1101; animation: none;
    border-radius: var(--pill); transition: left .55s var(--bounce); will-change: left; }
  .daybar > .db-pane { flex: 1 1 0; min-width: 0; overflow: hidden; justify-content: center;
    transition: flex-grow .55s var(--bounce), opacity .25s var(--ease); }
  .daybar[data-view=min] .db-min { display: none; }
  .daybar .db-mood .db-q { display: block; padding: 0 6px 0 8px; font-size: 14px; }
  .daybar .faces { gap: 0; }
  .db-cap { display: grid; place-items: center; flex: 0 0 0; width: 0; height: 46px; padding: 0; overflow: hidden; border: 0; border-radius: 50%;
    background: none; color: var(--mc, var(--muted)); opacity: 0; cursor: pointer;
    transition: flex-basis .22s var(--ease), width .22s var(--ease), opacity .25s var(--ease); }   /* quick to full size: a slow, bouncing width showed the face squeezed */
  .db-cap .i { width: 30px; height: 30px; flex: none; }
  .db-cap.f1 { --mc: var(--m1); } .db-cap.f2 { --mc: var(--m2); } .db-cap.f3 { --mc: var(--m3); } .db-cap.f4 { --mc: var(--m4); } .db-cap.f5 { --mc: var(--m5); }
  .db-cap.unpicked { box-shadow: inset 0 0 0 1.5px var(--mc, var(--rule)); }
  .db-cap.unpicked:not(.f1):not(.f2):not(.f3):not(.f4):not(.f5) { box-shadow: inset 0 0 0 1.5px var(--rule); }
  body.mood-min .daybar { left: calc(100% - 12px - 58px); cursor: pointer; }
  body.mood-min .daybar > .db-pane { flex-grow: 0; opacity: 0; pointer-events: none; }
  body.mood-min .db-cap { flex-basis: 46px; width: 46px; opacity: 1; }
  body.has-tabs main.day { padding-bottom: 150px; }
}
@media (max-width: 1099px) and (prefers-reduced-motion: reduce) {
  .create-menu, .create-menu [role=menuitem], .daybar, .daybar > .db-pane, .db-cap { transition: none !important; }
}

/* ---------- Phones: every bar is the tab bar (Nov 28) ----------
   The + bar and the mood bar take the tab bar's exact make: a 58px white pill with a 5px inset, 46px
   buttons in muted ink, 26px icons, the kept one filled; and all of them, with +, sit on one soft drop
   shadow for a little depth. */
@media (max-width: 1099px) {
  .tabs, .create-menu, .create-menu.from-fab, .daybar, body.tabs-min .daybar {
    height: 58px; padding: 5px; border: 1px solid var(--rule); border-radius: var(--pill); background: var(--surface);
    box-shadow: 0 1px 2px rgb(var(--shadow) / .10), 0 6px 16px rgb(var(--shadow) / .14); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .fab { box-shadow: 0 1px 2px rgb(var(--shadow) / .14), 0 6px 16px rgb(var(--shadow) / .18); }
  .create-menu, .create-menu.from-fab, .create-menu.is-closed { padding-right: 66px; }
  .create-menu [role=menuitem], .daybar .faces button, .daybar .db-icon, .daybar .db-face, .daybar .db-done, .db-cap {
    min-height: 46px; height: 46px; border-radius: var(--pill); color: var(--muted); }
  .create-menu [role=menuitem] .i, .daybar .db-icon .i, .db-cap .i, .daybar .faces button .i { width: 26px; height: 26px; }
  .create-menu [role=menuitem] .i { color: inherit; }
  .create-menu [role=menuitem]:hover, .create-menu [role=menuitem]:focus-visible { background: none; color: var(--ink); }
  .create-menu [role=menuitem]:active .i, .daybar .faces button:active .i { transform: scale(.85); }

  /* The mood bar, open: "Today's mood:", then the five faces sharing the rest like tabs, then Tags. */
  .daybar .db-mood { justify-content: flex-start; gap: 0; }
  .daybar .db-mood .db-q { flex: none; padding: 0 4px 0 12px; font: 600 14px var(--font); color: var(--ink); }
  .daybar .faces { flex: 1 1 auto; min-width: 0; display: flex; gap: 0; }
  .daybar .faces button { flex: 1 1 0; min-width: 0; width: auto; padding: 0; border: 0; color: var(--mc); }
  .daybar .faces button:focus:not(:focus-visible) { outline: none; }
  .daybar .faces button.sel { background: var(--mc); color: #fff; }
  .daybar .faces button.f3.sel { color: var(--hearth-charcoal); }
  .daybar .faces button.sug { border: 0; box-shadow: inset 0 0 0 1.5px var(--mc); }
  .daybar .db-icon { width: 46px; flex: none; }
  .daybar .db-face { width: 46px; }
  .daybar .db-done { width: 46px; flex: none; }
  /* Never an empty bar: open on its folded step, it shows the faces. */
  .daybar[data-view=min] .db-mood { display: flex; }

  /* Folded, the one that stays is filled, as the tab bar's is: the day's face in its colour. */
  .db-cap { background: var(--mc, var(--hair)); color: #fff; }
  .db-cap.f3 { color: var(--hearth-charcoal); }
  .db-cap.unpicked { background: var(--hair); color: var(--mc, var(--muted)); box-shadow: inset 0 0 0 1.5px var(--mc, var(--rule)); }
}

/* ---------- Phones: + is the tab bar folded the other way (Nov 28) ----------
   The + menu is always there as a white 58px pill; closed, it is just the white ring round the red +
   (a 46px button, like the tab bar's kept one). Opening slides its free left edge out with the tab bar's
   own spring (.55s, var(--bounce)) while the icons grow in; closing runs it back. */
@media (max-width: 1099px) {
  .create-menu.is-closed { visibility: visible; pointer-events: none; transition: left .55s var(--bounce); }
  .create-menu [role=menuitem] { visibility: visible; transition: flex-grow .55s var(--bounce), opacity .22s var(--ease) .2s, background .16s var(--ease), visibility 0s; }   /* icons come in once there's room */
  .create-menu.is-closed [role=menuitem] { visibility: hidden; transition: flex-grow .55s var(--bounce), opacity .12s var(--ease), visibility 0s .55s; }
  .create-menu, .create-menu.from-fab, .create-menu.is-closed { padding-right: 51px; }
  .fab, body.places-page .fab { right: 18px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 46px; height: 46px; min-height: 0;
    box-shadow: none; z-index: 1102; }
  .fab .i { width: 26px; height: 26px; }
  body.places-page.sheet-open .create-menu, body.places-page.card-open .create-menu { display: none; }
}
@media (max-width: 1099px) and (prefers-reduced-motion: reduce) { .create-menu.is-closed, .create-menu [role=menuitem] { transition: none !important; } }

/* ---------- Milestone: a chip at the head of the places row, with its checkbox (Nov 28) ---------- */

/* ---------- Phones: sheets dock on the + bar, above the keyboard (Nov 28) ----------
   Note, Voice and Video sit just above the + bar, which stays open with the one in use filled. --kb is how
   much of the screen the keyboard covers (create.js reads the visual viewport), so the bar and the sheet
   ride on top of it. Text wants the keyboard at once; voice and video don't raise it. */
.dock-scrim { display: none; }
@media (max-width: 1099px) {
  .tabs, .create-menu, .create-menu.from-fab, .create-menu.is-closed {
    bottom: max(calc(10px + env(safe-area-inset-bottom)), calc(10px + var(--kb, 0px))); }
  .fab, body.places-page .fab { bottom: max(calc(16px + env(safe-area-inset-bottom)), calc(16px + var(--kb, 0px))); }
  .create-menu [role=menuitem].on { background: var(--fill); color: var(--on-fill); opacity: 1; }
  .dock-scrim { display: block; position: fixed; inset: 0; z-index: 1098; background: rgb(var(--shadow) / .32); opacity: 0; pointer-events: none;
    transition: opacity .2s var(--ease); touch-action: none; }
  body.sheet-up .dock-scrim { opacity: 1; pointer-events: auto; }
  body.sheet-up .daybar { visibility: hidden; }

  .qn-dlg.docked, .cap-dlg.docked { position: fixed; z-index: 1099; inset: auto 8px auto 8px; margin: 0; width: auto; max-width: none;
    bottom: max(calc(76px + env(safe-area-inset-bottom)), calc(76px + var(--kb, 0px)));
    max-height: calc(var(--vvh, 100dvh) - 76px - 16px); overflow: auto; overscroll-behavior: contain;
    padding: 0; border-radius: 24px; border: 1px solid var(--rule); background: var(--surface);
    box-shadow: 0 1px 2px rgb(var(--shadow) / .10), 0 10px 28px rgb(var(--shadow) / .18); animation: dock-up .32s var(--spring) both; }
  .docked .qn-head .help-x { display: none; }   /* the × on the bar closes it */
  .docked .qn-head { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; align-items: baseline; }
  .docked .qn-head h2 { flex: none; }
  .docked .qn-head .meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  body.kb-up .qn-dlg.docked .qn-text { min-height: 64px; max-height: 22vh; }
  body.kb-up .docked .qn-form { gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .cap-dlg.docked .vd-stage { justify-self: center; }

  /* Note: Add Note at the top right, the words under it, then one row of Milestone and places. */
  .qn-dlg.docked .qn-form { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; }
  .qn-dlg.docked .qn-head { grid-row: 1; grid-column: 1; min-width: 0; }
  .qn-dlg.docked .qn-head h2 { font-size: 19px; }
  .qn-dlg.docked .qn-foot { grid-row: 1; grid-column: 2; gap: 6px; }
  .qn-dlg.docked .qn-gap { display: none; }
  .qn-dlg.docked .qn-mic { width: 38px; height: 38px; }
  .qn-dlg.docked .qn-save { height: 38px; padding: 0 16px; border-radius: var(--pill); }
  .qn-dlg.docked .qn-text, .qn-dlg.docked .qn-partial, .qn-dlg.docked .qn-places, .qn-dlg.docked .qn-pick { grid-column: 1 / -1; }
  .qn-dlg.docked .qn-mic { display: none; }   /* on phones the Quick Note is typed; Voice Note, on the same bar, is for talking */
  .qn-dlg.docked .qn-pick .ci-list { max-height: 34vh; }
  body.kb-up .qn-dlg.docked .qn-pick .ci-list { max-height: 22vh; }
  .qn-dlg.docked .qn-text { min-height: 88px; max-height: 34vh; resize: none; font-size: 17px; }
  .docked .qn-places { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 0 -16px; padding: 2px 12px 2px 16px; scrollbar-width: none; }
  .docked .qn-places::-webkit-scrollbar { display: none; }
  .docked .qn-chip { flex: none; height: 36px; }
  .docked .qn-place-in { flex: 0 0 150px; height: 36px; font-size: 16px; }   /* 16px: Safari doesn't zoom in on it */

  /* Voice and video: a little tighter, the recorder bar at the foot. */
  .cap-dlg.docked .cap-form { gap: 10px; padding: 12px 12px 12px 16px; }
  .cap-dlg.docked .qn-head h2 { font-size: 19px; }
  .cap-dlg.docked .vn-text { min-height: 120px; max-height: 30vh; font-size: 17px; }
  .cap-dlg.docked .vd-stage { max-height: 40vh; }
  .cap-dlg.docked .vd-caption { font-size: 16px; }
}
@keyframes dock-up { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@media (max-width: 1099px) and (prefers-reduced-motion: reduce) { .qn-dlg.docked, .cap-dlg.docked { animation: none; } }

/* ---------- Just saved: the new note or recording glows a moment where it landed (Nov 28) ---------- */
.landed { animation: landed 2.6s var(--ease) both; border-radius: 14px; }
@keyframes landed { 0%, 30% { box-shadow: 0 0 0 3px var(--fill), 0 0 0 9px var(--tint); background-color: var(--tint); }
                    100% { box-shadow: 0 0 0 0 transparent; background-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .landed { animation-duration: .01s; } }

/* ---------- Phones: the video sheet is as big as the screen allows ----------
   It runs from the top of the screen down to the + bar, and the camera takes every bit of it the header
   and the recorder bar don't, filling edge to edge (the stream is asked for upright, so little is cropped). */
@media (max-width: 1099px) {
  .vd-dlg.docked { top: calc(env(safe-area-inset-top) + 8px); height: auto; max-height: none; overflow: hidden; }
  .vd-dlg.docked .cap-form { display: flex; flex-direction: column; height: 100%; gap: 8px; padding: 10px 8px 8px; }
  .vd-dlg.docked .qn-head { flex: none; padding: 0 8px; }
  .vd-dlg.docked .vd-stage { flex: 1 1 auto; min-height: 0; width: 100%; max-height: none; aspect-ratio: auto; border-radius: 16px; justify-self: stretch; }
  .vd-dlg.docked .vd-review { object-fit: contain; background: #000; }
  .vd-dlg.docked .vd-caption, .vd-dlg.docked .vd-after, .vd-dlg.docked .cap-bar, .vd-dlg.docked .cap-msg { flex: none; }
}
@media (max-width: 1099px) {
  .docked .qn-head { padding-top: 2px; padding-bottom: 1px; }
  .docked .qn-head h2 { line-height: 1.25; }
}

/* ---------- Check In (Nov 28): the places around you, one tap to check in ---------- */
.ci-find { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--rule); border-radius: var(--pill);
  background: var(--page); color: var(--muted); }
.ci-find:focus-within { border-color: var(--fill); box-shadow: 0 0 0 3px var(--tint); }
.ci-q { flex: 1; min-width: 0; border: 0; background: none; outline: 0; padding: 0; font: 400 16px var(--font); color: var(--ink); }
.ci-q::-webkit-search-cancel-button { display: none; }
.ci-status { margin: 0; font-size: 13px; color: var(--muted); } .ci-status:empty { display: none; }
.ci-list { list-style: none; margin: 0 -6px; padding: 0; max-height: min(52vh, 420px); overflow-y: auto; overscroll-behavior: contain; outline: none; }
.ci-place { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 8px; border: 0; border-radius: 14px;
  background: none; color: var(--ink); text-align: left; cursor: pointer; transition: background .16s var(--ease), transform .2s var(--spring); }
.ci-place:hover, .ci-place:focus-visible { background: var(--hair); outline: none; }
.ci-place:active { transform: scale(.98); background: var(--tint); }
.ci-place:disabled { opacity: .55; cursor: default; }
.ci-ico { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--tint); color: var(--fill); }
.ci-ico .i { width: 20px; height: 20px; }
.ci-place.yours .ci-ico { background: var(--blush, var(--tint)); }
.ci-place.typed .ci-ico { background: var(--hair); color: var(--ink); }
.ci-txt { display: grid; gap: 1px; flex: 1; min-width: 0; }
.ci-txt strong { font: 600 15px/1.3 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-txt span { font-size: 13px; line-height: 1.3; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-m { flex: none; font: 500 12px var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.ci-wait { height: 56px; margin: 0 8px; border-radius: 14px; background: linear-gradient(90deg, var(--hair), var(--page), var(--hair));
  background-size: 200% 100%; animation: ci-shim 1.2s linear infinite; }
.ci-wait + .ci-wait { margin-top: 6px; }
@keyframes ci-shim { to { background-position: -200% 0; } }
.ci-words { height: 40px; padding: 0 14px; border: 1px solid var(--rule); border-radius: var(--pill); background: var(--page);
  font: 400 16px var(--font); color: var(--ink); }
.ci-words:focus { outline: none; border-color: var(--fill); box-shadow: 0 0 0 3px var(--tint); }
@media (max-width: 1099px) {
  .ci-dlg.docked .qn-form > :not(.qn-head) { grid-column: 1 / -1; }
  .ci-dlg.docked .ci-list { max-height: 44vh; }
  body.kb-up .ci-dlg.docked .ci-list { max-height: 26vh; }
}
@media (prefers-reduced-motion: reduce) { .ci-wait { animation: none; } }

/* The check-in on the day: the place and what's known about it. */
.card.checkin .kind span:not(.i) { margin-left: 2px; }
.ci-name { margin: 4px 0 2px; font: 800 22px/1.15 var(--display); color: var(--ink); }
.ci-about, .ci-hours { margin: 0; font-size: 14px; color: var(--muted); }
.ci-hours { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.card.checkin .body { margin: 10px 0 0; }
.ci-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.ci-links:empty { display: none; }
.ci-links a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--pill);
  font: 500 13px var(--font); color: var(--ink); text-decoration: none; }
.ci-links a:hover { background: var(--hair); }
.ci-near { margin: 10px 0 0; font-size: 13px; }
.note-place { margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--hair); }
.note-place .ci-about strong { color: var(--ink); font-weight: 600; }
.note-place .ci-links { margin-top: 8px; }
/* Folded, the mood bar is icons only, as the tab bar is: the face and its tags; the word is for screen readers. */
.db-min-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Landing on a saved item: keep it clear of the sticky date header and of the bars at the foot. */
.timeline .row, .hl-ms { scroll-margin-top: 170px; scroll-margin-bottom: 150px; }

/* ---------- Primary buttons: the arrow sits in its white dot, always (Nov 28) ----------
   The dot was pinned 8px from the right while the arrow followed the text, so any button with other
   padding (Add Note in the docked sheet, Save, Publish) had the arrow off its dot. Now both are pinned to
   the same spot and every primary button keeps room for them. */
.btn-primary, .w-publish, .w-done, .sheet-save { padding-right: 38px; }
.btn-primary::after, .w-publish::after, .w-done::after, .sheet-save::after { position: absolute; right: 8px; top: 50%; margin: -11px 0 0; }
.w-publish, .w-done { padding-left: 16px; }
.btn-primary.btn-sm { padding-right: 32px; }
.btn-primary.btn-sm::after, .btn-primary.btn-sm::before { right: 6px; margin-top: -10px; }
.btn-primary.is-busy { padding-right: 16px; }
@media (max-width: 1099px) { .qn-dlg.docked .qn-save { padding: 0 38px 0 16px; } }
@media (max-width: 380px) { .cap-save.btn-primary { padding-right: 14px; } }

/* The video stage is black behind a picture shown whole (capture.js picks cover or contain). */
.vd-stage { background: #000; }
@media (max-width: 1099px) { .vd-dlg.docked .vd-review { object-fit: contain; } }

/* The entry writer keeps the phone's bars (base.html `tools`); on wide screens it stays a full page. */
@media (min-width: 1100px) { body.phone-tools .tabs, body.phone-tools .fab, body.phone-tools .create-menu, body.phone-tools .dock-scrim { display: none; } }

/* A page that is none of the tabs (the entry writer) folds the tab bar to a plain circle: nothing lit. */
@media (max-width: 1099px) { body.tabs-min .tabs a.keep:not([aria-current]) { background: none; color: var(--muted); } }
/* Set the entry writer's opening state in place, with no slide (create.js). */
body.dock-instant .tabs, body.dock-instant .tabs a, body.dock-instant .create-menu, body.dock-instant .create-menu [role=menuitem] { transition: none !important; }

/* ---------- The picked sentence: one clean highlight, on that sentence only ----------
   A tint with soft ends on every line it wraps to, and nothing else. No underline (a shadow under a
   wrapped sentence broke at each line), and no hover or focus tint on touch screens, where it stuck to
   the last sentence touched and looked like a second highlight in the wrong place. */
.entry-doc .s { border-radius: 4px; padding: 1px 0; -webkit-tap-highlight-color: transparent; }
.entry-doc .s:hover, .entry-doc .s:focus-visible { background: none; }
.entry-doc .s:focus-visible { outline: 2px solid var(--fill); outline-offset: 1px; }
@media (hover: hover) { .entry-doc .s:hover { background: var(--tint); } }
.entry-doc .s.picked, .entry-doc .s.picked:hover { background: var(--blush); box-shadow: none; outline: none; }

/* ---------- Legibility (contrast audit, 2026-11-28) ----------
   The picked day in the Days list sits on Linen, where Taupe is 3.9:1; its small words take the body colour. */
.desk-days li a[aria-current] .dd-wd, .desk-days li a[aria-current] .dd-mo, .desk-days li a[aria-current] .dd-snip { color: var(--body); }

/* ---------- Quick Note: photos with the note (Nov 28) ---------- */
.qn-shots { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.qn-shots[hidden] { display: none; }
.qn-shot { position: relative; flex: none; width: 72px; height: 72px; margin: 0; border-radius: 12px; overflow: hidden; background: var(--hair); }
.qn-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qn-shot.busy img { opacity: .45; }
.qn-shot.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--surface); border-top-color: transparent; animation: spin .8s linear infinite; }
.qn-shot button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: rgb(var(--shadow) / .6); color: #fff; font: 600 15px/24px var(--font); cursor: pointer; }
.qn-photo { cursor: pointer; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1099px) { .qn-dlg.docked .qn-shots { grid-column: 1 / -1; } }

/* ---------- Phones: Note, Voice and Video as pages of their own (/new/<kind>, Nov 28) ----------
   The sheet fills the screen from the top down to the bars; no dimmed page behind it, since the page is
   the sheet. The tab bar and + bar work as on any page. */
.cap-page { min-height: 40vh; }
@media (max-width: 1099px) {
  body.as-page .dock-scrim { display: none; }
  body.as-page .qn-dlg.docked, body.as-page .cap-dlg.docked {
    top: calc(env(safe-area-inset-top) + 8px); height: auto; max-height: none; animation: none; box-shadow: none; }
  body.as-page.kb-up .qn-dlg.docked, body.as-page.kb-up .cap-dlg.docked { top: 8px; }
  body.as-page .qn-dlg.docked .qn-form { align-content: start; }
  body.as-page .qn-dlg.docked .qn-text { min-height: 30vh; max-height: none; }
  body.as-page.kb-up .qn-dlg.docked .qn-text { min-height: 64px; }
  body.capture-page { background: var(--page); }
}
/* Mood weather (static/moodfx.js): one canvas over the whole screen for about three seconds after a face
   is picked. It dims the page and plays points of light over it. It takes no touches. */
.moodfx { display: contents; }
.mfx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1500; pointer-events: none; }

/* ---------- Turning the page (swipe.js, 2026-11-28) ----------
   The page you turn to comes in beside this one and the week strip's marker slides to its day. A page
   that was turned to does not rise in: it slides in from its side, or (already shown by the swipe)
   just takes its place. */
.turn-pane > *, .turn-pane .wk { animation: none !important; }
.week { position: relative; isolation: isolate; }
.wk-pill { position: absolute; z-index: -1; border-radius: 16px; background: var(--hearth-linen); pointer-events: none; will-change: transform; }
.week.turning .wk.sel, .week.turning .wk.sel:hover { background: none; }
html[data-turn] main.day > *, html[data-turn] .day-read > *, html[data-turn] .week .wk, html[data-turn] .month .mc { animation: none !important; }
html[data-turn] .daybar, html[data-turn] .daybar * { animation: none !important; }
@keyframes turn-next { from { transform: translate3d(calc(100vw + 16px), 0, 0); } }
@keyframes turn-prev { from { transform: translate3d(calc(-100vw - 16px), 0, 0); } }
html[data-turn=next] [data-swipe-content] { animation: turn-next .3s cubic-bezier(.2, .8, .2, 1) both; }
html[data-turn=prev] [data-swipe-content] { animation: turn-prev .3s cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { html[data-turn] [data-swipe-content] { animation: none !important; } }

/* ---------- Phones: the mood bar rides with the other two bars (owner, 2026-11-28) ----------
   The tab bar and + sit on --kb (how much of the screen the keyboard or Safari's toolbar covers), and the
   mood bar did not, so while the page was pulled or the toolbar moved, + slid over the mood button. It
   now takes the same measure, always one row above them. And the picked face on its colour is white
   (Charcoal on Okay's yellow), not the bars' muted grey. */
@media (max-width: 1099px) {
  .daybar, body.tabs-min .daybar { bottom: max(calc(76px + env(safe-area-inset-bottom)), calc(76px + var(--kb, 0px))); }
  .daybar .db-face { color: #fff; }
  .daybar .db-face.f3 { color: var(--hearth-charcoal); }
}

/* ---------- Phones: the round button is the Quick Note pencil (owner, 2026-11-28) ----------
   It works as a tab does: folded, it is the bar's kept item (the pencil, filled) and the first tap opens
   the bar; open, the bar holds four, as the tab bar does (Entry, Voice, Video, and the pencil for a Quick
   Note). No + and no ×: a sheet closes with its own ×, and the bar folds when you tap away or scroll. */
.fab .fab-note { display: none; }
@media (max-width: 1099px) {
  .fab .fab-plus { display: none; }
  .fab .fab-note { display: block; }
  .fab[aria-expanded=true] .i { transform: none; }
  .create-menu [role=menuitem][data-kind=note] { display: none; }
  .fab.off { background: none; color: var(--muted); }
  .docked .qn-head .help-x { display: grid; flex: none; }
}

/* ---------- Phones: the pencil is one of the bar's four, the same size and shape (owner, 2026-11-28) ----------
   Open, the bar's inside is the screen less 104px (80 left, 12 right, and 5 of padding and 1 of border each side). The pencil
   takes a quarter of it, as each of the other three does, with the same 46px pill for its fill. Folded
   it is the 46px circle again. Its width moves on the bar's own spring. */
@media (max-width: 1099px) {
  .fab { transition: width .55s var(--bounce), right .55s var(--bounce), background .16s var(--ease), color .16s var(--ease); }
  body.plus-open .fab, body.plus-open.places-page .fab { width: calc((100vw - 104px) / 4); right: 18px; border-radius: var(--pill); }
  body.plus-open .create-menu, body.plus-open .create-menu.from-fab { padding-right: calc((100vw - 104px) / 4 + 5px); }
}
@media (max-width: 1099px) and (prefers-reduced-motion: reduce) { .fab { transition: none; } }
