/* day·two — clear and light: white page, hairline cards, serif reading type, one ink-blue accent. */
:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --ink: #1c1f24;
  --ink-2: #4b5260;
  --muted: #6b7280;
  --line: #e6e8ec;
  --wash: #f5f6f8;
  --accent: #2f5bd3;
  --accent-ink: #fff;
  --accent-wash: #e8eefc;
  --shadow-sm: 0 0 0 1px var(--line), 0 1px 2px rgb(16 24 40 / 4%);
  --shadow: 0 0 0 1px var(--line), 0 12px 32px -10px rgb(16 24 40 / 18%);
  --serif: "New York", "Iowan Old Style", "Charter", ui-serif, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --r: 16px;
  --w: 720px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --paper: #181b21;
    --ink: #e8eaee;
    --ink-2: #b4bac4;
    --muted: #7d8592;
    --line: #262a32;
    --wash: #1f232a;
    --accent: #7aa2ff;
    --accent-ink: #0f1115;
    --accent-wash: #1c2740;
    --shadow-sm: 0 0 0 1px var(--line);
    --shadow: 0 0 0 1px var(--line), 0 12px 30px -10px rgb(0 0 0 / 60%);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wordmark { font: 600 21px/1 var(--serif); letter-spacing: -0.015em; white-space: nowrap; }
.wordmark span { color: var(--accent); }

/* Avatars: Google photo, or initials on a light tint. */
.avatar { --s: 28px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; object-fit: cover; background: var(--accent-wash);
  color: var(--accent); display: inline-grid; place-items: center; font: 600 calc(var(--s) * 0.42)/1 var(--sans); overflow: hidden; }
.avatar.alt { background: #dfe7dc; color: #4c6a46; }
@media (prefers-color-scheme: dark) { .avatar.alt { background: #26321f; color: #9fbe92; } }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); text-align: center; padding: 8px; }
.login-card .wordmark { font-size: 46px; }
.login-sub { margin: 12px 0 36px; color: var(--muted); font: italic 17px var(--serif); }
#google-button { display: flex; justify-content: center; }
#dev-login { display: grid; gap: 10px; justify-items: center; margin-top: 14px; }
#dev-login button { min-width: 240px; padding: 11px 18px; border-radius: 999px; background: var(--paper); box-shadow: var(--shadow-sm); font-weight: 500; }
#dev-login button:hover { color: var(--accent); }
.login-error { color: var(--accent); margin-top: 18px; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.top-inner { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 22px; }
.tabs { display: flex; gap: 20px; }
.tabs a { color: var(--muted); font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; width: min(260px, 40vw); background: var(--wash); border-radius: 10px; padding: 7px 12px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); }
.search input::-webkit-search-cancel-button { display: none; }
.me .avatar { --s: 32px; }
.top-inner { position: relative; }
.menu { position: absolute; right: 16px; top: calc(100% - 4px); z-index: 30; min-width: 240px; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; animation: fade .15s; }
.menu-head { display: flex; gap: 10px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head .avatar { --s: 36px; }
.menu-head b { display: block; font-weight: 600; }
.menu-head small { color: var(--muted); font-size: 12.5px; }
.menu button { width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); }
.menu button:hover { background: var(--wash); color: var(--ink); }

.page { max-width: var(--w); margin: 0 auto; padding: 22px 16px 120px; }

/* Composer */
.composer { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 14px 16px; margin-bottom: 26px; }
.composer-row { display: flex; gap: 12px; align-items: flex-start; }
.composer:not(.open) .composer-row { align-items: center; }
.ed-main { flex: 1; min-width: 0; }
.composer textarea { width: 100%; display: block; border: 0; outline: 0; resize: none; background: none; font: 17px/1.6 var(--serif); padding: 3px 0; min-height: 30px; max-height: 60vh; }
.fmt { display: none; align-items: center; gap: 2px; margin: -4px 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.composer.open .fmt { display: flex; }
.fmt button { min-width: 32px; height: 30px; padding: 0 7px; border-radius: 7px; color: var(--ink-2); display: inline-grid; place-items: center; font: 600 15px/1 var(--serif); }
.fmt button:hover:not(:disabled) { background: var(--wash); color: var(--ink); }
.fmt button:disabled { opacity: .35; cursor: default; }
.fmt .t-h { font: 700 14px/1 var(--sans); }
.fmt .t-i { font: italic 600 16px/1 var(--serif); }
.fmt .fmt-text { font: 500 13px var(--sans); color: var(--muted); }
.ed-surface .wysiwyg { outline: 0; font-size: 17px; line-height: 1.6; min-height: 30px; }
.composer.open .ed-surface .wysiwyg { min-height: 110px; }
.editor .ed-surface .wysiwyg { font-size: 19px; min-height: 50vh; }
.wysiwyg > :first-child { margin-top: 0; }
.wysiwyg > :last-child { margin-bottom: 0; }
.wysiwyg p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--muted); font-style: italic; float: left; height: 0; pointer-events: none; }
.wysiwyg img { max-width: 100%; border-radius: 12px; display: block; margin: 12px 0; }
.wysiwyg img.ProseMirror-selectednode { outline: 3px solid var(--accent); }
.fmt button.active { background: var(--accent-wash); color: var(--accent); }
.link-input { display: inline-flex; gap: 4px; margin-left: 6px; }
.link-input input { width: 200px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); padding: 4px 8px; font-size: 13px; outline: 0; }
.link-input button { font-size: 13px; font-weight: 600; color: var(--accent); padding: 0 6px; }
.editor { margin-top: 8px; }

.reader-bar .spacer, .fmt .spacer { flex: 1; }
.composer textarea::placeholder { color: var(--muted); font-style: italic; }
.composer-tools { display: none; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.composer.open .composer-tools { display: flex; }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; }
.tool:hover { background: var(--wash); }
.tool.on { color: var(--accent); }
.tool select { border: 0; background: none; outline: 0; cursor: pointer; }
.composer .spacer { flex: 1; }
.btn { padding: 8px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.shots img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }

/* Memories ("An diesem Tag") */
.memories h2, .month { font: 600 12px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 2px 12px; }
.memories { margin-bottom: 30px; }
.mem-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.mem-row::-webkit-scrollbar { display: none; }
.mem { flex: 0 0 min(260px, 75%); scroll-snap-align: start; position: relative; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden;
  background: var(--accent-wash); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; color: #fff; }
.mem img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mem::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(10 12 16 / 72%), rgb(10 12 16 / 0%) 60%); }
.mem.text-only { color: var(--ink); justify-content: space-between; }
.mem.text-only::after { display: none; }
.mem > * { position: relative; z-index: 1; }
.mem small { font-size: 12px; font-weight: 600; letter-spacing: .04em; opacity: .85; }
.mem b { font: 600 17px/1.3 var(--serif); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mem.text-only p { margin: 0; font: italic 15px/1.45 var(--serif); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* Journal filter */
.filters { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 6px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 5px 12px; border-radius: 999px; color: var(--ink-2); font-size: 14px; }
.chip:hover { background: var(--wash); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Year/month jump bar, sticky under the header */
.years { position: sticky; top: var(--top-h, 57px); z-index: 5; margin: 0 -16px 4px; padding: 8px 16px 6px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px); }
.years-row { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.years-row::-webkit-scrollbar { display: none; }
.years-row .chip { font-variant-numeric: tabular-nums; }
.years-row.months { margin-top: 4px; }
.years-row .sep { flex: none; width: 1px; margin: 6px 6px; background: var(--line); }
.years-row.months .chip { font-size: 13px; padding: 4px 10px; }
.chip small { margin-left: 5px; font-size: 11px; color: var(--muted); }
.chip[aria-pressed="true"] small { color: inherit; opacity: .6; }

/* Timeline */
.month { margin: 34px 2px 12px; }
.card { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: start; padding: 16px; margin-bottom: 8px;
  background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow-sm); transition: box-shadow .2s ease, transform .2s ease; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.day { text-align: center; padding-top: 1px; }
.day b { display: block; font: 600 25px/1 var(--serif); }
.day small { display: block; margin-top: 5px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.card h3 { margin: 1px 0 4px; font: 600 17px/1.35 var(--serif); overflow-wrap: anywhere; }
.card p { margin: 0; color: var(--ink-2); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 9px; font-size: 12.5px; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .ico { width: 14px; height: 14px; }
.meta .avatar { --s: 18px; }
.meta .star { color: var(--accent); }
.meta .star .ico { fill: currentColor; stroke: none; }
.thumb { position: relative; }
.thumb img { width: 88px; height: 88px; object-fit: cover; border-radius: 12px; display: block; background: var(--wash); }
.thumb .count { position: absolute; right: 6px; bottom: 6px; background: rgb(0 0 0 / 55%); color: #fff; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 6px; }
.empty { text-align: center; color: var(--muted); padding: 70px 0; font: italic 17px var(--serif); }
.skeleton { height: 108px; border-radius: var(--r); background: var(--paper); margin-bottom: 8px; opacity: .6; }

/* Reader */
.reader { position: fixed; inset: 0; z-index: 20; overflow-y: auto; background: var(--bg); animation: rise .24s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.reader-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.reader-bar button { display: inline-flex; align-items: center; gap: 2px; padding: 6px 12px 6px 6px; border-radius: 999px; color: var(--ink-2); font-weight: 500; }
.reader-bar button:hover { background: var(--wash); }
.reader-body { max-width: 680px; margin: 0 auto; padding: 18px 20px 120px; }
.byline { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; color: var(--muted); font-size: 14px; }
.byline .avatar { --s: 34px; }
.byline b { display: block; color: var(--ink); font-weight: 600; }
.prose { font: 19px/1.72 var(--serif); overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3 { font-family: var(--serif); line-height: 1.22; letter-spacing: -0.01em; margin: 1.5em 0 .5em; }
.prose h1 { font-size: 34px; margin-top: 0; }
.prose h2 { font-size: 25px; }
.prose h3 { font-size: 21px; }
.prose p { margin: 0 0 1.05em; }
.prose blockquote { margin: 1.3em 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--accent); color: var(--ink-2); font-style: italic; }
.prose figure { margin: 1.6em -20px; }
.prose figure img { width: 100%; display: block; background: var(--wash); cursor: zoom-in; }
@media (min-width: 720px) { .prose figure { margin: 1.6em 0; } .prose figure img { border-radius: 14px; } }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1.05em; }
.prose li { margin: .2em 0; }
.prose hr { border: 0; text-align: center; margin: 2em 0; }
.prose hr::after { content: "·  ·  ·"; color: var(--muted); }
.prose .missing { display: grid; place-items: center; aspect-ratio: 3 / 2; border-radius: 14px; background: var(--wash); color: var(--muted); font: 14px var(--sans); }
.facts { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 14px; color: var(--ink-2); }
.facts div { display: flex; align-items: center; gap: 10px; }
.facts .ico { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { background: var(--accent-wash); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-size: 13px; }

.lightbox { position: fixed; inset: 0; z-index: 40; background: rgb(8 9 12 / 94%); display: grid; place-items: center; cursor: zoom-out; animation: fade .18s; }
.lightbox img { max-width: 96vw; max-height: 94dvh; border-radius: 4px; }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); animation: fade .2s; }

/* Map */
.map-page { position: fixed; inset: 0; top: var(--top-h, 58px); }
#map { position: absolute; inset: 0; background: var(--wash); }
.map-legend { position: absolute; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 500; display: flex; gap: 14px; align-items: center;
  background: var(--paper); border-radius: 999px; padding: 7px 14px 7px 8px; box-shadow: var(--shadow); font-size: 13px; color: var(--ink-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 7px; }
.map-legend .avatar { --s: 22px; }
.pin { position: relative; }
.pin .avatar { --s: 38px; border: 2.5px solid var(--paper); box-shadow: 0 2px 8px rgb(0 0 0 / 28%); }
.pin::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: var(--paper); transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 3px 0; z-index: -1; box-shadow: 2px 2px 4px rgb(0 0 0 / 15%); }
.cluster { display: grid; place-items: center; }
.cluster-inner { position: relative; display: flex; align-items: center; background: var(--paper); border-radius: 999px; padding: 3px 10px 3px 3px; box-shadow: 0 2px 10px rgb(0 0 0 / 25%); white-space: nowrap; }
.cluster-inner .avatar { --s: 30px; border: 2px solid var(--paper); }
.cluster-inner .avatar + .avatar { margin-left: -10px; }
.cluster-inner b { margin-left: 7px; font: 600 14px/1 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.leaflet-container { font: 14px var(--sans) !important; background: var(--wash) !important; }
.leaflet-tile-pane { filter: saturate(.35) brightness(1.04) contrast(.92); }
@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) saturate(.25) brightness(.8) contrast(.88); }
}
.leaflet-popup-content-wrapper { border-radius: 14px !important; background: var(--paper) !important; color: var(--ink) !important; box-shadow: var(--shadow) !important; padding: 0 !important; overflow: hidden; }
.leaflet-popup-content { margin: 0 !important; width: 240px !important; }
.leaflet-popup-tip { background: var(--paper) !important; }
.leaflet-control-zoom a { background: var(--paper) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--paper) 80%, transparent) !important; color: var(--muted) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.pop img { width: 100%; height: 130px; object-fit: cover; display: block; }
.pop div { padding: 10px 14px 12px; }
.pop small { color: var(--muted); font-size: 12px; }
.pop b { display: block; font: 600 15px/1.3 var(--serif); margin-top: 2px; }
.pop .more { display: block; margin-top: 6px; font-size: 12.5px; color: var(--accent); }

@media (max-width: 600px) {
  .top-inner { gap: 14px; }
  .search { width: auto; flex: 1; min-width: 0; }
  .search input::placeholder { color: transparent; }
  .tabs { gap: 14px; }
  .wordmark { font-size: 19px; }
  .card { grid-template-columns: 34px 1fr; gap: 12px; padding: 14px; }
  .card .thumb { grid-column: 1 / -1; order: -1; margin: -14px -14px 2px; }
  .card .thumb img { width: 100%; height: 190px; border-radius: var(--r) var(--r) 0 0; }
  .day b { font-size: 21px; }
  .prose { font-size: 18px; }
  .prose h1 { font-size: 28px; }
}
@media (max-width: 420px) { .top .wordmark { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.wysiwyg li > p { margin: 0; }
.wysiwyg ul, .wysiwyg ol { margin: .4em 0 .8em; }
.wysiwyg p { margin: 0 0 .7em; }

/* Floating "+" (appears once the composer is scrolled away) and the quick-entry sheet. */
.fab { position: fixed; right: max(20px, calc(50vw - var(--w) / 2 - 76px)); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 15;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 20px -4px color-mix(in srgb, var(--accent) 55%, transparent), 0 2px 6px rgb(16 24 40 / 12%);
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.fab.show { opacity: 1; transform: none; pointer-events: auto; }
.fab:hover { filter: brightness(1.08); }
.fab .ico { width: 24px; height: 24px; stroke-width: 2.2; }
.sheet { position: fixed; inset: 0; z-index: 25; background: rgb(10 12 16 / 36%); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: start center;
  padding: max(9vh, 24px) 16px 16px; animation: fade .16s; overflow-y: auto; }
.sheet-card { width: min(var(--w), 100%); animation: rise .22s cubic-bezier(.2,.7,.2,1); }
.sheet-card .composer { margin: 0; box-shadow: var(--shadow); }
@media (max-width: 640px) {
  .fab { right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); }
  .sheet { padding: 12px 8px; }
}
@media (prefers-color-scheme: dark) { .sheet { background: rgb(0 0 0 / 55%); } }
