:root {
  /* 가을색: 단풍 적갈색(강조), 겨자색(만드는 중), 이끼 올리브(만들었어요), 양피지·밤색 바탕 */
  color-scheme: light dark;
  --bg: #f5ede1;
  --card: #fffaf3;
  --ink: #2b1d14;
  --muted: #7a6553;
  --line: #e6d5bf;
  --accent: #b23f1a;
  --accent-ink: #fffaf3;
  --accent-soft: #f7dfcc;
  --review: #6e4b2a;
  --review-soft: #efe2d0;
  --doing: #8a5600;
  --doing-soft: #f6e7c4;
  --done: #4d6a26;
  --done-soft: #e6ecd3;
  --declined: #645a50;
  --declined-soft: #ebe4da;
  --warn: #7a4600;
  --warn-soft: #fbeccb;
  --bad: #a3271b;
  --shadow: 0 1px 2px rgba(60, 35, 15, .07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #19120d;
    --card: #241a13;
    --ink: #f3e7d7;
    --muted: #b49f89;
    --line: #3e2f23;
    --accent: #ec7b47;
    --accent-ink: #1f1008;
    --accent-soft: #3e2216;
    --review: #d9b08c;
    --review-soft: #33261b;
    --doing: #e6b65c;
    --doing-soft: #3a2c12;
    --done: #aac77b;
    --done-soft: #263019;
    --declined: #a99d90;
    --declined-soft: #2c2520;
    --warn: #f0c674;
    --warn-soft: #3a2c12;
    --bad: #ff7b6b;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
main { max-width: 680px; margin: 0 auto; padding: 28px 16px calc(48px + env(safe-area-inset-bottom)); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { margin-bottom: 20px; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
h1 { margin: 2px 0 8px; font-size: clamp(26px, 6vw, 34px); line-height: 1.25; letter-spacing: -.02em; }
.lead { margin: 0; color: var(--muted); font-size: 15px; }

.write {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.field { display: block; position: relative; margin-bottom: 12px; }
.label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.label em { font-style: normal; font-weight: 500; font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.write input, .write textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  padding: 10px 12px;
  font-size: 16px;
}
.write textarea { resize: vertical; min-height: 84px; }
.write input:focus, .write textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.count { display: block; text-align: right; font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.count.full { color: var(--bad); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.send-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: flex-end; }
.note { flex: 1 1 220px; margin: 0; font-size: 13px; color: var(--muted); }
.send-actions { flex: none; display: flex; align-items: center; gap: 6px; }
.check { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; font-size: 14px; font-weight: 600; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.primary {
  flex: none;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  padding: 10px 22px;
  min-height: 44px;
}
.primary:disabled { opacity: .55; cursor: default; }
.msg { margin: 8px 0 0; font-size: 14px; min-height: 0; }
.msg:empty { display: none; }
.msg.bad { color: var(--bad); }
.msg.good { color: var(--done); }

.warn { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.warn p { margin: 0 0 8px; }
.warn-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ghost { border: 1px solid currentColor; background: transparent; border-radius: 8px; padding: 6px 12px; font-size: 14px; min-height: 36px; }
.ghost.strong { font-weight: 700; }

.list { margin-top: 28px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--muted);
  min-height: 44px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.post {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px 16px;
  box-shadow: var(--shadow);
  scroll-margin-top: 16px;
}
.post.fresh { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); } }
.post-main { min-width: 0; }
.post h3 { margin: 0; font-size: 17px; line-height: 1.45; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 7px; margin-bottom: 4px; }
.badge.review { background: var(--review-soft); color: var(--review); }
.badge.doing { background: var(--doing-soft); color: var(--doing); }
.badge.done { background: var(--done-soft); color: var(--done); }
.badge.declined { background: var(--declined-soft); color: var(--declined); }
.badge.notice { background: var(--accent); color: var(--accent-ink); }
.badge.private { background: var(--review-soft); color: var(--review); }
.badge + .badge { margin-left: 4px; }
.post.private { grid-template-columns: 1fr; }
.notices { margin-bottom: 10px; }
.post.notice { grid-template-columns: 1fr; border-color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.post.notice .body { opacity: 1; }
.post .body { margin: 4px 0 0; white-space: pre-wrap; font-size: 15px; color: var(--ink); opacity: .88; }
.post .body.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }
.link.bad { color: var(--bad); }
.like {
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  padding: 8px 6px 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  transition: background .15s, color .15s, border-color .15s;
}
.like svg { width: 22px; height: 22px; }
.like svg path { fill: none; stroke: currentColor; stroke-width: 2; }
.like[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.like[aria-pressed="true"] svg path { fill: currentColor; }
.like.pop svg { animation: pop .3s ease-out; }
@keyframes pop { 50% { transform: scale(1.25); } }
@media (hover: hover) { .like:hover { border-color: var(--accent); color: var(--accent); } }

.empty { text-align: center; color: var(--muted); padding: 28px 0; margin: 0; }
.more {
  display: block;
  width: 100%;
  margin-top: 12px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-weight: 600;
}
.foot { margin-top: 40px; text-align: center; font-size: 12.5px; color: var(--muted); }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
