/* 티드립 2026 에디터 — 시안의 글쓰기 상자. 색·모서리·글자는 레이아웃 토큰(td-tokens)을 쓴다. */
.td-ed { position: relative; }
.td-ed__bar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border: 1px solid var(--td-line-strong); border-bottom-color: var(--td-line); border-radius: var(--td-r-md) var(--td-r-md) 0 0; background: var(--td-surface-2); }
.td-ed__bar button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--td-r-xs); color: var(--td-text-2); }
.td-ed__bar button:hover { background: var(--td-surface-3); color: var(--td-text); }
.td-ed__bar button[aria-pressed="true"] { background: var(--td-brand-soft); color: var(--td-brand-text); }

.td-ed__area { position: relative; min-height: 280px; padding: 16px 18px; border: 1px solid var(--td-line-strong); border-top: 0; border-radius: 0 0 var(--td-r-md) var(--td-r-md); background: var(--td-surface); color: var(--td-text); font-family: var(--td-font); font-size: var(--td-t-md); line-height: 1.8; outline: none; overflow-wrap: anywhere; transition: border-color var(--td-dur), box-shadow var(--td-dur); }
.td-ed:focus-within .td-ed__area, .td-ed:focus-within .td-ed__bar { border-color: var(--td-brand); }
.td-ed:focus-within .td-ed__area { box-shadow: 0 6px 0 -3px var(--td-brand-soft); }
.td-ed.is-empty .td-ed__area::before { content: attr(data-placeholder); position: absolute; top: 16px; left: 18px; right: 18px; color: var(--td-text-3); pointer-events: none; }
.td-ed__area p { margin: 0 0 .6em; }
.td-ed__area img, .td-ed__area video { max-width: 100%; height: auto; border-radius: var(--td-r-sm); }
.td-ed__area a { color: var(--td-brand-text); text-decoration: underline; text-underline-offset: 2px; }
.td-ed__area ul, .td-ed__area ol { margin: 0 0 .6em; padding-left: 1.4em; }
.td-ed__area ul { list-style: disc; }
.td-ed__area ol { list-style: decimal; }
.td-ed__area blockquote { margin: 0 0 .6em; padding: 4px 14px; border-left: 3px solid var(--td-brand-soft-2); color: var(--td-text-2); }
.td-ed__saved { margin-top: 6px; font-size: var(--td-t-2xs); color: var(--td-text-3); }

/* 사진 올리기 칸 */
/* 라이믹스 업로더 기본 모양(테두리·흰 바탕·회색 칸)을 걷어 낸다 */
.td-ed__upload.xefu-container { margin: 12px 0 0; border: 0; background: transparent; color: inherit; }
.td-ed__upload .td-ed__drop { padding: 0; color: inherit; }
.td-ed__upload .xefu-list { padding: 0; }
.td-ed__upload .xefu-list-images { max-height: none; overflow: visible; margin: 0; padding: 0; border: 0; }
.td-ed__drop { position: relative; border: 1.5px dashed var(--td-line-strong); border-radius: var(--td-r-md); background: var(--td-surface-2); transition: border-color var(--td-dur), background var(--td-dur); }
.td-ed__upload.hover .td-ed__drop, .td-ed__upload.in .td-ed__drop, .td-ed__drop:hover { border-color: var(--td-brand); background: var(--td-brand-soft); }
.td-ed__pick { position: relative; display: grid; justify-items: center; gap: 6px; padding: 26px 16px; text-align: center; cursor: pointer; overflow: hidden; }
.td-ed__pick .td-icon { width: 28px; height: 28px; color: var(--td-text-2); }
.td-ed__pick b { font-size: var(--td-t-sm); color: var(--td-text); }
.td-ed__hint { font-size: var(--td-t-xs); color: var(--td-text-3); }
.td-ed__pick input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.td-ed__progress { padding: 0 16px 8px; font-size: var(--td-t-xs); color: var(--td-brand-text); text-align: center; }
.td-ed__bar-progress { height: 4px; margin: 0 16px 12px; border-radius: 2px; background: var(--td-surface-3); overflow: hidden; }
.td-ed__bar-progress > div { height: 100%; width: 0; background: var(--td-brand); transition: width .2s; }
.td-ed__files-head { display: none; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.td-ed__upload:has(.xefu-list li) .td-ed__files-head { display: flex; }
.td-ed__files-acts { display: flex; gap: 6px; }
.td-ed__files ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.td-ed__files li { position: relative; display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 10px 6px 30px; border: 1px solid var(--td-line); border-radius: var(--td-r-sm); background: var(--td-surface); font-size: var(--td-t-xs); color: var(--td-text-2); cursor: pointer; }
.td-ed__files li.selected, .td-ed__files li.ui-selected { border-color: var(--td-brand); background: var(--td-brand-soft); }
.td-ed__files .xefu-file-info { display: flex; align-items: center; gap: 6px; }
.td-ed__files input[type="checkbox"] { position: absolute; top: 6px; left: 8px; margin: 0; accent-color: var(--td-brand); }
/* 사진: 정사각 썸네일, 대표 사진(목록 썸네일)은 초록 테두리 */
.td-ed__files .xefu-list-images li { width: 80px; height: 80px; padding: 0; overflow: hidden; }
.td-ed__files .xefu-list-images .xefu-file-name, .td-ed__files .xefu-list-images .xefu-file-size { display: none; }
.td-ed__files .xefu-thumbnail { display: block; width: 80px; height: 80px; background: var(--td-surface-2) center / cover no-repeat; }
.td-ed__files .xefu-act-set-cover { position: absolute; right: 4px; bottom: 4px; padding: 0 6px; height: 20px; border-radius: var(--td-r-pill); background: rgba(30, 27, 36, .6); color: #fff; font-size: 10px; font-weight: var(--td-w-bold); }
.td-ed__files .xefu-act-set-cover::after { content: "대표로"; }
.td-ed__files .xefu-act-set-cover i { display: none; }
.td-ed__files .xefu-is-cover-image { border: 2px solid var(--td-brand); }
.td-ed__files .xefu-is-cover-image .xefu-act-set-cover { background: var(--td-brand); }
.td-ed__files .xefu-is-cover-image .xefu-act-set-cover::after { content: "대표"; }

/* 댓글: 입력칸만(테두리·버튼은 게시판 댓글창이 그린다) */
.td-ed--comment .td-ed__area { min-height: 92px; max-height: 50vh; overflow-y: auto; padding: 14px 16px; line-height: 1.6; border: 0; border-radius: 0; background: transparent; box-shadow: none !important; }
.td-ed--comment .td-ed__area p:has(> img:only-child) { display: inline-block; margin: 4px 6px 0 0; vertical-align: top; }
.td-ed--comment .td-ed__area img { max-width: 160px; max-height: 120px; object-fit: cover; }
.td-ed--comment.is-empty .td-ed__area::before { top: 14px; left: 16px; }
.td-ed--comment .td-ed__upload { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }

/* 티드립: 도구 막대 묶음 사이 줄, 영상 칸, 붙어 다니는 도구 막대 */
.td-ed__bar { position: sticky; top: calc(var(--td-header-h) + 48px); z-index: 3; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.td-ed__bar::-webkit-scrollbar { display: none; }
.td-ed__bar button { flex: none; border: 0; background: none; cursor: pointer; }
.td-ed__sep { flex: none; width: 1px; height: 20px; margin: 0 4px; background: var(--td-line-strong); }
.td-ed__bar .td-ed__photo { width: auto; gap: 5px; margin-left: auto; padding: 0 12px; color: var(--td-brand-text); font-size: var(--td-t-sm); font-weight: 700; display: inline-flex; align-items: center; }
.td-ed__area { font-size: var(--td-t-base); min-height: 340px; }
.td-ed__area iframe { display: block; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--td-r-sm); margin: .6em 0; }
.td-ed__area blockquote { border-left-color: var(--td-brand); }
@media (max-width: 1023px) { .td-ed__bar { top: 0; } .td-ed__area { min-height: 260px; } }
