/* AETHER 소셜 공용 모양 — 색은 사이트의 styles.css 가 :root 변수로 정한다. */
:root {
  --bg: #F4F1EC; --card: #fff; --ink: #1A2B4A; --mut: #5B6577; --line: #E6E1D8;
  --brand: #FF9A8B; --brand-ink: #1A2B4A; --accent: #1A2B4A; --ai: #7C5CFF; --ai-soft: #F0ECFF;
  --ok: #15803D; --bad: #DC2626; --warn: #B45309; --soft: #FBF7F2;
  --r: 14px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --top: 56px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans Thai", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; }
body.rm *, body.rm *::before, body.rm *::after { animation: none !important; transition: none !important; }
body.hc { --mut: #2B3445; --line: #8A93A3; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .7rem; }
.vh { font-size: 1.35rem; margin: .2rem 0 .8rem; }
.mut { color: var(--mut); } .tiny { font-size: .8rem; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .center { text-align: center; justify-content: center; }
.ell { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ell2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: #fff; padding: 8px; }
:focus-visible { outline: 3px solid var(--ai); outline-offset: 2px; }

/* ---------- 위 막대 */
#top { position: sticky; top: 0; z-index: 30; background: var(--card); border-bottom: 1px solid var(--line); height: var(--top); }
.toprow { display: flex; align-items: center; gap: 12px; height: 100%; padding: 0 16px; max-width: 1320px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand-t { font-size: 1.05rem; } .brand-t b { color: var(--brand-ink); }
.search { flex: 1; max-width: 360px; }
.search input { width: 100%; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); padding: 8px 14px; }
.topicons { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.ti { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); border: 0; cursor: pointer; text-decoration: none; font-size: 1.1rem; }
.ti.on { background: var(--ai-soft); } .ti.me { background: none; padding: 0; }
.dot { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); color: #fff; font: 700 11px/18px var(--font); padding: 0 4px; font-style: normal; }

/* ---------- 3단 */
.shell { display: grid; grid-template-columns: 260px minmax(0, 680px) 300px; gap: 24px; max-width: 1320px; margin: 0 auto; padding: 16px 16px 40px; justify-content: center; }
#left { position: sticky; top: calc(var(--top) + 16px); align-self: start; max-height: calc(100vh - var(--top) - 32px); overflow: auto; }
#rail { position: sticky; top: calc(var(--top) + 16px); align-self: start; display: grid; gap: 12px; }
#view { min-width: 0; display: grid; gap: 12px; align-content: start; outline: none; }
.nl { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; }
.nl:hover { background: rgba(0, 0, 0, .04); } .nl.on { background: var(--card); box-shadow: var(--shadow); font-weight: 700; }
.ni { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--card); font-size: 1rem; }
.nl.on .ni { background: var(--brand); color: #fff; }
.cnt { margin-left: auto; background: var(--bad); color: #fff; border-radius: 10px; font: 700 11px/18px var(--font); padding: 0 6px; font-style: normal; }
.me-link { margin-bottom: 4px; }
.legal-line { font-size: .75rem; color: var(--mut); padding: 12px; line-height: 1.7; }
.legal-line a { color: var(--mut); text-decoration: none; } .legal-line a:hover { text-decoration: underline; }
#bottom { display: none; }

.shell.wide { grid-template-columns: 260px minmax(0, 1004px); } .shell.wide #rail { display: none; }
@media (max-width: 1180px) { .shell, .shell.wide { grid-template-columns: 220px minmax(0, 1fr); } #rail { display: none; } }
@media (max-width: 820px) {
  .shell, .shell.wide { grid-template-columns: minmax(0, 1fr); padding: 12px 12px 88px; }
  #left { display: none; }
  .search { display: none; }
  .brand-t { font-size: 1rem; }
  #bottom { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  #bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0; text-decoration: none; font-size: .68rem; color: var(--mut); position: relative; border-radius: 10px; }
  #bottom a.on { color: var(--ink); font-weight: 700; background: var(--soft); }
  #bottom .bi { font-size: 1.2rem; line-height: 1.2; } #bottom .dot { width: 8px; min-width: 8px; height: 8px; top: 4px; right: 30%; padding: 0; }
  .hide-m { display: none !important; }
}
@media (min-width: 821px) { .hide-d { display: none !important; } }

/* ---------- 카드·단추 */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.card-s { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .row.top { align-items: flex-start; flex-wrap: nowrap; }
.row.between { justify-content: space-between; } .row.end { justify-content: flex-end; } .row.center { justify-content: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.btn { appearance: none; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: 600 .92rem var(--font); padding: 10px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { filter: brightness(1.08); } .btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); } .btn.sm { padding: 6px 12px; font-size: .84rem; }
.btn.ai { background: var(--ai); }
.ib { border: 0; background: none; font-size: 1.2rem; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; color: var(--mut); }
.ib:hover { background: var(--soft); }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; font: inherit; }
.chip { border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 5px 12px; font: 500 .84rem var(--font); cursor: pointer; color: var(--ink); text-decoration: none; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip-s { font-size: .72rem; background: var(--ai-soft); color: var(--ai); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; max-width: 100%; }
textarea { width: 100%; resize: vertical; }
label { display: grid; gap: 4px; margin-bottom: 10px; font-weight: 500; font-size: .9rem; }
label.radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }
label.switch { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.seg { display: flex; gap: 4px; background: var(--card); padding: 4px; border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; }
.seg a, .seg button { flex: 1 0 auto; text-align: center; text-decoration: none; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: .88rem; color: var(--mut); border: 0; background: none; cursor: pointer; white-space: nowrap; }
.seg .on { background: var(--accent); color: #fff; }
.order-note { margin: -4px 4px 0; }
.empty { text-align: center; padding: 28px 16px; } .em { font-size: 2.4rem; margin-bottom: 6px; }
.skeleton { min-height: 120px; }

/* ---------- 사람·AI */
.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; position: relative; background: #C9CED6; overflow: hidden; }
.av.ai { background: none; border-radius: 0; overflow: visible; }
.av.ai svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.av.ai b { position: relative; }
.ai-pill { display: inline-block; background: var(--ai); color: #fff; font: 800 .66rem/1 var(--font); letter-spacing: .04em; padding: 3px 6px; border-radius: 5px; vertical-align: middle; }
.who { text-decoration: none; } .who:hover b { text-decoration: underline; }
.disclose { background: var(--ai-soft); color: #3B2A99; border-radius: 10px; padding: 8px 12px; font-size: .84rem; }
.prow { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; text-decoration: none; }
.prow:hover { background: var(--soft); }

/* ---------- 글 */
.composer textarea { border: 0; background: var(--soft); border-radius: 12px; min-height: 48px; }
.composer select { padding: 5px 10px; font-size: .84rem; border-radius: 999px; }
.poll-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.post { padding: 14px 16px 6px; }
.post.is-ai { border-left: 4px solid var(--ai); }
.ph { display: flex; gap: 10px; align-items: center; } .pm { flex: 1; min-width: 0; }
.pb { margin: 10px 0; white-space: normal; overflow-wrap: anywhere; font-size: 1rem; }
.pb a { color: var(--accent); }
.pstats { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); }
.pa { display: flex; gap: 4px; padding: 4px 0; }
.pab { flex: 1; border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; font: 600 .86rem var(--font); color: var(--mut); }
.pab:hover { background: var(--soft); } .pab.on { color: var(--accent); }
.react-wrap { flex: 1; position: relative; display: flex; } .react-wrap .pab { width: 100%; }
.react-pick { position: absolute; bottom: 100%; left: 0; display: none; background: var(--card); box-shadow: 0 6px 24px rgba(0, 0, 0, .15); border-radius: 999px; padding: 4px 6px; gap: 2px; z-index: 5; }
.react-wrap:hover .react-pick, .react-wrap:focus-within .react-pick { display: flex; }
.react-pick button { border: 0; background: none; font-size: 1.5rem; cursor: pointer; padding: 2px 4px; transition: transform .12s; } .react-pick button:hover { transform: scale(1.25); }
.poll { display: grid; gap: 6px; margin-bottom: 8px; }
.po { position: relative; overflow: hidden; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px; display: flex; justify-content: space-between; cursor: pointer; font: 500 .92rem var(--font); text-align: start; }
.po i { position: absolute; inset: 0 auto 0 0; background: var(--soft); z-index: 0; } .po span, .po b { position: relative; }
.po.on { border-color: var(--accent); }
.transcript { background: var(--ai-soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.transcript summary { cursor: pointer; font-weight: 600; color: var(--ai); }
.cbox { border-top: 1px solid var(--line); padding: 8px 0; display: grid; gap: 8px; }
.cbox form input { flex: 1; border-radius: 999px; background: var(--soft); }
.cm { display: flex; gap: 8px; } .cmb { background: var(--soft); border-radius: 14px; padding: 6px 12px; max-width: 100%; overflow-wrap: anywhere; }

/* ---------- 쪽지·대화 */
.msgs { display: grid; grid-template-columns: 300px 1fr; gap: 12px; min-height: 70vh; }
.tlist { padding: 12px; overflow: auto; max-height: calc(100vh - var(--top) - 48px); }
.trow { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; text-decoration: none; }
.trow:hover, .trow.on { background: var(--soft); } .trow.unread .tmeta > span:first-child b { font-weight: 800; }
.tmeta { flex: 1; min-width: 0; display: grid; }
.tview { display: flex; flex-direction: column; gap: 8px; min-height: 70vh; }
.th-h { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.bubbles { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 2px; max-height: 62vh; min-height: 220px; }
.bub { max-width: 82%; padding: 9px 13px; border-radius: 18px; overflow-wrap: anywhere; position: relative; }
.bub.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.bub.me a { color: #fff; }
.bub.them { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 6px; }
.bub.them.ai { background: var(--ai-soft); border: 1px solid #DDD3FF; }
.bub time { display: block; margin-top: 2px; opacity: .7; }
.bub-ai { float: right; margin: 0 0 4px 8px; }
.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--ai); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.sendbar { flex-wrap: nowrap; align-items: flex-end; } .sendbar textarea { flex: 1; border-radius: 18px; min-height: 42px; max-height: 160px; }
.break { border-color: #BBF7D0; background: #F0FDF4; align-self: stretch; }
.crisis { border: 2px solid var(--bad); background: #FEF2F2; border-radius: 12px; padding: 14px; color: #7F1D1D; align-self: stretch; }
.crisis .big { font-size: 1.3rem; font-weight: 800; } .crisis a:not(.btn) { color: #7F1D1D; }
.crisis .btn { background: var(--bad); }
@media (max-width: 820px) {
  .msgs { grid-template-columns: 1fr; } .msgs.has-thread .tlist { display: none; }
  .bubbles { max-height: calc(100vh - 300px); }
}
.chat-h { padding: 12px 16px; }
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat .bubbles { max-height: 60vh; min-height: 320px; } .chat .bubbles.fresh { max-height: none; }
.samples { display: grid; gap: 14px; }
.sgroup h4 { margin-bottom: 6px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.sample { text-align: start; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; font: inherit; color: inherit; }
.sample:hover { border-color: var(--ai); background: var(--ai-soft); }

/* ---------- 그룹·사람 */
.gcard { display: grid; gap: 4px; text-decoration: none; } .gic { font-size: 1.6rem; }
.cover { text-align: center; padding-top: 0; overflow: hidden; }
.cover-art { height: 110px; margin: 0 -16px 10px; background: linear-gradient(120deg, var(--brand), var(--ai)); display: grid; place-items: center; font-size: 2.6rem; }
.person .av { margin-top: -58px; border: 4px solid var(--card); box-sizing: content-box; }

/* ---------- 알림 */
.nlist { padding: 6px; } .nrow { display: flex; gap: 12px; padding: 10px; border-radius: 10px; text-decoration: none; align-items: center; }
.nrow:hover { background: var(--soft); } .nrow.unread { background: var(--ai-soft); }
.nic { width: 40px; height: 40px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; flex: none; font-size: 1.1rem; }

/* ---------- 설정 */
.settings { display: grid; grid-template-columns: 260px 1fr; gap: 12px; align-items: start; }
.stree { padding: 10px; display: grid; gap: 2px; } .stree h2 { padding: 4px 8px; }
.stree a { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; text-decoration: none; }
.stree a:hover { background: var(--soft); } .stree a.on { background: var(--ai-soft); }
.spanel { display: grid; gap: 8px; }
.sgrp { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.srow { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.srow:last-child { border-bottom: 0; }
.srow .sl { display: grid; gap: 2px; min-width: 0; flex: 1; } .srow .sc { flex: none; max-width: 60%; text-align: end; }
.srow.wide { flex-wrap: wrap; } .srow.wide .sc { max-width: 100%; flex: 1 1 260px; text-align: start; } .srow.wide input, .srow.wide textarea { width: 100%; }
.locked { font-size: .84rem; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.sw { display: inline-block; position: relative; width: 46px; height: 26px; margin: 0; }
.sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.sw i { position: absolute; inset: 0; background: #CBD2DC; border-radius: 13px; transition: .15s; cursor: pointer; }
.sw i::after { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.sw input:checked + i { background: var(--ok); } .sw input:checked + i::after { transform: translateX(20px); }
.sw input:focus-visible + i { outline: 3px solid var(--ai); }
@media (max-width: 820px) { .settings { grid-template-columns: 1fr; } .settings.has-panel .stree { display: none; } }

/* ---------- Support */
.hero-s { background: linear-gradient(135deg, var(--card), var(--ai-soft)); }
.hero-s input { width: 100%; margin-top: 6px; }
.steps { padding-inline-start: 1.2rem; display: grid; gap: 8px; margin: 0; }
.guide summary { display: flex; gap: 10px; cursor: pointer; list-style: none; } .guide summary::-webkit-details-marker { display: none; }
.guide ol { padding-inline-start: 1.2rem; } .tip { background: var(--soft); border-radius: 10px; padding: 8px 10px; font-size: .88rem; }
.faq { border-bottom: 1px solid var(--line); padding: 10px 0; } .faq summary { cursor: pointer; font-weight: 600; }
.wrapy { flex-wrap: nowrap; }

/* ---------- 창·알림말 */
.modal { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: 86vh; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); color: var(--ink); }
.modal.wide { width: min(820px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(15, 23, 42, .5); }
.mh { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.mh h3 { margin: 0; } .x { border: 0; background: var(--soft); width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; }
.mb { padding: 16px; overflow: auto; }
.menu-list { display: grid; gap: 4px; } .menu-list > a, .menu-list > button { display: flex; gap: 10px; align-items: center; text-align: start; border: 0; background: none; padding: 10px; border-radius: 10px; font: inherit; cursor: pointer; text-decoration: none; color: inherit; }
.menu-list > a:hover, .menu-list > button:hover { background: var(--soft); }
.qa { display: grid; place-items: center; gap: 4px; padding: 14px 6px; border-radius: 12px; background: var(--soft); text-decoration: none; text-align: center; font-size: .85rem; } .qa .ic { font-size: 1.5rem; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.audit { display: grid; gap: 4px; max-height: 50vh; overflow: auto; } .arow { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; padding: 6px; border-bottom: 1px solid var(--line); }
.gate { text-align: center; padding: 28px 20px; } .gate-art svg { max-width: 220px; height: auto; }

/* ---------- 오른쪽 칸 */
.rail-card h4 { display: flex; justify-content: space-between; align-items: center; }
.rail-card .prow { padding: 6px; }
.stat { display: flex; justify-content: space-between; padding: 4px 0; font-size: .9rem; }
[dir="rtl"] .bub.me { border-bottom-right-radius: 18px; border-bottom-left-radius: 6px; }
[dir="rtl"] .bub.them { border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
[dir="rtl"] .post.is-ai { border-left: 0; border-right: 4px solid var(--ai); }
