:root {
  --bg: #0f1115; --panel: #171a21; --line: #2a2f3a; --text: #e8eaf0; --muted: #9aa3b2;
  --accent: #f2b544; --accent-ink: #1a1200; --danger: #e5484d; --ok: #3ddc84; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; }
main { max-width: 640px; margin: 0 auto; padding: 24px 16px 64px; }
header.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
header.top h1 { font-size: 22px; margin: 0; letter-spacing: 0.3px; }
header.top h1 a { color: inherit; text-decoration: none; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; font-size: 13px; }
.lang button { background: none; border: 0; color: var(--muted); padding: 6px 12px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--panel); color: var(--text); }
.intro { color: var(--muted); margin: 0 0 12px; }
.intro + .card, .intro:last-of-type { margin-bottom: 20px; }
.intro strong { color: var(--text); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 16px; }
.tabs button { background: var(--bg); border: 1px solid var(--line); color: var(--muted); padding: 10px 6px; border-radius: 10px; font-size: 15px; cursor: pointer; }
.tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--text); }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
input[type="text"], select, textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font: inherit; }
textarea { min-height: 110px; resize: vertical; }
input[type="file"] { width: 100%; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
button.primary, a.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer; width: 100%; margin-top: 16px; display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
button.primary:disabled { opacity: 0.6; cursor: wait; }
button.ghost { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 12px; font: inherit; cursor: pointer; }
#done-card button.ghost { width: 100%; margin-top: 10px; padding: 11px 12px; }
button.danger { border-color: var(--danger); color: var(--danger); }
canvas.doodle { width: 100%; aspect-ratio: 1; background: #fff; border-radius: 10px; touch-action: none; display: block; }
.palette { display: flex; gap: 8px; margin-top: 10px; }
.palette button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.palette button[aria-pressed="true"] { border-color: var(--text); }
.preview { max-width: 100%; border-radius: 10px; display: block; margin-top: 10px; }
.status { margin-top: 14px; font-size: 14px; color: var(--muted); min-height: 1.4em; }
.status.error { color: var(--danger); }
.code { font-size: 34px; letter-spacing: 3px; font-weight: 700; text-align: center; padding: 14px; background: var(--bg); border-radius: 10px; margin: 12px 0; user-select: all; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.grid a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--panel); }
.grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.92); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.lightbox[open] { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.months a { display: block; text-align: center; padding: 10px 4px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; }
.months a[aria-current="page"] { border-color: var(--accent); }
.post { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.post img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--bg); }
.post .note { width: 96px; height: 96px; border-radius: 8px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.post .meta { font-size: 13px; color: var(--muted); }
.post .text { white-space: pre-wrap; margin: 4px 0; }
.post .actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.filters { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; font-size: 13px; margin: 6px 0 0; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-all; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); margin-right: 4px; }
.hidden { display: none !important; }
footer { color: var(--muted); font-size: 13px; text-align: center; margin-top: 32px; }
footer a { color: var(--muted); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
