/* NONEX Social — 화면 공통 스타일 (인라인 스타일·스크립트 없이 CSP 'self' 만 사용) */
:root {
  --bg: #f7f5f1; --panel: #ffffff; --soft: #fbfaf7; --line: #ebe6de; --line2: #ddd6cb;
  --ink: #2b2320; --sub: #776b63; --faint: #a69b92;
  --y: #f2b81d; --y2: #ffd95a; --ys: #fff6d9; --yd: #8a6400;
  --r: #d9473f; --rs: #fdecea; --g: #23946a; --gs: #e3f4ec; --b: #2f6fd6; --bs: #e8f0fd;
  --radius: 14px; --shadow: 0 1px 2px rgba(43,35,32,.04), 0 4px 16px rgba(43,35,32,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.6 "Pretendard", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; color: var(--sub); }
p { margin: 0 0 .8em; }
code { background: #f2eee8; padding: 1px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; }
.muted { color: var(--sub); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; } .mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.right { margin-left: auto; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.hide { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- 앱 레이아웃 */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex;
  flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; text-decoration: none; padding: 4px 8px; }
.logo .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--y); display: grid; place-items: center;
  font-size: 15px; color: var(--ink); }
.logo small { font-weight: 600; color: var(--sub); font-size: 12px; }
.team-pick { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--soft); }
.team-pick .label { font-size: 11px; color: var(--faint); margin-bottom: 2px; }
.team-pick .cur { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.team-pick form { margin: 6px 0 0; display: flex; flex-direction: column; gap: 2px; }
.team-pick button { text-align: left; background: none; border: 0; padding: 4px 6px; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--sub); }
.team-pick button:hover { background: #f1ece4; color: var(--ink); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .group { font-size: 11px; color: var(--faint); margin: 10px 10px 4px; letter-spacing: .04em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none;
  color: var(--sub); font-weight: 600; font-size: 14px; }
.nav a:hover { background: #f4f0ea; color: var(--ink); }
.nav a.on { background: var(--ys); color: var(--ink); }
.nav a.on .icon { color: var(--yd); }
.nav .count { margin-left: auto; background: var(--r); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 7px; }
.side .cta { margin: 4px 0; }
.side .me { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; }
.side .me .who { font-weight: 700; }
.side .me .row { gap: 10px; margin-top: 6px; }
.main { min-width: 0; }
.page { max-width: 1160px; margin: 0 auto; padding: 28px 32px 64px; }
.page.narrow { max-width: 760px; }
.head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { margin: 0; }
.head .desc { color: var(--sub); margin: 4px 0 0; }
.head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--sub); text-decoration: none; display: inline-flex; gap: 4px; align-items: center; margin-bottom: 6px; }
.crumb:hover { color: var(--ink); }

/* ---------------------------------------------------------------- 공통 부품 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); margin-bottom: 18px; }
.card.flat { box-shadow: none; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 22px; align-items: start; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px;
  border: 1px solid var(--line2); border-radius: 10px; background: var(--panel); color: var(--ink); cursor: pointer;
  font: inherit; font-weight: 700; font-size: 14px; text-decoration: none; line-height: 1.3; white-space: nowrap; }
.btn:hover { border-color: #c9bfb2; background: var(--soft); }
.btn.primary { background: var(--y); border-color: var(--y); }
.btn.primary:hover { background: var(--y2); border-color: var(--y2); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { color: var(--r); border-color: #f1c7c3; }
.btn.danger:hover { background: var(--rs); }
.btn.ghost { border-color: transparent; background: none; color: var(--sub); }
.btn.ghost:hover { background: #f1ece4; color: var(--ink); }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 0; color: var(--sub); cursor: pointer; font: inherit; text-decoration: underline; }
form.inline { display: inline; margin: 0; }

label.field { display: block; margin: 0 0 14px; }
label.field > span { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
label.field > small { display: block; color: var(--faint); font-size: 12px; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local],
input:not([type]), select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; font: inherit;
  background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--y); outline-offset: 0; border-color: var(--y); }
textarea { resize: vertical; min-height: 90px; }
textarea.code { font: 13px/1.6 "D2Coding", Consolas, "Malgun Gothic", monospace; }
input[type=file] { font-size: 13px; }
input[type=number] { max-width: 120px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; margin: 6px 0; }
.check input { margin-top: 4px; accent-color: var(--ink); }
.check b { font-weight: 700; }
.check small { display: block; color: var(--faint); }

/* 선택 카드 (라디오) */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 14px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .box { border: 1.5px solid var(--line2); border-radius: 12px; padding: 14px; height: 100%; background: #fff; }
.choice .box b { display: block; font-size: 15px; }
.choice .box span { display: block; font-size: 13px; color: var(--sub); margin-top: 2px; }
.choice input:checked + .box { border-color: var(--ink); background: var(--soft); box-shadow: 0 0 0 3px var(--ys); }
.choice input:disabled + .box { opacity: .45; cursor: not-allowed; }
.choice input:focus-visible + .box { outline: 2px solid var(--y); }

/* 상태 배지 */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 9px;
  border-radius: 20px; background: #efebe5; color: var(--sub); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.st-ready, .badge.ok { background: var(--gs); color: var(--g); }
.st-published { background: var(--g); color: #fff; }
.st-writing, .st-rendering, .st-queued, .st-publishing, .st-scheduled, .badge.wait { background: var(--ys); color: var(--yd); }
.st-failed, .badge.bad { background: var(--rs); color: var(--r); }
.badge.info { background: var(--bs); color: var(--b); }

/* 알림 */
.flash, .note { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.flash { background: var(--ys); border-color: #f1dc9a; }
.note { background: var(--soft); border-color: var(--line); color: var(--sub); }
.note.warn { background: var(--ys); border-color: #f1dc9a; color: var(--ink); }
.note.bad { background: var(--rs); border-color: #f1c7c3; color: var(--ink); }
.note.ok { background: var(--gs); border-color: #bfe5d3; color: var(--ink); }
.note b { color: var(--ink); }
.note.busy { display: flex; gap: 12px; align-items: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--y); border-right-color: transparent;
  animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 탭 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--sub); font-weight: 700; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.seg { display: inline-flex; background: #efebe5; border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 12px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 700; color: var(--sub); }
.seg a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* 표 */
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { font-size: 12px; color: var(--faint); font-weight: 700; }
table.list tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
td.clip { max-width: 360px; white-space: pre-wrap; color: var(--sub); font-size: 13px; }

/* ---------------------------------------------------------------- 대시보드 */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .k { font-size: 12px; color: var(--sub); font-weight: 700; }
.kpi .v { font-size: 26px; font-weight: 800; margin-top: 2px; }
.kpi .v small { font-size: 14px; color: var(--faint); font-weight: 700; }
.meter { height: 6px; background: #efebe5; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--y); border-radius: 6px; }
.w0 { width: 0; } .w10 { width: 10%; } .w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; } .w100 { width: 100%; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps a { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-decoration: none; height: 100%; background: #fff; }
.steps a:hover { border-color: var(--line2); }
.steps .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: #efebe5; margin-bottom: 8px; }
.steps .done .n { background: var(--g); color: #fff; }
.steps b { display: block; font-size: 14px; }
.steps span { font-size: 12px; color: var(--sub); }
.steps .done b { color: var(--sub); text-decoration: line-through; }
.composer textarea { font-size: 16px; min-height: 110px; border-radius: 12px; padding: 14px; }
.composer .bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line2);
  border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; background: #fff; }
.pill input { accent-color: var(--ink); margin: 0; }

/* 콘텐츠 카드 목록 */
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile .th { aspect-ratio: 4 / 5; background: #f1ece4; display: grid; place-items: center; color: var(--faint); overflow: hidden; }
.tile .th img { width: 100%; height: 100%; object-fit: cover; }
.tile .th .ph { text-align: center; font-size: 13px; padding: 10px; }
.tile .th .ph .icon { width: 28px; height: 28px; margin: 0 auto 6px; }
.tile .bd { padding: 12px 14px; }
.tile .t { font-weight: 700; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .m { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--faint); flex-wrap: wrap; }
.empty { text-align: center; padding: 48px 20px; color: var(--sub); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--faint); }

/* ---------------------------------------------------------------- 콘텐츠 상세 */
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery a img { border-radius: 10px; border: 1px solid var(--line); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.gallery .num { font-size: 11px; color: var(--faint); margin-top: 3px; }
.videos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 260px)); }
.videos video { border-radius: 12px; background: #000; width: 100%; aspect-ratio: 9 / 16; }
.caption { white-space: pre-wrap; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  font-size: 14px; max-height: 340px; overflow: auto; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.timeline li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline pre { white-space: pre-wrap; font-size: 12px; background: var(--rs); padding: 8px; border-radius: 8px; margin: 6px 0 0; max-height: 160px; overflow: auto; }
.history { list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--sub); }
.history li { padding: 4px 0 4px 14px; position: relative; }
.history li::before { content: ""; position: absolute; left: 2px; top: 12px; width: 5px; height: 5px; border-radius: 50%; background: var(--line2); }
details { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin: 12px 0; background: #fff; }
details > summary { cursor: pointer; padding: 12px 0; font-weight: 700; font-size: 14px; color: var(--sub); list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; float: right; color: var(--faint); }
details[open] > summary::after { content: "–"; }
details[open] { padding-bottom: 14px; }
.target { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.target .icon { width: 22px; height: 22px; }
.target select { border: 0; padding: 4px 0; background: none; font-weight: 700; }
.target select:focus { outline: none; }

/* 연결 카드 */
.conn { display: flex; gap: 16px; align-items: flex-start; }
.conn .logo2 { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; }
.conn .logo2 .icon { width: 24px; height: 24px; }
.bg-ig { background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af); }
.bg-yt { background: #e62117; }
.acct { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.code-box { font: 800 30px/1 "D2Coding", Consolas, monospace; letter-spacing: 4px; background: var(--ys); border-radius: 12px;
  padding: 14px 18px; display: inline-block; margin: 6px 0 10px; }
ol.how { padding-left: 20px; margin: 0 0 12px; } ol.how li { margin: 4px 0; }

/* 캐릭터 */
.chars { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.char { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; text-align: center; }
.char img { width: 110px; height: 110px; object-fit: contain; margin: 0 auto 8px; }
.char b { display: block; }
.char small { display: block; color: var(--sub); font-size: 12px; min-height: 2.4em; }

/* ---------------------------------------------------------------- 로그인 전 화면 */
.public { min-height: 100vh; display: flex; flex-direction: column; }
.pub-top { display: flex; align-items: center; gap: 12px; padding: 18px 28px; max-width: 1160px; width: 100%; margin: 0 auto; }
.pub-top .right { display: flex; gap: 8px; }
.auth { flex: 1; display: grid; place-items: center; padding: 24px 16px 60px; }
.auth .card { width: 100%; max-width: 440px; padding: 30px; }
.auth h1 { font-size: 22px; }
.hero { max-width: 1160px; margin: 0 auto; padding: 56px 28px 40px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 42px; line-height: 1.2; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--y2) 62%); }
.hero p.lead { font-size: 17px; color: var(--sub); margin: 14px 0 26px; }
.hero .mock { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: 0 20px 50px rgba(43,35,32,.08); }
.mock .bubble { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 14px; }
.mock .arrow { text-align: center; color: var(--faint); margin: 10px 0; font-size: 13px; }
.mock .cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mock .cards3 div { aspect-ratio: 4/5; border-radius: 10px; background: var(--ys); border: 1px solid #f1dc9a; padding: 8px; font-size: 11px; font-weight: 800; }
.mock .cards3 div:nth-child(2) { background: #eef4fd; border-color: #cfe0fa; }
.mock .cards3 div:nth-child(3) { background: var(--gs); border-color: #bfe5d3; }
.features { max-width: 1160px; margin: 0 auto; padding: 10px 28px 60px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature .icon { width: 26px; height: 26px; color: var(--yd); margin-bottom: 10px; }
.feature b { display: block; margin-bottom: 4px; }
.feature p { font-size: 14px; color: var(--sub); margin: 0; }
.foot { border-top: 1px solid var(--line); padding: 20px 28px; text-align: center; font-size: 13px; color: var(--faint); }
.foot a { color: var(--sub); }

/* ---------------------------------------------------------------- 작은 화면 */
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .steps, .kpis, .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .team-pick, .side .me, .nav .group { display: none; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; }
  .nav a { white-space: nowrap; padding: 7px 10px; }
  .side .cta { margin: 0 0 0 auto; }
  .page { padding: 20px 16px 48px; }
  .g2, .g3, .g4, .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .head .actions { margin-left: 0; }
}
@media (max-width: 520px) {
  .steps, .kpis, .features { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
