:root { --bg:#f6f6f7; --card:#fff; --text:#111; --muted:#6b7280; --line:#e5e7eb; --pri:#111; --pri-text:#fff; --ok:#059669; --err:#dc2626; --warn:#d97706; --radius:12px; }
@media (prefers-color-scheme: dark) { :root { --bg:#0b0b0c; --card:#17171a; --text:#f3f4f6; --muted:#9ca3af; --line:#2a2a2e; --pri:#f3f4f6; --pri-text:#111; } }
* { box-sizing: border-box; }
body { margin:0; font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif; background:var(--bg); color:var(--text); font-size:15px; padding-bottom:76px; }
a { color: inherit; }
header.top { position:sticky; top:0; z-index:10; display:flex; justify-content:space-between; align-items:center; padding:12px 16px; background:var(--card); border-bottom:1px solid var(--line); }
.brand { font-weight:800; text-decoration:none; }
.bell { position:relative; text-decoration:none; font-size:20px; }
#noti-badge:not(:empty) { position:absolute; top:-6px; right:-10px; background:var(--err); color:#fff; border-radius:10px; font-size:11px; padding:1px 6px; }
main { max-width:860px; margin:0 auto; padding:12px; }
nav.bottom { position:fixed; bottom:0; left:0; right:0; display:flex; background:var(--card); border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom); z-index:10; }
nav.bottom a { flex:1; text-align:center; padding:8px 0; text-decoration:none; font-size:20px; color:var(--muted); }
nav.bottom a span { display:block; font-size:11px; }
nav.bottom a.active { color:var(--text); font-weight:700; }
body.logged-out nav.bottom, body.logged-out header.top .bell { display:none; }
h2 { font-size:20px; margin:8px 0 12px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:14px; margin-bottom:12px; display:flex; flex-direction:column; gap:10px; }
.card.warn { border-color:var(--warn); }
.card.error, .error { color:var(--err); }
.row { display:flex; gap:8px; align-items:center; }
.row.between { justify-content:space-between; }
.row.end { justify-content:flex-end; }
.row.wrap, .wrap { flex-wrap:wrap; }
.grow { flex:1; min-width:0; }
.right { text-align:right; display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
@media (max-width:560px) { .grid2 { grid-template-columns:1fr; } }
input, textarea, select { width:100%; font:inherit; color:inherit; background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:10px; }
input[type=checkbox] { width:auto; }
textarea { resize:vertical; line-height:1.5; }
button, .button { font:inherit; border:1px solid var(--line); background:var(--card); color:var(--text); border-radius:10px; padding:10px 14px; cursor:pointer; text-decoration:none; display:inline-block; white-space:nowrap; }
button.primary, .button.primary { background:var(--pri); color:var(--pri-text); border-color:var(--pri); font-weight:700; }
button.ghost { background:transparent; }
button.small, .button.small { padding:6px 10px; font-size:13px; }
button.danger { color:var(--err); }
button.icon { border:none; background:transparent; padding:4px 8px; }
button:disabled { opacity:.45; cursor:not-allowed; }
.field { display:flex; flex-direction:column; gap:4px; }
.label { font-size:13px; font-weight:600; color:var(--muted); }
.hint { color:var(--muted); font-size:13px; }
.toggle { display:flex; gap:8px; align-items:center; }
.seg { display:flex; gap:6px; flex-wrap:wrap; }
.seg-btn { flex:1; min-width:110px; }
.seg-btn.on { background:var(--pri); color:var(--pri-text); border-color:var(--pri); }
.stepper { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin-bottom:12px; }
.step { font-size:13px; padding:8px 4px; }
.step.on { background:var(--pri); color:var(--pri-text); }
.step.done { border-color:var(--ok); }
.sub { border-left:3px solid var(--line); padding-left:10px; display:flex; flex-direction:column; gap:8px; }
.acc-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:6px; }
.acc-chip { display:flex; gap:8px; align-items:center; border:1px solid var(--line); border-radius:10px; padding:8px; }
.acc-chip.off { opacity:.5; }
.acc-chip img, .pf { width:28px; height:28px; border-radius:50%; object-fit:cover; }
.avatar { width:28px; height:28px; border-radius:50%; background:var(--line); display:inline-flex; align-items:center; justify-content:center; font-weight:700; }
.thread-box { border:1px solid var(--line); border-radius:10px; padding:10px; display:flex; flex-direction:column; gap:6px; background:var(--card); }
.thread-box.kind-affiliate { border-color:#60a5fa; }
.thread-box.kind-notice { border-color:var(--warn); }
.grip { cursor:grab; font-size:13px; color:var(--muted); }
.counter { font-size:12px; color:var(--muted); }
.counter.over { color:var(--err); font-weight:700; }
.threads { display:flex; flex-direction:column; gap:8px; }
.tabs { display:flex; gap:6px; margin-bottom:10px; flex-wrap:wrap; }
.tabs.scroll { flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; }
.tab { padding:6px 12px; border:1px solid var(--line); border-radius:999px; text-decoration:none; font-size:13px; background:var(--card); white-space:nowrap; }
.tab.on { background:var(--pri); color:var(--pri-text); }
.tab.err { border-color:var(--err); color:var(--err); }
.tab.on.err { color:var(--pri-text); background:var(--err); }
.notice { background:rgba(217,119,6,.08); border:1px solid rgba(217,119,6,.35); border-radius:10px; padding:10px; font-size:13px; }
pre { white-space:pre-wrap; word-break:break-word; margin:0; font-family:inherit; }
.preview { background:var(--bg); border-radius:10px; padding:10px; font-size:13px; }
.preview.small { font-size:12px; padding:6px; }
.media-grid { display:flex; gap:8px; flex-wrap:wrap; }
.media { position:relative; width:84px; height:84px; border-radius:10px; overflow:hidden; border:1px solid var(--line); }
.media img, .media video { width:100%; height:100%; object-fit:cover; }
.media button { position:absolute; top:2px; right:2px; background:rgba(0,0,0,.6); color:#fff; border-radius:50%; padding:2px 6px; }
.product, .product-edit { display:flex; gap:8px; align-items:center; border:1px solid var(--line); border-radius:10px; padding:8px; }
.product-edit { flex-direction:column; align-items:stretch; }
.product img { width:48px; height:48px; object-fit:cover; border-radius:8px; }
.product-results { display:flex; flex-direction:column; gap:6px; max-height:320px; overflow:auto; }
.rotation { display:flex; flex-direction:column; gap:10px; margin-top:8px; }

/* 계정 그룹: 큰 토글 버튼(칩) + 버튼식 멤버 관리 */
.group-chips { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.group-chip { flex:1 1 160px; padding:12px 14px; font-size:15px; font-weight:700; text-align:left; min-height:52px; }
.group-chip small { display:block; font-size:12px; font-weight:400; opacity:.75; margin-top:3px; white-space:normal; }
.group-chip.on { background:var(--pri); color:var(--pri-text); border-color:var(--pri); }
.group-card { gap:8px; }
.group-members { display:flex; flex-direction:column; gap:6px; }
.group-members .row { border:1px solid var(--line); border-radius:10px; padding:8px 10px; }
.cap-stepper { display:flex; gap:6px; align-items:stretch; }
.cap-stepper input { text-align:center; min-width:0; }
.cap-stepper button { min-width:48px; min-height:44px; font-size:20px; font-weight:700; padding:6px 10px; }
.rot-row { border:1px solid var(--line); border-radius:10px; padding:8px; display:flex; flex-direction:column; gap:6px; }
.rot-cells { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:6px; }
.stats { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:8px; margin-bottom:12px; }
.stat { background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:10px; display:flex; flex-direction:column; }
.stat b { font-size:20px; }
.big-cta { display:block; text-align:center; background:var(--pri); color:var(--pri-text); padding:16px; border-radius:var(--radius); font-weight:800; text-decoration:none; margin-bottom:12px; }
.list-row { display:flex; gap:10px; align-items:center; padding:10px 0; border-bottom:1px solid var(--line); text-decoration:none; cursor:pointer; }
.list-row:last-child { border-bottom:none; }
.badge { font-size:12px; padding:2px 8px; border-radius:999px; background:var(--line); white-space:nowrap; }
.s-published, .s-done, .s-active, .s-ok { background:rgba(5,150,105,.15); color:var(--ok); }
.s-failed, .s-expired, .s-error, .s-unusable, .s-disconnected { background:rgba(220,38,38,.15); color:var(--err); }
.s-scheduled, .s-publishing, .s-partial, .s-temp_error { background:rgba(217,119,6,.15); color:var(--warn); }
table.result { width:100%; border-collapse:collapse; font-size:13px; }
table.result th, table.result td, .plan td, .plan th { border-bottom:1px solid var(--line); padding:6px 4px; text-align:left; vertical-align:top; }
.plan table { width:100%; border-collapse:collapse; font-size:13px; }
.noti { display:flex; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); }
.noti.unread b::before { content:'● '; color:var(--err); }
.noti.error b { color:var(--err); }
.cal { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; margin-bottom:12px; }
.cal-head { text-align:center; font-size:12px; color:var(--muted); }
.cal-cell { min-height:56px; background:var(--card); border:1px solid var(--line); border-radius:8px; padding:4px; cursor:pointer; }
.cal-cell.empty { background:transparent; border:none; }
.cal-cell.today { border-color:var(--pri); border-width:2px; }
.cal-dots { display:flex; flex-wrap:wrap; gap:2px; font-size:10px; }
.dot { width:8px; height:8px; border-radius:50%; background:var(--muted); display:inline-block; }
.dot.s-published { background:var(--ok); } .dot.s-failed { background:var(--err); } .dot.s-scheduled, .dot.s-publishing { background:var(--warn); }
.bars { display:flex; align-items:flex-end; gap:3px; height:140px; }
.bar { flex:1; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; height:100%; }
.bar .fill { width:100%; background:var(--pri); border-radius:4px 4px 0 0; min-height:2px; }
.bar small { font-size:9px; color:var(--muted); }
.reply { border-bottom:1px solid var(--line); padding:8px 0; display:flex; flex-direction:column; gap:4px; }
.reply.hidden { opacity:.5; }
.chips { display:flex; flex-wrap:wrap; gap:6px; }
.chip { border-radius:999px; font-size:13px; padding:6px 10px; }
.idea { display:flex; flex-direction:column; gap:4px; border-bottom:1px solid var(--line); padding:8px 0; }
.up { color:var(--ok); font-weight:700; } .down { color:var(--err); font-weight:700; }
.menu { display:flex; flex-direction:column; gap:8px; }
.menu-item { background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:16px; text-decoration:none; font-weight:600; }
.log { font-size:13px; border-bottom:1px solid var(--line); padding:4px 0; }
.login { max-width:360px; margin:60px auto; }
.loading { padding:40px; text-align:center; color:var(--muted); }
.modal-wrap { position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:flex-end; justify-content:center; z-index:50; }
@media (min-width:700px) { .modal-wrap { align-items:center; } }
.modal { background:var(--card); width:100%; max-width:640px; max-height:90vh; overflow:auto; border-radius:16px 16px 0 0; padding:14px; display:flex; flex-direction:column; gap:10px; }
@media (min-width:700px) { .modal { border-radius:16px; } }
.modal-head, .modal-foot { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.modal-foot { justify-content:flex-end; }
.modal-body { display:flex; flex-direction:column; gap:8px; }
#toasts { position:fixed; top:60px; left:50%; transform:translateX(-50%); z-index:100; display:flex; flex-direction:column; gap:6px; width:min(92vw,480px); }
.toast { background:#111; color:#fff; padding:10px 14px; border-radius:10px; white-space:pre-wrap; box-shadow:0 4px 14px rgba(0,0,0,.2); }
.toast.success { background:var(--ok); } .toast.error { background:var(--err); }
code { font-size:12px; word-break:break-all; }
details summary { cursor:pointer; font-weight:600; margin:4px 0; }
