/* 이런 앱 있었으면 좋겠다 (Apps Wanted) — Craigslist처럼 단순하게, 하지만 깔끔하게 */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f4;
  --text: #1b1b1b;
  --muted: #6d6d6d;
  --line: #e6e6e3;
  --link: #0b3fc6;
  --visited: #5b2a86;
  --brand: #5b2a86;
  --brand-ink: #ffffff;
  --accent: #0b3fc6;
  --found: #16794a;
  --found-bg: #e7f5ee;
  --building: #9a5b00;
  --building-bg: #fdf1dc;
  --closed: #6d6d6d;
  --closed-bg: #efefed;
  --danger: #b3261e;
  --radius: 8px;
  --wrap: 1080px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --bg-soft: #1b1b1b;
    --text: #e9e9e7;
    --muted: #9b9b98;
    --line: #2c2c2a;
    --link: #8fb0ff;
    --visited: #c3a2e6;
    --brand: #b88ae0;
    --brand-ink: #121212;
    --accent: #8fb0ff;
    --found: #6fd3a0;
    --found-bg: #173326;
    --building: #f0b561;
    --building-bg: #33270f;
    --closed: #9b9b98;
    --closed-bg: #262625;
    --danger: #ff8a80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .25rem; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 64px; min-height: 70vh; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.n { color: var(--muted); font-size: .85em; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }

/* ───── Header ───── */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; gap: 16px; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo::before { content: ""; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid var(--brand); }
.search { flex: 1; max-width: 420px; }
.search input {
  width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-soft); outline: none;
}
.search input:focus { border-color: var(--accent); background: var(--bg); }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.navlink { color: var(--text); font-weight: 500; }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.08);
  display: flex; flex-direction: column;
}
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.menu-pop a:hover, .menu-pop button:hover { background: var(--bg-soft); text-decoration: none; }

/* ───── Buttons ───── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { border-color: var(--brand); filter: brightness(1.08); }
.btn-on { background: var(--found-bg); border-color: var(--found); color: var(--found); }
.btn-quiet { border-color: transparent; color: var(--muted); }
.btn-sm { height: 28px; padding: 0 10px; font-size: .85rem; }
.btn-lg { height: 46px; padding: 0 18px; font-size: 1rem; width: 100%; justify-content: center; border-radius: 10px; }
.btn.disabled { opacity: .45; pointer-events: none; }
.btn:disabled { opacity: .6; }
.linklike { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font-size: inherit; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: .82rem; color: var(--muted);
}
.chip.on { border-color: var(--found); color: var(--found); background: var(--found-bg); }
form.inline, .inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }

/* ───── Home ───── */
.intro { margin: 0 0 18px; padding: 14px 16px; background: var(--bg-soft); border-radius: var(--radius); }
.intro p { margin: 0; color: var(--muted); }
.cols { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 32px; align-items: start; }
.cols > *, .cols2 > * { min-width: 0; }
.side-h { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 8px; font-weight: 600; }
.cats ul { list-style: none; margin: 0; padding: 0; position: sticky; top: 72px; }
.cats li a { display: flex; justify-content: space-between; padding: 4px 8px; margin: 0 -8px; border-radius: 6px; color: var(--link); }
.cats li a.on { background: var(--bg-soft); color: var(--text); font-weight: 600; text-decoration: none; }

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.list-h { font-size: 1.15rem; margin: 0; }
.sorts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .9rem; }
.sorts a { color: var(--muted); }
.sorts a.on { color: var(--text); font-weight: 600; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.row-main { min-width: 0; flex: 1; }
.row-title { font-size: 1rem; font-weight: 500; }
.row-title:visited { color: var(--visited); }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .82rem; color: var(--muted); margin-top: 2px; align-items: center; }
.row-meta a { color: var(--muted); }
.meta-ans { color: var(--found) !important; font-weight: 600; }
.lang-tag { font-size: .7rem; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }

.vote { margin: 0; }
.vote button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; color: var(--muted); padding: 2px 0; line-height: 1.1;
}
.vote button:hover { border-color: var(--muted); }
.vote button.on { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--bg)); }
.vote-arrow { font-size: .7rem; }
.vote-n { font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.vote-lg button { width: 56px; min-height: 56px; }
.vote-lg .vote-n { font-size: 1.05rem; }

.pager { display: flex; justify-content: space-between; padding: 16px 0; }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; line-height: 1.6; white-space: nowrap; }
.st-open { background: var(--bg-soft); color: var(--muted); }
.st-building { background: var(--building-bg); color: var(--building); }
.st-found { background: var(--found-bg); color: var(--found); }
.st-closed { background: var(--closed-bg); color: var(--closed); }
.badge.maker { background: color-mix(in srgb, var(--brand) 14%, var(--bg)); color: var(--brand); vertical-align: middle; font-size: .7rem; }
.st-row-closed .row-title { color: var(--muted); }

/* ───── Want detail ───── */
.want { max-width: 760px; }
.want-head { display: flex; gap: 14px; align-items: flex-start; }
.want-title { font-size: 1.45rem; margin: 2px 0 6px; }
.byline { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: .85rem; color: var(--muted); margin: 14px 0 10px; }
.userlink { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 500; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--bg-soft); }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; border: 1px solid var(--line); }
.rich p { margin: 0 0 .7rem; }
.rich p:last-child { margin-bottom: 0; }
.want > .rich { font-size: 1.02rem; line-height: 1.75; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 22px 0 8px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.actions select { height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); padding: 0 10px; }

.answer-list, .comment-list { list-style: none; padding: 0; margin: 0; }
.answer { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.answer.is-accepted { border-color: var(--found); box-shadow: inset 3px 0 0 var(--found); }
.answer .byline { margin: 10px 0 0; }
.answer .rich { margin-top: 8px; }
.answer-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.answer-name { font-weight: 700; font-size: 1.02rem; }
.host { font-size: .82rem; }
.kind { font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 4px; border: 1px solid currentColor; }
.kind-made { color: var(--brand); }
.kind-found { color: var(--accent); }
.kind-building { color: var(--building); }
.is-hidden { opacity: .45; }

.comment-list li { padding: 2px 0 12px; border-bottom: 1px solid var(--line); }
.comment-list li .byline { margin: 10px 0 4px; }
.comment-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 14px; }
.login-hint { margin-top: 12px; }

/* ───── Forms ───── */
.narrow { max-width: 640px; }
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.form label { display: flex; flex-direction: column; gap: 4px; }
.form label > span { font-size: .85rem; font-weight: 600; }
.form input:not([type=radio]):not([type=checkbox]), .form select, .form textarea, .comment-form textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); outline: none;
}
.form input:focus, .form select:focus, .form textarea:focus, .comment-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.form textarea, .comment-form textarea { resize: vertical; line-height: 1.6; }
.form select { height: 40px; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-actions { display: flex; gap: 8px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--bg-soft); margin-top: 16px; }
.card.form { gap: 12px; }
.kinds { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.radio { flex-direction: row !important; align-items: center; gap: 6px !important; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); cursor: pointer; font-size: .9rem; }
.radio:has(input:checked) { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.radio input { accent-color: var(--brand); margin: 0; }
.error { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--bg)); padding: 8px 12px; border-radius: 8px; }
.flash { color: var(--found); background: var(--found-bg); padding: 8px 12px; border-radius: 8px; }

.login { max-width: 400px; margin: 40px auto; }
.login-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.login-btns small { color: var(--muted); font-weight: 400; }
.dev-login { margin-top: 28px; padding-top: 18px; border-top: 1px dashed var(--line); flex-direction: row; align-items: flex-end; }
.dev-login label { flex: 1; }

/* ───── Profile / makers ───── */
.profile-head { display: flex; gap: 18px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.profile-head h1 { margin: 0; }
.stats { display: flex; gap: 16px; color: var(--muted); font-size: .9rem; }
.stats b { color: var(--text); }
.cols2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.makers { padding-left: 1.4em; }
.makers li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.makers li > * { vertical-align: middle; margin-right: 8px; }

.prose h2 { margin-top: 1.8rem; }
.prose li { margin-bottom: .35rem; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; }

/* ───── Footer ───── */
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.foot-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding-top: 18px; padding-bottom: 28px; }
.foot-links { display: flex; gap: 16px; }
.foot a { color: var(--muted); }

/* ───── Mobile ───── */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .top-in { gap: 10px; height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .topnav .btn-primary { height: 32px; padding: 0 12px; font-size: .88rem; }
  .cols { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cats .side-h { display: none; }
  .cats ul { position: static; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .cats li a { margin: 0; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: .88rem; }
  .cats li a .n { margin-left: 4px; }
  .grid2, .grid3, .cols2 { grid-template-columns: 1fr; }
  .want-title { font-size: 1.25rem; }
  .profile-head { flex-direction: column; }
  .table { display: block; overflow-x: auto; }
}

/* avatar sizes (CSP: no inline styles) */
.av-18 { width: 18px; height: 18px; font-size: 10px; }
.av-20 { width: 20px; height: 20px; font-size: 10px; }
.av-28 { width: 28px; height: 28px; font-size: 14px; }
.av-64 { width: 64px; height: 64px; font-size: 28px; }

.logo-sub { font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: 0; align-self: flex-end; margin-bottom: 3px; }
@media (max-width: 760px) {
  .logo { font-size: 1.02rem; }
  .logo-sub { display: none; }
}
@media (max-width: 360px) {
  .logo { font-size: .92rem; }
}
.lbl-short { display: none; }
@media (max-width: 420px) {
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .top-in { gap: 8px; }
  .topnav { gap: 10px; }
}
