* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.6 -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; background: #f6f3ef; color: #222; padding-bottom: 90px; }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: #7a2e0e; color: #fff; }
header h1 { flex: 1; margin: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { background: none; border: 0; color: #fff; font-size: 24px; padding: 0 6px; position: relative; }
#q-count { position: absolute; top: -4px; right: -4px; background: #e33; border-radius: 9px; font-size: 11px; padding: 0 5px; }
#q-count:empty { display: none; }
.view { display: none; padding: 12px 14px; max-width: 820px; margin: 0 auto; }
.view.on { display: block; }
button, input, textarea { font: inherit; }
button { padding: 10px 14px; border: 1px solid #ccc; border-radius: 8px; background: #fff; }
.primary { background: #7a2e0e; color: #fff; border: 0; width: 100%; margin: 6px 0; }
input[type=email], input[type=password], textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 8px; margin: 6px 0; }
.muted { color: #777; font-size: 14px; }
.pre { white-space: pre-wrap; }
.cards { list-style: none; padding: 0; margin: 0 0 16px; }
.cards a { display: block; padding: 12px; margin: 6px 0; background: #fff; border-radius: 8px; color: inherit; text-decoration: none; box-shadow: 0 1px 2px #0002; }
summary { font-size: 16px; font-weight: bold; color: #7a2e0e; padding: 10px 2px; cursor: pointer; }
summary small { color: #999; font-weight: normal; }
#fab { position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 16px); background: #e05a1c; color: #fff; border: 0; border-radius: 28px; padding: 14px 20px; box-shadow: 0 2px 8px #0004; font-weight: bold; }
.photo-btn { display: block; text-align: center; padding: 12px; border: 2px dashed #bbb; border-radius: 8px; margin: 6px 0; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumbs span { position: relative; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; }
.thumbs button { position: absolute; top: 2px; right: 2px; padding: 0 6px; }
.q { background: #fff; border-radius: 8px; padding: 10px 12px; margin: 8px 0; }

/* 카드 본문 (마크다운) */
.md h1 { font-size: 21px; } .md h2 { font-size: 18px; border-bottom: 2px solid #e0c9b8; padding-bottom: 4px; margin-top: 28px; } .md h3 { font-size: 16px; color: #333; margin-top: 20px; }
.md img { max-width: 100%; height: auto; border: 1px solid #ddd; border-radius: 6px; background: #fff; }
.md blockquote { margin: 10px 0; padding: 8px 12px; background: #fff6df; border-left: 4px solid #e0a800; border-radius: 4px; }
.md blockquote p { margin: 4px 0; }
.md pre { background: #2b2b2b; color: #eee; padding: 10px; border-radius: 6px; overflow-x: auto; font-size: 13px; }
.md code { background: #0001; padding: 0 3px; border-radius: 3px; font-size: 14px; }
.md pre code { background: none; padding: 0; }
.md .tbl { overflow-x: auto; }
.md table { border-collapse: collapse; font-size: 14px; background: #fff; }
.md th, .md td { border: 1px solid #ddd; padding: 6px 8px; vertical-align: top; }
.md th { background: #f1e6dd; }
.md li input[type=checkbox] { transform: scale(1.3); margin-right: 8px; }
.md del { color: #999; }
