:root {
  color-scheme: light;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.7;
  --paper: #fdfdfb;
  --ink: #191a17;
  --muted: #52554f;
  --line: #e4e4df;
  --accent: #333430;
  --surface: #f5f5f2;
  --private: #f0f0ec;
  color: var(--ink);
  background: var(--paper);
}
* { 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(42px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, 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: #c6c7bf; }
button:disabled { 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(--line); border-radius: 4px; padding: 7px 10px; min-width: 0; }
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; line-height: 1.8; padding: 0; overflow-y: hidden; min-height: 100px; }
textarea::placeholder { color: #75776f; opacity: 1; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
h1 { margin: 0; font-size: 25px; letter-spacing: -1.5px; font-weight: 600; }
.brand-dot { color: var(--accent); }
nav { display: flex; border: 1px solid var(--line); border-radius: 6px; padding: 3px; gap: 2px; }
nav a { display: grid; place-items: center; min-height: 44px; padding: 3px 14px; font-size: 12px; color: var(--muted); border-radius: 3px; }
nav a[aria-current="page"] { color: var(--ink); background: #edede8; }
nav a:hover { color: var(--ink); background: var(--surface); }
h2 { font-size: 17px; font-weight: 500; }
.muted { color: var(--muted); font-size: 12px; }
.primary { color: #fff; background: var(--accent); border-color: var(--accent); min-width: 76px; }
.primary:hover:enabled { color: #fff; background: var(--ink); border-color: var(--ink); }
#add:disabled { color: #85877f; background: var(--surface); border-color: var(--line); opacity: 1; }
.quiet { border-color: transparent; color: var(--muted); font-size: 12px; }
.day-toolbar, .date-controls { display: flex; align-items: center; gap: 6px; }
.day-toolbar { justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.icon-button { padding: 8px; width: 44px; display: inline-grid; place-items: center; border-color: transparent; }
.date-controls > .icon-button { flex-shrink: 0; }
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; width: calc(10ch + 12px); flex-shrink: 0; font-size: 12px; border-radius: 4px; }
.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 { border: 1px solid var(--line); border-radius: 4px; padding: 20px; margin-bottom: 30px; background: transparent; transition: border-color 120ms; }
#composer:focus-within { border-color: #c6c7bf; }
#thought { min-height: 3lh; }
#thought:focus-visible { outline: none; }
.composer-controls { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.private-compose { position: relative; display: inline-grid; place-items: center; color: var(--muted); cursor: pointer; min-height: 44px; width: 44px; border-radius: 4px; }
.private-compose input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.private-compose .lock-icon { pointer-events: none; }
.private-compose:hover, .private-compose:has(:checked) { color: var(--ink); background: var(--private); }
.private-compose:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.shortcut { margin-left: auto; font-size: 10px; color: var(--muted); }
.shortcut.is-disabled { color: #93958d; }
.entry { position: relative; padding: 14px 12px 12px; margin: 0 -12px 6px; border-bottom: 1px solid var(--line); scroll-margin-top: 30px; }
.entry.is-private .entry-text, .entry.is-private .editor textarea { color: #963f39; }
#entries > .entry:not(.review-entry) { border-bottom: 0; padding-block: 0; margin-bottom: 24px; }
.entry-meta { display: flex; align-items: center; gap: 10px; justify-content: space-between; min-height: 36px; margin-bottom: 3px; }
#entries > .entry:not(.review-entry) > .entry-meta { min-height: 0; margin-bottom: 14px; gap: 10px; }
#entries > .entry:not(.review-entry) > .entry-meta::before { content: ""; flex: 1; order: 1; border-top: 1px solid var(--line); }
#entries > .entry:not(.review-entry) > .entry-meta > .entry-actions { order: 2; font-size: 11px; height: 1lh; }
.entry time { color: var(--muted); font-size: 11px; }
.entry-actions { display: flex; align-items: center; }
.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); }
.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 #191a1710; }
.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; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.editor { margin: 8px 0 2px; }
.editor textarea { border: 1px solid #c6c7bf; border-radius: 3px; padding: 10px; min-height: 90px; background: var(--paper); }
.edit-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.edit-error { color: #8d302c; 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; }
.review-entry { display: grid; grid-template-columns: minmax(0, 1fr) 44px; column-gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.review-entry .entry-meta { flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; min-height: 0; margin: 0; }
.review-entry .entry-meta > .icon-button { width: 44px; min-height: 44px; padding: 6px; }
#export-menu { position: relative; }
#review-tools { margin-left: auto; }
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; }
.export-panel { position: absolute; z-index: 3; right: 0; top: 50px; width: min(295px, calc(100vw - 36px)); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 18px; box-shadow: 0 8px 24px #191a1710; }
.export-panel label { display: block; font-size: 11px; color: var(--muted); margin: 8px 0 4px; }
.export-panel input, .export-panel select { width: 100%; }
.export-actions { display: flex; gap: 10px; }
.export-actions button { flex: 1; }
#export-status { margin-bottom: 0; }
#query { width: 100%; padding: 14px 16px; background: transparent; border-color: var(--line); }
#search-status { margin: 14px 0 22px; }
.search-result > a { display: block; border-radius: 2px; }
.search-result:not(.is-private) > a:hover .entry-text { color: var(--accent); }
.search-result .entry-meta { justify-content: flex-start; }
#load-more { display: block; margin: 22px auto 0; }
@keyframes highlight { from { background: #deded5; } }
footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 48px; padding-top: 10px; }
#login-panel { margin: 80px 0; max-width: 440px; }
#login-panel h2 { font-size: 18px; letter-spacing: -.5px; }
#login { margin-top: 30px; }
#login label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.login-controls { display: flex; gap: 10px; }
#password { flex: 1; width: 100%; background: transparent; }
.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 #191a170a; font-size: 12px; overflow-wrap: anywhere; max-height: 30vh; overflow-y: auto; pointer-events: auto; }
#error { color: #80453f; }
.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; }
@media (max-width: 560px) {
  main { padding: max(22px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
  .header { margin-bottom: 24px; gap: 10px; flex-wrap: wrap; }
  nav { margin-left: auto; }
  h1 { font-size: 23px; }
  nav a { padding: 3px 9px; font-size: 11px; }
  #composer { padding: 16px; }
  .shortcut { display: none; }
  .composer-controls .primary { margin-left: auto; }
  input, textarea, select { font-size: 16px; }
  .entry { padding: 10px 8px; margin-left: -8px; margin-right: -8px; }
  .entry-meta { gap: 4px; }
  .review-entry { padding-top: 12px; padding-bottom: 12px; }
  footer { margin-top: 32px; }
  #login-panel { margin-top: 60px; }
}
@media (max-width: 400px) {
  .date-controls { gap: 2px; }
  .date-picker { width: 10ch; }
  #export-menu > summary { padding-inline: 4px; }
}
@media (max-width: 360px) {
  .header { flex-direction: column; align-items: stretch; gap: 12px; }
  nav { margin-left: 0; }
  nav a { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
