:root {
  --bg: #f7f5f0; --card: #fff; --ink: #1d1b16; --muted: #6b665c; --line: #e4dfd4;
  --accent: #c2410c; --accent-ink: #fff; --chip: #f1ece2; --bad: #b42318;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15140f; --card: #1f1d17; --ink: #efeae0; --muted: #a39d90; --line: #34302a;
    --accent: #fb923c; --accent-ink: #1d1b16; --chip: #2b2821; --bad: #f97066;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.wrap { max-width: 760px; margin: 0 auto; padding: 32px 16px 80px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
h1 { font: 700 28px/1 Georgia, "Times New Roman", serif; margin: 0; letter-spacing: -0.5px; }
h1 span { color: var(--accent); }
.sub { color: var(--muted); font-size: 13px; }
form.add { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
input, textarea { width: 100%; font: inherit; color: inherit; background: transparent; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 64px; }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
button { font: inherit; border: 0; border-radius: 9px; padding: 9px 16px; cursor: pointer; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.ghost { background: transparent; color: var(--muted); padding: 4px 8px; font-weight: 500; }
button.ghost:hover { color: var(--ink); }
button:disabled { opacity: .6; cursor: default; }
.err { color: var(--bad); font-size: 13px; }
.search { margin: 28px 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip { background: var(--chip); color: var(--muted); border: 1px solid transparent; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; cursor: pointer; }
.chip.on { border-color: var(--accent); color: var(--ink); }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.item h2 { font-size: 16px; margin: 0 0 2px; line-height: 1.35; }
.item h2 a { color: inherit; text-decoration: none; }
.item h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.item .meta { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.item p { margin: 8px 0; }
.item .note { color: var(--muted); white-space: pre-wrap; border-left: 3px solid var(--line); padding-left: 10px; }
.item .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pending { color: var(--muted); font-style: italic; }
.pending::after { content: "…"; animation: dots 1.2s steps(3) infinite; display: inline-block; width: 1em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0 } to { width: 1em } }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.banner { background: var(--chip); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px; }
.login { max-width: 340px; margin: 18vh auto 0; padding: 0 16px; }
.login form { display: grid; gap: 10px; margin-top: 18px; }
.hero p { font-size: 17px; color: var(--muted); margin: 0 0 18px; }
.tabs { display: flex; gap: 6px; }
.tab { background: transparent; color: var(--muted); padding: 6px 12px; font-weight: 600; }
.tab.on { background: var(--chip); color: var(--ink); }
.fine { color: var(--muted); font-size: 12.5px; }
a { color: var(--accent); }
button.danger { background: var(--bad); color: #fff; }
details summary { cursor: pointer; font-size: 14px; }
footer { margin-top: 48px; text-align: center; font-size: 12.5px; }
footer a { color: var(--muted); }
#accountBtn { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prose h1 { margin: 12px 0 6px; }
.prose h2 { font-size: 17px; margin: 26px 0 6px; }
.prose li { margin: 4px 0; }
