:root {
  --bg: #1b120a; --bg2: #2d1b0e; --card: #26180d; --line: #4a3020; --ink: #f6ead8; --muted: #c4ab8d;
  --amber: #e6952b; --amber-ink: #1b120a; --doc: #34c38f; --danger: #ef6b5b;
  --pink: #f48fb1; --orange: #ffa94d; --red: #ff6b6b; --blue: #74c0fc; --purple: #b197fc;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--amber); }
.shell { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg2) 92%, transparent); backdrop-filter: blur(8px); padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: .01em; }
.who { font-size: .85rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
main { flex: 1; padding: 14px 16px 110px; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; background: var(--bg2); border-top: 1px solid var(--line); padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px); }
.tabs .row { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tab { background: none; border: 0; padding: 6px 2px; color: var(--muted); font-size: .72rem; display: grid; justify-items: center; gap: 2px; cursor: pointer; border-radius: 12px; }
.tab span { font-size: 1.35rem; line-height: 1; }
.tab.on { color: var(--ink); background: color-mix(in srgb, var(--amber) 16%, transparent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 700; cursor: pointer; background: var(--amber); color: var(--amber-ink); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.doc { background: transparent; color: var(--doc); border: 1.5px solid var(--doc); }
.btn.small { padding: 7px 12px; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: wait; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.post { margin-bottom: 16px; }
.post-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #5a3a1e; display: grid; place-items: center; font-weight: 800; color: #ffd8a8; }
.name { font-weight: 700; font-size: .95rem; }
.meta { font-size: .78rem; color: var(--muted); }
.post img.photo { display: block; width: 100%; max-height: 70vh; object-fit: cover; background: #120c07; }
.caption { padding: 10px 14px 0; }
.votes { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.vote { border: 1px solid var(--line); background: #1f140b; border-radius: 999px; padding: 6px 10px; font-size: .85rem; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.vote.on { border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }
.post-foot { display: flex; justify-content: space-between; padding: 0 14px 12px; }
.linkish { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 0; font-size: .88rem; }
.seg { display: inline-flex; background: #1f140b; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 14px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; color: var(--muted); cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--amber); color: var(--amber-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.badge-doc { color: var(--doc); border: 1px solid var(--doc); border-radius: 999px; font-size: .7rem; padding: 1px 7px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
label.field { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; margin-bottom: 12px; }
input[type=text], input[type=password], textarea { width: 100%; background: #1f140b; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted); margin: 6px 0 14px; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--amber); }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 34px 16px; text-align: center; color: var(--muted); cursor: pointer; display: block; }
.drop img { max-width: 100%; max-height: 50vh; border-radius: 12px; }
.err { color: var(--danger); font-size: .9rem; min-height: 1.2em; margin: 6px 0; }
.note { color: var(--muted); font-size: .85rem; }
.welcome { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.welcome .box { width: 100%; max-width: 380px; position: relative; z-index: 1; text-align: center; }
.welcome h1 { font-size: 2.6rem; margin: 6px 0 4px; }
.welcome .emoji { font-size: 4rem; }
.welcome .stack { display: grid; gap: 10px; margin-top: 22px; text-align: left; }
.rain { position: absolute; inset: 0; pointer-events: none; opacity: .18; }
.rain span { position: absolute; top: -40px; font-size: 26px; animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rain { display: none; } }
.creds { background: #1f140b; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-family: ui-monospace, Menlo, monospace; text-align: left; margin: 12px 0; }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: grid; align-items: end; }
.sheet { background: var(--bg2); border-radius: 20px 20px 0 0; max-height: 88dvh; overflow: auto; width: 100%; max-width: 560px; margin: 0 auto; padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px); }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line); }
.row2 { display: flex; gap: 8px; align-items: center; }
.row2 input { flex: 1; }
h2 { font-size: 1.15rem; margin: 4px 0 10px; }
h3 { font-size: 1rem; margin: 18px 0 6px; }
.bristol { display: grid; gap: 8px; }
.bristol div { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 10px 12px; background: #1f140b; border: 1px solid var(--line); border-radius: 12px; font-size: .92rem; }
.bristol b { color: var(--amber); }
.warnbox { border: 1px solid var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); border-radius: 12px; padding: 12px 14px; }
.warnbox ul, .tips ul { margin: 6px 0 0; padding-left: 20px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 700; z-index: 30; }
.rank { width: 30px; text-align: center; font-weight: 800; color: var(--muted); }
.lb-item { display: flex; align-items: center; gap: 10px; padding: 8px; }
.lb-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
