/* 4단계 토론 — 기사 아래 실시간 댓글 */
.dz { display: grid; gap: 16px; }
.dz__head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dz__online { color: var(--state-success); }
.dz__sort { margin-left: auto; display: flex; gap: 2px; }
.dz__sort button { background: none; border: 0; padding: 6px 10px; font-size: var(--fs-ui); color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; }
.dz__sort button[aria-selected=true] { color: var(--text-primary); border-color: var(--brand-navy); font-weight: 700; }
.dz__closed, .dz__empty { padding: 20px; text-align: center; background: var(--bg-sunken); border-radius: var(--radius); color: var(--text-secondary); margin: 0; list-style: none; }
.dz__new { position: sticky; top: 12px; z-index: 5; justify-self: center; border: 0; border-radius: 999px; padding: 8px 18px; background: var(--brand-navy); color: var(--text-on-dark); font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px rgb(0 0 0 / .18); }
.dz__new[hidden] { display: none; }
.dz__list, .cm__replies { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.dz__more { justify-self: center; }
.dz__avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-navy); color: var(--text-on-dark); display: grid; place-items: center; font-weight: 700; font-size: 14px; overflow: hidden; }
.dz__avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 쓰기 */
.cmp__atts { display: flex; gap: 8px; flex-wrap: wrap; }
.cmp__atts:empty { display: none; }
.cmp__att { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 8px; border: 1px solid var(--border-default); border-radius: var(--radius); font-size: var(--fs-caption); }
.cmp__att img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.cmp__att button { border: 0; background: none; cursor: pointer; color: var(--text-secondary); }

/* 입력 중 (흐릿한 댓글) */
.dz__typing { display: grid; gap: 8px; }
.dz__typing:empty { display: none; }
.ghost { padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius); opacity: .75; animation: ghost-in .3s ease-out; }
.ghost__who { display: flex; align-items: center; gap: 8px; font-size: var(--fs-ui); }
.ghost__dots::after { content: "…"; animation: dots 1.2s steps(3, end) infinite; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; }
.ghost__text { margin: 8px 0 0; filter: blur(4px); user-select: none; color: var(--text-secondary); }
@keyframes ghost-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes dots { from { width: 0; } }

/* 댓글 */
.cm { border-top: 1px solid var(--border-default); }
.cm__replies { padding-left: 44px; }
.cm__replies .cm { border-top: 0; }
.cm__card { display: grid; gap: 8px; padding: 16px 0; }
.cm__replies .cm__card { padding: 10px 0; }
.cm.has-new > .cm__replies > .cm__more { color: var(--brand-gold); font-weight: 700; }
.cm__who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-ui); }
.cm__name { font-weight: 700; }
.cm__flag { font-size: 15px; }
.cm__angle { font-size: var(--fs-caption); padding: 1px 8px; border-radius: 4px; background: var(--brand-gold-soft); }
.cm__time { margin-left: auto; color: var(--text-tertiary); }
.cm__body { line-height: 1.75; overflow-wrap: anywhere; }
.cm__body p { margin: 0 0 6px; }
.cm__body blockquote { margin: 4px 0; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--text-secondary); }
.cm__body a { color: var(--text-link); text-decoration: underline; }
.cm__body .mention { text-decoration: none; font-weight: 700; }
.cm__gone { margin: 0; color: var(--text-tertiary); font-size: var(--fs-body-s); }
.cm__held { padding: 10px 12px; border-radius: var(--radius); background: var(--state-warning-soft); display: grid; gap: 4px; justify-items: start; font-size: var(--fs-body-s); }
.cm__held p { margin: 0; }
.cm__att { display: flex; gap: 8px; flex-wrap: wrap; }
.cm__img { position: relative; margin: 0; max-width: 360px; border-radius: var(--radius); overflow: hidden; }
.cm__img img { display: block; width: 100%; max-height: 360px; object-fit: cover; }
.cm__img.is-blur img { filter: blur(24px); }
.cm__reveal { position: absolute; inset: 0; border: 0; background: rgb(0 0 0 / .35); color: #fff; font-weight: 700; cursor: pointer; }
.cm__voice { display: grid; gap: 4px; }
.cm__voice audio { height: 36px; }
.cm__tr:empty { display: none; }
.cm__tr { padding: 10px 12px; background: var(--bg-sunken); border-radius: var(--radius); display: grid; gap: 4px; }
.cm__actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.cm__vote, .cm__act, .cm__more { background: none; border: 0; padding: 4px 8px; border-radius: 999px; font-size: var(--fs-caption); color: var(--text-secondary); cursor: pointer; }
.cm__vote:hover, .cm__act:hover { background: var(--bg-sunken); color: var(--text-primary); }
.cm__vote[aria-pressed=true] { background: var(--brand-gold-soft); color: var(--text-primary); font-weight: 700; }
.cm__more { color: var(--text-link); font-weight: 500; padding-left: 0; margin: 4px 0 8px; }

/* 투표 */
.poll { display: grid; gap: 6px; max-width: 480px; padding: 12px; border: 1px solid var(--border-default); border-radius: var(--radius); }
.poll__q { font-size: var(--fs-body-s); }
.poll__opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: none; cursor: pointer; overflow: hidden; text-align: left; }
.poll__bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--bg-sunken); transition: width .4s; }
.poll__opt.is-mine { border-color: var(--brand-gold); }
.poll__opt.is-mine .poll__bar { background: var(--brand-gold-soft); }
.poll__text, .poll__pct { position: relative; font-size: var(--fs-ui); }
.poll__pct { font-weight: 700; }

/* 문장 카드 버튼 */
.quote-fab { position: absolute; z-index: 30; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--brand-navy); color: var(--text-on-dark); font-weight: 700; font-size: var(--fs-caption); box-shadow: 0 6px 18px rgb(0 0 0 / .25); cursor: pointer; }
.quote-fab[hidden] { display: none; }

@media (max-width: 767px) {
  .cm__replies { padding-left: 16px; }
  .cmp--reply { margin-left: 0; }
  .dz__sort { margin-left: 0; }
}
.dz__support { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--brand-gold); border-radius: var(--radius); background: var(--brand-gold-soft); }
.dz__support:hover { text-decoration: none; filter: brightness(.98); }

/* ───────── 댓글 꾸미기 (static/js/editor.js · 서버 허용 class와 같아요) ───────── */
:root {
  --cc-gray: #6b6b6b; --cc-red: #c62828; --cc-orange: #d9631a; --cc-gold: #a47a1c; --cc-green: #2e7d32;
  --cc-teal: #00838f; --cc-blue: #1e64c8; --cc-navy: #1f2a36; --cc-purple: #7b3fb5; --cc-pink: #d6337a; --cc-hl: #fff1a8;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cc-gray: #a6a6a6; --cc-red: #ff6b6b; --cc-orange: #ff9d57; --cc-gold: #e0b84f; --cc-green: #6fcf7a; --cc-teal: #4fd1d9; --cc-blue: #6ea8ff; --cc-navy: #9fb6d6; --cc-purple: #c39bff; --cc-pink: #ff7fb3; --cc-hl: #5c4d0a; } }
:root[data-theme="dark"] { --cc-gray: #a6a6a6; --cc-red: #ff6b6b; --cc-orange: #ff9d57; --cc-gold: #e0b84f; --cc-green: #6fcf7a; --cc-teal: #4fd1d9; --cc-blue: #6ea8ff; --cc-navy: #9fb6d6; --cc-purple: #c39bff; --cc-pink: #ff7fb3; --cc-hl: #5c4d0a; }

.c-gray { --cc: var(--cc-gray); } .c-red { --cc: var(--cc-red); } .c-orange { --cc: var(--cc-orange); } .c-gold { --cc: var(--cc-gold); } .c-green { --cc: var(--cc-green); }
.c-teal { --cc: var(--cc-teal); } .c-blue { --cc: var(--cc-blue); } .c-navy { --cc: var(--cc-navy); } .c-purple { --cc: var(--cc-purple); } .c-pink { --cc: var(--cc-pink); } .c-base { --cc: var(--text-primary); }
:is(.cm__body, .rte__ed) [class*="c-"] { color: var(--cc); }
:is(.cm__body, .rte__ed) .fs-s { font-size: 13px; } :is(.cm__body, .rte__ed) .fs-m { font-size: 16px; } :is(.cm__body, .rte__ed) .fs-l { font-size: 20px; line-height: 1.5; } :is(.cm__body, .rte__ed) .fs-xl { font-size: 26px; line-height: 1.35; font-weight: 700; }
.ff-serif { font-family: var(--font-serif); } .ff-round { font-family: "Gowun Dodum", var(--font-sans); } .ff-hand { font-family: "Nanum Pen Script", cursive; font-size: 1.3em; }
.ff-bold { font-family: "Black Han Sans", var(--font-sans); letter-spacing: .01em; } .ff-mono { font-family: "Nanum Gothic Coding", ui-monospace, monospace; } .ff-base { font-family: var(--font-sans); }
:is(.cm__body, .rte__ed) .hl { background: linear-gradient(transparent 45%, var(--cc-hl) 45%); padding: 0 1px; } :is(.cm__body, .rte__ed) .hl-none { background: none; }
:is(.cm__body, .rte__ed) .al-center { text-align: center; } :is(.cm__body, .rte__ed) .al-right { text-align: right; }

/* 편집기 */
.rte__ed blockquote { margin: 4px 0; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--text-secondary); }
.rte__ed a { color: var(--text-link); text-decoration: underline; }
.rte__ed { overflow-wrap: anywhere; }

/* 댓글 속 유튜브: 썸네일 → 누르면 재생 */
.cm__yt { position: relative; width: 100%; max-width: 480px; aspect-ratio: 16 / 9; margin: 6px 0 4px; border-radius: 8px; overflow: hidden; background: #000; }
.cm__yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cm__yt-btn { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; background: #000 center / cover no-repeat; }
.cm__yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); border-radius: 12px; background: rgb(255 0 0 / .9); }
.cm__yt-play::after { content: ""; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.cm__yt-btn:hover .cm__yt-play { background: #f00; }
.cm__body a { word-break: break-all; }

/* 음성 댓글 플레이어 — 크기는 --vp-s (재생 버튼 지름) 하나로 정해요. 사이트 설정 48에서 5단계 */
.vp { --s: var(--vp-s, 28px); display: inline-flex; align-items: center; gap: calc(var(--s) * .3); width: 100%; max-width: calc(var(--s) * 10); padding: calc(var(--s) * .15) calc(var(--s) * .45) calc(var(--s) * .15) calc(var(--s) * .15); border: 1px solid var(--border-default); border-radius: 999px; background: var(--bg-page); }
.vp__btn { flex: none; width: var(--s); height: var(--s); border-radius: 50%; border: 0; background: var(--brand-navy); cursor: pointer; position: relative; padding: 0; }
.vp__btn::before { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); border-style: solid; border-width: calc(var(--s) * .18) 0 calc(var(--s) * .18) calc(var(--s) * .28); border-color: transparent transparent transparent var(--text-on-dark); }
.vp.is-playing .vp__btn::before { transform: translate(-50%, -50%); width: calc(var(--s) * .32); height: calc(var(--s) * .36); border: 0; background: linear-gradient(90deg, var(--text-on-dark) 0 36%, transparent 36% 64%, var(--text-on-dark) 64%); }
.vp__mic { flex: none; font-size: calc(var(--s) * .45); }
.vp__bar { flex: 1; height: max(3px, calc(var(--s) * .15)); border-radius: 99px; background: var(--bg-sunken); position: relative; cursor: pointer; }
.vp__bar::after { content: ""; position: absolute; left: 0; right: 0; top: -8px; bottom: -8px; } /* 누르기 쉽게 터치 영역만 넓혀요 */
.vp__bar:focus-visible { outline: 2px solid var(--brand-gold); outline-offset: 3px; }
.vp__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: var(--brand-gold); transition: width .1s linear; }
.vp__time { flex: none; font-size: max(11px, calc(var(--s) * .32)); color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 5.2em; text-align: right; }
.vp.is-error .vp__btn { background: var(--border-strong); cursor: default; }

/* 프로필 사진 밑 띠 */
.dz__face { flex: none; display: inline-flex; flex-direction: column; align-items: center; width: 40px; }
.dz__face .dz__avatar { width: 36px; height: 36px; }
.dz__belt { display: block; width: 40px; margin-top: -3px; position: relative; z-index: 1; }
.cm__who { align-items: flex-start; }
.cm__who > :not(.dz__face) { margin-top: 8px; }
.cmp__me { align-items: center; }

/* 공유 링크로 들어온 댓글 */
.dz__shared { margin: 8px 0 20px; padding: 4px 16px 0; border: 1px solid var(--border-strong); border-top: 3px solid var(--brand-gold); background: var(--bg-page); }
.dz__shared-label { margin: 10px 0 0; font-size: 12px; font-weight: 700; color: var(--brand-gold); letter-spacing: .02em; }
.dz__shared .cm:first-child { border-top: 0; }
.cm.is-target { animation: cm-target 2.4s ease-out; box-shadow: inset 3px 0 0 var(--brand-gold); }
@keyframes cm-target { 0%, 30% { background: var(--brand-gold-soft); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .cm.is-target { animation: none; } }
/* 쓰는 중에도 올린 사진 · AI 이미지를 댓글에 붙을 크기 그대로 미리 보여 줘요 */
.cmp__att--img { position: relative; padding: 0; border: 0; display: block; }
.cmp__att--img .cm__img { max-width: 360px; }
.cmp__att--img .cm__img figcaption { padding: 6px 8px; background: var(--bg-subtle, rgba(0,0,0,.04)); }
.cmp__att--img .cmp__x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; display: grid; place-items: center; }
.cmp__att--img .cmp__x:hover { background: rgba(0,0,0,.8); }
.cmp__att--img { width: min(360px, 100%); }
.cmp__att--img .cm__img { width: 100%; }
.cmp__att.cmp__att--img img { width: 100%; height: auto; max-height: 360px; border-radius: 0; }

/* ───────── 토론 섹션 머리 (에디토리얼) ───────── */
.discuss { border-top: 2px solid var(--text-primary); padding-top: 18px; }
.discuss > .t-h2 { font-family: var(--font-serif); font-weight: 700; letter-spacing: -.01em; }
.dz { gap: 18px; }
.dz__head { padding-bottom: 12px; border-bottom: 1px solid var(--border-default); }
.dz__head > .t-ui { font-weight: 700; }
.dz__online { display: inline-flex; align-items: center; gap: 6px; }
.dz__sort { gap: 14px; }
.dz__sort button { padding: 4px 0; }
.dz__sort button[aria-selected=true] { border-color: var(--text-primary); }
.dz__support { margin-top: -18px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--border-default); border-radius: 0; background: none; color: var(--text-secondary); }
.dz__support strong { font-weight: 400; }
.dz__support span { color: var(--text-link); font-weight: 700; border-bottom: 1px solid var(--brand-gold); }
.dz__support:hover { filter: none; } .dz__support:hover span { border-bottom-width: 2px; }
.dz__empty { background: none; border-top: 1px solid var(--border-default); border-radius: 0; padding: 28px 0 8px; display: grid; gap: 4px; font-size: var(--fs-body-s); }
.dz__empty-t { font-family: var(--font-serif); font-size: 19px; color: var(--text-primary); }
.dz__closed { background: var(--bg-paper); }
.dz__more[hidden] { display: none; }

/* ───────── 댓글 작성기 (공통) ───────── */
.cmp { display: grid; gap: 8px; }
.cmp__card { position: relative; display: grid; background: var(--bg-page); }
.cmp__me { display: flex; align-items: center; gap: 10px; font-size: var(--fs-ui); }
.cmp__atts { padding: 0 16px; }
.cmp__busy { display: flex; align-items: center; gap: 10px; margin: 0 16px 8px; padding: 8px 12px; border-radius: 8px; background: var(--bg-paper); font-size: var(--fs-caption); color: var(--text-primary); }
.cmp__busy[hidden] { display: none; }
.cmp__pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--state-danger); animation: cmp-pulse 1s ease-in-out infinite alternate; }
@keyframes cmp-pulse { to { opacity: .25; } }
.cmp__stop { margin-left: auto; border: 1px solid var(--border-strong); background: var(--bg-page); color: var(--text-primary); border-radius: 999px; padding: 2px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.cmp__bar, .cmp__foot { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-width: 0; }
.cmp__end { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.cmp__count { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp__count.is-over { color: var(--state-danger); font-weight: 700; }
.cmp__send { height: 40px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--brand-navy); color: var(--text-on-dark); font: inherit; font-size: var(--fs-ui); font-weight: 700; letter-spacing: .02em; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.cmp__send:hover { background: var(--brand-navy-soft); }
.cmp__send.is-idle { background: var(--bg-sunken); color: var(--text-tertiary); }
.cmp__send:disabled { opacity: .6; cursor: default; }
.cmp__cancel { height: 40px; padding: 0 14px; border: 0; background: none; color: var(--text-secondary); font: inherit; font-size: var(--fs-ui); cursor: pointer; }
.cmp__a { display: inline-flex; align-items: center; gap: 6px; height: 34px; min-width: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--text-secondary); font: inherit; font-size: var(--fs-caption); cursor: pointer; white-space: nowrap; }
.cmp__a:hover { background: var(--bg-sunken); color: var(--text-primary); }
.cmp__a.is-on { color: var(--state-danger); }
.cmp__a:disabled { opacity: .5; cursor: default; }
.cmp__a .cmp__ic svg { display: block; }
.cmp__a.is-locked > .cmp__ic:last-child { margin-left: -4px; opacity: .7; }
.cmp__hint { margin-left: auto; font-size: 11px; color: var(--text-tertiary); }
.cmp__under { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 4px; font-size: 12px; color: var(--text-tertiary); }
.cmp__share { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.cmp__kbd { margin-left: auto; }
.cmp--reply, .cmp--edit { margin: 8px 0 8px 44px; }
.cmp--edit { margin-left: 0; }
.cmp--reply .cmp__under, .cmp--edit .cmp__under { display: none; }

/* 편집기 바탕 */
.rte { position: relative; display: grid; }
.rte__ed { position: relative; min-height: 96px; max-height: 420px; overflow-y: auto; padding: 12px 18px 16px; outline: none; font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.rte--compact .rte__ed { min-height: 56px; }
.rte__ed p { margin: 0 0 4px; }
.rte__ed.is-empty::before { content: attr(data-placeholder); position: absolute; color: var(--text-tertiary); pointer-events: none; }
.rte__ed blockquote { margin: 4px 0; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--text-secondary); }
.rte__ed a { color: var(--text-link); text-decoration: underline; }
.rte__tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.rte__sep { width: 1px; height: 18px; background: var(--border-default); margin: 0 6px; flex: none; }
.rte__b { min-width: 34px; height: 34px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 8px; background: none; color: var(--text-primary); cursor: pointer; font: inherit; font-size: 15px; line-height: 1; }
.rte__b:hover { background: var(--bg-sunken); }
.rte__b[aria-pressed="true"], .rte__b[aria-checked="true"] { background: var(--brand-navy); color: var(--text-on-dark); }
.rte__b[aria-expanded="true"] { background: var(--bg-sunken); }
.rte__b:focus-visible { outline: 2px solid var(--brand-gold); outline-offset: 1px; }
.rte__b.is-b { font-weight: 800; } .rte__b.is-i { font-style: italic; font-family: Georgia, var(--font-serif); } .rte__b.is-u { text-decoration: underline; text-underline-offset: 3px; } .rte__b.is-s { text-decoration: line-through; }
.rte__b svg { display: block; }
.rte__hl { background: linear-gradient(transparent 45%, var(--cc-hl) 45%); padding: 0 2px; font-weight: 700; }
.rte__b[aria-pressed="true"] .rte__hl { background: linear-gradient(transparent 45%, #c9a227 45%); }
.rte__caret svg { width: 13px; height: 13px; opacity: .55; }
.rte__swatch { width: 16px; height: 16px; border-radius: 50%; background: var(--cc, var(--text-primary)); box-shadow: inset 0 0 0 2px var(--bg-page), 0 0 0 1px var(--border-default); }
.rte__swatch.c-base { background: conic-gradient(var(--text-primary) 0 50%, var(--bg-page) 0); }
.rte__seg { display: inline-flex; align-items: stretch; border: 1px solid var(--border-default); border-radius: 8px; overflow: hidden; }
.rte__seg > .rte__b { border-radius: 0; flex: 1; }
.rte__seg > .rte__b + .rte__b { border-left: 1px solid var(--border-default); }
.rte__size { font-weight: 500; }
.rte__line { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rte__lab { flex: none; width: 2.8em; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text-tertiary); }
.rte__fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.rte__font { justify-content: space-between; height: 38px; padding: 0 10px; font-size: 16px; }
.rte__font small { display: none; }
.rte__font b { font-weight: 400; }
.rte__font b.ff-hand { font-size: 21px; }
.rte__font[aria-checked="true"] { background: var(--bg-sunken); color: var(--text-primary); }
.rte__font[aria-checked="true"]::after { content: "✓"; font-size: 13px; color: var(--brand-navy); }
.rte__colors { display: grid; grid-template-columns: repeat(6, 26px); gap: 10px; }
.rte__dot { min-width: 0; width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--cc, var(--text-primary)); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08); }
.rte__dot.c-base, .rte__dot.c-base:hover, .rte__dot.c-base[aria-checked="true"] { background: conic-gradient(var(--text-primary) 0 50%, var(--bg-page) 0); box-shadow: inset 0 0 0 1px var(--border-default); }
.rte__dot:hover { background: var(--cc, var(--text-primary)); transform: scale(1.08); }
.rte__dot[aria-checked="true"] { background: var(--cc, var(--text-primary)); box-shadow: 0 0 0 2px var(--bg-page), 0 0 0 3.5px var(--brand-navy); }
.rte__dot.c-base[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bg-page), 0 0 0 3.5px var(--brand-navy); }
/* 펼침 메뉴 */
.rte__pop { position: relative; display: inline-flex; }
.rte__panel { position: absolute; z-index: 20; left: 0; top: calc(100% + 8px); width: max-content; max-width: min(360px, calc(100vw - 32px)); display: grid; gap: 6px; padding: 10px; background: var(--bg-page); color: var(--text-primary); border: 1px solid var(--border-default); border-radius: 12px; box-shadow: 0 18px 48px -12px rgb(20 24 30 / .28); }
.rte__panel[hidden] { display: none; }
.rte__h { margin: 4px 4px 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--text-tertiary); }
.rte__panel .rte__line { gap: 6px; }
.rte__panel .rte__seg { flex: 1; }
.rte__panel > .rte__seg .rte__b, .rte__panel .rte__line .rte__b { height: 36px; }

/* ───────── A · 한 줄 도구 + 펼침 메뉴 ───────── */
.cmp--a .cmp__card { border: 1px solid var(--border-default); border-radius: 14px; box-shadow: 0 10px 30px -20px rgb(31 42 54 / .4); transition: border-color .15s, box-shadow .15s; }
.cmp--a .cmp__card:focus-within { border-color: var(--brand-navy); box-shadow: 0 0 0 3px rgb(31 42 54 / .07), 0 10px 30px -20px rgb(31 42 54 / .4); }
.cmp--a .cmp__me { padding: 16px 18px 0; }
.cmp--a .cmp__bar { padding: 8px 10px; border-top: 1px solid var(--border-default); }
.cmp--a .cmp__a .cmp__lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rte__aa { font-size: 15px; } .rte__aa b { font-weight: 700; }
.rte--a .rte__panel, .cmp--a .rte__panel { width: 340px; }

/* ───────── B · 글자를 고르면 떠오르는 메뉴 ───────── */
.cmp--b .cmp__card { border-bottom: 1px solid var(--text-primary); }
.cmp__write { display: flex; gap: 12px; align-items: flex-start; }
.cmp__write .rte { flex: 1; min-width: 0; }
.cmp--b .rte__ed { padding: 6px 0 12px; font-size: 17px; line-height: 1.8; }
.cmp--b .cmp__atts, .cmp--b .cmp__busy { margin-left: 52px; padding: 0; }
.cmp--b .cmp__foot { padding: 6px 0 12px 46px; gap: 8px; }
.cmp--b:not(.is-open) .cmp__card { border: 1px solid var(--border-default); border-radius: 999px; padding: 8px 14px; cursor: text; }
.cmp--b:not(.is-open) .rte__ed { min-height: 0; max-height: 1.8em; overflow: hidden; padding: 4px 0; font-size: 15px; }
.cmp--b:not(.is-open) .cmp__write { align-items: center; }
.cmp--b:not(.is-open) .cmp__foot, .cmp--b:not(.is-open) + .cmp__under, .cmp--b:not(.is-open) .cmp__under { display: none; }
.cmp--b:not(.is-open) .dz__face .dz__belt { display: none; }
.rte__bubble { position: absolute; z-index: 25; display: flex; align-items: center; gap: 1px; padding: 4px; border-radius: 10px; background: #1b222b; color: #e8e8e8; box-shadow: 0 12px 30px -8px rgb(0 0 0 / .45); white-space: nowrap; }
.rte__bubble[hidden] { display: none; }
.rte__bubble::after { content: ""; position: absolute; left: var(--tip, 50%); bottom: -6px; transform: translateX(-50%); border: 6px solid transparent; border-bottom: 0; border-top-color: #1b222b; }
.rte__bubble.is-below::after { bottom: auto; top: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: #1b222b; }
.rte__bubble .rte__b { color: #e8e8e8; height: 32px; min-width: 32px; padding: 0 7px; font-size: 14px; }
.rte__bubble .rte__b:hover, .rte__bubble .rte__b[aria-expanded="true"] { background: #2c3541; }
.rte__bubble .rte__b[aria-pressed="true"] { background: #3a4656; color: #fff; }
.rte__bubble .rte__sep { background: #3c4652; height: 16px; margin: 0 3px; }
.rte__bubble .rte__swatch { box-shadow: 0 0 0 2px #1b222b, 0 0 0 3px rgb(255 255 255 / .4); }
.rte__bubble .rte__ddlab { font-size: 13px; }
.rte__bubble .rte__pop { position: static; }
.rte__bubble .rte__panel { white-space: normal; }
.rte__bubble { max-width: 100%; flex-wrap: wrap; }
.rte__bubble .rte__panel .rte__b { color: var(--text-primary); }
.rte__bubble .rte__panel .rte__b:hover { background: var(--bg-sunken); }
.rte__bubble .rte__panel .rte__b:not(.rte__dot)[aria-checked="true"], .rte__bubble .rte__panel .rte__b[aria-pressed="true"] { background: var(--brand-navy); color: var(--text-on-dark); }
.rte__bubble .rte__panel .rte__font[aria-checked="true"] { background: var(--bg-sunken); color: var(--text-primary); }
.rte__bubble .rte__panel .rte__dot { color: transparent; }
.rte__bubble .rte__fonts { width: 260px; }

/* ───────── C · 편지지 + 꾸미기 서랍 ───────── */
.cmp--c .cmp__card { gap: 10px; padding: 18px 20px 14px; background: var(--bg-paper); border-top: 3px solid var(--brand-navy); border-radius: 4px; }
.cmp--c .rte { gap: 10px; }
.cmp--c .rte__ed { background: var(--bg-page); border: 1px solid var(--border-default); border-radius: 4px; padding: 14px 16px; }
.cmp--c .rte__ed.is-empty::before { font-family: var(--font-serif); }
.cmp--c .cmp__atts, .cmp--c .cmp__busy { padding: 0; margin: 0; }
.cmp--c .cmp__busy { background: var(--bg-page); }
.rte__tray { display: grid; gap: 14px; padding: 14px 16px; background: var(--bg-page); border: 1px solid var(--border-default); border-radius: 4px; }
.rte__tray[hidden] { display: none; }
.rte__tray .rte__fonts { display: flex; flex-wrap: wrap; gap: 8px; }
.rte__tray .rte__font { flex-direction: column; justify-content: center; gap: 2px; width: 84px; height: auto; padding: 8px 0 6px; border: 1px solid var(--border-default); border-radius: 4px; }
.rte__tray .rte__font b { font-size: 19px; line-height: 1.3; }
.rte__tray .rte__font b.ff-hand { font-size: 24px; }
.rte__tray .rte__font small { display: block; font-size: 11px; color: var(--text-tertiary); font-family: var(--font-sans); }
.rte__tray .rte__font[aria-checked="true"] { background: var(--bg-page); border-color: var(--brand-navy); box-shadow: inset 0 0 0 1px var(--brand-navy); }
.rte__tray .rte__font[aria-checked="true"]::after { content: none; }
.rte__tray .rte__colors { display: flex; flex-wrap: wrap; gap: 10px; }
.rte__tray .rte__colors .rte__dot { width: 22px; height: 22px; }
.rte__tray .rte__seg { border: 0; }
.rte__tray .rte__seg > .rte__b + .rte__b { border-left: 0; }
.rte__tray .rte__seg > .rte__b { border-radius: 4px; }
.rte__toggle, .cmp__add { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--border-default); border-radius: 999px; background: var(--bg-page); color: var(--text-primary); font: inherit; font-size: var(--fs-caption); cursor: pointer; }
.rte__toggle b { font-family: var(--font-serif); }
.rte__toggle[aria-expanded="true"] { background: var(--brand-navy); border-color: var(--brand-navy); color: var(--text-on-dark); }
.cmp--c .cmp__foot { gap: 8px; }
.cmp__addbox { position: relative; }
.cmp__menu { position: absolute; z-index: 20; left: 0; top: calc(100% + 6px); width: 200px; padding: 6px; display: grid; gap: 2px; background: var(--bg-page); border: 1px solid var(--border-default); border-radius: 8px; box-shadow: 0 18px 40px -14px rgb(20 24 30 / .3); }
.cmp__menu[hidden] { display: none; }
.cmp__menu .cmp__a { width: 100%; justify-content: flex-start; gap: 10px; padding: 0 10px; height: 38px; font-size: var(--fs-ui); color: var(--text-primary); }
.cmp__menu .cmp__a .cmp__ic { color: var(--text-secondary); }
.cmp--c .cmp__send { border-radius: 4px; }

@media (max-width: 600px) {
  .cmp--reply { margin-left: 0; }
  .cmp--a .cmp__bar { padding: 6px; }
  .rte__b, .cmp__a { min-width: 32px; height: 32px; padding: 0 5px; }
  .rte__sep { margin: 0 3px; }
  .rte__dot { min-width: 0; padding: 0; height: 26px; }
  .rte__tray .rte__colors .rte__dot { height: 22px; }
  .cmp__end { gap: 10px; }
  .cmp__send { height: 36px; padding: 0 16px; }
  .cmp--b .cmp__foot { padding-left: 0; }
  .cmp--b .cmp__a .cmp__lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cmp--b .cmp__atts, .cmp--b .cmp__busy { margin-left: 0; }
  .cmp--c .cmp__card { padding: 14px 12px 12px; }
  .rte__tray .rte__line { flex-direction: column; align-items: flex-start; gap: 6px; }
  .rte__tray .rte__font { width: 74px; }
  .cmp__kbd { display: none; }
}
@media (pointer: coarse) { .cmp__kbd { display: none; } }
