/* Ciphlo — 디스코드st 다크 + 네온 테마 */
:root {
  --bg: #0a0a0f;
  --bg-2: #101018;
  --bg-3: #16161f;
  --panel: #14141d;
  --border: #24243050;
  --text: #e7e7ef;
  --muted: #8b8ba3;
  --neon-cyan: #22d3ee;
  --neon-magenta: #ff3df0;
  --neon-purple: #a855f7;
  --neon-lime: #a3ff12;
  --glow-cyan: 0 0 12px #22d3ee66, 0 0 2px #22d3ee;
  --radius: 14px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 15% -10%, #1b1030 0%, transparent 55%),
    radial-gradient(1000px 500px at 100% 0%, #06212b 0%, transparent 50%),
    var(--bg);
  /* 글로우를 뷰포트에 고정 — 스크롤해도 배경이 뚝 끊기지 않게. */
  background-attachment: fixed;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--neon-cyan); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.app { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand {
  font-weight: 800; font-size: 22px; letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta), var(--neon-purple));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px #ff3df033);
}
.brand small { display:block; font-size:11px; font-weight:500; letter-spacing:2px; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.side-lang { display: flex; align-items: center; gap: 8px; background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.side-lang-ico { font-size: 14px; }
.side-lang select { flex: 1; background: transparent; border: none; color: var(--text); font-size: 13px; padding: 2px 4px; outline: none; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); padding: 0 6px; }
.thread-list { display: flex; flex-direction: column; gap: 6px; }
.thread-item {
  display: block; padding: 10px 12px; border-radius: 10px; color: var(--text);
  background: var(--bg-3); border: 1px solid transparent; transition: .15s;
}
.thread-item:hover { border-color: #22d3ee55; background: #191922; }
.thread-item .t-plat { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--neon-magenta); }
.thread-item .t-title { font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-item .t-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* --- Main --- */
.main { padding: 32px clamp(16px, 5vw, 56px); max-width: 900px; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 8px; line-height: 1.15; }
.hero .accent { color: var(--neon-cyan); text-shadow: var(--glow-cyan); }
.hero p { color: var(--muted); margin: 0 0 24px; font-size: 15px; }

.paste-box { display: flex; gap: 10px; margin-bottom: 10px; }
.paste-box input {
  flex: 1; background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  padding: 14px 16px; border-radius: 12px; font-size: 15px; outline: none; transition: .15s;
}
.paste-box input:focus { border-color: #22d3ee88; box-shadow: 0 0 0 3px #22d3ee22; }
.btn {
  position: relative; isolation: isolate;
  color: #eafaff; font-weight: 700; letter-spacing: -0.01em; font-size: 15px; white-space: nowrap;
  padding: 0 24px; border-radius: 12px; border: 1.5px solid transparent;
  /* 어두운 본체 + 브랜드 그라디언트 테두리 (CIPHLO 로고와 통일) */
  background:
    linear-gradient(180deg, #191925, #111119) padding-box,
    linear-gradient(95deg, var(--neon-cyan), var(--neon-magenta) 52%, var(--neon-purple)) border-box;
  box-shadow: 0 2px 10px #0006;
  transition: transform .1s ease, box-shadow .2s ease, filter .2s ease;
}
/* 은은한 내부 광택 */
.btn::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: linear-gradient(180deg, #ffffff0e, transparent 42%);
}
.btn:hover { filter: brightness(1.08); box-shadow: 0 0 22px #22d3ee2e, 0 0 28px #ff3df01f, 0 6px 22px #0007; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: saturate(.7); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 8px 14px; font-weight: 600; transition: .15s; }
.btn-ghost:hover { border-color: #ffffff30; background: #ffffff08; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chip { font-size: 12px; color: var(--muted); background: var(--bg-3); padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); }
.hint { color: var(--muted); font-size: 13px; margin-top: 14px; }
.error { color: #ff6b6b; font-size: 14px; margin-top: 10px; min-height: 18px; }

/* --- Thread page --- */
.back { color: var(--muted); font-size: 13px; margin-bottom: 16px; display: inline-block; }
.embed-wrap {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #000;
  box-shadow: 0 0 30px #a855f722; margin-bottom: 8px;
}
.embed-wrap iframe { width: 100%; border: 0; display: block; }
.thread-head { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 4px; flex-wrap: wrap; }
.thread-head .plat { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--neon-magenta); border: 1px solid #ff3df044; padding: 2px 8px; border-radius: 999px; }
.thread-head h2 { margin: 0; font-size: 20px; }
.orig-link { font-size: 13px; color: var(--muted); }

select {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; outline: none;
}
select:focus { border-color: var(--neon-cyan); }

.empty { color: var(--muted); text-align: center; padding: 40px 0; font-size: 14px; }

/* --- Comments (유튜브 댓글 스타일) --- */
.cmt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.cmt-count { font-size: 16px; font-weight: 700; margin: 0; }
.posts { display: flex; flex-direction: column; gap: 20px; margin-bottom: 40px; padding-bottom: 8px; }
.msg { display: flex; gap: 12px; max-width: none; }
.msg-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #06060a; margin-top: 2px; }
.msg.reply .msg-avatar { width: 28px; height: 28px; font-size: 11px; }
.msg-col { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.msg-top { display: flex; align-items: baseline; gap: 8px; margin: 0 0 3px; font-size: 13px; }
.msg-top .handle { font-weight: 700; }
.msg-top .time { color: var(--muted); font-size: 12px; }
/* 내 댓글 표시: 닉네임 옆 '나' 배지 + 아바타 링 + 은은한 강조 */
.me-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .3px; color: #04141a;
  background: linear-gradient(180deg, var(--neon-cyan), #17b4d4);
  padding: 1px 7px; border-radius: 999px; line-height: 1.5;
}
.msg.mine > .msg-avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--neon-cyan); }
/* 하이라이트 박스는 레이아웃을 밀지 않는 ::before로 그린다 — 음수 margin 겹침/잘림 방지. */
.msg.mine, .msg.now { position: relative; }
.msg.mine::before, .msg.now::before {
  content: ""; position: absolute; inset: -9px -12px; border-radius: 13px; z-index: -1;
  transition: background .4s ease, box-shadow .4s ease;
}
.msg.mine:not(.now)::before { background: #22d3ee0a; }
/* 댓글 본문 — 말풍선 아닌 평문 */
.bubble { background: none; border: none; padding: 0; }
.bubble-text { font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
/* 타임스탬프 칩 + 본문을 유튜브처럼 한 흐름으로: 칩 뒤에 텍스트가 이어짐 */
.bubble .ts-jump { vertical-align: baseline; margin-right: 7px; }
/* 숨김 상태인 원문(.orig-view)까지 inline이 되면 번역문과 겹쳐 보이므로 제외한다. */
.bubble:has(.ts-jump) .bubble-text:not(.orig-view) { display: inline; }
/* 액션 줄: 좋아요 · 답글 · 원문 · 신고 (항상 표시) */
.msg-bottom { display: flex; align-items: center; gap: 16px; margin: 7px 0 0; font-size: 12px; }
.msg-bottom .time { color: var(--muted); }
.msg-bottom button { background: none; border: none; padding: 0; cursor: pointer; font-size: 12px; }
/* 답글 접기/펼치기 */
.replies-toggle { align-self: flex-start; margin: 10px 0 0; background: none; border: none; cursor: pointer;
  color: var(--neon-cyan); font-weight: 600; font-size: 13px; padding: 4px 0; }
.replies-toggle:hover { filter: brightness(1.15); }
.replies { margin-top: 12px; }
.report-btn { color: #6a6a80; }
.report-btn:hover { color: #ff6b6b; }
.orig-toggle { color: var(--neon-purple); }
.orig-toggle:hover { color: var(--neon-cyan); }

/* --- 접힘(soft-collapse): 신고 누적/검토 대기 글을 지우지 않고 가린다 --- */
/* 접힘 상태에선 배너만 보이고 본문·액션·답글은 숨는다. '보기'로 해제. */
.collapse-banner { display: none; }
.msg.collapsed > .msg-avatar { opacity: .35; filter: grayscale(1); }
.msg.collapsed .msg-top,
.msg.collapsed .bubble,
.msg.collapsed .msg-bottom,
.msg.collapsed .replies-toggle,
.msg.collapsed .replies { display: none; }
.msg.collapsed .collapse-banner {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: 1px dashed var(--border); border-radius: 10px;
  padding: 10px 14px; cursor: pointer; text-align: left;
  color: var(--muted); font-size: 13px;
}
.msg.collapsed .collapse-banner:hover { border-color: var(--neon-cyan); }
.collapse-reason { flex: 1; min-width: 0; }
.collapse-show { color: var(--neon-cyan); font-weight: 700; font-size: 13px; flex: none; }

/* 번역/원문 토글 표시 전환 */
.orig-view { display: none; }
.msg.show-orig .bubble-text.tr-view { display: none; }
.msg.show-orig .orig-view { display: inline; }

/* --- Composer (댓글 입력) --- */
.composer { position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, var(--bg) 28%); padding: 14px 0 10px; }
/* 상단 '댓글 추가' 배치 — sticky 해제하고 목록 위에 고정 배치 */
.composer-top { position: static; background: none; padding: 0 0 22px; }
.composer-bar {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 22px; padding: 6px 6px 6px 16px;
  transition: border-color .15s, box-shadow .15s;
}
.composer-bar:focus-within { border-color: #22d3ee66; box-shadow: 0 0 0 3px #22d3ee1a; }
.composer-bar textarea {
  flex: 1; background: none; color: var(--text); border: none; outline: none;
  font-size: 14.5px; font-family: inherit; line-height: 1.45; resize: none; padding: 8px 0; max-height: 160px;
}
.send-btn {
  flex: none; width: 38px; height: 38px; border-radius: 50%; border: none;
  display: grid; place-items: center; color: #04141a;
  background: linear-gradient(180deg, #34e2f5, #17b4d4);
  box-shadow: inset 0 1px 0 #ffffff66, 0 1px 3px #0007; transition: transform .08s, filter .15s;
}
.send-btn:hover { filter: brightness(1.05); }
.send-btn:active { transform: scale(.94); }
.send-btn:disabled { opacity: .5; }
.send-btn svg { transform: translateX(1px); }
.composer-foot { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); margin: 10px 4px 0; }
.composer-foot .foot-note { display: inline-flex; align-items: center; gap: 6px; }
.composer-foot .ts-attach { margin-right: auto; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--neon-lime); box-shadow: 0 0 8px var(--neon-lime); }

/* --- 신고 모달 --- */
.modal-back { position: fixed; inset: 0; background: #04040a99; backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; }
.modal { width: min(400px, 92vw); background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 20px 60px #000a; }
.modal h3 { margin: 0 0 4px; font-size: 17px; }
.modal-sub { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.reason-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.reason { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; font-size: 14px; cursor: pointer; transition: background .12s; }
.reason:hover { background: #ffffff08; }
.reason input { accent-color: var(--neon-cyan); }
.modal-detail { width: 100%; background: var(--bg-3); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px; font-size: 13.5px; font-family: inherit; resize: none; outline: none; }
.modal-detail:focus { border-color: #22d3ee66; }
.modal-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn-danger { background: linear-gradient(180deg, #ff6b6b, #e63e3e) padding-box, linear-gradient(180deg, #ff9a9a, #b52a2a) border-box; color: #2a0606; }
.btn-danger:hover { box-shadow: 0 6px 18px #e63e3e55; filter: brightness(1.05); }

/* --- Toast --- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #16161f; border: 1px solid var(--border); color: var(--text); font-size: 13px;
  padding: 10px 16px; border-radius: 999px; box-shadow: 0 8px 24px #000a; transition: opacity .2s, transform .2s; z-index: 60; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* --- Insights (B2B 대시보드) --- */
.ins { max-width: 1000px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.ins-bar { display: flex; align-items: center; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: linear-gradient(180deg, var(--bg) 70%, transparent); z-index: 10; }
.ins-bar .brand small { -webkit-text-fill-color: var(--neon-cyan); color: var(--neon-cyan); letter-spacing: 3px; }
.ins-badge { font-size: 11px; letter-spacing: .5px; color: var(--muted); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; }
.ins-main { padding: 26px 0 60px; }
.ins-loading { color: var(--muted); text-align: center; padding: 80px 0; }

.ins-gate { max-width: 420px; margin: 60px auto; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 26px; text-align: center; }
.ins-gate h2 { margin: 0 0 8px; font-size: 20px; }
.ins-gate p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 16px; }
.ins-gate-err { color: #ff6b6b; font-size: 13px; margin-bottom: 10px; }
.ins-gate-row { display: flex; gap: 8px; }
.ins-gate-row input { flex: 1; background: var(--bg-3); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 12px 14px; outline: none; }
.ins-gate-row input:focus { border-color: #22d3ee88; box-shadow: 0 0 0 3px #22d3ee22; }

.ins-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ins-head h1 { margin: 6px 0 0; font-size: 24px; line-height: 1.2; }
.ins-head .plat { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--neon-magenta); border: 1px solid #ff3df044; padding: 2px 8px; border-radius: 999px; }
.ins-link { font-size: 13px; color: var(--muted); white-space: nowrap; }
.ins-sub { color: var(--muted); font-size: 13.5px; margin: 12px 0 22px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.tile-val { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.tile-label { font-size: 12px; color: var(--muted); margin-top: 6px; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; }
.card-wide { grid-column: 1 / -1; }
.card h3 { margin: 0 0 14px; font-size: 14px; font-weight: 700; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12.5px; }
.bar-label { width: 74px; flex: none; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 8px; background: var(--bg-3); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple)); }
.bar-val { width: 68px; flex: none; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.sent-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--bg-3); }
.sent-bar.mini { height: 8px; flex: 1; }
.sent-seg { height: 100%; }
.sent-legend { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.sent-key { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sent-key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.note { font-size: 11px; color: #6a6a80; margin-top: 12px; }

.kw-cloud { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; }
.kw { color: var(--neon-cyan); font-weight: 600; }

.timeline { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.tl-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.tl-bar { width: 100%; max-width: 40px; background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple)); border-radius: 6px 6px 0 0; }
.tl-label { font-size: 10px; color: var(--muted); }
.ins-tools { display: flex; gap: 8px; margin: -8px 0 20px; }

/* --- 스레드 부가 (원본/임베드) --- */
.thread-sub { display: flex; align-items: center; gap: 14px; }
.embed-copy { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 0; }
.embed-copy:hover { color: var(--neon-cyan); }

/* --- 맥락 광고 --- */
.ad { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 14px 0 4px; cursor: pointer; transition: border-color .15s; position: relative; }
.ad:hover { border-color: #a855f755; }
.ad-tag { position: absolute; top: -8px; left: 12px; font-size: 9px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); padding: 1px 7px; border-radius: 999px; }
.ad-body { flex: 1; min-width: 0; }
.ad-title { font-size: 14px; font-weight: 700; color: var(--text); }
.ad-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ad-adv { font-size: 11px; color: var(--neon-cyan); margin-top: 4px; }
.ad-x { flex: none; background: none; border: 1px solid var(--border); color: var(--muted); font-size: 11px; padding: 5px 9px; border-radius: 8px; cursor: pointer; }
.ad-x:hover { border-color: var(--neon-lime); color: var(--neon-lime); }

/* --- 프로모션 라벨 --- */
.promo-tag { font-size: 9px; margin-left: 6px; color: var(--neon-lime); border: 1px solid #a3ff1244; padding: 0 5px; border-radius: 999px; letter-spacing: .5px; }
.thread-item.promoted { border-color: #a3ff1233; }

/* --- 사이드바 후원 --- */
.side-foot { margin-top: auto; padding-top: 14px; }
/* 어두운 본체 + 핑크 그라디언트 테두리 — 다른 버튼(.btn)과 통일, 후원은 핑크로 정체성만. */
.donate-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  position: relative; isolation: isolate;
  color: #ffd7e4; font-weight: 700; font-size: 14px; letter-spacing: -0.01em;
  padding: 11px 14px; border-radius: 12px; border: 1.5px solid transparent;
  background:
    linear-gradient(180deg, #191722, #131119) padding-box,
    linear-gradient(150deg, #ff9ab5, #ff3df0 55%, #b52a51) border-box;
  box-shadow: 0 2px 10px #0006;
  transition: transform .1s ease, box-shadow .2s ease, filter .2s ease;
}
.donate-btn::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: linear-gradient(180deg, #ff5c8a12, transparent 55%);
}
.donate-btn:hover { filter: brightness(1.06); box-shadow: 0 0 22px #ff3df033, 0 6px 22px #0007; }
.donate-btn:active { transform: translateY(1px); }
.donate-note { font-size: 11px; color: var(--muted); text-align: center; margin-top: 8px; line-height: 1.4; }

/* --- 임베드 위젯 --- */
.embed-widget { display: flex; flex-direction: column; height: 100vh; background: var(--bg); }
.embed-posts { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.embed-msg { font-size: 14px; line-height: 1.5; }
.embed-handle { font-weight: 700; margin-right: 6px; }
.embed-text { color: var(--text); word-break: break-word; }
.embed-empty { color: var(--muted); text-align: center; padding: 30px 0; font-size: 13px; }
.embed-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.embed-composer textarea { flex: 1; background: var(--bg-3); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 9px 14px; font-size: 14px; font-family: inherit; resize: none; outline: none; max-height: 100px; }
.embed-composer textarea:focus { border-color: #22d3ee66; }
.embed-brand { text-align: center; font-size: 11px; color: var(--muted); padding: 6px; border-top: 1px solid var(--border); }
.embed-brand b { color: var(--neon-cyan); }

/* --- 운영 콘솔 --- */
.admin-h { font-size: 16px; margin: 24px 0 10px; }
.admin-grid { display: grid; grid-template-columns: 2.4fr 1.6fr .6fr .6fr .6fr .7fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.admin-grid.admin-head { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; border-bottom-color: #ffffff18; }
.admin-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.admin-form input { background: var(--bg-3); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 13px; outline: none; }
.admin-form input:focus { border-color: #22d3ee66; }
.admin-form .btn { grid-column: 1 / -1; }
.admin-th { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.admin-th-plat { font-size: 10px; text-transform: uppercase; color: var(--neon-magenta); flex: none; width: 70px; }
.admin-th-title { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-th .btn-ghost { flex: none; }
/* 광고 삭제 — 기본 버튼 크롬 대신 테마 고스트. */
.admin-grid .del-ad { background: none; border: 1px solid var(--border); color: var(--muted); padding: 5px 10px; border-radius: 8px; font-size: 12px; transition: .15s; }
.admin-grid .del-ad:hover { border-color: #ff6b6b66; color: #ff6b6b; }

/* --- 인쇄(인사이트 PDF) --- */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #111; }
  .card, .tile { break-inside: avoid; border-color: #ddd; background: #fff; }
  .ins-bar { border-color: #ddd; }
}

/* --- 반응형 (모바일) --- */
@media (max-width: 820px) {
  /* 그리드 대신 블록 — 사이드바(상단바)가 콘텐츠 높이만 차지하게. */
  .app { display: block; }
  /* 사이드바 → 상단 고정 바: 브랜드 + 내 언어만. 최근 스레드는 숨김. */
  .sidebar {
    position: sticky; top: 0; z-index: 20;
    flex-direction: row; align-items: center; gap: 12px;
    height: auto; padding: 10px 14px;
    background: var(--bg-2);
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .brand { font-size: 18px; }
  .brand small { display: none; }
  .side-label, .thread-list { display: none; }
  .side-lang { margin-left: auto; padding: 6px 10px; }
  .side-lang select { max-width: 108px; }
  /* 후원은 상단바에 컴팩트 버튼으로만 — 안내문은 숨긴다. */
  .side-foot { margin-top: 0; padding-top: 0; }
  .donate-btn { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
  .donate-note { display: none; }

  .main { padding: 20px 16px 8px; max-width: none; }
  .hero h1 { font-size: 30px; }
  .paste-box { flex-direction: column; }
  .paste-box .btn { padding: 12px; }
  .msg { max-width: 88%; }
  .embed-wrap { margin-top: 4px; }

  .tiles { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr; }
  .ins-head h1 { font-size: 20px; }
}

/* ============================================================
   댓글 정렬 · 좋아요 · 대댓글 (스레드 페이지)
   ============================================================ */
.sort-bar { display: flex; gap: 6px; margin: 6px 0 14px; }
.sort-tab {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; transition: .15s;
}
.sort-tab:hover { color: var(--text); border-color: #ffffff24; }
.sort-tab.on {
  color: #eafaff; border-color: transparent;
  background: linear-gradient(180deg, #191925, #111119) padding-box,
    linear-gradient(95deg, var(--neon-cyan), var(--neon-magenta) 52%, var(--neon-purple)) border-box;
}

.like-btn { color: #6a6a80; display: inline-flex; align-items: center; gap: 3px; transition: color .15s, transform .1s; }
.like-btn:hover { color: #ff5c8a; }
.like-btn.on { color: #ff3df0; }
.like-btn:active { transform: scale(1.18); }
.like-btn .like-n { font-variant-numeric: tabular-nums; }
.reply-btn { color: #6a6a80; }
.reply-btn:hover { color: var(--neon-cyan); }

.replies {
  margin: 8px 0 2px; padding-left: 14px; border-left: 2px solid #ffffff12;
  display: flex; flex-direction: column; gap: 10px;
}
.msg.reply { margin: 0; }
.msg.reply .msg-avatar { width: 26px; height: 26px; font-size: 10px; }

.reply-box { margin: 8px 6px 4px; display: flex; flex-direction: column; gap: 8px; }
.reply-ta {
  width: 100%; resize: none; background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 14px; outline: none;
}
.reply-ta:focus { border-color: #ffffff30; }
.reply-actions { display: flex; justify-content: flex-end; gap: 8px; }
.reply-actions .btn { padding: 6px 16px; font-size: 13px; }

/* ============================================================
   홈 디스커버 — 핫한/최근 스레드 + 플랫폼 필터
   ============================================================ */
.discover { margin-top: 40px; }
.discover-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.disc-tabs { display: flex; gap: 6px; }
.disc-tab {
  background: transparent; border: none; color: var(--muted);
  font-size: 16px; font-weight: 700; padding: 4px 2px; position: relative; transition: color .15s;
}
.disc-tab:hover { color: var(--text); }
.disc-tab.on { color: var(--text); }
.disc-tab.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
}
.disc-plats { display: flex; gap: 6px; flex-wrap: wrap; }
.plat-chip {
  font-size: 12px; color: var(--muted); background: var(--bg-3);
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); transition: .15s;
}
.plat-chip:hover { color: var(--text); border-color: #ffffff24; }
.plat-chip.on { color: #eafaff; border-color: transparent;
  background: linear-gradient(180deg, #191925, #111119) padding-box,
    linear-gradient(95deg, var(--neon-cyan), var(--neon-magenta) 52%, var(--neon-purple)) border-box;
}

.disc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.disc-card {
  display: flex; flex-direction: column; gap: 8px; padding: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); transition: .15s;
}
.disc-card:hover { border-color: #ffffff2a; transform: translateY(-2px); box-shadow: 0 8px 24px #0005; }
.disc-card.promoted { border-color: #a3ff1240; }
.disc-plat { font-size: 11px; color: var(--neon-cyan); font-weight: 700; letter-spacing: .3px; }
.disc-title { font-size: 14px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.disc-meta { display: flex; gap: 6px; font-size: 12px; color: var(--muted); margin-top: auto; }
.disc-empty { color: var(--muted); font-size: 14px; padding: 24px 4px; grid-column: 1 / -1; }

/* ============================================================
   후원 페이지 /donate
   ============================================================ */
.donate-page { max-width: 900px; margin: 0 auto; padding: 40px 22px 64px; }
.donate-hero { text-align: center; margin: 24px 0 40px; }
.donate-badge {
  display: inline-block; font-size: 11px; letter-spacing: 2px; font-weight: 700; color: #2a0612;
  background: linear-gradient(90deg, #ff9ab5, #ff5c8a); padding: 4px 12px; border-radius: 999px; margin-bottom: 18px;
}
.donate-hero h1 { font-size: clamp(26px, 4.4vw, 42px); line-height: 1.18; margin: 0 0 16px; }
.donate-hero .accent { color: var(--neon-cyan); text-shadow: var(--glow-cyan); }
.donate-hero p { color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 620px; margin: 0 auto; }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.tier {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 24px 20px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
}
.tier.featured {
  border-color: transparent;
  background: linear-gradient(180deg, #141420, #101018) padding-box,
    linear-gradient(160deg, var(--neon-cyan), var(--neon-magenta) 55%, var(--neon-purple)) border-box;
  box-shadow: 0 0 30px #ff3df01f;
}
.tier-flag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #eafaff;
  background: linear-gradient(90deg, var(--neon-magenta), var(--neon-purple)); padding: 3px 12px; border-radius: 999px;
}
/* 인기(중간 등급)는 은은하게, 최상위(고수) 플래그가 더 도드라지게 대비 */
.tier-flag.alt { background: #ffffff14; color: var(--muted); border: 1px solid var(--border); }
/* 등급 레벨 — 돈 많이 낼수록 위(고급)라는 신호 */
.tier-rank { font-size: 10px; font-weight: 800; letter-spacing: 1.5px; color: var(--muted); }
.tier.top .tier-rank { color: var(--neon-cyan); }
.tier-name { font-size: 15px; font-weight: 700; }
.tier-price { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.tier-price span { font-size: 14px; font-weight: 500; color: var(--muted); }
.tier-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tier-perks li { font-size: 13.5px; color: var(--text); padding-left: 22px; position: relative; line-height: 1.5; }
.tier-perks li::before { content: "✓"; position: absolute; left: 0; color: var(--neon-lime); font-weight: 700; }
.tier-btn {
  margin-top: auto; background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  font-weight: 700; font-size: 14px; padding: 11px; border-radius: 12px; transition: .15s;
}
.tier-btn:hover { border-color: #ffffff30; background: #ffffff08; }
.tier-btn.primary {
  color: #eafaff; border-color: transparent;
  background: linear-gradient(180deg, #191925, #111119) padding-box,
    linear-gradient(95deg, var(--neon-cyan), var(--neon-magenta) 52%, var(--neon-purple)) border-box;
}
.tier-btn.primary:hover { filter: brightness(1.08); box-shadow: 0 0 22px #22d3ee2e; }

.donate-cta { text-align: center; margin: 8px 0 40px; }
.btn.big { display: inline-block; line-height: 52px; height: 52px; font-size: 16px; }
.cta-note { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.cta-soon { color: var(--muted); font-size: 14px; padding: 14px; border: 1px dashed var(--border); border-radius: 12px; display: inline-block; }

.redeem {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; text-align: center; margin-bottom: 24px;
}
.redeem h3 { margin: 0 0 6px; font-size: 17px; }
.redeem-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.redeem-row { display: flex; gap: 8px; max-width: 420px; margin: 0 auto; }
.redeem-row input {
  flex: 1; background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 11px 14px; font: inherit; font-size: 14px; outline: none;
}
.redeem-row input:focus { border-color: #ffffff30; }
.redeem-row .btn { line-height: 44px; height: 44px; }
.redeem-msg { font-size: 13px; margin-top: 12px; min-height: 18px; }
.redeem-msg.ok { color: var(--neon-lime); }
.redeem-msg.err { color: #ff6b6b; }
.donate-foot { color: var(--muted); font-size: 12.5px; text-align: center; line-height: 1.6; }

@media (max-width: 720px) {
  .tiers { grid-template-columns: 1fr; }
  .discover-head { flex-direction: column; align-items: flex-start; }
}

/* --- 유튜브 타임스탬프 댓글 --- */
.ts-attach {
  flex: none; background: transparent; border: 1px solid var(--border);
  color: var(--neon-cyan); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: .15s;
}
.ts-attach:hover { border-color: #22d3ee66; background: #22d3ee12; }
.ts-chiprow { display: flex; align-items: center; gap: 10px; margin: 8px 4px 0; flex-wrap: wrap; }
.ts-chip { display: inline-flex; align-items: center; gap: 2px; }
.ts-chip-jump {
  background: #22d3ee16; border: 1px solid #22d3ee44; color: var(--neon-cyan);
  font-weight: 700; font-size: 12.5px; padding: 4px 10px; border-radius: 999px 0 0 999px; cursor: pointer;
}
.ts-chip-x {
  background: #22d3ee16; border: 1px solid #22d3ee44; border-left: none; color: var(--muted);
  font-size: 12px; padding: 4px 9px; border-radius: 0 999px 999px 0; cursor: pointer;
}
.ts-chip-x:hover { color: #ff6b6b; }
.ts-chip-note { font-size: 11.5px; color: var(--muted); }
/* 댓글 안 타임스탬프 칩 */
.ts-jump {
  background: #22d3ee14; border: 1px solid #22d3ee3a; color: var(--neon-cyan);
  font-weight: 700; font-size: 12px; padding: 2px 9px; border-radius: 999px; cursor: pointer; transition: .15s;
}
.ts-jump:hover { background: #22d3ee2a; filter: brightness(1.1); }

/* --- 싱크 재생 (구간순, 유튜브) --- */
.sync-row { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; flex-wrap: wrap; }
.sync-btn {
  background: transparent; border: 1px solid #22d3ee55; color: var(--neon-cyan);
  font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: .15s;
}
.sync-btn:hover { background: #22d3ee12; }
.sync-btn.on {
  color: #04141a; border-color: transparent;
  background: linear-gradient(180deg, #34e2f5, #17b4d4);
  box-shadow: 0 0 16px #22d3ee55; animation: syncPulse 1.8s ease-in-out infinite;
}
@keyframes syncPulse { 0%,100% { box-shadow: 0 0 14px #22d3ee44; } 50% { box-shadow: 0 0 24px #22d3ee88; } }
.sync-hint { font-size: 12px; color: var(--muted); }

/* 재생 위치에 걸린 구간 댓글 강조 (상단으로 떠오른 상태) */
.msg.now::before {
  background: #22d3ee16;
  box-shadow: inset 0 0 0 1px #22d3ee66, 0 0 26px #22d3ee2e;
}
.msg.now .ts-jump { background: #22d3ee33; }

/* --- 익명 복구 코드 (사이드바 신원 블록 + 모달) --- */
.side-id { margin: 14px 6px 0; padding-top: 14px; border-top: 1px solid var(--border); }
.side-id-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.side-id-face { font-size: 15px; flex: none; }
.side-id-handle { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-id-link { display: inline-block; margin-top: 6px; background: none; border: none; padding: 0; cursor: pointer;
  color: var(--neon-cyan); font-size: 12px; font-weight: 600; }
.side-id-link:hover { filter: brightness(1.15); }
.id-code-row { display: flex; gap: 8px; }
.id-code { flex: 1; min-width: 0; background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; font-family: ui-monospace, monospace; }
.id-div { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--muted); font-size: 12px; }
.id-div::before, .id-div::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.id-msg { font-size: 12.5px; color: var(--neon-cyan); margin-top: 10px; }
.id-msg.bad { color: #ff6b6b; }

/* --- 운영자 모더레이션 목록 --- */
.mod-list { margin: 4px 0 10px; display: flex; flex-direction: column; gap: 10px; }
.mod-item { background: var(--bg-3); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.mod-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.mod-body { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.mod-reasons { font-size: 12px; color: var(--muted); margin-top: 6px; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mod-actions .btn-ghost { padding: 5px 12px; font-size: 12px; }
.mod-badge { font-size: 10px; font-weight: 700; letter-spacing: .3px; padding: 2px 8px; border-radius: 999px; }
.mod-badge.ok { color: #04141a; background: var(--neon-cyan); }
.mod-badge.rep { color: #2a1204; background: #ffb057; }
.mod-badge.pend { color: #04141a; background: #b98bff; }
.mod-badge.hide { color: #fff; background: #ff6b6b; }
