:root {
  --paper: #f4f3ef; --surface: #fbfaf7; --ink: #203c52; --muted: #4a5e6f; --sand: #e8dcc2;
  --sky: #dce9f3; --harbor: #305c7d; --terra: #a84f33; --terra-soft: #f3e2d9;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 "Open Sans", "Segoe UI", system-ui, sans-serif; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); background: var(--harbor); color: #fff; }
.brand { display: inline-flex; align-items: center; min-height: 44px; color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; letter-spacing: .14em; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px 64px; }
h1 { margin: 16px 0 8px; font-size: 26px; line-height: 1.15; letter-spacing: -.02em; }
h2 { margin: 32px 0 8px; font-size: 16px; }
p { margin: 8px 0; }
a { color: var(--harbor); }
:focus-visible { outline: 2px solid var(--harbor); outline-offset: 2px; }
header :focus-visible { outline-color: #fff; }
code { font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

.mode { margin: 0 0 8px; padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.mode.on { background: var(--sky); }
.mode.off { background: var(--sand); }
.flash { padding: 12px; border-radius: 6px; background: var(--harbor); color: #fff; font-weight: 600; }
.empty { padding: 16px; border: 1px solid var(--sand); border-radius: 6px; background: var(--surface); color: var(--muted); }
.n { color: var(--muted); font-weight: 400; }
.back { margin-top: 4px; font-size: 14px; }
.back a { display: inline-block; padding: 10px 0; }

.cards, .plain, .notes, .photos, .log ul { list-style: none; margin: 0; padding: 0; }
.cards { display: grid; gap: 8px; }
.card { display: flex; gap: 12px; min-height: 96px; padding: 8px; border: 1px solid var(--sand); border-radius: 6px; background: var(--surface); color: inherit; text-decoration: none; }
.card:hover { border-color: var(--harbor); }
.thumb { flex: none; width: 64px; height: 80px; overflow: hidden; border-radius: 2px; background: var(--sand); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.time { font-size: 13px; font-weight: 600; color: var(--muted); }
.first { display: -webkit-box; overflow: hidden; font-size: 15px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 0; }
.count { font-size: 12px; color: var(--muted); }
.pill { padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.warm { background: var(--terra-soft); color: var(--terra); }
.pill.blue { background: var(--sky); color: var(--harbor); }
.pill.quiet { background: var(--sand); color: var(--ink); }

.photos { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; scroll-snap-type: x mandatory; }
.photos li { flex: 0 0 min(88%, 420px); scroll-snap-align: start; }
.photos li:only-child { flex-basis: 100%; }
.photos img { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--sand); }
.photos .missing { padding: 32px 16px; border-radius: 6px; background: var(--terra-soft); color: var(--terra); }
.caption { padding: 12px; border: 1px solid var(--sand); border-radius: 6px; background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; }
.fb { font-size: 13px; color: var(--muted); }
.fb span { overflow-wrap: anywhere; }
.hint { font-size: 14px; color: var(--muted); }
.ok { font-weight: 600; }
.notes { display: grid; gap: 6px; margin-top: 16px; font-size: 14px; }
.notes li { padding: 8px 12px; border-radius: 6px; background: var(--sand); }
.notes .bad { background: var(--terra-soft); color: var(--terra); }
.actions { margin-top: 24px; }

.who { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
select { min-width: 140px; min-height: 44px; padding: 0 8px; border: 1px solid var(--harbor); border-radius: 2px; background: var(--surface); color: var(--ink); font: inherit; }
button { min-height: 44px; border-radius: 2px; font: inherit; cursor: pointer; }
.primary { width: 100%; padding: 10px 16px; border: 0; background: var(--terra); color: #fff; font-weight: 700; }
.primary:hover { background: #8f412a; }
.secondary { width: 100%; padding: 10px 16px; border: 1px solid var(--harbor); background: transparent; color: var(--harbor); font-weight: 600; }
.log { margin-top: 40px; font-size: 13px; color: var(--muted); }
.log summary { min-height: 44px; padding: 10px 0; cursor: pointer; }
.log li { padding: 4px 0; overflow-wrap: anywhere; }

.post-id { display: block; color: var(--harbor); font: 700 15px/1.3 ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.post-title { font: 700 24px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0; overflow-wrap: anywhere; user-select: all; }
.post-when { margin: 0 0 8px; color: var(--muted); font-weight: 600; }
header{display:flex;justify-content:space-between;align-items:center;gap:16px}
.who-out{display:flex;align-items:center;gap:8px;font-size:.875rem}
button.link{background:none;border:0;padding:0;color:inherit;text-decoration:underline;cursor:pointer;font:inherit}
.grid{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:16px}
.tile{display:flex;flex-direction:column;gap:8px;color:inherit;text-decoration:none}
.tile img{width:100%;aspect-ratio:4/5;object-fit:cover;border-radius:6px;display:block}
.tile-name{font-size:.8125rem;overflow-wrap:anywhere}
.tile .pill{align-self:flex-start}
.upload,.search{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;margin:16px 0}
.upload label,.search label{display:flex;flex-direction:column;gap:4px;flex:1 1 200px}
.review{display:flex;flex-direction:column;gap:16px;margin-top:16px}
.review label{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.review input:not([type=radio]):not([type=checkbox]),.review select{flex:1 1 200px;min-width:0;padding:8px}
.review fieldset{border:1px solid #e5dcc8;border-radius:6px;display:flex;flex-direction:column;gap:8px;padding:16px}
img.full{width:100%;height:auto;border-radius:6px;display:block;margin:16px 0}
