:root {
  color-scheme: light;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  --paper: #fdfdfb;
  --ink: #191a17;
  --muted: #52554f;
  --line: #e4e4df;
  --line-strong: #c6c7bf;
  --accent: #333430;
  --on-accent: #fff;
  --surface: #f5f5f2;
  --editor: #f7f7f3;
  --private-selected: #e7e7e1;
  --private-bg: #f2efe8;
  --field: #8a8c84;
  --mark: #ebe8cf;
  --flash: #deded5;
  --error: #8d302c;
  --shadow: #191a1710;
  --backdrop: #191a1740;
  --sev-1: #d9a300;
  --sev-2: #e86f00;
  --sev-3: #cf1f3a;
  color: var(--ink);
  background: var(--paper);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141513;
  --ink: #e6e5df;
  --muted: #a3a49c;
  --line: #2c2d29;
  --line-strong: #4a4b45;
  --accent: #d9d8d1;
  --on-accent: #141513;
  --surface: #1f201d;
  --editor: #1b1c19;
  --private-selected: #2e2f2b;
  --private-bg: #2a2621;
  --field: #6f716a;
  --mark: #4d4830;
  --flash: #3a3b36;
  --error: #ec9a8f;
  --shadow: #00000066;
  --backdrop: #00000099;
  --sev-1: #f0c43c;
  --sev-2: #f58f3a;
  --sev-3: #ff5a6e;
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) {
  html { overflow-y: scroll; }
}
body { margin: 0; padding-bottom: 96px; }
main { max-width: 720px; margin: 0 auto; padding: max(26px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left)); }
button, input, textarea, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button, input, select { min-height: 44px; }
button { border: 1px solid var(--line); background: transparent; padding: 7px 14px; border-radius: 5px; transition: background 120ms, border-color 120ms; }
button:hover:enabled { background: var(--surface); border-color: var(--line-strong); }
button:disabled, button[aria-disabled="true"] { opacity: .55; cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, select { background: transparent; border: 1px solid var(--field); border-radius: 4px; padding: 7px 10px; min-width: 0; }
select { background: var(--paper); }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; min-height: 16px; margin: 0; }
textarea { display: block; width: 100%; resize: vertical; background: transparent; border: 0; outline: none; font-size: 14px; line-height: 1.55; padding: 0; overflow-y: hidden; min-height: 100px; }
textarea::placeholder { color: var(--muted); opacity: 1; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
h1 { margin: 0; font-size: 20px; letter-spacing: 0; font-weight: 600; }
#brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand-dot { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 2px; margin-right: -10px; }
.header-actions .icon-button { height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 5px; color: var(--muted); }
.header-actions .icon-button:hover, #search-link[aria-current="page"], #app-menu[open] > summary { color: var(--ink); background: var(--surface); }
.header-actions svg { width: 18px; height: 18px; }
#app-menu { position: relative; }
.app-menu-panel { position: absolute; z-index: 6; right: 0; top: 48px; width: 180px; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 6px 20px var(--shadow); }
.app-menu-panel > * { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 12px; font-size: 13px; text-align: left; border: 0; border-radius: 4px; }
.app-menu-panel > :hover { background: var(--surface); }
h2 { font-size: 17px; font-weight: 500; }
.muted { color: var(--muted); font-size: 12px; }
.primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); min-width: 76px; }
.primary:hover:enabled { color: var(--on-accent); background: var(--ink); border-color: var(--ink); }
#add { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0; color: var(--accent); background: transparent; }
#add:hover:enabled { background: transparent; }
#add .send-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--private-selected); transition: background 120ms, color 120ms; }
#add:enabled .send-icon { background: var(--accent); color: var(--on-accent); }
#add:hover:enabled .send-icon { background: var(--ink); }
#add:disabled { opacity: .45; }
#add svg { width: 14px; height: 14px; transform: rotate(-45deg); }
.quiet { border-color: transparent; color: var(--muted); font-size: 12px; }
.day-toolbar, .date-controls { display: flex; align-items: center; gap: 6px; }
.day-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 10px; }
.date-controls { grid-row: 1; grid-column: 2; }
#today { grid-row: 1; grid-column: 1; justify-self: start; padding-inline: 4px; text-decoration: underline; text-underline-offset: 4px; }
.icon-button { padding: 8px; width: 44px; display: inline-grid; place-items: center; border-color: transparent; }
.date-controls > .icon-button { flex-shrink: 0; }
.date-controls svg { width: 20px; height: 20px; }
#copy { grid-row: 1; grid-column: 3; justify-self: end; min-height: 44px; padding: 0; border: 0; border-radius: 5px; color: var(--muted); }
#copy:hover { color: var(--ink); background: var(--surface); }
#copy svg { width: 18px; height: 18px; }
svg { width: 16px; height: 16px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.date-picker { position: relative; display: grid; place-items: center; min-height: 44px; min-width: calc(10ch + 12px); padding-inline: 6px; white-space: nowrap; flex-shrink: 0; font-size: 14px; border-radius: 4px; }
.date-controls [aria-disabled="true"]:hover { background: transparent; border-color: transparent; }
.date-picker:hover { background: var(--surface); }
.date-picker:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
#day { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
#composer { margin-inline: -8px; padding: 10px 8px 6px; border: 0; border-radius: 0; box-shadow: none; background: var(--editor); }
#thought { --expanded-height: min(5lh, max(44px, calc(var(--stream-height, 100dvh) * .3))); min-height: 44px; height: 44px; max-height: var(--expanded-height); padding: 0; resize: none; overflow-y: auto; overscroll-behavior-y: contain; transition: height 140ms ease, min-height 140ms ease; }
#composer.expanded #thought { min-height: var(--expanded-height); }
#thought:focus-visible { outline: none; }
.composer-controls { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: center; margin-top: 6px; }
#composer:not(.expanded) #thought { overflow-y: hidden; }
.private-compose { position: relative; display: inline-grid; place-items: center; color: var(--muted); cursor: pointer; height: 44px; width: 44px; flex-shrink: 0; }
.private-compose input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.private-compose .lock-icon { display: grid; place-items: center; width: 28px; height: 28px; pointer-events: none; }
.private-compose .lock-icon svg { width: 14px; height: 14px; }
.private-compose:hover, .private-compose:has(:checked) { color: var(--ink); }
.private-compose:has(:checked) .lock-icon { background: var(--private-selected); }
.private-compose:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.private-compose:has(:focus-visible)::after { content: attr(title); position: absolute; z-index: 4; bottom: calc(100% + 4px); left: 0; width: max-content; max-width: calc(100vw - 56px); padding: 4px 8px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); font-size: 12px; pointer-events: none; }
.entry { position: relative; padding: 14px 12px 12px; margin: 0 -12px 6px; border-bottom: 1px solid var(--line); scroll-margin-top: 30px; }
.entry.is-private { background: var(--private-bg); }
.private-mark { display: none; color: var(--muted); }
.entry.is-private .private-mark { display: inline-grid; place-items: center; }
.private-mark svg { width: 11px; height: 11px; }
#entries > .entry { border-bottom: 0; padding-block: 2px 4px; margin-bottom: 12px; border-radius: 4px; line-height: 1.55; }
.entry-meta { display: flex; align-items: center; gap: 10px; justify-content: space-between; min-height: 36px; margin-bottom: 3px; }
#entries > .entry > .entry-meta { position: relative; height: 18px; min-height: 18px; justify-content: flex-start; gap: 6px; margin-bottom: 2px; }
.entry time { color: var(--muted); font-size: 12px; }
#entries .entry time { font-size: 11px; }
.entry-actions { display: flex; align-items: center; }
#entries .entry-actions { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.entry-menu { position: relative; }
.entry-menu > summary { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 8px; border-color: transparent; color: var(--muted); }
/* The 44px-wide target overlaps the 18px time line instead of adding height. */
#entries .entry-menu > summary { min-height: 32px; height: 32px; padding: 0; }
/* Pointer devices reveal the menu on hover or focus; touch keeps it visible. */
@media (hover: hover) and (pointer: fine) {
  #entries .entry-menu:not([open]) > summary { opacity: 0; transition: opacity 120ms; }
  #entries .entry:hover .entry-menu > summary, #entries .entry:focus-within .entry-menu > summary { opacity: 1; }
}
/* With timestamps hidden, the menu and lock sit beside the first line of text. */
:root[data-timestamps="off"] #entries .entry time { display: none; }
:root[data-timestamps="off"] #entries > .entry:not(:has(.editor)) > .entry-meta { position: absolute; top: -3px; right: 0; height: 32px; min-height: 32px; margin: 0; flex-direction: row-reverse; gap: 0; }
:root[data-timestamps="off"] #entries > .entry:not(:has(.editor)) .entry-actions { position: static; transform: none; }
:root[data-timestamps="off"] #entries > .entry:not(:has(.editor)) > .entry-text { padding-right: 30px; }
:root[data-timestamps="off"] #entries > .entry.is-private:not(:has(.editor)) > .entry-text { padding-right: 48px; }
.entry-menu-time { display: none; margin: 0 0 4px; padding: 6px 12px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
:root[data-timestamps="off"] .entry-menu-time { display: block; }
/* An inline edit replaces the composer so the keyboard cannot stack both. */
.stream-view #day-view:has(#entries .editor) #composer { display: none; }
.entry-menu > summary:hover, .entry-menu[open] > summary { background: var(--surface); }
.entry-menu > summary svg { stroke-width: 2.5; }
.entry-menu-panel { position: absolute; z-index: 3; right: 0; top: 44px; width: 200px; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 6px 20px var(--shadow); }
.entry-menu.opens-up .entry-menu-panel { top: auto; bottom: 44px; }
#entries .entry-menu-panel { top: 32px; }
#entries .entry-menu.opens-up .entry-menu-panel { top: auto; bottom: 32px; }
.stream-view .entry-menu-panel { overflow-y: auto; overscroll-behavior-y: contain; }
.entry-menu-panel button { display: block; width: 100%; min-height: 44px; text-align: left; font-size: 12px; padding: 8px 12px; border-color: transparent; }
.entry-text { margin: 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.entry-text, #thought, .editor textarea { font-family: var(--mono); }
.editor { margin: 8px 0 2px; }
.editor textarea { border: 1px solid var(--field); border-radius: 3px; padding: 10px; min-height: 90px; background: var(--paper); }
.edit-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.edit-error { color: var(--error); font-size: 12px; margin: 8px 0; }
.empty { color: var(--muted); margin: 36px 0; font-size: 12px; }
.entry.highlight { animation: highlight 2.5s ease-out; }
.entry.highlight:focus { outline: none; }
summary { min-height: 44px; padding: 9px 14px; cursor: pointer; font-size: 12px; border: 1px solid var(--line); border-radius: 5px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#query { width: 100%; height: 44px; padding: 7px 10px; font-size: 16px; background: transparent; }
#search-status { margin: 14px 0 22px; }
#search-status:empty { margin: 0; }
.search-result > a { display: block; border-radius: 2px; }
.search-result > a:hover .entry-text { color: var(--accent); }
.search-result .entry-meta { justify-content: flex-start; gap: 6px; }
mark { background: var(--mark); color: inherit; padding: 0 1px; border-radius: 2px; }
#load-more { display: block; margin: 22px auto 0; }
@keyframes highlight { from { background: var(--flash); } }
.settings-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-title h2 { margin: 0; }
.settings-title h2:focus { outline: none; }
#settings-done { display: grid; place-items: center; min-height: 44px; padding-inline: 8px; margin-right: -8px; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
#settings-view h3 { margin: 28px 0 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding-block: 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
label.setting { cursor: pointer; }
.segmented { display: inline-flex; flex-shrink: 0; padding: 2px; border: 1px solid var(--line); border-radius: 6px; }
.segmented label { position: relative; display: grid; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.segmented span { display: grid; place-items: center; min-width: 44px; min-height: 40px; padding: 0 10px; border-radius: 4px; color: var(--muted); font-size: 12px; }
.segmented label:hover span { color: var(--ink); }
.segmented input:checked + span { background: var(--private-selected); color: var(--ink); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.mono-sample { font-family: var(--mono); }
input.switch { appearance: none; position: relative; flex-shrink: 0; width: 44px; height: 26px; min-height: 26px; margin: 0; padding: 0; border: 1px solid var(--field); border-radius: 13px; background: var(--surface); cursor: pointer; transition: background 120ms, border-color 120ms; }
input.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform 120ms, background 120ms; }
input.switch:checked { background: var(--accent); border-color: var(--accent); }
input.switch:checked::before { transform: translateX(18px); background: var(--paper); }
#timezone { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#passkey-status { margin: 12px 0 0; font-size: 12px; }
#passkey-status:empty { display: none; }
#passkey-status.success { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 13px; }
#passkey-status.success svg { width: 14px; height: 14px; }
#passkey-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
#passkey-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding-block: 6px; border-bottom: 1px solid var(--line); }
#passkey-list small { display: block; color: var(--muted); font-size: 11px; }
#passkey-list li.is-new small { color: var(--ink); }
#passkey-start, #settings-logout { margin-top: 12px; font-size: 12px; }
#passkey-add { margin-top: 12px; }
#passkey-add label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
#passkey-password { width: 100%; max-width: 360px; font-size: 16px; }
.passkey-actions { display: flex; gap: 8px; margin-top: 10px; }
#export-dialog { width: min(320px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); box-shadow: 0 12px 40px var(--shadow); }
#export-dialog::backdrop { background: var(--backdrop); }
.export-panel { padding: 16px 18px 18px; }
.export-panel h2 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.export-panel label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 11px; }
.export-panel input, .export-panel select { display: block; width: 100%; }
/* iOS gives native date fields an intrinsic minimum width that overflows narrow dialogs. */
.export-panel input[type="date"] { -webkit-appearance: none; appearance: none; min-width: 0; text-align: left; }
.export-panel input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.export-panel .muted { margin: 12px 0 0; }
.compose-extras { display: flex; align-items: center; gap: 6px; min-width: 0; }
#draw { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 5px; color: var(--muted); }
#draw:hover:enabled { color: var(--ink); background: var(--surface); }
.body-view { width: auto; height: auto; stroke-width: 1.6; }
.body-view .outline, #draw-canvas .outline { color: var(--muted); }
.stroke { fill: none; stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.sev-1 { stroke: var(--sev-1); }
.sev-2 { stroke: var(--sev-2); }
.sev-3 { stroke: var(--sev-3); }
.drawing-thumb { display: inline-flex; gap: 2px; min-height: 0; margin-top: 6px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
button.drawing-thumb:hover:enabled { border-color: var(--line-strong); background: var(--paper); }
.drawing-thumb .body-view { width: 48px; height: 114px; }
.drawing-thumb .stroke { stroke-width: 24; }
#entries .drawing-thumb { display: flex; width: max-content; }
#compose-drawing .drawing-thumb { margin: 0; padding: 2px 4px; }
#compose-drawing .drawing-thumb .body-view { width: 16px; height: 38px; }
#compose-drawing .drawing-thumb .stroke { stroke-width: 36; }
#draw-dialog { width: min(440px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 32px)); max-width: 100vw; max-height: 100dvh; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); box-shadow: 0 12px 40px var(--shadow); overscroll-behavior: contain; }
#draw-dialog::backdrop { background: var(--backdrop); }
.draw-panel { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
.draw-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.draw-header h2 { margin: 0; font-size: 15px; font-weight: 600; }
#draw-cancel { justify-self: start; padding-inline: 4px; }
#draw-done { justify-self: end; }
.draw-views { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.draw-views button { flex: 1; min-height: 36px; border: 0; border-radius: 0; color: var(--muted); }
.draw-views button[aria-pressed="true"], .draw-views button[aria-pressed="true"]:hover { color: var(--on-accent); background: var(--accent); }
.draw-surface { flex: 1; min-height: 0; }
.draw-detail { display: flex; flex: 1; min-height: 0; gap: 10px; justify-content: center; }
.draw-detail .body-view { flex: 1; width: auto; height: 100%; max-width: 50%; }
.draw-legend { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
.draw-legend .swatch { display: inline-block; width: 12px; height: 12px; margin: 0 4px 0 12px; vertical-align: -1px; }
.draw-legend .swatch:first-child { margin-left: 0; }
#draw-canvas { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: crosshair; }
#draw-status { min-height: 1.4em; margin: 0; color: var(--error); font-size: 12px; }
#draw-status:empty { min-height: 0; }
.draw-tools { display: flex; gap: 6px; }
.severities { display: flex; flex: 1; gap: 6px; }
.severity { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; padding: 6px 4px; color: var(--muted); font-size: 12px; }
.severity[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.swatch { width: 20px; height: 20px; border-radius: 50%; }
.swatch.sev-1 { background: var(--sev-1); }
.swatch.sev-2 { background: var(--sev-2); }
.swatch.sev-3 { background: var(--sev-3); }
#draw-undo, #draw-clear { padding-inline: 10px; font-size: 12px; color: var(--muted); }
@media (max-width: 560px) {
  #draw-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
}
.export-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#export-status { margin: 10px 0 0; }
#export-status:empty { display: none; }
#main:has(#login-panel:not([hidden])) { max-width: 488px; }
#main:has(#login-panel:not([hidden])) .header { margin-bottom: 36px; }
#login-panel { margin: 0; max-width: 440px; }
#login { margin: 0; }
#login label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.login-controls { display: flex; gap: 10px; }
#password { flex: 1; width: 100%; height: 44px; background: transparent; font-size: 16px; }
#unlock { min-height: 44px; }
#passkey-login { display: block; width: 100%; margin-top: 14px; }
.notifications { position: fixed; z-index: 5; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: min(480px, calc(100vw - 36px)); pointer-events: none; }
.notifications p { margin: 0; padding: 10px 16px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); box-shadow: 0 4px 16px var(--shadow); font-size: 12px; overflow-wrap: anywhere; max-height: 30vh; overflow-y: auto; pointer-events: auto; }
#error { color: var(--error); }
.status { color: var(--muted); }
.status:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
:root[data-font="sans"] :is(.entry-text, #thought, .editor textarea) { font-family: var(--sans); font-size: 15px; line-height: 1.45; }
@media (max-width: 560px) {
  main { padding: max(22px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left)); }
  h1 { font-size: 18px; }
  input, textarea, select { font-size: 16px; }
  .entry-text, #thought, .editor textarea, .date-picker { font-size: 15px; }
  :root[data-font="sans"] :is(.entry-text, #thought, .editor textarea) { font-size: 16px; }
  .entry { padding: 10px 8px; margin-left: -8px; margin-right: -8px; }
  .entry-meta { gap: 4px; }
}
@media (max-width: 400px) {
  .date-controls { gap: 2px; }
  .date-picker { min-width: 10ch; padding-inline: 4px; }
}
@media (max-width: 380px) {
  .login-controls { flex-direction: column; }
  #password { flex: auto; }
}
@media (max-width: 360px) {
  main { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
  .day-toolbar { column-gap: 2px; }
  .date-controls > .icon-button { width: 36px; }
  .date-picker { font-size: 14px; }
}
html.stream-view, .stream-view body { height: 100%; overflow: hidden; overscroll-behavior-y: none; }
.stream-view body { padding-bottom: 0; }
.stream-view #main { position: relative; top: var(--stream-top, 0px); height: var(--stream-height, 100dvh); display: flex; flex-direction: column; }
.stream-view .header { flex-shrink: 0; }
.stream-view #journal, .stream-view #day-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.stream-view .day-toolbar, .stream-view #composer { flex-shrink: 0; }
.stream-view #entries { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; overflow-anchor: none; padding: 0 12px 18px; margin-inline: -12px -8px; scroll-padding-block: 4px; }
.stream-view #entries:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stream-view .notifications { position: static; transform: none; width: auto; max-width: none; flex-shrink: 0; }
.stream-view .notifications p { border: 0; border-radius: 0; box-shadow: none; padding: 6px 0; max-height: min(20vh, 5lh); }
.stream-view.compact-stream #main { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.stream-view.compact-stream .header { margin-bottom: 4px; }
.stream-view.compact-stream .day-toolbar { margin-bottom: 4px; }
.stream-view.compact-stream #entries { padding-block: 4px; scroll-padding-block: 4px; }
.stream-view.compact-stream .notifications p { padding-block: 2px; max-height: max(1lh, calc(var(--stream-height, 100dvh) * .1)); }
.stream-view.compact-stream #thought { --expanded-height: min(3lh, max(44px, calc(var(--stream-height, 100dvh) * .2))); }
.stream-view #composer { margin-right: 12px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
