/* ============================================================
   Rich editor (minecap 글쓰기 에디터를 옮긴 것) + 문서 작성 화면
   색은 사이트 토큰(다크/라이트)을 따른다. minecap 이름을 그대로 쓰기 위해 아래에서 다리를 놓는다.
   ============================================================ */
.ed, .ed-ask, .ed-pick, .ed-float, .sizepop, .wr {
  --ink: var(--text);
  --ink-2: var(--text-2);
  --ink-3: var(--text-3);
  --ink-4: var(--text-3);
  --paper: var(--surface);
  --bg-soft: var(--surface-2);
  --bg-sunken: var(--bg-1);
  --lift: var(--surface-3);
  --brand: var(--gold);
  --brand-ink: var(--gold-2);
  --brand-soft: var(--gold-soft);
  --brand-line: var(--gold-soft-2);
  --hot: var(--danger);
  --pop-shadow: 0 12px 32px rgba(var(--shadow-rgb), 0.35);
}

/* ---------- 문서 작성 화면 — 종이 한 장 + 옆칸 ---------- */
.wr { padding-bottom: 40px; }
.wr__top {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0 14px; border-bottom: 1px solid var(--line-2);
}
.wr__h { font-size: 21px; font-weight: 800; letter-spacing: -0.035em; margin-right: auto; }
.wr__acts { display: flex; align-items: center; gap: 8px; }
.wr__cols {
  display: grid; grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px; align-items: start; margin-top: 20px;
}
.wr__aside { display: flex; flex-direction: column; gap: 14px; }
.wr__opt { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--paper); }
.wr__opt-h { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 10px; }
.wr__opt-h i { color: var(--brand); }
.wr__opt select, .wr__opt textarea {
  width: 100%; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink); font-size: 13.5px; padding: 9px 11px; outline: none;
}
.wr__opt select { height: 40px; cursor: pointer; }
.wr__opt textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.wr__opt select:focus, .wr__opt textarea:focus { border-color: var(--gold-3); }
.wr__hint { margin-top: 7px; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }

.wr__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* overflow 는 clip — hidden 이면 안쪽 에디터 툴바의 sticky 가 죽는다. */
.wr__paper { border: 1px solid var(--line-2); border-radius: 14px; background: var(--paper); overflow: clip; }
.wr__head { display: flex; gap: 10px; padding: 16px 18px; }
.wr__head .icon-pick { flex: none; width: 52px; height: 52px; border-radius: 10px; font-size: 24px; }
.wr__title {
  flex: 1 1 auto; min-width: 0; height: 52px; padding: 0 16px;
  border: 0; border-radius: 10px; background: var(--bg-sunken);
  font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; outline: none;
}
.wr__title::placeholder { color: var(--ink-4); font-weight: 500; }
.wr__title:focus { box-shadow: inset 0 0 0 2px var(--brand-line); }
.wr__tags { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.wr__tags .tags-input { border: 0; background: none; padding: 0; }
.wr__tags .tags-input:focus-within { box-shadow: none; }

/* 종이 안에서는 에디터가 자기 테두리를 버리고 이어진다. */
.wr__paper .ed { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.wr__paper .ed:focus-within { border-color: var(--line); }

@media (max-width: 900px) {
  .wr__cols { grid-template-columns: minmax(0, 1fr); }
  .wr__aside { order: 2; }
  .wr__main { order: 1; }
}

/* 카테고리 설명처럼 좁은 자리에 들어가는 에디터 */
.cat-desc-editor .ed__area { min-height: 260px; }

/* ---------- 에디터 ---------- */
/* overflow 는 clip — 모서리만 자르고 스크롤 상자를 만들지 않아 툴바 sticky 가 산다. */
.ed { position: relative; border: 1px solid var(--line-2); border-radius: 12px; overflow: clip; background: var(--paper); }
.ed:focus-within { border-color: var(--gold-3); }

/* 글이 길어져도 툴바는 위에 붙어 따라온다. 붙는 높이는 editor.js 가 상단바를 재서 넘긴다. */
.ed__bar {
  position: sticky; top: var(--ed-bar-top, 0px); z-index: 20;
  background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 5px 6px;
}
.ed__row { display: flex; align-items: center; gap: 1px; flex-wrap: wrap; }
.ed__row + .ed__row { margin-top: 2px; padding-top: 4px; border-top: 1px solid var(--line); }

/* 넣기 줄 — 무엇이 들어가는지 한눈에 보이게 아이콘 아래에 이름을 붙인다. */
.ed__row--insert { gap: 2px; padding: 4px 2px 6px; }
.ed__ins {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 54px; padding: 6px 4px; border: 0; border-radius: 8px;
  background: none; cursor: pointer; color: var(--ink-2);
  font-size: 11px; font-weight: 600; letter-spacing: -0.03em; white-space: nowrap;
}
.ed__ins:hover { background: var(--lift); color: var(--ink); }
.ed__ins svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.ed__hint { font-size: 11.5px; font-weight: 700; color: var(--brand-ink); padding-inline: 6px; flex: none; }
.ed__num { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; }
.ed__num input {
  width: 62px; height: 26px; padding: 0 6px;
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-sunken); color: var(--ink);
  font-family: var(--font-mono); font-size: 12px; text-align: right;
}
.ed__num input:focus { outline: none; border-color: var(--brand); }
.ed__num span { font-size: 11px; color: var(--ink-4); }
.ed__row--image[hidden] { display: none; }

@media (max-width: 768px) {
  .ed__ins { min-width: 48px; font-size: 10.5px; }
  .ed__ins svg { width: 19px; height: 19px; }
}
.ed__btn {
  display: grid; place-items: center; min-width: 30px; height: 30px; padding-inline: 6px;
  border: 0; border-radius: 6px; font-size: 13.5px; color: var(--ink-2); background: none; cursor: pointer;
}
.ed__btn:hover { background: var(--lift); color: var(--ink); }
.ed__btn[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); }
.ed__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ed__btn--danger:hover { color: var(--hot); }
.ed__btn--wide {
  width: auto; padding: 0 9px; font-size: 11.5px; font-weight: 600;
  color: var(--ink-2); background: var(--paper); border: 1px solid var(--brand-line);
}
.ed__btn--wide:hover { border-color: var(--brand); color: var(--brand-ink); }
.ed__sep { width: 1px; height: 18px; background: var(--line-2); margin-inline: 5px; flex: none; }
.ed__sep--tall { height: 34px; margin-inline: 6px; }

/* 글자색·형광펜 — 아이콘 아래에 현재 색 띠를 깐다. */
.ed__color {
  position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; width: 30px; height: 30px; border-radius: 6px;
  cursor: pointer; color: var(--ink-2);
}
.ed__color:hover { background: var(--lift); color: var(--ink); }
.ed__color input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.ed__color-ico { width: 15px; height: 15px; pointer-events: none; }
.ed__color-bar { width: 15px; height: 3px; border-radius: 2px; pointer-events: none; background: currentColor; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* 본문 — 공개 화면과 똑같이 보이도록 .article 규칙을 그대로 쓰고 에디터에 필요한 것만 덧댄다. */
.ed__area.article {
  max-width: none; margin: 0; min-height: 420px; padding: 22px 28px 28px;
  outline: none; overflow-wrap: anywhere;
}
.ed__area.article > :first-child { margin-top: 0; }
.ed.is-empty .ed__area::before { content: attr(data-placeholder); color: var(--ink-4); pointer-events: none; position: absolute; }
/* 나란히 흐르는 사진이 아래 문단을 파고들지 않게 바닥을 받쳐 준다. */
.ed__area::after { content: ""; display: block; clear: both; }
.ed__area img { max-width: 100%; }
/* 표는 칸 경계가 보여야 고칠 수 있다 — 에디터 안에서만 옅은 칸선을 더한다. */
.ed__area th, .ed__area td { box-shadow: inset 0 0 0 1px var(--line); min-width: 40px; }
.ed__area video { max-width: 100%; }
.ed__area .yt-wrap::after { content: ''; position: absolute; inset: 0; }
.ed__source {
  display: block; width: 100%; min-height: 420px; border: 0; padding: 18px 20px; outline: none; resize: vertical;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7; background: var(--bg-sunken); color: var(--ink);
}
.ed__source[hidden] { display: none; }

/* 표 칸·코드·인용구의 안내 글 — 칸은 비워 두고 안내만 흐리게 얹는다. */
.ed__area th:empty::before, .ed__area th:has(> br:only-child)::before { content: "제목"; color: var(--ink-4); pointer-events: none; }
.ed__area td:empty::before, .ed__area td:has(> br:only-child)::before { content: "내용"; color: var(--ink-4); pointer-events: none; }
.ed__area pre > code:empty::before, .ed__area pre > code:has(> br:only-child)::before { content: "코드를 입력하세요"; color: var(--ink-4); }
.ed__area pre { min-height: 46px; }
.ed__area blockquote p:empty::before, .ed__area blockquote p:has(> br:only-child)::before { content: '내용을 입력하세요'; color: var(--ink-4); pointer-events: none; }

/* ── 구분선·인용구 고르기 판 ── */
.ed-pick {
  position: absolute; z-index: 30; padding: 6px;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--pop-shadow);
}
.ed-pick--hr { display: grid; grid-template-columns: repeat(4, 46px); gap: 2px; }
.ed-pick--quote { display: grid; grid-template-columns: repeat(3, 58px); gap: 2px; }
.ed-pick__opt { display: block; border: 0; border-radius: 7px; background: none; cursor: pointer; text-align: left; color: var(--ink); }
.ed-pick__opt:hover { background: var(--bg-soft); }
.ed-pick__opt[aria-pressed="true"] { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-line); }
.ed-pick__opt .mc-q p { margin: 0; }
.ed-pick__opt--hr { width: 46px; padding: 4px; }
.ed-pick__opt--hr .mc-hr { height: 22px; margin: 0; }
.ed-pick__opt--hr .mc-hr::before { max-width: 38px; }
.ed-pick__opt--hr .mc-hr--bar::before { height: 18px; }
.ed-pick__opt--q { width: 58px; padding: 4px; }
.ed-pick__opt--q .mc-q { margin: 0; padding: 8px 5px; font-size: 8px; line-height: 1.3; max-width: none; pointer-events: none; overflow: hidden; }
.ed-pick__opt--q .mc-q::before, .ed-pick__opt--q .mc-q::after { font-size: 12px; }
.ed-pick__opt--q .mc-q--mark::before, .ed-pick__opt--q .mc-q--mark::after { width: 8px; height: 6px; }
.ed-pick__opt--q .mc-q--line { padding-left: 7px; }
.ed-pick__opt--q .mc-q--line::before { border-left-width: 3px; }
.ed-pick__opt--q .mc-q--bubble { border-width: 2px; }
.ed-pick__opt--q .mc-q--bubble::before, .ed-pick__opt--q .mc-q--bubble::after { display: none; }
.ed-pick__opt--q .mc-q--underline::before { width: 10px; height: 6px; }
.ed-pick__opt--q .mc-q--postit { border-width: 2px; padding-bottom: 12px; }
.ed-pick__opt--q .mc-q--postit::before, .ed-pick__opt--q .mc-q--postit::after { display: none; }
.ed-pick__opt--q .mc-q--corner::before, .ed-pick__opt--q .mc-q--corner::after { width: 10px; height: 10px; border-width: 3px; }

/* 끌어서 잡아 둔 칸. */
.ed__area td.is-sel, .ed__area th.is-sel { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-line); }

/* ── 표에 직접 붙는 손잡이 ── */
.ed-tbl { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.ed-tbl[hidden] { display: none; }
.ed-tbl__grip {
  position: absolute; display: flex; pointer-events: auto;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 7px; box-shadow: var(--pop-shadow); overflow: hidden;
}
.ed-tbl__grip--row { flex-direction: column; transform: translateY(-50%); }
.ed-tbl__grip--col { transform: translateX(-50%); }
.ed-tbl__grip button {
  width: 22px; height: 22px; display: grid; place-items: center; border: 0;
  background: none; cursor: pointer; color: var(--ink-3); font-size: 14px; font-weight: 700; line-height: 1;
}
.ed-tbl__grip button:hover { background: var(--brand-soft); color: var(--brand); }
.ed-tbl__grip--row button + button { border-top: 1px solid var(--line); }
.ed-tbl__grip--col button + button { border-left: 1px solid var(--line); }
.ed-tbl__x, .ed-tbl__paint {
  position: absolute; pointer-events: auto; width: 22px; height: 22px; display: grid; place-items: center;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 7px; box-shadow: var(--pop-shadow);
  cursor: pointer; color: var(--ink-3);
}
.ed-tbl__x:hover { border-color: var(--hot); color: var(--hot); }
.ed-tbl__x svg { width: 11px; height: 11px; }
.ed-tbl__paint:hover { border-color: var(--brand); color: var(--brand); }
.ed-tbl__paint svg { width: 12px; height: 12px; grid-area: 1 / 1; pointer-events: none; }
.ed-tbl__paint input { grid-area: 1 / 1; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.ed__area.is-colresize, .ed__area.is-colresize td, .ed__area.is-colresize th { cursor: col-resize; }

/* ── 덩어리(구분선·인용구) 고르기 ── 올리면 옅은 네모, 고르면 진해진다. */
.ed__area .mc-hr { cursor: grab; user-select: none; }
.ed__area hr { cursor: grab; }
.ed__area .mc-hr, .ed__area .mc-q { transition: outline-color .12s; }
.ed__area .mc-hr:hover { outline: 2px solid var(--brand-line); outline-offset: -1px; }
.ed__area hr.is-picked { outline: 2px solid var(--brand); outline-offset: 4px; }
.ed__area .mc-q { cursor: grab; }
.ed__area .mc-q p, .ed__area .mc-q li { cursor: text; }
.ed__area .mc-q:hover { outline: 2px solid var(--brand-line); outline-offset: 6px; }
.ed__area .mc-q.is-picked { outline: 2px solid var(--brand); outline-offset: 6px; }
.ed__area .mc-hr.is-moving, .ed__area .mc-q.is-moving { opacity: .35; }

/* 고른 덩어리 위에 떠서 따라다니는 막대 — 붙어 다니는 툴바(z 20)보다 위. */
.ed-float {
  position: absolute; z-index: 26; display: flex; align-items: center; gap: 2px; padding: 4px 6px;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--pop-shadow);
}
.ed-float[hidden] { display: none; }
.ed-float .ed__sep { margin-inline: 4px; }

/* 발판 — 왼쪽에 편집 모드, 오른쪽에 글자수. */
.ed__foot {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px;
  border-top: 1px solid var(--line); background: var(--bg-soft); font-size: 11.5px; color: var(--ink-3);
}
.ed__len { margin-left: auto; font-family: var(--font-mono); }
.ed__modes { display: flex; align-items: center; gap: 7px; }
.ed__modes-bar { color: var(--line-2); }
.ed__mode { padding: 3px 2px; border: 0; background: none; cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--ink-4); letter-spacing: -0.02em; }
.ed__mode:hover { color: var(--ink-2); }
.ed__mode.is-on { color: var(--brand); font-weight: 800; }
.ed.is-uploading .ed__len::before { content: "업로드 중… "; color: var(--brand); }

/* 업로드가 끝나기 전 이미지는 반투명 — 아직 임시 미리보기다. */
.ed__area img[data-uploading] { opacity: .45; filter: saturate(.4); }
.ed.is-drop { border-color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand-soft); }

/* ── 사진 고르기 · 옮기기 · 크기 ── */
.ed__area img.is-picked { outline: 2px solid var(--brand); outline-offset: 2px; }
.ed__area img.is-moving { opacity: .35; }
.ed__area img { cursor: grab; }
.ed.is-dragging, .ed.is-dragging * { cursor: grabbing !important; }
.ed.is-dragging .ed__area { user-select: none; }
.ed__grip {
  position: absolute; z-index: 4; width: 11px; height: 11px;
  border-radius: 3px; background: var(--paper); border: 2px solid var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.ed__grip[hidden] { display: none; }
.ed__grip--w, .ed__grip--e { cursor: ew-resize; }
.ed__grip--nw, .ed__grip--se { cursor: nwse-resize; }
.ed__grip--ne, .ed__grip--sw { cursor: nesw-resize; }
.ed__sizetip {
  position: absolute; z-index: 6; padding: 3px 8px; border-radius: 6px;
  background: rgba(10,12,14,.86); color: #fff; pointer-events: none;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
}
/* 끌어 옮기는 동안 어디에 놓일지 알려 주는 줄 — 옆에 붙이는 자리는 세로 막대. */
.ed__dropline { position: absolute; z-index: 5; height: 3px; border-radius: 2px; background: var(--brand); pointer-events: none; }
.ed__dropline[hidden] { display: none; }
.ed__dropline--v { width: 3px; height: auto; }

/* 링크·동영상 주소를 받는 작은 창. */
.ed-ask {
  position: absolute; z-index: 30; width: 340px; max-width: calc(100% - 16px);
  padding: 12px 13px 13px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--paper); box-shadow: var(--pop-shadow);
}
.ed-ask__head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--ink); }
.ed-ask__x { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 6px; background: none; color: var(--ink-3); cursor: pointer; }
.ed-ask__x:hover { background: var(--bg-soft); color: var(--ink); }
.ed-ask__x svg { width: 12px; height: 12px; }
.ed-ask__row { display: flex; gap: 6px; margin-top: 9px; }
.ed-ask__in {
  flex: 1; min-width: 0; height: 36px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-sunken); color: var(--ink); font-size: 13.5px;
}
.ed-ask__in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ed-ask__ok { flex: none; height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--brand); color: var(--gold-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.ed-ask__hint { margin-top: 7px; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }
.ed-ask__err { margin-top: 7px; font-size: 11.5px; font-weight: 600; line-height: 1.6; color: var(--hot); }
.ed-ask__err[hidden] { display: none; }
.ed-ask.is-bad .ed-ask__in { border-color: var(--hot); }
.ed-ask.is-bad .ed-ask__ok { background: var(--hot); color: #fff; }

/* 동영상이 들어갈 자리 — 주소를 받기 전에 어디에 놓이는지 먼저 보여 준다. */
.ed-video--empty {
  display: grid; place-items: center; aspect-ratio: 16 / 9;
  border: 2px dashed var(--brand-line); border-radius: 10px; background: var(--brand-soft);
  color: var(--brand-ink); font-size: 13px; font-weight: 700;
}

/* 특수문자 고르기 */
.ed-chars {
  position: absolute; right: 10px; top: 92px; z-index: 26; width: 320px;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--pop-shadow); overflow: hidden;
}
.ed-chars[hidden] { display: none; }
.ed-chars__head {
  display: flex; align-items: center; justify-content: space-between; padding: 9px 12px;
  border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--ink-2); background: var(--bg-soft);
}
.ed-chars__head button { border: 0; background: none; color: var(--ink-3); cursor: pointer; }
.ed-chars__head svg { width: 13px; height: 13px; }
.ed-chars__grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 1px; padding: 8px; max-height: 220px; overflow-y: auto; }
.ed-chars__grid button { height: 28px; border: 0; border-radius: 6px; background: none; cursor: pointer; font-size: 14px; color: var(--ink); }
.ed-chars__grid button:hover { background: var(--brand-soft); color: var(--brand-ink); }

/* 본문 이미지 업로드 진행 — 본문 HTML 을 건드리지 않게 위에 따로 덮는 층. */
.ed-uplayer { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.ed-up {
  position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border-radius: 6px; background: rgba(8, 10, 12, .55); backdrop-filter: blur(1px); color: #fff;
}
.ed-up__ring { position: relative; width: 44px; height: 44px; }
.ed-up__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ed-up__ring circle { fill: none; stroke-width: 4; }
.ed-up__trk { stroke: rgba(255, 255, 255, .28); }
.ed-up__bar { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .18s linear; }
.ed-up__pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ed-up__label { font-size: 12px; font-weight: 600; opacity: .92; }
.ed-up.is-saving .ed-up__ring svg { animation: ed-up-spin 1s linear infinite; }
@keyframes ed-up-spin { to { transform: rotate(270deg); } }
.ed-up.is-sm { gap: 0; }
.ed-up.is-sm .ed-up__label { display: none; }
.ed-up.is-sm .ed-up__ring { width: 34px; height: 34px; }
.ed-up.is-sm .ed-up__pct { font-size: 9.5px; }

/* 사진이 너무 클 때 */
.sizepop { position: fixed; inset: 0; z-index: var(--z-modal); }
.sizepop[hidden] { display: none; }
.sizepop__dim { position: absolute; inset: 0; background: rgba(4, 5, 7, .6); }
.sizepop__panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(340px, calc(100vw - 40px)); padding: 26px 24px 22px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--pop-shadow);
  animation: sizepop-in .22s cubic-bezier(.2, .9, .3, 1.25);
}
@keyframes sizepop-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.94); } }
.sizepop__ico { font-size: 44px; color: var(--brand); line-height: 1; }
.sizepop__t { font-size: 18px; font-weight: 800; letter-spacing: -0.04em; margin-top: 10px; }
.sizepop__d { margin-top: 8px; font-size: 13.5px; line-height: 1.6; color: var(--ink-3); }
.sizepop__d b { color: var(--hot); font-weight: 700; }
.sizepop__file {
  display: flex; align-items: center; gap: 8px; max-width: 100%;
  margin-top: 14px; padding: 8px 12px; border-radius: 9px; background: var(--bg-sunken); font-size: 12.5px; color: var(--ink-3);
}
.sizepop__file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sizepop__file b { flex: none; color: var(--hot); font-weight: 700; }
.sizepop__ok {
  width: 100%; height: 44px; margin-top: 18px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--brand); color: var(--gold-ink); font-size: 14.5px; font-weight: 700;
}
@media (prefers-reduced-motion: reduce) {
  .ed-up.is-saving .ed-up__ring svg, .sizepop__panel { animation: none; }
}

/* ---------- 커스텀 드롭다운 (에디터 툴바) ---------- */
.dd { position: relative; display: inline-block; }
.dd > .dd__opt { display: none; }
.dd__btn {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 30px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer;
  font-family: inherit; font-size: 12.5px; text-align: left; transition: border-color .15s, background .15s;
}
.dd__btn:hover { background: var(--lift); color: var(--ink); }
.dd__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd__caret {
  flex: none; width: 6px; height: 6px; margin-right: 2px;
  border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s;
}
.dd__panel {
  position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 130px;
  padding: 5px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface);
  box-shadow: 0 10px 28px rgba(var(--shadow-rgb), .35); display: none;
  max-height: min(420px, 60vh); overflow-y: auto;
}
.dd.is-open .dd__btn { border-color: var(--gold-3); }
.dd.is-placeholder .dd__label { color: var(--text-2); }
.dd.is-open .dd__caret { transform: rotate(225deg) translate(-2px, -2px); }
.dd.is-open .dd__panel { display: block; }
.dd__opt {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px;
  background: none; color: var(--text-2); cursor: pointer; font-family: inherit; font-size: 13.5px; text-align: left; white-space: nowrap;
}
.dd__opt:hover, .dd__opt:focus-visible { background: var(--surface-2); color: var(--text); outline: none; }
.dd__opt.is-on { background: var(--gold-soft); color: var(--gold-2); font-weight: 700; }
/* 목록 위에 붙는 직접 입력 칸 — 글자 크기·줄간격을 목록에 없는 값으로. */
.dd__num { display: flex; align-items: center; gap: 4px; margin: 1px 1px 5px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.dd__num input {
  width: 100%; min-width: 0; height: 30px; padding: 0 8px;
  border: 1px solid var(--line-2); border-radius: 7px; background: var(--bg-1); color: var(--text); font-size: 13px; text-align: right;
}
.dd__num input:focus { outline: none; border-color: var(--gold); }
.dd__num span { flex: none; font-size: 11.5px; color: var(--text-3); }
/* 줄간격 버튼 — 숫자만 있으면 무엇을 조절하는지 모른다. 줄 간격 아이콘을 앞에 세운다. */
.ed__dd--lh .dd__btn::before {
  content: ""; flex: none; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: var(--lh-ico) center / contain no-repeat; mask: var(--lh-ico) center / contain no-repeat;
  --lh-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M6 3h9M6 8h9M6 13h9'/%3E%3Cpath d='M2.6 4.6L2.6 11.4M1.2 5.9L2.6 4.5 4 5.9M1.2 10.1L2.6 11.5 4 10.1'/%3E%3C/svg%3E");
}

/* ============================================================
   본문 블록 — 에디터와 공개 화면(.article)이 같은 CSS 를 쓴다. 종류는 class 로만 남는다.
   ============================================================ */

/* 사진 나란히 놓기 (.mc-row) — 한 줄에 세 장까지. 넘치면 함께 줄어든다. */
.mc-row { display: flex; align-items: flex-start; gap: 10px; margin-block: 24px; }
.mc-row > img { flex: 0 1 auto; min-width: 0; max-width: 100%; height: auto; margin: 0; float: none; display: block; }

/* 본문 동영상(YouTube) */
.ed-video { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 18px 0; border-radius: var(--r-md); overflow: hidden; background: #000; }
.ed-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── 구분선 여덟 가지 ── 60px 칸 안에 선이 놓인다. 선은 ::before 로 그려 정렬을 margin 하나로 바꾼다. */
.mc-hr { border: 0; background: none; height: 60px; margin: 30px 0 0; display: flex; align-items: center; }
.mc-hr::before { content: ""; display: block; margin-inline: auto; }
.mc-hr--left::before { margin-inline: 0 auto; }
.mc-hr--center::before { margin-inline: auto; }
.mc-hr--right::before { margin-inline: auto 0; }
.mc-hr--plain::before { width: 220px; height: 1px; background: var(--line-2); }
.mc-hr--wide::before { width: 100%; height: 1px; background: var(--line-2); }
.mc-hr--thick::before { width: 67px; height: 3px; background: var(--text-2); }
.mc-hr--bar::before { width: 2px; height: 60px; background: var(--text-3); }
/* 장식이 들어간 것들은 모양을 마스크로 따고 색은 토큰으로 칠한다 — 다크/라이트 모두 맞는다. */
.mc-hr--chevron::before, .mc-hr--diamond::before, .mc-hr--dots::before, .mc-hr--slash::before {
  background: var(--text-3); -webkit-mask: var(--hr-shape) center / contain no-repeat; mask: var(--hr-shape) center / contain no-repeat;
}
.mc-hr--chevron::before {
  width: 238px; height: 9px; opacity: .7;
  --hr-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='238' height='9'%3E%3Cpath d='M0 1.5h108l11 6 11-6h108' fill='none' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E");
}
.mc-hr--diamond::before {
  width: 192px; height: 23px; opacity: .7;
  --hr-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='23'%3E%3Cpath d='M0 11.5h84M108 11.5h84' stroke='%23000' stroke-width='1'/%3E%3Cpath d='M96 4l7.5 7.5L96 19l-7.5-7.5z' fill='none' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E");
}
.mc-hr--dots::before {
  width: 66px; height: 6px;
  --hr-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='66' height='6'%3E%3Cg fill='%23000'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='15' cy='3' r='3'/%3E%3Ccircle cx='27' cy='3' r='3'/%3E%3Ccircle cx='39' cy='3' r='3'/%3E%3Ccircle cx='51' cy='3' r='3'/%3E%3Ccircle cx='63' cy='3' r='3'/%3E%3C/g%3E%3C/svg%3E");
}
.mc-hr--slash::before {
  width: 44px; height: 44px;
  --hr-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M30 8L14 36' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ── 인용구 여섯 가지 ── */
.mc-q { position: relative; margin: 30px 0; color: var(--text); line-height: 1.8; background: none; border-radius: 0; }
.mc-q--mark, .mc-q--bubble, .mc-q--postit, .mc-q--corner { text-align: center; }
.mc-q--line, .mc-q--underline { text-align: left; }
.mc-q p { margin: 0; }
.mc-q p + p { margin-top: 8px; }

/* 1. 따옴표 — 인용부호만 위아래 가운데에 놓는다. */
.mc-q--mark { padding: 35px 0 33px; }
.mc-q--mark::before, .mc-q--mark::after {
  content: ""; position: absolute; left: 0; right: 0; margin-inline: auto;
  width: 21px; height: 16px; background: var(--text-3);
  -webkit-mask: var(--q-mark) center / contain no-repeat; mask: var(--q-mark) center / contain no-repeat;
}
.mc-q--mark::before {
  top: 0;
  --q-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='16'%3E%3Cpath d='M9.6 1C6 2.6 3.6 5 3.2 7.6c2.6-.9 4.9.6 4.9 3.1 0 2.4-1.8 4.3-4 4.3C1.5 15 0 12.9 0 10.6 0 5.9 3.6 2 9.4.4zM19.9.8c-3.6 1.6-6 4-6.5 6.6 2.6-.9 4.8.6 4.8 3.1 0 2.4-1.8 4.3-4 4.3-2.5 0-3.8-2.1-3.8-4.4 0-4.7 3.6-8.6 9.3-10.2z'/%3E%3C/svg%3E");
}
.mc-q--mark::after {
  bottom: 0; transform: rotate(180deg);
  --q-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='16'%3E%3Cpath d='M9.6 1C6 2.6 3.6 5 3.2 7.6c2.6-.9 4.9.6 4.9 3.1 0 2.4-1.8 4.3-4 4.3C1.5 15 0 12.9 0 10.6 0 5.9 3.6 2 9.4.4zM19.9.8c-3.6 1.6-6 4-6.5 6.6 2.6-.9 4.8.6 4.8 3.1 0 2.4-1.8 4.3-4 4.3-2.5 0-3.8-2.1-3.8-4.4 0-4.7 3.6-8.6 9.3-10.2z'/%3E%3C/svg%3E");
}

/* 2. 세로선 */
.mc-q--line { padding: 2px 0 2px 16px; }
.mc-q--line::before { content: ""; position: absolute; left: 2px; top: 2px; bottom: 2px; border-left: 5px solid var(--gold); }

/* 3. 말풍선 — 꼬리는 바탕색 삼각형 위에 테두리색 대각선 띠를 얹어 그린다. */
.mc-q--bubble {
  --q-edge: var(--surface-3); --q-bg: var(--surface);
  max-width: 460px; margin-inline: auto; margin-bottom: 72px;
  padding: 35px 21px 33px; border: 5px solid var(--q-edge); background: var(--q-bg);
}
.mc-q--bubble::before, .mc-q--bubble::after {
  content: ""; position: absolute; left: 126px; bottom: -42px; width: 38px; height: 42px;
}
.mc-q--bubble::before { background: var(--q-bg); clip-path: polygon(0 0, 100% 0, 100% 11.7%, 0 96.4%); }
.mc-q--bubble::after { background: var(--q-edge); clip-path: polygon(87.9% 0, 100% 0, 100% 11.7%, 0 96.4%, 0 78.8%); }

/* 4. 밑줄 — 얇은 선 하나와 왼쪽 위 따옴표. */
.mc-q--underline { padding: 40px 0 25px; border-bottom: 1px solid var(--text-3); }
.mc-q--underline::before {
  content: ""; position: absolute; left: 0; top: 0; width: 24px; height: 15px; background: var(--text-3);
  -webkit-mask: var(--q-under) left top / contain no-repeat; mask: var(--q-under) left top / contain no-repeat;
  --q-under: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='15'%3E%3Cpath d='M9.9.8C7.5 1.8 5.9 3.2 5.9 4.8c3 .3 4.5 2.1 4.5 4.6 0 3.2-2.4 5.6-5.3 5.6C2.1 15 0 12.6 0 9.4 0 5 3.6 1.5 9.5 0zM23.1.9c-2.4 1-4 2.3-4 3.9 3 .3 4.8 2.1 4.8 4.6 0 3.2-2.4 5.6-5.3 5.6-3 0-5.1-2.4-5.1-5.6 0-4.4 3.6-7.9 9.5-9.4z'/%3E%3C/svg%3E");
}

/* 5. 포스트잇 — 본체 + 아래 띠 + 접힌 모서리. */
.mc-q--postit {
  --q-edge: var(--surface-3); --q-bg: var(--surface);
  max-width: 460px; margin-inline: auto; padding: 33px 33px 49px; background: var(--q-bg);
  border: 4px solid var(--q-edge); border-bottom: 0;
}
.mc-q--postit::after {
  content: ""; position: absolute; left: -4px; right: 38px; bottom: 0; height: 49px; background: var(--q-bg);
  border-left: 4px solid var(--q-edge); border-bottom: 4px solid var(--q-edge);
}
.mc-q--postit::before {
  content: ""; position: absolute; right: -4px; bottom: 0; width: 42px; height: 49px;
  background: linear-gradient(to top left, transparent 50%, var(--text-3) 50%) 5px 11px / 33px 34px no-repeat, var(--q-edge);
  clip-path: polygon(0 0, 100% 0, 100% 14%, 2.4% 100%, 0 100%);
}

/* 6. 모서리 — 굵은 갈고리 두 개로 감싼다. */
.mc-q--corner { max-width: 460px; margin-inline: auto; padding: 39px 36px; }
.mc-q--corner::before, .mc-q--corner::after { content: ""; position: absolute; width: 26px; height: 26px; }
.mc-q--corner::before { left: 0; top: 0; border-left: 6px solid var(--text-2); border-top: 6px solid var(--text-2); }
.mc-q--corner::after { right: 0; bottom: 0; border-right: 6px solid var(--text-2); border-bottom: 6px solid var(--text-2); }

/* ---------- 태그 입력 ---------- */
.tags-input { display: flex; flex-wrap: wrap; gap: 6px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; cursor: text; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.tags-input:focus-within { border-color: var(--gold-3); box-shadow: 0 0 0 4px var(--gold-soft); }
.tags-input .tag-chip .x { cursor: pointer; margin-left: 2px; color: var(--text-3); }
.tags-input .tag-chip .x:hover { color: var(--danger); }
.tags-input input { flex: 1; min-width: 110px; background: none; border: none; outline: none; color: var(--text); font-size: 13px; padding: 3px; }
