:root {
  --bg: #f6f3ee;
  --card: #fffdf9;
  --ink: #1d1b18;
  --muted: #6f6a62;
  --line: #e6e0d6;
  --accent: #e8572a;
  --accent-ink: #fff;
  --ok: #1f8a4c;
  --bad: #c0392b;
  --run: #b7791f;
  --radius: 14px;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#151412; --card:#1e1c19; --ink:#f1ede6; --muted:#a39d93; --line:#34302a; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.55; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: 1.15rem; }
h3 { font-size: .95rem; margin-top: 1.4em; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); font-size: .9rem; }
.warn { color: var(--bad); font-size: .9rem; margin: .6em 0 0; }

.topbar { display:flex; justify-content:space-between; align-items:center; padding:14px 22px; max-width:960px; margin:0 auto; }
.brand { display:flex; gap:10px; align-items:center; font-weight:800; text-decoration:none; font-size:1.05rem; }
.logo { width:26px; height:26px; border-radius:8px; background:var(--accent); position:relative; }
.logo::after { content:""; position:absolute; inset:7px 6px 8px; border:3px solid #fff; border-bottom:none; border-right:none; transform:rotate(45deg) translate(2px,2px); border-radius:2px; }
.user-box { display:flex; gap:10px; align-items:center; font-size:.9rem; color:var(--muted); }
.user-box img { width:28px; height:28px; border-radius:50%; }

button, .primary, .ghost { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid transparent; padding: .6em 1.1em; text-decoration: none; display: inline-flex; align-items: center; gap: .5em; }
.primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.primary:disabled { opacity: .5; cursor: default; }
.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.small { padding: .3em .7em; font-size: .85rem; }
.big { padding: .9em 1.5em; font-size: 1.05rem; }
.link { background:none; border:none; padding:0; color:var(--muted); text-decoration:underline; font-size:inherit; }

.landing { max-width: 960px; margin: 0 auto; padding: 8vh 22px; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); letter-spacing: -.03em; margin: .2em 0 .4em; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .02em; font-size: .9rem; }
.lede { max-width: 560px; color: var(--muted); font-size: 1.1rem; margin-bottom: 2em; }
.how { list-style:none; display:flex; flex-wrap:wrap; gap:18px; padding:0; margin-top:3em; color:var(--muted); }
.how b { display:inline-grid; place-items:center; width:24px; height:24px; border-radius:50%; background:var(--ink); color:var(--bg); font-size:.8rem; margin-right:6px; }

.app { max-width: 760px; margin: 0 auto; padding: 8px 16px 60px; display: grid; gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.row-between { display:flex; justify-content:space-between; align-items:center; }

textarea, input, select { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .7em .8em; width: 100%; }
textarea { resize: vertical; min-height: 140px; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: grid; gap: 4px; margin: .7em 0; font-size: .9rem; }
label.check { display:flex; align-items:center; gap:8px; }
label.check input { width:auto; }

.counters { display:flex; flex-wrap:wrap; gap:6px 14px; margin:.5em 0 1em; font-size:.8rem; color:var(--muted); font-variant-numeric: tabular-nums; }
.counters .over { color: var(--bad); font-weight: 700; }

.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; cursor: pointer; }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
#drop-empty { display:grid; gap:4px; }
#drop-empty span { font-size:.85rem; color:var(--muted); }
#preview-media img, #preview-media video { max-width:100%; max-height:280px; border-radius:10px; }
.preview-meta { display:flex; justify-content:space-between; align-items:center; margin-top:8px; font-size:.85rem; color:var(--muted); gap:8px; }

.targets { display:flex; flex-wrap:wrap; gap:8px; }
.chip { display:inline-flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:999px; padding:5px 12px 5px 5px; cursor:pointer; user-select:none; font-size:.9rem; background:var(--bg); }
.chip img, .chip .ph { width:24px; height:24px; border-radius:50%; object-fit:cover; background:var(--line); }
.chip input { display:none; }
.chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.chip.off { opacity:.45; cursor:not-allowed; }
.tag { font-size:.7rem; font-weight:700; padding:1px 7px; border-radius:6px; background:var(--ink); color:var(--bg); }

.opts { border-top:1px solid var(--line); margin-top:1.2em; }
.opts .tt-account { margin-top:1em; padding:12px; border:1px solid var(--line); border-radius:10px; }
.opts .note { font-size:.8rem; color:var(--muted); }

.submit-row { display:flex; gap:12px; align-items:center; justify-content:flex-end; margin-top:1.4em; }
.progress { flex:1; height:8px; background:var(--line); border-radius:99px; overflow:hidden; }
.progress div { height:100%; width:0; background:var(--accent); transition:width .2s; }

.accounts { display:grid; gap:8px; }
.account { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); }
.account:last-child { border-bottom:none; }
.account img, .account .ph { width:34px; height:34px; border-radius:50%; background:var(--line); object-fit:cover; }
.account .who { flex:1; display:grid; line-height:1.3; }
.account .who small { color:var(--muted); }
.connect { display:flex; flex-wrap:wrap; gap:8px; }
.connect button[disabled] { opacity:.45; cursor:not-allowed; }

.history { display:grid; gap:12px; }
.post { border:1px solid var(--line); border-radius:12px; padding:12px 14px; }
.post .meta { font-size:.8rem; color:var(--muted); margin-bottom:4px; }
.post .body { white-space:pre-wrap; overflow-wrap:anywhere; max-height:4.8em; overflow:hidden; }
.post .tlist { display:grid; gap:6px; margin-top:10px; }
.tline { display:flex; gap:8px; align-items:center; font-size:.85rem; flex-wrap:wrap; }
.st { font-weight:700; font-size:.75rem; padding:1px 8px; border-radius:99px; }
.st.done { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.st.failed { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.st.running, .st.queued { background: color-mix(in srgb, var(--run) 18%, transparent); color: var(--run); }
.tline .err { color: var(--bad); flex-basis:100%; font-size:.8rem; }

.foot { text-align:center; color:var(--muted); font-size:.85rem; padding:20px; }

dialog { border:1px solid var(--line); border-radius:var(--radius); background:var(--card); color:var(--ink); max-width:440px; width:92vw; padding:22px; }
dialog::backdrop { background: rgb(0 0 0 / .4); }
.dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:1em; }
details { font-size:.85rem; color:var(--muted); }

.toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); background:var(--ink); color:var(--bg); padding:.7em 1.2em; border-radius:10px; max-width:90vw; font-size:.9rem; box-shadow:0 6px 24px rgb(0 0 0/.2); }
.toast.error { background: var(--bad); color:#fff; }

.legal { max-width:720px; margin:0 auto; padding:20px 22px 80px; }
.legal h2 { margin-top:1.6em; }

.targets-head h3 { margin-top: 1.4em; }
.targets-head > div { margin-top: 1em; }
.chip .why { font-size:.72rem; color:var(--muted); }
