@charset "UTF-8";

/* =====================================================
   목차
   1. Reset
   2. Demo
   3. 공통 애니메이션
   4. 메인 툴바 (.toolbar)  ← PC 툴바
   5. 툴바 모바일 (.toolbar-mobile / .toolbar-pop)
   6. WRITING TOOLBAR (모바일 쓰기 툴바)
   7. DRAWING TOOLBAR (그리기 툴바)
   8. CUSTOM COLOR PICKER MODAL
   9. 색상 그리드 / 투명도 슬라이더
   10. 툴바용 버튼 / 두께 포인터
   11. 미디어쿼리 - PC
   12. 미디어쿼리 - 모바일
   ===================================================== */


/* =====================================================
   1. Reset
   ===================================================== */
*,
*::before,
*::after{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

button{
  border:none;
  background:none;
  cursor:pointer;
  font-family:inherit;
  font-size:inherit;
}

.writing-toolbar,
.drawing-toolbar svg{
  display:block;
  flex-shrink:0;
}


/* =====================================================
   2. Demo
   ===================================================== */
.demo-label{
  font-size:11px;
  font-weight:700;
  color:#a8a29e;
  letter-spacing:.12em;
  text-transform:uppercase;
  margin-bottom:8px;
  text-align:center;
}

.demo-wrap{
  width:100%;
  position:relative;
}


/* =====================================================
   3. 공통 애니메이션
   ===================================================== */
@keyframes slideUp{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}

@keyframes fadeIn{
  from{opacity:0}
  to{opacity:1}
}


/* =====================================================
   4. 메인 툴바 (.toolbar)
   A 툴바(HTML 유지) + B 디자인 적용
   ===================================================== */

/* ── 래퍼 (B .letter-toolbar) ── */
.toolbar{ 
  width:1008px;   /* [2026-12-02] 900 → 1008 */
  height:auto;
  margin:0 auto;
  background:#fff;
  box-shadow:0 6px 20px rgba(30,40,60,.10), 0 0 0 1px rgba(30,40,60,.05);
  border-radius:12px;
  padding:6px 10px;
  display:flex;
  align-items:center;               /* 세로 중앙 */
  justify-content:space-between;    /* 가로 분산 */
  gap:4px;
  font-family:'Pretendard',sans-serif;
  color:#37474F;
   position: sticky;
   top: 16px;
   z-index: 94;
}

.toolbar > .d-flex{
  gap:4px;
}

/* ── order 정리 ──
   1 전체태그 / 2 줄수 / 3 글꼴 / 4 폰트사이즈 / 5 전체폰트색 / 6~8 정렬 / 9 구분선
   10 강조태그 / 11 글자색 / 12 배경색 / 13~16 B I U S / 20 구분선 / 21 시간넣기 */

/* ── "전체" / "강조" 태그 — 일반 요소 <p class="tb-tag"> (index.html)  [2026-12-02]
   예전엔 '전체'는 p::after, '강조'는 div::after 로 그렸음. 높이 25px 로 통일 */
.toolbar .tb-tag{
  margin:0 1px 0 0 !important;
  padding:0 7px !important;
  height:25px;
  box-sizing:border-box;
  display:flex;
  align-items:center;
  font-size:12px;
  font-weight:700;
  line-height:1;
  letter-spacing:-.1px;
  white-space:nowrap;
  border-radius:8px;
  cursor:default;
  flex-shrink:0;
}
.toolbar .tb-tag-page{ order:1;  background:#E0F7FA; color:#00838F; }
.toolbar .tb-tag-em  { order:10; background:#EDE7F6; color:#5E35B1; }

/* 왼쪽 묶음의 구분선: 기본 숨김 (1281px 이상에서만 두 번째 것을 표시) */
.toolbar > div:first-child .line-gy2{
  display:none !important;
}

/* ── 셀렉트 3종 (B .tb-select) ── */
.toolbar select.my-select{
  height:38px !important;
  padding:0 19px 0 10px !important;
  border:1px solid #E3E8EF;
  border-radius:12px;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378909C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center;
  background-size:12px 12px;
  -webkit-appearance:none;
  appearance:none;
  outline:none;
  cursor:pointer;
  font-family:inherit;
  font-size:14px !important;
  font-weight:500;
  color:#37474F;
  text-overflow:ellipsis;
  box-shadow:none;
  line-height:normal;
}

.toolbar select.my-select:hover,
.toolbar select.my-select:focus{
  border-color:#26C6DA;
  box-shadow:none;
}

.toolbar select.my-select:not(.font-selector):not(.font-size-selector){   /* 줄수 · 줄모양 */
  order:2;
}
.toolbar select.line-cnt-selector{      /* 줄수 [2026-12-02] */
  width:70px !important;
}
.toolbar select.line-style-selector{    /* 줄모양 [2026-12-02] */
  width:96px !important;
}

.toolbar select.font-selector{          /* 글꼴 */
  order:3;
  width:146px !important;
}

.toolbar select.font-size-selector{     /* 폰트사이즈 */
  order:4;
  width:62px !important;
}

/* ── 전체 폰트색상 (B .tb-color-wrap / .tb-fcolor) ── */
.toolbar .tb-color-wrap{
  order:5;
  position:relative;
  display:inline-flex;
}

.toolbar .tb-fcolor{
  width:42px;
  height:38px;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  box-sizing:border-box;
  border:1px solid #E3E8EF;
  border-radius:12px;
  background:#fff;
  color:#37474F;
  cursor:pointer;
  transition:border-color .15s, background .15s;
}

.toolbar .tb-fcolor:hover{
  border-color:#26C6DA;
  background:#F4FCFD;
}

.toolbar .tb-fcolor .glyph{
  color:#000;   /* A 는 항상 검은색 (막대만 글자색) */
  font-size:17px;
  font-weight:800;
  line-height:1;
}

.toolbar .tb-fcolor .bar{
  width:20px;
  height:4px;
  border-radius:2px;
  background:#212121;
}

/* ── 정렬 3버튼 (B .tb-seg) : 공통 ── */
.toolbar .tool-btn[data-fontstyle='left'],
.toolbar .tool-btn[data-fontstyle='center'],
.toolbar .tool-btn[data-fontstyle='right']{
  position:relative;
  width:35px;
  height:38px;
  padding:0;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fff;
  color:#37474F;
  cursor:pointer;
  border:1px solid #E3E8EF;
  border-radius:0;
  box-sizing:border-box;
}

/* 정렬 3버튼 : 개별 */
.toolbar .tool-btn[data-fontstyle='left']{
  order:6;
  border-right:0;
  border-radius:12px 0 0 12px;
  margin-right:-4px;
}

.toolbar .tool-btn[data-fontstyle='center']{
  order:7;
  border-left:0;
  border-right:0;
  margin-right:-4px;
}

.toolbar .tool-btn[data-fontstyle='right']{
  order:8;
  border-left:0;
  border-radius:0 12px 12px 0;
}

.toolbar .tool-btn[data-fontstyle='left']::before,
.toolbar .tool-btn[data-fontstyle='center']::before,
.toolbar .tool-btn[data-fontstyle='right']::before{
  content:'';
  position:absolute;
  left:50%;
  top:50%;
  width:32px;
  height:32px;
  transform:translate(-50%,-50%);
  border-radius:9px;
  background:transparent;
  transition:background .15s;
  z-index:0;
}

.toolbar .tool-btn[data-fontstyle='left'] svg,
.toolbar .tool-btn[data-fontstyle='center'] svg,
.toolbar .tool-btn[data-fontstyle='right'] svg{
  position:relative;
  z-index:1;
}

.toolbar .tool-btn[data-fontstyle='left']:hover::before,
.toolbar .tool-btn[data-fontstyle='center']:hover::before,
.toolbar .tool-btn[data-fontstyle='right']:hover::before{
  background:#F5F7FA;
}

.toolbar .tool-btn[data-fontstyle='left'].active,
.toolbar .tool-btn[data-fontstyle='left'].on,
.toolbar .tool-btn[data-fontstyle='center'].active,
.toolbar .tool-btn[data-fontstyle='center'].on,
.toolbar .tool-btn[data-fontstyle='right'].active,
.toolbar .tool-btn[data-fontstyle='right'].on{
  color:#00838F;
  background:#fff;
}

.toolbar .tool-btn[data-fontstyle='left'].active::before,
.toolbar .tool-btn[data-fontstyle='left'].on::before,
.toolbar .tool-btn[data-fontstyle='center'].active::before,
.toolbar .tool-btn[data-fontstyle='center'].on::before,
.toolbar .tool-btn[data-fontstyle='right'].active::before,
.toolbar .tool-btn[data-fontstyle='right'].on::before{
  background:#E0F7FA;
}

/* ── 빠른도구모음 (쓰기 도구모음 패널 안) [2026-12-02]
   위 폰트 선택(.font-dd: 좌우 1rem)과 같은 폭으로 양 끝을 맞춘다. 줄 모양 칸이 남는 폭을 채움 ── */
.toolbar.quick-toolbar{
  width:auto !important;
  margin:0 1rem 1rem !important;
  padding:0 !important;
  box-shadow:none;
  border:none;
  border-radius:0;
  position:static;
  flex-direction:row !important;
  justify-content:space-between;
  gap:6px;
}
.toolbar.quick-toolbar > .d-flex{
  width:100%;
  gap:6px;
}
.toolbar.quick-toolbar select.my-select{
  margin:0 !important;
}
.toolbar.quick-toolbar select.line-cnt-selector,
.toolbar.quick-toolbar select.font-size-selector{
  width:68px !important;
  flex:0 0 68px;
}
.toolbar.quick-toolbar select.line-style-selector{
  width:auto !important;
  flex:1 1 0;
  min-width:0;
}

/* ── 정렬 버튼 하나 (빠른도구모음, 누를 때마다 좌측→중앙→우측) — 아이콘 + 글자로 지금 정렬 표시 ── */
.toolbar .tool-btn.align-cycle-btn{
  order:6;
  flex:0 0 auto;
  width:auto !important;      /* .tool-btn 기본 29px 해제 */
  aspect-ratio:auto;
  height:38px;
  padding:0 10px 0 8px;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  background:#fff;            /* [2026-12-02] 색 뺌 — 옆 선택 상자와 같은 흰 바탕·회색 테두리 */
  color:#37474F;
  cursor:pointer;
  border:1px solid #E3E8EF;
  border-radius:12px;
  box-sizing:border-box;
  user-select:none;
  white-space:nowrap;
}
.toolbar .tool-btn.align-cycle-btn svg{
  flex-shrink:0;
}
.toolbar .tool-btn.align-cycle-btn .align-cycle-label{
  font-size:13px;
  font-weight:700;
  letter-spacing:-.2px;
  line-height:1;
}
.toolbar .tool-btn.align-cycle-btn:hover{
  background:#F5F7FA;
}
.toolbar .tool-btn.align-cycle-btn:active{
  transform:scale(.96);
}

/* ── 구분선 (B .tb-divider) ── */
.toolbar .line-gy2{
  width:2px;
  height:30px;
  padding:0;
  border:0 !important;
  background:#C5CED6;
  border-radius:1px;
  flex-shrink:0;
  font-size:0;
  line-height:0;
  overflow:hidden;
  margin:0 auto !important;     /* 묶음 사이 간격 균등 분배 */
}

.toolbar > div:last-child .line-gy2{   /* 시간넣기 앞 */
  order:20;
}

/* ── 글자색 / 배경색 원형 버튼 (B .tb-dot) : 공통 ── */
.toolbar #d-btn-fontcolor-pc,
.toolbar #ts-color-trigger-btn{
  width:34px;
  height:34px;
  margin:0 !important;
  padding:0 !important;
  display:flex !important;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  border:1px solid #E3E8EF;
  border-radius:50%;
  background:#fff;
  transition:all .15s;
}

.toolbar #d-btn-fontcolor-pc img,
.toolbar #ts-color-trigger-btn img{
  display:none !important;
}

/* 글자색 (B .tb-dot.tc) */
.toolbar #d-btn-fontcolor-pc{
  order:11;
}

.toolbar #d-btn-fontcolor-pc::before{
  content:'A';
  font-size:16px;
  font-weight:800;
  line-height:1;
}

.toolbar #d-btn-fontcolor-pc:hover{
  background:#FFF3F3;
}

/* 배경색 (B .tb-dot.bg) */
.toolbar #ts-color-trigger-btn{
  order:12;
  background:#FFF59D;
  border-color:#FFF59D;
  color:#5D4E1A;
}

.toolbar #ts-color-trigger-btn::before{
  content:'';
  width:18px;
  height:18px;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 11-6 6v3h9l3-3'/%3E%3Cpath d='m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4'/%3E%3C/svg%3E") center/contain no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 11-6 6v3h9l3-3'/%3E%3Cpath d='m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4'/%3E%3C/svg%3E") center/contain no-repeat;
}

.toolbar #ts-color-trigger-btn:hover{
  background:#FFF176;
  border-color:#FFF176;
}

/* ── B / I / U / S 원형 버튼 (B .tb-btn) : SVG 숨기고 B처럼 글자로 표시 ── */
.toolbar .tool-btn[data-fontstyle='bold'],
.toolbar .tool-btn[data-fontstyle='italic'],
.toolbar .tool-btn[data-fontstyle='underline'],
.toolbar .tool-btn[data-fontstyle='strike']{
  width:34px;
  height:34px;
  margin:0;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  border:1px solid #E3E8EF;
  border-radius:50%;
  background:#fff;
  color:#37474F;
  cursor:pointer;
  transition:all .15s;
  font-family:inherit;
  font-size:16px;
  line-height:1;
}

.toolbar .tool-btn[data-fontstyle='bold'] svg,
.toolbar .tool-btn[data-fontstyle='italic'] svg,
.toolbar .tool-btn[data-fontstyle='underline'] svg,
.toolbar .tool-btn[data-fontstyle='strike'] svg{
  display:none;
}

.toolbar .tool-btn[data-fontstyle='bold']{
  order:13;
  margin-left:3px;      /* 색상 그룹과 3px 더 띄움 */
}

.toolbar .tool-btn[data-fontstyle='italic']{
  order:14;
}

.toolbar .tool-btn[data-fontstyle='underline']{
  order:15;
}

.toolbar .tool-btn[data-fontstyle='strike']{
  order:16;
}

.toolbar .tool-btn[data-fontstyle='bold']::before{
  content:'B';
  font-weight:800;
}

.toolbar .tool-btn[data-fontstyle='italic']::before{
  content:'I';
  font-style:italic;
  font-family:Georgia,serif;
  font-weight:600;
}

.toolbar .tool-btn[data-fontstyle='underline']::before{
  content:'U';
  text-decoration:underline;
  text-underline-offset:3px;
  font-weight:600;
}

.toolbar .tool-btn[data-fontstyle='strike']::before{
  content:'S';
  text-decoration:line-through;
  font-weight:600;
}

.toolbar .tool-btn[data-fontstyle='bold']:hover,
.toolbar .tool-btn[data-fontstyle='italic']:hover,
.toolbar .tool-btn[data-fontstyle='underline']:hover,
.toolbar .tool-btn[data-fontstyle='strike']:hover{
  background:#F5F7FA;
}

/* 활성 상태 (A의 JS는 .active 사용) */
.toolbar .tool-btn[data-fontstyle='bold'].active,
.toolbar .tool-btn[data-fontstyle='bold'].on,
.toolbar .tool-btn[data-fontstyle='italic'].active,
.toolbar .tool-btn[data-fontstyle='italic'].on,
.toolbar .tool-btn[data-fontstyle='underline'].active,
.toolbar .tool-btn[data-fontstyle='underline'].on,
.toolbar .tool-btn[data-fontstyle='strike'].active,
.toolbar .tool-btn[data-fontstyle='strike'].on{
  background:#EDE7F6;
  border-color:#7E57C2;
  color:#5E35B1;
}

.tb-zone.sel .tb-btn.on{
  background:#EDE7F6;
  border-color:#7E57C2;
  color:#5E35B1;
}

/* 아이콘 크기 (정렬 아이콘) */
.toolbar .tool-btn svg{
  width:18px;
  height:18px;
  display:block;
}

/* ── 시간넣기 (B .tb-time) ── */
.toolbar #pc-clock-btn{
  order:21;
  width:auto !important;
  height:38px;
  margin:0;
  padding:0 11px 0 10px;
  display:flex;
  align-items:center;
  gap:5px;
  box-sizing:border-box;
  border:1px solid #E3E8EF;
  border-radius:12px;
  background:#fff;
  color:#37474F;
  font-family:inherit;
  font-size:14px !important;
  font-weight:600 !important;
  white-space:nowrap;
  transition:all .15s;
}

.toolbar #pc-clock-btn img{
  display:none !important;
}

.toolbar #pc-clock-btn::before{
  content:'';
  width:18px;
  height:18px;
  flex-shrink:0;
  background:#F57C00;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M12 7v5l4 2'/%3E%3C/svg%3E") center/contain no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M12 7v5l4 2'/%3E%3C/svg%3E") center/contain no-repeat;
}

.toolbar #pc-clock-btn:hover{
  background:#FFF8EE;
  border-color:#FFB74D;
}

/* ── 시간넣기 팝업 박스 틀 (B .tb-stamp-pop) ── */
.toolbar #pc-clock-pop{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  width:320px;
  padding:16px 18px 18px;
  box-sizing:border-box;
  background:#fff;
  border-radius:14px;
  color:#37474F;
  text-align:left;
  font-weight:400;
  box-shadow:0 14px 32px rgba(30,40,60,.18), 0 0 0 1px rgba(30,40,60,.06);
  z-index:50;
}


/* =====================================================
   5. 툴바 모바일 (.toolbar-mobile / .toolbar-pop)
   ※ 표시/숨김 및 위치는 [11. PC] / [12. 모바일] 미디어쿼리 참고
   ===================================================== */

/* 툴바모바일 팝업 */
.toolbar-pop{
  display:flex;
  height:2.6rem;
  border:1px solid var(--mypink-lt);
  position:absolute;
  top:-46px;
  background-color:#fff;
  border-radius:12px;
  padding:0.7rem 1rem;
  gap:16px;
}

/* 툴바모바일 팝업 - 수직형 */
.toolbar-pop-y{
  display:flex;
  flex-direction:column;
  border:1px solid var(--myborder);
  position:absolute;
  top:-17.5rem;
  background-color:#fff;
  border-radius:12px;
  padding:0.7rem;
  gap:8px;
}

.toolbar-pop-y div{
  width:1.7rem;
  height:1.7rem;
}


/* =====================================================
   6. WRITING TOOLBAR -- 모바일용 툴바 CSS
   ※ .writing-toolbar 위치는 [12. 모바일] 참고
   ===================================================== */

/* ── Popovers (writing) ── */
.w-popover{
  position:absolute;
  bottom:calc(100% + 12px);
  background:white;
  border-radius:18px;
  box-shadow:0 20px 50px -10px rgba(244,114,182,.35);
  border:1.5px solid #fbcfe8;
  padding:8px;
  display:none;
  z-index:60;
  animation:slideUp .2s cubic-bezier(.16,1,.3,1);
}

.w-popover.open{
  display:flex;
  gap:6px;
}

#pop-clock{
  flex-direction:column;
  gap:6px;
  right:4px;
  min-width:130px;
  padding:8px;
}

#pop-style{
  right:65px;
}

#pop-align{
  right:50px;
}

#pop-colors{
  right:50px;
  flex-direction:column;
  gap:8px;
  padding:8px;
  max-height:280px;
  overflow-y:auto;
}

#pop-colors::-webkit-scrollbar{
  display:none;
}

.w-popover-title{
  font-size:10px;
  font-weight:700;
  color:#9ca3af;
  padding:2px 6px 6px;
  border-bottom:1px solid #f9fafb;
  margin-bottom:2px;
}

.w-pop-btn{
  width:36px;
  height:36px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#4b5563;
  transition:all .15s;
  flex-shrink:0;
}

.w-pop-btn:hover{
  background:#f3f4f6;
}

.w-pop-btn.active{
  background:#111827;
  color:white;
  box-shadow:0 2px 8px rgba(0,0,0,.2);
  transform:scale(1.05);
}

.clock-item{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:10px;
  transition:all .15s;
}

.clock-item:hover{
  background:#f9fafb;
}

.clock-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  flex-shrink:0;
}

.clock-time{
  font-size:13px;
  font-weight:700;
}

.color-swatch{
  width:34px;
  height:34px;
  border-radius:50%;
  border:2px solid white;
  box-shadow:0 1px 4px rgba(0,0,0,.12);
  flex-shrink:0;
  transition:transform .15s;
  cursor:pointer;
}

.color-swatch:hover{
  transform:scale(1.12);
}

.color-swatch.selected{
  box-shadow:0 0 0 3px #ec4899, 0 0 0 5px #fce7f3;
}

/* ── Main Writing Bar ── */
.w-bar{
  width:100%;
  display:flex;
  align-items:center;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(12px);
  border:1.5px solid #fbcfe8;
  border-radius:24px;
  padding:6px;
  box-shadow:0 10px 30px -10px rgba(244,114,182,.3), 0 0 0 1px rgba(0,0,0,.04);
}

.w-selectors{
  display:flex;
  align-items:center;
  gap:4px;
  flex:1;
  overflow-x:auto;
  padding:0 0 0 3px;
}

.w-selectors::-webkit-scrollbar{
  display:none;
}

.w-sel-btn{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:2px;
  padding:8px;
  border:1px solid #f3f4f6;
  border-radius:14px;
  color:#4b5563;
  white-space:nowrap;
  flex-shrink:0;
  font-size:13px;
  font-weight:700;
  transition:background .15s;
}

.w-sel-btn:hover{
  background:#f9fafb;
}

.w-divider{
  width:1px;
  height:28px;
  background:#f3f4f6;
  flex-shrink:0;
  margin:0 4px;
}

.w-actions{
  display:flex;
  align-items:center;
  gap:2px;
  flex-shrink:0;
  padding:0 3px 0 0;
}

.w-action-btn{
  width:30px;
  height:30px;
  border-radius:10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  color:#6b7280;
  transition:all .15s;
  flex-shrink:0;
}

.w-action-btn:hover{
  background:rgba(249,250,251,.8);
}

.w-action-btn.active{
  background:#111827;
  color:white;
  box-shadow:0 2px 8px rgba(0,0,0,.2);
}

.w-action-btn.ring{
  outline:2px solid #f472b6;
  outline-offset:1px;
  transform:scale(1.05);
}

.color-bar{
  width:20px;
  height:4px;
  margin-top:2px;
  border-radius:99px;
  background:linear-gradient(to right,#f87171,#4ade80,#60a5fa);
}

.w-clock-btn{
  width:30px;
  height:30px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f9fafb;
  color:#4b5563;
  transition:all .15s;
}

.w-clock-btn:hover{
  background:#f3f4f6;
}

.w-clock-btn.active{
  background:#111827;
  color:white;
  box-shadow:0 4px 12px rgba(0,0,0,.25);
  transform:scale(1.05);
}


/* =====================================================
   7. DRAWING TOOLBAR
   ※ .drawing-toolbar 위치는 [12. 모바일] 참고
   ===================================================== */
/* .drawing-toolbar{display:flex;flex-direction:column;align-items:center} */

#d-popover-container{
  position:absolute;
  bottom:calc(100% + 8px);
  left:0;
  right:0;
  display:flex;
  justify-content:center;
  pointer-events:none;
  z-index:100;
}

#d-popover-container > *{
  pointer-events:auto;
}

/* ── Handle ── */
.d-handle{
  width:40px;
  height:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.6);
  backdrop-filter:blur(8px);
  border-radius:10px 10px 0 0;
  border:1px solid rgba(251,207,232,.5);
  border-bottom:none;
  cursor:pointer;
  margin:0 auto 2px auto;
}

.d-handle-bar{
  width:24px;
  height:4px;
  border-radius:99px;
  background:#e7e5e4;
  transition:background .15s;
}

.d-handle:hover .d-handle-bar{
  background:#f9a8d4;
}

.drawing-toolbar.collapsed .d-handle-bar{
  background:#f472b6;
}

/* ── Main Drawing Bar ── */
.d-bar{
  width:100%;
  display:flex;
  align-items:center;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(12px);
  border:1.5px solid #fbcfe8;
  border-radius:24px;
  padding:6px;
  box-shadow:0 10px 30px -10px rgba(244,114,182,.3), 0 0 0 1px rgba(0,0,0,.04);
  transition:all .4s cubic-bezier(.4,0,.2,1);
  overflow:hidden;
}

.drawing-toolbar.collapsed .d-bar{
  width:48px;
  height:48px;
  padding:0;
  justify-content:center;
  border-radius:50%;
}

.drawing-toolbar.collapsed .d-bar-inner{
  display:none;
}

.d-collapsed-btn{
  display:none;
  width:100%;
  height:100%;
  align-items:center;
  justify-content:center;
  color:#ec4899;
}

.drawing-toolbar.collapsed .d-collapsed-btn{
  display:flex;
}

.d-bar-inner{
  flex:1;
  display:flex;
  align-items:center;
}

.d-tools-group{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:space-around;
  padding:0 4px;
}

.d-divider{
  width:1px;
  height:24px;
  background:#f5f5f4;
  margin:0 4px;
  flex-shrink:0;
}

.d-undo-group{
  display:flex;
  align-items:center;
  gap:4px;
  padding:0 4px;
}

/* ── Tool buttons ── */
.d-tool-btn{
  position:relative;
  width:40px;
  height:40px;
  border-radius:14px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  color:#57534e;
  transition:all .15s;
  cursor:pointer;
}

.d-tool-btn::after{       /* full click area */
  content:'';
  position:absolute;
  inset:-6px;
  border-radius:20px;
}

.d-tool-btn:hover{
  background:#f5f5f4;
}

.d-tool-btn.pen-active{
  background:#ec4899;
  color:white;
  box-shadow:0 2px 8px rgba(236,72,153,.3);
}

.d-tool-btn.pen-active.ring{
  outline:2px solid #f9a8d4;
  outline-offset:1px;
}

.d-tool-btn.shape-active{
  background:#3b82f6;
  color:white;
  box-shadow:0 2px 8px rgba(59,130,246,.3);
}

.d-tool-btn.shape-active.ring{
  outline:2px solid #93c5fd;
  outline-offset:1px;
}

.d-tool-btn.eraser-active{
  background:#ef4444;
  color:white;
  box-shadow:0 2px 8px rgba(239,68,68,.3);
}

.d-tool-btn.eraser-active.ring{
  outline:2px solid #fca5a5;
  outline-offset:1px;
}

.d-tool-btn.thickness-active{
  background:#6366f1;
  color:white;
  box-shadow:0 2px 8px rgba(99,102,241,.3);
  outline:2px solid #a5b4fc;
  outline-offset:1px;
}

.thickness-icon{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
}

.thickness-line-thick{
  width:16px;
  height:4px;
  background:currentColor;
  border-radius:99px;
}

.thickness-line-thin{
  width:8px;
  height:4px;
  background:currentColor;
  border-radius:99px;
  opacity:.5;
}

.d-color-btn{
  width:40px;
  height:40px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all .15s;
}

.d-color-btn:hover{
  transform:scale(1.05);
}

.d-color-btn.ring{
  outline:2px solid #5eead4;
  outline-offset:1px;
  transform:scale(1.05);
  background:#f0fdfa;
}

.d-color-swatch{
  width:28px;
  height:28px;
  border-radius:100px;
  border:2px solid #e7e5e4;
  box-shadow:0 1px 3px rgba(0,0,0,.1);
}

.d-undo-btn{
  width:36px;
  height:36px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#57534e;
  transition:all .15s;
}

.d-undo-btn:hover{
  background:#f5f5f4;
  color:#1c1917;
}

.d-undo-btn:active{
  transform:scale(.9);
}

.d-undo-btn.disabled{
  color:#d6d3d1;
  cursor:not-allowed;
}

/* ── Drawing Popovers ── */
.d-popover{
  width:calc(100vw - 32px);
  max-width:300px;
  background:white;
  border-radius:14px;
  padding:16px 18px 18px;
/*  border:1.5px solid #fbcfe8; */
  box-shadow:0 14px 32px rgba(30,40,60,.18), 0 0 0 1px rgba(30,40,60,.06);
  display:none;
  animation:slideUp .25s cubic-bezier(.16,1,.3,1);
}

.d-popover.open{
  display:block;
}

/* ⚠ 원본 그대로 유지 (box-shadow 뒤 세미콜론 누락 상태) */
.d-popover.teal{border-color:#5eead4;box-shadow:0 15px 40px -10px rgba(20,184,166,.25),0 0 0 1px rgba(0,0,0,.04)  top: calc(100% + 10px);    left: 50%;}

.d-popover.indigo{
  border-color:#a5b4fc;
  box-shadow:0 15px 40px -10px rgba(99,102,241,.25), 0 0 0 1px rgba(0,0,0,.04);
}

.d-pop-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px;
}

.d-pop-header-left{
  display:flex;
  align-items:center;
  gap:8px;
}

.d-pop-header-right{
  display:flex;
  align-items:center;
  gap:2px;
}

.d-pop-icon{
  width:32px;
  height:32px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.d-pop-icon.pink{background:#fdf2f8;color:#ec4899}
.d-pop-icon.blue{background:#eff6ff;color:#3b82f6}
.d-pop-icon.red{background:#fef2f2;color:#ef4444}
.d-pop-icon.indigo{background:#eef2ff;color:#6366f1}

.d-pop-icon.teal{
  width:26px;
  height:26px;
  border-radius:9px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  font-weight:800;
  font-size:14px;
  background:#FFEBEE;
  color:#E53935;
}

.d-pop-title{
  font-size:14px;
  font-weight:600;
  color:#546E7A;
}

.d-pop-close,
.d-pop-star{
  width:30px;
  height:30px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#a8a29e;
  transition:all .15s;
}

.d-pop-close:hover{
  background:#f5f5f4;
  color:#6366f1;
}

.d-pop-star:hover{
  background:#f5f5f4;
}

/* ── Tool selector grid ── */
.d-tool-grid{
  display:flex;
  justify-content:space-around;
  padding-bottom:18px;
  margin-bottom:14px;
  border-bottom:1px solid rgba(231,229,228,.8);
}

.d-tool-option{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  cursor:pointer;
  transition:transform .15s;
}

.d-tool-option.active{
  transform:scale(1.05);
}

.d-tool-option-icon{
  width:44px;
  height:44px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all .15s;
}

.d-tool-option-label{
  font-size:9px;
  font-weight:900;
}

/* colors for each tool type - inactive */
.ic-pen    {background:#fdf2f8;color:#ec4899}
.ic-hl     {background:#fffbeb;color:#f59e0b}
.ic-pencil {background:#eef2ff;color:#6366f1}
.ic-spray  {background:#f5f3ff;color:#8b5cf6}
.ic-brush  {background:#ecfdf5;color:#10b981}
.ic-line   {background:#f0f9ff;color:#0ea5e9}
.ic-tri    {background:#fff7ed;color:#f97316}
.ic-rect   {background:#eff6ff;color:#3b82f6}
.ic-circle {background:#ecfdf5;color:#10b981}
.ic-star   {background:#fefce8;color:#eab308}
.ic-eraser {background:#fef2f2;color:#ef4444}
.ic-elaser {background:#fffbeb;color:#f59e0b}
.ic-trash  {background:#f4f4f5;color:#71717a}

/* active */
.active .ic-pen    {background:#ec4899;color:white;box-shadow:0 4px 12px rgba(236,72,153,.3)}
.active .ic-hl     {background:#f59e0b;color:white;box-shadow:0 4px 12px rgba(245,158,11,.3)}
.active .ic-pencil {background:#6366f1;color:white;box-shadow:0 4px 12px rgba(99,102,241,.3)}
.active .ic-spray  {background:#8b5cf6;color:white;box-shadow:0 4px 12px rgba(139,92,246,.3)}
.active .ic-brush  {background:#10b981;color:white;box-shadow:0 4px 12px rgba(16,185,129,.3)}
.active .ic-line   {background:#0ea5e9;color:white;box-shadow:0 4px 12px rgba(14,165,233,.3)}
.active .ic-tri    {background:#f97316;color:white;box-shadow:0 4px 12px rgba(249,115,22,.3)}
.active .ic-rect   {background:#3b82f6;color:white;box-shadow:0 4px 12px rgba(59,130,246,.3)}
.active .ic-circle {background:#10b981;color:white;box-shadow:0 4px 12px rgba(16,185,129,.3)}
.active .ic-star   {background:#eab308;color:white;box-shadow:0 4px 12px rgba(234,179,8,.3)}
.active .ic-eraser {background:#ef4444;color:white;box-shadow:0 4px 12px rgba(239,68,68,.3)}
.active .ic-elaser {background:#f59e0b;color:white;box-shadow:0 4px 12px rgba(245,158,11,.3)}

/* text colors */
.tc-pen{color:#db2777}
.tc-hl{color:#d97706}
.tc-pencil{color:#4f46e5}
.tc-spray{color:#7c3aed}
.tc-brush{color:#059669}
.tc-line{color:#0284c7}
.tc-tri{color:#ea580c}
.tc-rect{color:#2563eb}
.tc-circle{color:#059669}
.tc-star{color:#ca8a04}
.tc-eraser{color:#dc2626}
.tc-elaser{color:#d97706}

.d-tool-option:not(.active) .d-tool-option-label{
  color:#c4b5b0;
}

/* Element eraser info */
.elaser-info{
  background:rgba(255,251,235,.5);
  border-radius:16px;
  height:44px;
  border:1px solid rgba(253,230,138,.5);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 16px;
  gap:10px;
}

.elaser-info-text{
  font-size:11px;
  color:#d97706;
  font-weight:700;
  line-height:1.4;
}

/* Pagination dots */
.pop-dots{
  display:none;
  justify-content:center;
  gap:6px;
  margin-top:16px;
  opacity:.1;
}

.pop-dot{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#292524;
}

.pop-dot.dim{
  opacity:.3;
}


/* =====================================================
   8. CUSTOM COLOR PICKER MODAL
   ===================================================== */
#cp-modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:9999;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.28);
  backdrop-filter:blur(6px);
}

#cp-modal.open{
  display:flex;
  animation:fadeIn .18s ease;
}

.cp-box{
  width:300px;
  background:white;
  border-radius:24px;
  padding:14px;
  border:1.5px solid #5eead4;
  box-shadow:0 15px 40px -10px rgba(20,184,166,.25), 0 0 0 1px rgba(0,0,0,.04);
  animation:slideUp .22s cubic-bezier(.16,1,.3,1);
  position:relative;
  overflow:hidden;
  font-family:'Noto Sans KR',sans-serif;
}

.cp-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}

.cp-header-left{
  display:flex;
  align-items:center;
  gap:8px;
}

.cp-header-icon{
  width:28px;
  height:28px;
  border-radius:8px;
  background:#f0fdfa;
  color:#14b8a6;
  display:flex;
  align-items:center;
  justify-content:center;
}

.cp-header-title{
  font-size:13px;
  font-weight:900;
  color:#1c1917;
}

.cp-close-btn{
  width:28px;
  height:28px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#a8a29e;
  transition:all .15s;
  border:none;
  background:none;
  cursor:pointer;
}

.cp-close-btn:hover{
  background:#f5f5f4;
  color:#6366f1;
}

/* Canvas */
.cp-canvas-wrap{
  position:relative;
  width:100%;
  height:135px;
  border-radius:14px;
  overflow:hidden;
  cursor:crosshair;
  margin-bottom:10px;
  user-select:none;
  -webkit-user-select:none;
}

#cp-canvas{
  width:100%;
  height:100%;
  display:block;
  border-radius:14px;
}

.cp-cursor{
  position:absolute;
  width:16px;
  height:16px;
  border-radius:50%;
  border:2px solid white;
  box-shadow:0 0 0 1px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.5);
  transform:translate(-50%,-50%);
  pointer-events:none;
}

/* Hue row */
.cp-hue-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}

.cp-preview{
  width:30px;
  height:30px;
  border-radius:10px;
  flex-shrink:0;
  border:1.5px solid rgba(0,0,0,.1);
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}

.cp-hue-wrap{
  flex:1;
  position:relative;
  height:12px;
  border-radius:6px;
  cursor:pointer;
  user-select:none;
  -webkit-user-select:none;
  background:linear-gradient(to right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00);
}

.cp-hue-thumb{
  position:absolute;
  top:50%;
  width:18px;
  height:18px;
  border-radius:50%;
  background:white;
  box-shadow:0 0 0 1px rgba(0,0,0,.15), 0 2px 6px rgba(0,0,0,.2);
  transform:translate(-50%,-50%);
  pointer-events:none;
}

#cp-hue-input{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer;
  margin:0;
  padding:0;
  -webkit-appearance:none;
  appearance:none;
}

/* Inputs */
.cp-inputs{
  display:grid;
  grid-template-columns:1.4fr 1fr 1fr 1fr;
  gap:6px;
  margin-bottom:10px;
}

.cp-input-group{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
}

.cp-input-label{
  font-size:9px;
  font-weight:700;
  color:rgba(0,0,0,.35);
  letter-spacing:.1em;
  text-transform:uppercase;
}

.cp-input-field{
  width:100%;
  text-align:center;
  font-size:11px;
  font-weight:700;
  color:#1c1917;
  background:#f5f6f8;
  border:1px solid rgba(0,0,0,.1);
  border-radius:7px;
  padding:6px 2px;
  font-family:'Noto Sans KR',monospace;
  outline:none;
  transition:border-color .15s;
}

.cp-input-field:focus{
  border-color:#5eead4;
}

/* Apply button */
.cp-apply{
  position:relative;
  width:100%;
  padding:10px;
  border-radius:11px;
  border:1px solid rgba(0,0,0,.1);
  cursor:pointer;
  font-family:'Noto Sans KR',sans-serif;
  font-size:13px;
  font-weight:700;
  color:rgba(0,0,0,.6);
  background:#f0f1f4;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  overflow:hidden;
  transition:all .15s;
}

.cp-apply:hover{
  border-color:rgba(0,0,0,.15);
  box-shadow:0 4px 12px rgba(0,0,0,.08);
  color:rgba(0,0,0,.8);
}

.cp-apply-tint{
  position:absolute;
  inset:0;
  opacity:.12;
  transition:opacity .15s;
  pointer-events:none;
}

.cp-apply:hover .cp-apply-tint{
  opacity:.2;
}


/* =====================================================
   9. 색상 그리드 / 투명도 슬라이더
   ===================================================== */

/* ── Slider ── */
.my-slider-row{
  display:flex;
  align-items:center;
  gap:6px;
  flex-direction:row;
}

.slider-stepper{
  width:28px;
  height:28px;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fafaf9;
  border:1px solid #e7e5e4;
  color:#57534e;
  transition:background 0.15s;
  flex-shrink:0;
  cursor:pointer;
}

.slider-stepper:hover{
  background:#f5f5f4;
  color:#ec4899;
}

.slider-stepper:active{
  background:#e7e5e4;
}

.custom-slider{
  position:relative;
  flex:1;
  height:40px;
  display:flex;
  align-items:center;
}

.slider-track{
  position:absolute;
  height:24px;
  border-radius:16px;
  overflow:hidden;
  background:#f5f5f4;
  left:0;
  right:0;
}

.slider-track-dots{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 20px;
  opacity:.2;
}

.slider-track-dot{
  border-radius:50%;
  background:#78716c;
}

.slider-track-checker{
  position:absolute;
  inset:0;
  background-image:conic-gradient(
    #e5e7eb 0.25turn, #fff 0deg, #fff 0.5turn,
    #e5e7eb 0deg, #e5e7eb 0.75turn, #fff 0deg
  );
  background-size:8px 8px;
}

.slider-track-gradient{
  position:absolute;
  inset:0;
  background:linear-gradient(to right, transparent, #f97316);
}

.slider-input{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer;
  z-index:20;
  -webkit-appearance:none;
  appearance:none;
  margin:0;
  padding:0;
  background:transparent;
}

.slider-input::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:40px;
  height:40px;
  border-radius:50%;
}

.slider-input::-moz-range-thumb{
  width:40px;
  height:40px;
  border-radius:50%;
  border:none;
}

.slider-handle{
  position:absolute;
  pointer-events:none;
  width:40px;
  height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  transform:translateX(-50%);
  z-index:10;
  transition:left .05s linear;
}

.slider-knob{
  width:40px;
  height:40px;
  border-radius:9999px;
  background:#fff;
  border:2px solid #fff;
  box-shadow:0 4px 12px rgba(0,0,0,0.15);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.slider-knob-inner{
  width:100%;
  height:100%;
  border-radius:9999px;
  border:1px solid #d4d0cb;
  transition:all 0.15s;
}

/* ── 투명도 슬라이더 구분선 ── */
.opacity-divider{
  padding-top:12px;
  border-top:1px solid rgba(231,229,228,0.8);
  margin-top:0;
}

/* ── Color palette grid — 한 줄 7개, 완전한 원형 ── */
.color-grid{
  display:grid;
  grid-auto-flow:column;                       /* 한 줄로 가로 생성 */
  grid-auto-columns:calc((100% - 30px) / 7);   /* 한 화면에 7개 고정 */
  gap:7px;
  padding:4px;
  margin-bottom:12px;
  overflow-x:auto;                             /* 좌우 스와이프 */
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;            /* 모바일 스와이프 부드럽게 */
  scrollbar-width:none;                        /* 파이어폭스 스크롤바 숨김 */
}

.color-grid > *{
  width:calc(100% * var(--dot-scale));
  height:calc(100% * var(--dot-scale));
  aspect-ratio:1 / 1;
  justify-self:center;
  align-self:center;
}

.color-grid::-webkit-scrollbar{     /* 크롬 / 사파리 스크롤바 숨김 */
  display:none;
}

.color-grid .palette-dot{
  width:32px;
  height:32px;
  flex:1 1 0;
  min-width:0;
  aspect-ratio:1/1;
  border-radius:50%;
  border:2px solid #e7e5e4;
  box-shadow:0 1px 3px rgba(0,0,0,.1);
  cursor:pointer;
  transition:all .15s;
}

.color-grid .palette-dot:hover{
  transform:scale(1.1);
}

.color-grid .palette-dot.selected{
  border-color:white;
  box-shadow:0 4px 16px rgba(0,0,0,.2), 0 0 0 2px #14b8a6;
}

.color-grid .rainbow-btn{
  width:32px;
  height:32px;
  flex:1 1 0;
  min-width:0;
  aspect-ratio:1/1;
  border-radius:50%;
  overflow:hidden;
  position:relative;
  border:2px solid #e7e5e4;
  cursor:pointer;
  box-shadow:0 1px 3px rgba(0,0,0,.1);
  display:flex;
  align-items:center;
  justify-content:center;
  transition:transform .15s;
}

.color-grid.rainbow-btn:hover{      /* ⚠ 원본 그대로 (.color-grid 와 .rainbow-btn 사이 공백 없음) */
  transform:scale(1.1);
}

/* ── 색상 그리드 (툴바 모바일 > 그리기 > 색상선택) ── */
.color-grid-full{
  display:grid;
  grid-template-columns:repeat(6, 1fr);
  gap:8px;
  max-height:180px;
  overflow-y:auto;
  scrollbar-width:none;
  padding:4px;
  margin-bottom:12px;
  margin-top:10px;
}

.color-grid-full::-webkit-scrollbar{
  display:none;
}

/* 색상 점 */
.color-grid-full .palette-dot{
  width:36px;
  height:36px;
  border-radius:9999px;
  border:2px solid #e7e5e4;
  cursor:pointer;
  box-shadow:0 1px 3px rgba(0,0,0,0.1);
  transition:transform 0.15s;
}

.color-grid-full .palette-dot:hover{
  transform:scale(1.1);
}

.color-grid-full .palette-dot.selected{
  border-color:#fff;
  box-shadow:0 0 0 2px #14b8a6;
  z-index:1;
}

/* 컬러휠 버튼 */
.rainbow-btn{
  width:36px;
  height:36px;
  border-radius:9999px;
  border:2px solid #e7e5e4;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  position:relative;
  overflow:hidden;
  transition:transform 0.15s;
  background:none;
}

.rainbow-btn:hover{
  transform:scale(1.1);
}

.rainbow-bg{
  position:absolute;
  inset:0;
  background:conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
}

.rainbow-center{
  position:absolute;
  inset:5px;
  background:#fff;
  border-radius:9999px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 1px 3px rgba(0,0,0,0.1);
  color:#a8a29e;
}

.rainbow-btn:hover .rainbow-center{
  color:#57534e;
}


/* =====================================================
   10. 툴바용 버튼 / 두께 포인터
   ===================================================== */

/* 툴바용 버튼 */
.tool-btn{
  width:29px;
  height:30px;
  margin:0 3px;
  cursor:pointer;
  padding:0;
}

.tool-btn img{
  width:14px;
}

.tool-btn.active{
  background-color:#1f1f1f;
}

/* 툴바 모바일 > 그리기 > 두께 포인터 */
.circle-pointer{
  width:20px;
  height:20px;
  border-radius:100%;
  background:#e9ecef;     /* 외부 원 배경 */
  display:flex;
  align-items:center;
  justify-content:center;
  aspect-ratio:1 / 1;     /* 항상 정사각 */
}

.inner-circle{
  background:#6c757d;     /* 내부 원 색상 */
  border-radius:100%;
  transition:all 0.3s ease;   /* 부드러운 애니메이션 */
}


/* =====================================================================
   11. 미디어쿼리 - PC
   ※ 모바일(12번)보다 반드시 먼저 위치 (캐스케이드 순서 유지)
   ===================================================================== */

/* [PC] 툴바 모바일 / 그리기 툴바 - PC 에서 숨김
@media (min-width: 768px) {
  .writing-toolbar, .drawing-toolbar {
    display: none;
  }
}*/

/* [PC] 768px 이상 - 툴바모바일 숨김 */
@media (min-width: 768px) {
  .toolbar-mobile{
    display:none;
  }
}

/* [PC] 768px 이상 - 색상 그리드 스크롤 해제 (태블릿 이상에서 해제) */
@media (min-width: 768px) {
  .color-grid-full{
    max-height:none;
    overflow-y:visible;
  }
}

/* [PC] 1281px 이상 - 1줄: 두 묶음을 풀어서 B 순서로 한 줄 배치 */
@media (min-width: 1281px) {
  .toolbar{
    justify-content:flex-start;
  }

  .toolbar > .d-flex{
    display:contents !important;
  }

  .toolbar > div:first-child .line-gy2 ~ .line-gy2{   /* 정렬 뒤 구분선 */
    display:block !important;
    order:9;
  }
}

/* [PC] 1280px 이하 - 2줄: A의 column 구조 유지 (1줄=전체, 2줄=강조+시간) */
@media (max-width: 1280px) {
  .toolbar{
    flex-direction:column;
    width:600px;
    margin:0 auto;
    gap:6px;
  }

  .toolbar .line-gy2{
    margin:0 6px !important;
  }
}


/* =====================================================================
   12. 미디어쿼리 - 모바일
   ===================================================================== */

/* [모바일] 840px 이하 - 쓰기 툴바 하단 고정 */
@media (max-width: 840px) {
  .writing-toolbar{
    position:fixed;
    bottom:6rem;
    left:2%;
    right:2%;
    width:96%;
    z-index:100;
  }
}

/* [모바일] 840px 이하 - 그리기 툴바 하단 고정 */
@media (max-width: 840px) {
  .drawing-toolbar{
    position:fixed;
    bottom:6rem;
    left:2%;
    right:2%;
    max-width:640px;
    display:flex;
    flex-direction:column;
    align-items:center;
    z-index:100;
    margin:0 auto;
  }
}

/* [모바일] 840px 이하 - PC 툴바 숨김 */
@media (max-width: 840px) {
  .toolbar{
    display:none;
  }
}

/* [모바일] 840px 이하 - 툴바모바일 (기본 숨김 → .toolbar-m-on 으로 표시) */
@media (max-width: 840px) {
  .toolbar-mobile{
    position:fixed;
    bottom:6rem;
    left:2%;
    right:2%;
    width:96%;
    /*background:#FFFFFF;
    box-shadow:0px 4px 10px rgba(0, 0, 0, 0.1);
    border:2px solid #FBCFE8;
    border-radius:20px;*/
    padding:0.5rem;
    align-items:center;            /* 세로 중앙 */
    justify-content:space-between;
    z-index:100;
    gap:4px;
    display:none;
  }

  .toolbar-m-on{                   /* 툴바 보이게 */
    display:flex;
  }
}

/* [모바일] 840px 이하 - 툴바용 버튼 */
@media (max-width: 840px) {
  .tool-btn{
    aspect-ratio:1 / 1;
  }
}

/* [모바일] 840px 이하 - 안 보임 */
@media (max-width: 840px) {
  .d-pop-color_fontpc,
  .d-pop-color_fontpc2{
    display:none !important;
  }
}

.rainbow-m {width:28px; height:28px}/* 레인보우 버튼 모바일 전용*/ 
 