body { font-family: 'Geist', sans-serif; -webkit-font-smoothing: antialiased; }

/* ---------- Light / dark theme ----------
   --c-*  : theme colours as "R G B" (used by the Tailwind colour names in index.html, e.g. bg-surface-subtle)
   --hx-* : the same palette for the hand-written styles in this file */
:root {
  --c-secondary: 0 80 204; --c-error: 186 26 26; --c-error-container: 255 218 214;
  --c-surface-canvas: 255 255 255; --c-surface-card: 255 255 255; --c-surface-subtle: 248 250 252; --c-surface-container-highest: 211 228 254;
  --c-border-subtle: 226 232 240; --c-border-strong: 203 213 225;
  --c-text-primary: 15 23 42; --c-text-secondary: 71 85 105; --c-text-muted: 148 163 184;
  --c-accent-emerald: 16 185 129; --c-accent-emerald-subtle: 236 253 245; --c-accent-blue: 0 102 255; --c-accent-blue-hover: 0 82 204;
  --hx-bg: #FFFFFF; --hx-ink: #0F172A; --hx-ink2: #475569; --hx-ink3: #64748B; --hx-muted: #94A3B8;
  --hx-line2: #CBD5E1; --hx-line: #E2E8F0; --hx-fill: #F1F5F9; --hx-fill2: #F8FAFC; --hx-bluefill: #EFF6FF; --hx-blue: #0066FF; --hx-pop: #FFFFFF; --hx-mark: #FEF3C7; --hx-amberfill: #FEF3C7;
}
/* Dark palette = Google Calendar's dark theme: #202124 page, #E8EAED / #BDC1C6 / #9AA0A6 text,
   #3C4043 / #5F6368 lines, #8AB4F8 blue, #81C995 green, #F28B82 red, #FDD663 yellow, #394457 selected. */
html.dark {
  color-scheme: dark;   /* native date pickers, dropdowns and scrollbars go dark too */
  --c-secondary: 174 203 250; --c-error: 242 139 130; --c-error-container: 92 43 41;
  --c-surface-canvas: 32 33 36; --c-surface-card: 32 33 36; --c-surface-subtle: 45 46 49; --c-surface-container-highest: 57 68 87;
  --c-border-subtle: 60 64 67; --c-border-strong: 95 99 104;
  --c-text-primary: 232 234 237; --c-text-secondary: 189 193 198; --c-text-muted: 154 160 166;
  --c-accent-emerald: 129 201 149; --c-accent-emerald-subtle: 30 58 43; --c-accent-blue: 138 180 248; --c-accent-blue-hover: 174 203 250;
  --hx-bg: #202124; --hx-ink: #E8EAED; --hx-ink2: #BDC1C6; --hx-ink3: #9AA0A6; --hx-muted: #80868B;
  --hx-line2: #5F6368; --hx-line: #3C4043; --hx-fill: #35363A; --hx-fill2: #2D2E31; --hx-bluefill: #394457; --hx-blue: #8AB4F8; --hx-pop: #292A2D;
  --hx-mark: rgb(253 214 99 / .32);   /* search matches: Google's dark-theme yellow */
  --hx-amberfill: #3D3524;
}
/* Fixed Tailwind colours used in the markup, re-coloured for dark mode. */
html.dark .bg-white, html.dark .focus\:bg-white:focus, html.dark .focus-within\:bg-white:focus-within { background-color: #202124; }   /* = page colour, like white on white in light mode */
/* Raised things stay raised, as in light mode: the selected option in a switch stands out from its track
   (Google's selected-chip colour), and menus / popups / dialogs sit a step above the page. */
html.dark button.bg-white.shadow-sm { background-color: #394457; }
html.dark :is(.bg-white.shadow-lg, .bg-white.shadow-xl, .bg-white.shadow-2xl) { background-color: #292A2D; }
html.dark .bg-white\/95 { background-color: rgb(32 33 36 / .95); }
html.dark .hover\:bg-white:hover, html.dark .hover\:bg-white\/60:hover, html.dark .hover\:bg-white\/70:hover { background-color: #3C4043; }
html.dark .bg-slate-100 { background-color: #303134; }
html.dark .bg-slate-200 { background-color: #3C4043; }
html.dark .bg-slate-300 { background-color: #5F6368; }
html.dark .bg-slate-400 { background-color: #80868B; }
html.dark .text-slate-600 { color: #BDC1C6; }
html.dark .ring-white { --tw-ring-color: #202124; }
html.dark .border-white { border-color: #202124; }
html.dark .bg-red-50, html.dark .hover\:bg-red-50:hover { background-color: #45302F; }
html.dark .bg-red-50\/40 { background-color: rgb(69 48 47 / .5); }
html.dark .border-red-100 { border-color: #6B3A37; }
html.dark .bg-amber-50 { background-color: #3D3524; }
html.dark .border-amber-200 { border-color: #6B5A2E; }
html.dark .text-amber-600, html.dark .text-amber-500, html.dark .hover\:text-amber-500:hover { color: #FDD663; }
html.dark .text-amber-800, html.dark .text-amber-900 { color: #FDE293; }
html.dark .border-emerald-100 { border-color: #2B4D38; }
html.dark .text-emerald-700 { color: #81C995; }
html.dark .text-sky-500 { color: #8AB4F8; }
html.dark .shadow-sm, html.dark .shadow-lg, html.dark .shadow-xl { --tw-shadow-color: rgb(0 0 0 / .5); }
/* Dark "primary" buttons (bg-text-primary + white text) turn light in dark mode, so their text turns dark. */
html.dark .bg-text-primary.text-white, html.dark .bg-text-primary .text-white { color: #202124; }
/* Blue buttons (bg-accent-blue + white text): Google's light blue takes dark text. */
html.dark .bg-accent-blue.text-white, html.dark .bg-accent-blue .text-white { color: #202124; }
/* Form fields without their own background (the forms plugin paints them white). */
html.dark :is(input, textarea, select):not([class*="bg-"]) { background-color: #202124; color: inherit; border-color: #5F6368; }
html.dark img.rt-fav, html.dark .rt-ic { filter: none; }

.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20; line-height: 1; }

/* Editable fields (Google Docs-style inline editing) */
[contenteditable] { outline: none; white-space: pre-wrap; word-break: break-word; }
[contenteditable][data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: var(--hx-muted);
  font-weight: 400;
  pointer-events: none;
}
.edit-chip {
  display: inline-block;
  border: 1px dashed var(--hx-line2);
  border-radius: 4px;
  padding: 1px 6px;
  transition: border-color .15s, background-color .15s;
  min-width: 2.5rem;
}
.edit-line {
  display: inline-block;
  border-bottom: 1px dashed var(--hx-line2);
  padding-bottom: 1px;
  min-height: 20px;
  transition: border-color .15s;
}
.edit-box {
  border: 1px dashed var(--hx-line2);
  border-radius: 6px;
  padding: 4px 8px;
  min-height: 28px;
  transition: border-color .15s, background-color .15s;
}
.edit-chip:hover, .edit-line:hover, .edit-box:hover { border-color: var(--hx-blue); }
.edit-chip:focus, .edit-box:focus { border-color: var(--hx-blue); border-style: solid; background: var(--hx-bg); }
.edit-line:focus { border-bottom-color: var(--hx-blue); border-bottom-style: solid; }

/* Google Docs-style entry editing (app.js entryForm): fields look like plain text until hovered / focused */
.pv-edit { border-radius: 4px; padding: 0 2px; margin: 0 -2px; outline: none; transition: background-color .12s, box-shadow .12s; }
.pv-edit:hover { background-color: var(--hx-fill); }
.pv-edit:focus { background: var(--hx-bg); box-shadow: 0 0 0 1.5px #93C5FD; }
/* An empty inline contenteditable has no line box, so Chrome draws no caret in it; inline-block gives it one. */
span.pv-edit { display: inline-block; min-width: 1ch; vertical-align: top; }
.pv-edit:empty::before, [data-date-label]:empty::before { content: attr(data-placeholder); color: var(--hx-muted); font-weight: 400; }
.pv-sel { border-radius: 4px; padding: 0 2px; margin: 0 -2px; cursor: pointer; transition: background-color .12s; }
.pv-sel:hover, .pv-sel:focus-within { background-color: var(--hx-fill); }
.pv-select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; padding: 0 2px; font: inherit; color: inherit; cursor: pointer; outline: none; }
.pv-desc { border-radius: 4px; margin: 0 -4px; padding: 0 4px; transition: background-color .12s, box-shadow .12s; }
.pv-desc:hover { background-color: var(--hx-fill2); }
.pv-desc:focus-within { background: var(--hx-bg); box-shadow: 0 0 0 1.5px #93C5FD; }
/* So it's clear what can be changed: every editable part of an edit card has a light dashed underline
   (the description a light dashed box), and gets a soft grey fill on hover. */
/* Drawn as a background line / outline, never a border, so edit mode is exactly as tall as view mode. */
.pv-edit, .pv-sel { --dash: var(--hx-line2); background-image: linear-gradient(to right, var(--dash) 60%, transparent 0); background-size: 5px 1px; background-repeat: repeat-x; background-position: 0 100%; }
.pv-edit:hover, .pv-sel:hover { --dash: var(--hx-muted); }
.pv-edit:focus, .pv-sel:focus-within { background-image: none; }
.pv-desc { outline: 1px dashed var(--hx-line2); outline-offset: 2px; }
.pv-desc:hover { outline-color: var(--hx-muted); }
.pv-desc:focus-within { outline-color: transparent; }

/* Edit-card field styles (class ef-v2 on every edit card, app.js entryForm).
   1. Filled fields look like plain text — no dashes; a soft fill on hover.
   2. Empty fields keep the dashed underline and grey hint, so the gaps stand out.
   3. One "typing here" state everywhere: light fill + 2px blue line underneath (like Google's text fields).
   The description follows the same rules instead of having its own dashed box. */
.ef-v2 .pv-edit, .ef-v2 .pv-sel { background-image: none; }
/* Not while typing: the typing style resets the dash's 5px size, which would stretch one dash into a grey block. */
.ef-v2 .pv-edit:empty:not(:focus) { background-image: linear-gradient(to right, var(--hx-line2) 60%, transparent 0); }
.ef-v2 .pv-edit:empty:not(:focus):hover { background-image: linear-gradient(to right, var(--hx-muted) 60%, transparent 0); }
.ef-v2 .pv-edit:hover, .ef-v2 .pv-sel:hover { background-color: var(--hx-fill); }
.ef-v2 .pv-edit:focus, .ef-v2 .pv-desc:focus-within {
  background-color: var(--hx-fill2); background-image: none; box-shadow: inset 0 -2px 0 var(--hx-blue); border-radius: 4px 4px 0 0; outline: none;
}
.ef-v2 .pv-desc { outline: none; }
.ef-v2 .pv-desc:hover { background-color: var(--hx-fill2); }
.ef-v2 .pv-desc:has(.is-editor-empty) { background-image: linear-gradient(to right, var(--hx-line2) 60%, transparent 0); background-size: 5px 1px; background-repeat: repeat-x; background-position: 0 100%; }
.ef-v2 .pv-desc:focus-within:has(.is-editor-empty) { background-image: none; }
/* 4. Lines hug the text: the title and note are only as wide as what's written (the typing line follows). */
.ef-v2 h2.pv-edit { flex: 0 1 auto; min-width: 4ch; margin-right: auto; }
/* 5. Pickers look clickable even when set: a small ⌄ appears on hover (they open a menu instead of taking typing). */
.ef-v2 .pv-sel::after { content: 'expand_more'; font-family: 'Material Symbols Outlined'; font-size: 14px; line-height: 1; margin-left: 1px; opacity: .45; transition: opacity .12s; color: var(--hx-ink3); }
.ef-v2 .pv-sel:hover::after, .ef-v2 .pv-sel:focus-within::after { opacity: 1; }
.ef-v2 label.pv-sel:has(.material-symbols-outlined:last-child)::after { content: none; }   /* already has its own ⌄ */
/* 6. Keyboard: Tab through the card and pickers show where you are too, not just typed fields. */
.ef-v2 .pv-sel:has(:focus-visible), .ef-v2 .pv-sel:focus-visible { box-shadow: 0 0 0 2px var(--hx-blue); outline: none; }
.ef-v2 .pv-edit:focus-visible { outline: none; }
/* 7. Labels quieter than values: "Meeting:" / "Location:" step back, what you wrote stands out. */
.ef-v2 p:has(> [data-field]) { color: var(--hx-muted); }
.ef-v2 p > [data-field]:not(:empty) { color: var(--hx-ink); }

/* Doc-like header editing */
.doc-editable { border-radius: 6px; outline: 1px dashed transparent; outline-offset: 4px; transition: box-shadow .15s, background-color .15s, outline-color .15s; }
.doc-editable:hover { outline-color: var(--hx-muted); box-shadow: 0 0 0 4px var(--hx-fill2); background: var(--hx-fill2); }
.name-tip { position: fixed; z-index: 70; padding: 4px 8px; border-radius: 6px; background: var(--hx-ink); color: var(--hx-bg); font-size: 12px; font-weight: 500; line-height: 1.45; white-space: pre-line; max-width: 240px; pointer-events: none; opacity: 0; transition: opacity .1s; }
.name-tip.on { opacity: 1; }
.icon-editable { outline: 1px dashed transparent; outline-offset: 1px; transition: background-color .15s, outline-color .15s; }
.icon-editable:hover { outline-color: var(--hx-muted); }
.doc-editable:focus, .doc-editable:focus-within { outline-color: transparent; box-shadow: 0 0 0 4px var(--hx-bg), 0 0 0 5px var(--hx-blue); background: var(--hx-bg); }

/* Notion-style description editor (lib/richtext.js) */
.rt { white-space: pre-wrap; word-break: break-word; }
.rt > [data-b] { position: relative; min-height: 1.625em; padding: 1px 0; }
.rt > [data-b="h1"] { font-size: 20px; font-weight: 600; color: var(--hx-ink); line-height: 1.35; margin-top: .55em; }
.rt > [data-b="h2"] { font-size: 16.5px; font-weight: 600; color: var(--hx-ink); line-height: 1.4; margin-top: .4em; }
.rt > [data-b]:first-child { margin-top: 0; }
.rt > [data-b="ul"], .rt > [data-b="ol"], .rt > [data-b="todo"] { padding-left: 1.6em; }
.rt > [data-b="ul"]::before { content: '•'; position: absolute; left: .5em; color: var(--hx-ink2); }
.rt > [data-b="ol"]::before { content: attr(data-n) '.'; position: absolute; left: 0; width: 1.25em; text-align: right; color: var(--hx-ink2); font-variant-numeric: tabular-nums; }
.rt > [data-b="todo"]::before { content: ''; position: absolute; left: .15em; top: .42em; width: 14px; height: 14px; border: 1.5px solid var(--hx-muted); border-radius: 3px; background: var(--hx-bg); box-sizing: border-box; }
.rt[contenteditable="true"] > [data-b="todo"]::before { cursor: pointer; }
.rt > [data-b="todo"][data-checked]::before { background: var(--hx-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--hx-blue); }
.rt > [data-b="todo"][data-checked] { color: var(--hx-muted); text-decoration: line-through; }
.rt > [data-indent="1"] { margin-left: 1.6em; }
.rt > [data-indent="2"] { margin-left: 3.2em; }
.rt > [data-indent="3"] { margin-left: 4.8em; }
.rt > [data-indent="4"] { margin-left: 6.4em; }
.rt > [data-b="quote"] { border-left: 3px solid var(--hx-line2); padding-left: .85em; margin: 2px 0; }
.rt > [data-b="hr"] { padding: .55em 0; min-height: 0; cursor: default; }
.rt > [data-b="hr"] hr { border: 0; border-top: 1px solid var(--hx-line); }
.rt > [data-ph]::before { content: attr(data-ph); position: absolute; left: 0; color: var(--hx-muted); pointer-events: none; white-space: nowrap; }
.rt b, .rt strong { font-weight: 600; color: var(--hx-ink); }
.rt code { font-family: 'JetBrains Mono', monospace; font-size: .84em; background: var(--hx-fill); color: var(--hx-ink); padding: .1em .35em; border-radius: 4px; }
/* Links look like Notion's, and custom-text links match smart links: same weight, underline and hover. */
.rt a:not(.rt-chip):not(.rt-name) { padding: 0 2px; margin: 0 -2px; border-radius: 4px; color: inherit; font-weight: 500; text-decoration: underline; text-decoration-color: rgb(var(--c-text-primary) / .3); text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; transition: background-color .12s; }
.rt a:not(.rt-chip):not(.rt-name):hover { background: rgb(var(--c-text-primary) / .06); text-decoration-color: rgb(var(--c-text-primary) / .7); }
.rt a[data-fav]::before { content: ''; display: inline-block; width: 1.05em; height: 1.05em; margin-right: .28em; vertical-align: -0.16em; border-radius: 3px; background: var(--fav) center / contain no-repeat; }
.rt-chip { display: inline; padding: 0 2px; margin: 0 -2px; border-radius: 4px; color: inherit; text-decoration: none; cursor: pointer; white-space: normal; transition: background-color .12s; }
.rt-chip:hover { background: rgb(var(--c-text-primary) / .06); }
.rt-chip.rt-icon { padding: 0 3px; margin: 0 -1px; }
.rt-chip.rt-icon .rt-ic { margin-right: 0; width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.rt-chip .rt-ic { display: inline-block; width: 1.05em; height: 1.05em; margin-right: .28em; vertical-align: -0.16em; border-radius: 3px; object-fit: contain; }
.rt-chip .material-symbols-outlined.rt-ic { font-size: 1.05em; line-height: 1; color: var(--hx-ink3); }
.rt-chip .rt-name { font-weight: 500; text-decoration: underline; text-decoration-color: rgb(var(--c-text-primary) / .3); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.rt-chip:hover .rt-name { text-decoration-color: rgb(var(--c-text-primary) / .7); }
.rt-fav { object-fit: contain; flex-shrink: 0; }
.rt [data-b="embed"] { margin: 6px 0; max-width: 560px; }
.rt-embed { position: relative; border-radius: 10px; overflow: hidden; background: #0F172A; border: 1px solid var(--hx-line); }
.rt-embed-video { aspect-ratio: 16 / 9; }
.rt-embed-audio { height: 152px; background: transparent; border: 0; }
.rt-embed-map { height: 340px; background: var(--hx-fill); }
.rt-embed-doc { height: 480px; background: var(--hx-bg); }
.rt-embed-post { height: 560px; max-width: 480px; background: var(--hx-bg); }
/* Bookmark cards */
.rt [data-b="bookmark"] { position: relative; margin: 6px 0; max-width: 560px; }
.rt-bm { display: flex; align-items: stretch; min-height: 84px; border: 1px solid var(--hx-line); border-radius: 10px; overflow: hidden; color: inherit; text-decoration: none !important; background: var(--hx-bg); transition: background-color .12s, border-color .12s; }
.rt-bm:hover { background: var(--hx-fill2); border-color: var(--hx-line2); }
.rt-bm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 10px 14px; }
.rt-bm-title { font-size: 14px; font-weight: 500; color: var(--hx-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-bm-desc { font-size: 12.5px; line-height: 1.45; color: var(--hx-ink3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rt-bm-url { margin-top: auto; display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--hx-ink2); overflow: hidden; white-space: nowrap; }
.rt-bm-url .rt-ic { width: 14px; height: 14px; font-size: 14px; color: var(--hx-ink3); border-radius: 3px; flex-shrink: 0; }
.rt-bm-img { width: 32%; max-width: 200px; flex-shrink: 0; background: var(--hx-fill) center / cover no-repeat; border-left: 1px solid var(--hx-line); }
.rt-bm-img[hidden] { display: none; }
.rt-bm-more, .rt-media-more { position: absolute; top: 6px; right: 6px; background: rgb(var(--c-surface-card) / .92); box-shadow: 0 1px 3px rgba(15,23,42,.15); }
.rt [data-b="bookmark"] .rt-bm-more, .rt [data-b="image"] .rt-media-more, .rt [data-b="file"] .rt-media-more { opacity: 0; transition: opacity .12s; }
.rt [data-b="bookmark"]:hover .rt-bm-more, .rt [data-b="image"]:hover .rt-media-more, .rt [data-b="file"]:hover .rt-media-more { opacity: 1; }
.rt:not(:has(.rt-pm)) .rt-bm-more, .rt:not(:has(.rt-pm)) .rt-media-more { display: none !important; }
/* Images and files placed in the text */
.rt [data-b="image"] { position: relative; margin: 6px 0; max-width: 100%; width: fit-content; }
.rt-img { display: block; max-width: 100%; max-height: 520px; border-radius: 8px; border: 1px solid var(--hx-line); }
.rt [data-b="file"] { position: relative; margin: 4px 0; max-width: 420px; }
.rt-file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--hx-line); border-radius: 8px; background: var(--hx-fill2); color: var(--hx-ink); text-decoration: none !important; transition: background-color .12s, border-color .12s; }
.rt-file:hover { background: var(--hx-fill); border-color: var(--hx-line2); }
.rt-file-ic { font-size: 20px; color: var(--hx-ink3); }
.rt-file-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-file-size { font-size: 12px; color: var(--hx-muted); white-space: nowrap; }
.rt-file-dl { font-size: 18px; color: var(--hx-muted); margin-right: 22px; }
.rt-pm .ProseMirror-selectednode[data-b] { outline: 2px solid rgba(0,102,255,.35); outline-offset: 2px; border-radius: 10px; }
/* @mentions */
.rt-mention { white-space: nowrap; }
.rt-menu .rt-menu-person { padding: 4px 8px; }
.rt-menu-person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.rt-menu-handle { font-size: 11px; color: var(--hx-muted); }
.rt-menu-empty { padding: 6px 8px 8px; font-size: 12px; color: var(--hx-muted); }
.rt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rt-embed-cap { display: flex; align-items: center; gap: 6px; padding: 0 2px 6px; font-size: 12.5px; color: var(--hx-ink2); }
.rt-embed-cap .rt-ic { font-size: 15px; color: var(--hx-blue); }
.rt-embed-cap .rt-fav { width: 14px; height: 14px; }
.rt .rt-embed-cap .rt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hx-ink2); text-decoration: none !important; }
.rt .rt-embed-cap .rt-name:hover { color: var(--hx-blue); }
.rt-embed-more { display: none; padding: 0 4px; border-radius: 6px; color: var(--hx-muted); }
.rt-embed-more:hover { background: var(--hx-fill); color: var(--hx-ink); }
.rt-embed-more .material-symbols-outlined { font-size: 18px; }
.rt[contenteditable="true"] .rt-embed-more { display: inline-flex; }
.rt-menu-sep { height: 1px; background: var(--hx-line); margin: 4px 6px; }
.rt-linkpop { position: fixed; z-index: 70; background: var(--hx-pop); border: 1px solid var(--hx-line); border-radius: 10px; box-shadow: 0 10px 30px -10px rgba(15,23,42,.25), 0 2px 6px rgba(15,23,42,.06); padding: 6px; font-size: 12px; max-width: 360px; }
.rt-linkpop[hidden] { display: none; }
.rt-lp-head { padding: 0 4px 6px; font-size: 11px; color: var(--hx-muted); font-weight: 500; }
.rt-lp-row { display: flex; align-items: center; gap: 2px; }
.rt-lp-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 7px; background: var(--hx-fill2); border: 1px solid var(--hx-line); }
.rt-lp-seg button { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 5px; color: var(--hx-ink3); font-weight: 500; }
.rt-lp-seg button:hover { color: var(--hx-ink); }
.rt-lp-seg button.on { background: var(--hx-bg); color: var(--hx-blue); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 0 0 1px rgba(0,102,255,.5); }
.rt-lp-seg .material-symbols-outlined { font-size: 15px; }
.rt-lp-div { width: 1px; height: 18px; background: var(--hx-line); margin: 0 4px; }
.rt-lp-row > button { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--hx-ink3); }
.rt-lp-row > button:hover { background: var(--hx-fill); color: var(--hx-ink); }
.rt-lp-row > button[data-lp="remove"]:hover { color: #ba1a1a; }
.rt-lp-row > button .material-symbols-outlined { font-size: 16px; }
.rt-lp-row > button[data-lp="open"] { color: var(--hx-blue); background: var(--hx-bluefill); }
.rt-lp-row > button[data-lp="open"]:hover { color: #fff; background: var(--hx-blue); }
.rt-lp-url.rt-lp-go { display: flex; align-items: center; gap: 4px; margin: 6px 0 0; padding: 4px 6px; border-radius: 6px; color: var(--hx-blue); font-size: 12px; font-weight: 500; cursor: pointer; }
.rt-lp-go:hover, .rt-lp-go:focus-visible { background: var(--hx-bluefill); outline: none; }
.rt-lp-go:hover .rt-lp-go-t { text-decoration: underline; }
.rt-lp-go .material-symbols-outlined { font-size: 14px; flex-shrink: 0; }
.rt-lp-go-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-lp-custom { display: flex; gap: 4px; padding: 6px 2px 0; }
.rt-lp-custom input { flex: 1; min-width: 0; padding: 4px 8px; border: 1px solid var(--hx-line); border-radius: 6px; font-size: 12.5px; color: var(--hx-ink); }
.rt-lp-custom input:focus { border-color: var(--hx-blue); box-shadow: 0 0 0 1px rgba(0,102,255,.25); outline: none; }
.rt-lp-custom button { padding: 4px 10px; border-radius: 6px; background: var(--hx-ink); color: var(--hx-bg); font-size: 12px; font-weight: 500; }
.rt-lp-custom button:hover { background: #0050cc; }
.rt-lp-url { padding: 6px 4px 0; color: var(--hx-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Tiptap editor (lib/editor.js) */
.rt-pm:not(:focus) a[href], .rt-pm:not(:focus) .rt-chip, .rt-pm:not(:focus) .rt-bm { cursor: pointer; }   /* reading: links open on click */
.doc-editable:focus-within { box-shadow: 0 0 0 4px var(--hx-bg), 0 0 0 5px var(--hx-blue); background: var(--hx-bg); }
.rt-pm { outline: none; white-space: pre-wrap; word-break: break-word; }
.rt-pm p { margin: 0; min-height: 1.625em; padding: 1px 0; }
.rt-pm ol { list-style: decimal; padding-left: 1.6em; margin: 0; }
.rt-pm ol ol { list-style: lower-alpha; }
.rt-pm ol ol ol { list-style: lower-roman; }
.rt-pm ol ol ol ol { list-style: decimal; }
.rt-pm li::marker { color: var(--hx-ink2); font-variant-numeric: tabular-nums; }
.rt-pm ul[data-type="taskList"] { list-style: none; padding-left: .15em; margin: 0; }
.rt-pm li ul[data-type="taskList"], .rt-pm li ol { margin-left: 0; }
.rt-pm ul[data-type="taskList"] > li ul[data-type="taskList"] { padding-left: .2em; }
.rt-pm ul[data-type="taskList"] > li { display: flex; align-items: flex-start; gap: .55em; }
.rt-pm ul[data-type="taskList"] > li > label { flex-shrink: 0; margin-top: .36em; user-select: none; line-height: 0; }
.rt-pm ul[data-type="taskList"] > li > label input { width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid var(--hx-muted); color: var(--hx-blue); cursor: pointer; }
.rt-pm ul[data-type="taskList"] > li > label input:focus { box-shadow: none; outline: none; }
.rt-pm ul[data-type="taskList"] > li > div { flex: 1; min-width: 0; }
.rt-pm ul[data-type="taskList"] > li[data-checked="true"] > div > p { color: var(--hx-muted); text-decoration: line-through; }
/* The hint in an empty editor stays on one line (cut off with "…") — wrapped, it spilled over the rows below it. */
.rt-pm p.is-editor-empty:first-child { position: relative; }
.rt-pm p.is-editor-empty:first-child::before { content: attr(data-placeholder); position: absolute; left: 0; right: 0; top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--hx-muted); pointer-events: none; }
.rt-pm .rt-chip.ProseMirror-selectednode { background: rgba(0,102,255,.12); }
.rt-pm strong, .rt-pm b { font-weight: 600; color: var(--hx-ink); }
.rt-pm .rt-embed-more { display: inline-flex; }
.rt-loading { opacity: .85; }

.rt-menu, .rt-toolbar { position: fixed; z-index: 70; background: var(--hx-pop); border: 1px solid var(--hx-line); border-radius: 10px; box-shadow: 0 10px 30px -10px rgba(15,23,42,.25), 0 2px 6px rgba(15,23,42,.06); font-size: 13px; }
.rt-menu[hidden], .rt-toolbar[hidden] { display: none; }
.rt-menu { width: 240px; max-height: 300px; overflow-y: auto; padding: 4px; }
.rt-menu-head { padding: 4px 8px 4px; font-size: 11px; color: var(--hx-muted); font-weight: 500; }
.rt-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border-radius: 6px; color: var(--hx-ink); text-align: left; }
.rt-menu button .material-symbols-outlined { font-size: 18px; color: var(--hx-ink2); }
.rt-menu button.on, .rt-menu button:hover { background: var(--hx-fill); }
.rt-toolbar { display: flex; gap: 1px; padding: 3px; }
.rt-toolbar button { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--hx-ink2); }
.rt-toolbar button:hover { background: var(--hx-fill); color: var(--hx-ink); }
.rt-toolbar button.on { background: var(--hx-bluefill); color: var(--hx-blue); }
.rt-toolbar button .material-symbols-outlined { font-size: 18px; }
.rt-link-input { width: 260px; border: 0; padding: 4px 8px; font-size: 13px; outline: none; box-shadow: none !important; }

/* Search highlight: colours the matched letters only. No padding, so the text keeps its spacing;
   the shadow lets the colour bleed slightly past the letters without moving them. */
mark.search-mark { background: var(--hx-mark); color: inherit; padding: 0; border-radius: 2px; box-shadow: 0 0 0 1px var(--hx-mark); }

/* Flash highlight for newly added / linked entries */
@keyframes flash { 0% { box-shadow: 0 0 0 3px rgba(0,102,255,.35); background:var(--hx-bluefill); } 100% { box-shadow: 0 0 0 0 rgba(0,102,255,0); } }
.flash { animation: flash 1.6s ease-out; }

@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.pop { animation: pop .16s ease-out; }

@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.45); } 100% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }
.recording { animation: pulse-ring 1.2s infinite; }

.scroll-thin::-webkit-scrollbar { width: 6px; }
.scroll-thin::-webkit-scrollbar-thumb { background: var(--hx-line); border-radius: 9999px; }

/* ── Touch screens (phones, tablets) ──────────────────────────────────────────
   Only applies where the main pointer is a finger, so the desktop look is unchanged.
   Prefixed with html so these win over the Tailwind classes loaded after this file. */
.touch-only { display: none; }
@media (pointer: coarse) {
  /* iPhones zoom the page when a text box under 16px gets focus; 16px stops that. */
  html input:not([type=checkbox]):not([type=radio]):not([type=range]),
  html textarea, html select, html [contenteditable]:not([contenteditable="false"]):not(h1) { font-size: 16px !important; }
  /* Bigger fields make the date picker taller; keep it on screen and let it scroll. */
  html #dt-pop { max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; }
  /* Bigger tap targets: RSVP switch, scope choice, "+ Add", and the faces that open Responses. */
  html [data-action="rsvp"], html [data-action="rsvp-scope"] { height: 34px; padding-left: 12px; padding-right: 12px; font-size: 13px; }
  html [data-action="add-on-day"] { padding: 8px 4px 8px 10px; margin: -8px -4px -8px 0; font-size: 12px; }
  html [data-action="responses"] { min-height: 34px; }
  .touch-only { display: inline; }
  .mouse-only { display: none; }
}

/* Phones: while the week strip is pinned under the top bar, its date line replaces the sticky day headings. */
@media (max-width: 639px) {
  html.week-on #feed [id^="day-"] { position: static; }
}

/* Composer: the "Drop to read it" overlay shows only while a file is dragged over the box. */
#dropzone .drop-overlay { display: none; }
#dropzone.is-drag .drop-overlay { display: flex; }

/* Breathing room: the same extra padding on view cards and edit / draft cards, so a card stays the same size
   when you click into it ("article" so it outranks Tailwind's px-4 / py-2.5, which load after this file). */
article.ev-card:not([data-collapsed]), article.ef-v2 { padding: 14px 20px; }