/* ====================================================
   1. 리셋 및 기본 스타일
   ==================================================== */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 테마 변수 설정 - 다크모드/화이트모드 지원 */
:root {
    /* 화이트모드(기본) 색상 */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #fafafa;
    --text-primary: #16161D;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --sidebar-bg: #ffffff;
    --sidebar-text: #16161D;
    --sidebar-icon: #666666;
    --sidebar-hover: #f5f5f5;
    --sidebar-active: rgba(99,102,241,0.2);
    --sidebar-section-title: #666666;
    --sidebar-border: #e0e0e0;
    --sidebar-btn-bg: #efefef;
    --sidebar-btn-text: #444444;
    --sidebar-btn-border: #d8d8d8;
    --highlight-color: #6366F1;
    --highlight-hover: rgba(99,102,241,0.1);
    --scrollbar-track: #f0f0f0;
    --scrollbar-thumb: #c0c0c0;
    --selected-item-bg: #f0f0ff;
    --search-highlight: #e8e2ff;
}


body {
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: auto; /* 가로 스크롤 허용 */
    overflow-y: hidden; /* 세로 스크롤 방지 */
    height: 100vh;
    min-width: 100vw; /* 최소 너비 보장 */
}

/* ====================================================
   2. 레이아웃 구조
   ==================================================== */
.app-container {
    display: flex;
    width: 100%;
    overflow-x: auto; /* 가로 스크롤 허용 */
    overflow-y: hidden; /* 세로 스크롤 방지 */
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
    min-width: 100vw; /* 최소 너비 보장 */
}

.project-header {
    --uip-header-control-height: 32px;
    --uip-header-icon-size: 32px;
    --uip-header-control-font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.94) 100%);
    border-bottom: 1px solid rgba(229, 231, 235, 0.95);
    height: 48px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 10px 24px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.project-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #111827;
}

.project-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
}

/* 뷰 컨트롤 영역 */
.view-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
}

/* 헤더 구분선 */
.header-divider,
.project-header .uid-editor__divider {
  width: 1px;
  height: 20px;
  background: #E5E7EB;
  margin: 0 -2px;
  align-self: center;
  flex-shrink: 0;
}


/* 헤더의 줌 컨트롤 스타일 조정 */
.project-header .zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--uip-header-control-height);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #E5E7EB;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 1px 2px rgba(15, 23, 42, 0.04);
}

.project-header .zoom-btn {
  width: var(--uip-header-icon-size);
  height: 100%;
  font-size: 14px;
  background: transparent;
  border-color: transparent;
  color: #4B5563;
  box-shadow: none;
}

.project-header .zoom-btn:hover {
  background: #EEF2FF;
  border-color: #C7D2FE;
  color: #4F46E5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.project-header .zoom-btn:active {
  background: #E0E7FF;
  color: #4338CA;
}

.project-header .zoom-level-container {
  display: flex;
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0 2px;
  gap: 2px;
  height: 100%;
  box-shadow: none;
}

.project-header .zoom-level-container:focus-within {
  border-color: #C7D2FE;
  background: #FFFFFF;
}

.project-header .zoom-level-input {
  width: 36px;
  height: calc(var(--uip-header-control-height) - 4px);
  font-size: var(--uip-header-control-font-size);
  color: #111827;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.project-header .zoom-percent {
  font-size: 12px;
  color: #6B7280;
  font-weight: 600;
}

/* 헤더의 캔버스 사이즈 버튼 조정 */
.project-header #canvas-size-btn {
  height: var(--uip-header-control-height);
  min-height: var(--uip-header-control-height);
  padding: 0 10px;
  font-size: var(--uip-header-control-font-size);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #E5E7EB;
  color: #374151;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 1px 2px rgba(15, 23, 42, 0.04);
}

.project-header #canvas-size-btn span {
  font-size: var(--uip-header-control-font-size);
  font-weight: 600;
  color: inherit;
  letter-spacing: -0.01em;
}

.project-header #fit-frames-btn,
.project-header #hand-tool-btn,
.project-header #select-tool-btn {
  width: var(--uip-header-icon-size);
  height: var(--uip-header-control-height);
  min-width: var(--uip-header-icon-size);
  min-height: var(--uip-header-control-height);
  font-size: var(--uip-header-control-font-size);
}

.project-header .icon-btn,
.project-header #hand-tool-btn,
.project-header #select-tool-btn,
.project-header #show-description-btn,
.project-header #figma-target-settings-btn {
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #E5E7EB;
  color: #4B5563;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.project-header .icon-btn:hover,
.project-header #hand-tool-btn:hover,
.project-header #select-tool-btn:hover,
.project-header #show-description-btn:hover,
.project-header #figma-target-settings-btn:hover {
  background: #EEF2FF;
  border-color: #C7D2FE;
  color: #4F46E5;
}

.project-header .icon-btn:focus-visible,
.project-header #fit-frames-btn:focus-visible,
.project-header #hand-tool-btn:focus-visible,
.project-header #select-tool-btn:focus-visible,
.project-header #show-description-btn:focus-visible,
.project-header #figma-target-settings-btn:focus-visible,
.project-header #canvas-size-btn:focus-visible,
.project-header .save-btn:focus-visible,
.project-header .figma-export-btn:focus-visible,
.project-header .zoom-btn:focus-visible,
.project-header .zoom-controls:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(199, 210, 254, 0.85),
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 1px 2px rgba(15, 23, 42, 0.05);
}

.project-header #fit-frames-btn.is-active,
.project-header #hand-tool-btn.is-active,
.project-header #select-tool-btn.is-active,
.project-header #hand-tool-btn.active,
.project-header #show-description-btn.active,
.project-header #figma-target-settings-btn.is-active,
.project-header #figma-target-settings-btn.active {
  background: linear-gradient(90deg, #4F46E5 31%, #6366F1 100%);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow:
    0 10px 22px rgba(79, 70, 229, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.project-header #fit-frames-btn.is-active:hover,
.project-header #hand-tool-btn.is-active:hover,
.project-header #select-tool-btn.is-active:hover,
.project-header #hand-tool-btn.active:hover,
.project-header #show-description-btn.active:hover,
.project-header #figma-target-settings-btn.is-active:hover,
.project-header #figma-target-settings-btn.active:hover {
  background: linear-gradient(90deg, #4338CA 31%, #4F46E5 100%);
  color: #FFFFFF;
}

.project-header #fit-frames-btn.is-active,
.project-header #hand-tool-btn.is-active,
.project-header #select-tool-btn.is-active {
  background: linear-gradient(90deg, #4F46E5 31%, #6366F1 100%);
  color: #FFFFFF;
}


#project-name-input {
    font-size: 18px;
    font-weight: 600;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    padding: 6px 10px;
    border-radius: 0;
    transition: all 0.2s ease;
    min-width: 120px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

#project-name-input {
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em !important;
    line-height: 1.2 !important;
    color: #111827 !important;
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid #D1D5DB !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

#project-name-input:hover {
    background: #F8FAFC !important;
    border-color: #C7D2FE !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 2px 4px rgba(79, 70, 229, 0.08) !important;
}

#project-name-input:focus {
    background: #FFFFFF !important;
    border-color: #A5B4FC !important;
    box-shadow:
        0 0 0 2px rgba(199, 210, 254, 0.65),
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 2px 6px rgba(79, 70, 229, 0.1) !important;
}

.project-header .figma-export-btn {
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  border: 1px solid #D1D5DB;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 1px 2px rgba(15, 23, 42, 0.04);
}

.project-header .figma-export-btn:hover {
  background: #F8FAFC;
  border-color: #C7D2FE;
  color: #111827;
}

.project-header .figma-export-btn span {
  font-weight: 600;
  letter-spacing: -0.01em;
}


.project-header .save-btn {
  background: linear-gradient(90deg, #4F46E5 31%, #6366F1 100%);
  color: #FFFFFF;
  box-shadow:
    0 10px 22px rgba(79, 70, 229, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.project-header .save-btn:hover {
  background: linear-gradient(90deg, #4338CA 31%, #4F46E5 100%);
  color: #FFFFFF;
}

.project-header .save-btn span {
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* 모드 전환 버튼 스타일 - 기본 icon-btn 스타일 상속 */

/* ====================================================
   3. 사이드바 스타일 (Google Slides식 필름스트립)
   ==================================================== */
.sidebar {
    width: 260px;
    min-width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0; /* 사이드바 크기 고정 */
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--sidebar-text);
    letter-spacing: 0.5px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 0;
    background-color: var(--bg-secondary);
    margin-right: 12px;
}

.logo-icon i {
    color: #6366F1;
    font-size: 16px;
}

.app-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--sidebar-text);
}

.sidebar-section {
    margin-bottom: 28px;
    position: relative; /* sticky 동작을 위한 컨테이너 설정 */
}

.uip-sidebar-pages {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

/* ─── Google Slides식 화면 필름스트립 ─── */
#editor-root .uip-filmstrip,
.uip-filmstrip {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #ffffff;
    color: #111827;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
    scrollbar-color: #D1D5DB #ffffff;
}

#editor-root .uip-filmstrip__toolbar,
.uip-filmstrip__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    padding: 10px 12px 8px;
    border-bottom: 1px solid #E5E7EB;
    background: #ffffff;
}

/* Beat dragdrop.css `#file-list { min-height:100% }` (loaded later, ID-only). */
#editor-root #file-list.uip-filmstrip__list {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1 1 auto;
    padding-top: 8px;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 96px !important; /* beats inline padding-bottom:0 on #file-list */
    background: #ffffff;
}

#editor-root .uip-filmstrip__list {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1 1 auto;
    padding: 8px 10px 96px;
    background: #ffffff;
}

#editor-root .uip-filmstrip__group,
.uip-filmstrip__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 10px;
    flex: 0 0 auto;
}

#editor-root .uip-filmstrip__group-title,
.uip-filmstrip__group-title {
    padding: 8px 6px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6B7280;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
}

#editor-root .uip-filmstrip__item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 8px;
    row-gap: 6px;
    flex: 0 0 auto;
    flex-shrink: 0;
    min-height: unset;
    align-items: start;
    width: 100%;
    padding: 8px 6px;
    border: 2px solid transparent;
    background: transparent;
    color: #111827;
    cursor: pointer;
    border-radius: 0;
    box-sizing: border-box;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
}

#editor-root .uip-filmstrip__item:hover {
    background: #F9FAFB;
}

#editor-root .uip-filmstrip__item.is-active {
    background: #EEF2FF;
    border-color: #6366F1;
}

#editor-root .uip-filmstrip__check {
    display: none;
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
}

#editor-root .uip-filmstrip.is-selecting .uip-filmstrip__check,
#editor-root .uip-filmstrip__item.is-checked .uip-filmstrip__check {
    display: block;
}

#editor-root .uip-filmstrip__item.is-checked {
    border-color: #4F46E5;
    background: #EEF2FF;
}

#editor-root .uip-filmstrip__index {
    grid-column: 1;
    grid-row: 1 / span 2;
    padding-top: 2px;
    color: #6B7280;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-align: right;
}

#editor-root .uip-filmstrip__item.is-active .uip-filmstrip__index {
    color: #4F46E5;
}

#editor-root .uip-filmstrip__thumb {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    min-height: 70px;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 0;
}

#editor-root .uip-filmstrip__thumb img {
    display: none !important;
}

#editor-root .uip-filmstrip__preview {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    pointer-events: none;
    border: 0;
}

#editor-root .uip-filmstrip__preview iframe {
    display: block;
    border: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: #ffffff;
}

#editor-root .uip-filmstrip__name {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#editor-root .uip-filmstrip__item.is-active .uip-filmstrip__name {
    color: #111827;
    font-weight: 600;
}

#editor-root .uip-filmstrip__empty,
.uip-filmstrip__empty {
    padding: 24px 12px;
    color: #6B7280;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    flex: 0 0 auto;
}

/* 기존 페이지 이름 행이 필름스트립 카드와 겹치지 않게 */
#editor-root .uip-filmstrip .file-item {
    padding: 0;
    background: transparent;
}

#editor-root .uip-filmstrip .file-item:hover,
#editor-root .uip-filmstrip .file-item.active {
    background: transparent;
}

#editor-root .uip-filmstrip .file-item.uip-filmstrip__item,
#editor-root .uip-filmstrip .uip-filmstrip__item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 8px;
    row-gap: 6px;
    padding: 8px 6px;
    flex: 0 0 auto;
    flex-shrink: 0;
    min-height: unset;
    align-items: start;
    width: 100%;
}

#editor-root .uip-filmstrip .file-item.uip-filmstrip__item:hover,
#editor-root .uip-filmstrip .uip-filmstrip__item:hover {
    background: #F9FAFB;
}

#editor-root .uip-filmstrip .file-item.uip-filmstrip__item.is-active,
#editor-root .uip-filmstrip .file-item.uip-filmstrip__item.active,
#editor-root .uip-filmstrip .uip-filmstrip__item.is-active,
#editor-root .uip-filmstrip .uip-filmstrip__item.is-checked {
    background: #EEF2FF;
    border-color: #6366F1;
    color: #111827;
}

.section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 12px;
    color: var(--sidebar-section-title);
}

.action-button {
    display: flex;
    align-items: center;
    background-color: #6366F1;
    color: white;
    border: none;
    border-radius: 0;
    padding: 8px 12px;
    width: 100%;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.2s;
    font-weight: 500;
}

.action-button:hover {
    background-color: #6366F1;
}

.action-button i {
    margin-right: 8px;
    font-size: 14px;
}

.hide-sidebar-btn {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 0;
    transition: background 0.2s;
}

.hide-sidebar-btn:hover {
    background: var(--sidebar-hover);
}

/* 파일 아이템 스타일 */
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 0;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    color: var(--sidebar-text);
    min-height: 32px;
    scroll-margin-top: 110px;
}

.file-item:hover {
    background-color: var(--sidebar-hover);
}

.file-item:active {
    background-color: var(--selected-item-bg);
    transform: scale(0.99);
}

.file-item.active {
    background-color: var(--selected-item-bg);
    color: var(--highlight-color);
    font-weight: 500;
}

.file-item.active .file-item-left i,
.file-item.active .file-item-left svg {
    color: var(--highlight-color);
    stroke: var(--highlight-color);
}

.file-item-left {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: calc(100% - 40px);
    overflow: hidden;
}

.file-item-left i {
    margin-right: 6px;
    color: var(--sidebar-icon);
    flex-shrink: 0;
}

/* 파일명 텍스트 2줄 표시 */
.file-item-left .file-name,
.file-item-left span {
    font-size: 13px;
    white-space: normal;
    overflow: hidden;
    word-break: break-word;
    line-height: 1.3;
    max-height: 2.6em; /* 2줄 제한 (line-height * 2) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1; /* flex 컨테이너에서 남은 공간 차지 */
    min-width: 0; /* flex 아이템이 축소될 수 있도록 */
    margin-right: 8px; /* 메뉴 버튼과의 여백 확보 */
}

.file-item-actions {
    display: flex;
    align-items: center;
    padding-top: 2px; /* 버튼을 약간 아래로 이동 */
}

.file-action-btn {
    background: none;
    border: none;
    color: var(--sidebar-icon);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    margin-left: 6px;
    border-radius: 0;
    transition: all 0.2s;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-action-btn:hover {
    background-color: var(--sidebar-hover);
    color: var(--highlight-color);
}

.reference-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 0;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    color: var(--sidebar-text);
}

.reference-item:hover {
    background-color: var(--sidebar-hover);
}

.reference-item i {
    margin-right: 8px;
    font-size: 14px;
    color: var(--sidebar-icon);
}

/* WebKit 브라우저용 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 0
}

::-webkit-scrollbar-thumb:hover {
    background: var(--highlight-color);
    opacity: 0.7;
}

/* 사이드바 영역의 스크롤바 스타일 */
.sidebar-section::-webkit-scrollbar {
    width: 4px;
}

.sidebar-section::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.sidebar-section::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 0
}

/* ====================================================
   4. 메인 콘텐츠 영역
   ==================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #F5F5F5;
    height: 100%;
    overflow: hidden;
    min-width: 0; /* flexbox 축소 방지 */
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #fff;
    border-bottom: 1px solid #EBEBEB;
    height: 49px;
}

.file-info {
    display: flex;
    align-items: center;
}

.file-icon {
    color: #6366F1;
    margin-right: 10px;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-buttons > button {
    height: 32px;
    box-sizing: border-box;
    background-color: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    padding: 0 12px;
    font-size: 13px;
    cursor: pointer;
    margin-left: 0;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
    color: #374151;
}

.action-buttons > button:hover {
    background-color: #F9FAFB;
    border-color: #D1D5DB;
    color: #111827;
}

.action-buttons > button.primary {
    background-color: #6366F1;
    color: white;
    border-color: #6366F1;
}

.action-buttons > button.primary:hover {
    background-color: #4F46E5;
}

.uip-toolbar-context-menu {
    position: relative;
}

.uip-toolbar-context-menu__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    box-sizing: border-box;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    list-style: none;
    white-space: nowrap;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.uip-toolbar-context-menu__trigger::-webkit-details-marker {
    display: none;
}

.uip-toolbar-context-menu__trigger::marker {
    content: "";
}

.uip-toolbar-context-menu__trigger:hover,
.uip-toolbar-context-menu[open] .uip-toolbar-context-menu__trigger {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #111827;
}

.uip-toolbar-context-menu__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    padding: 4px 0;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    z-index: 80;
}

.uip-toolbar-context-menu__item {
    width: 100%;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #374151;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.uip-toolbar-context-menu__item:hover {
    background: #F9FAFB;
    color: #111827;
}

.uip-toolbar-context-menu__item.is-linked {
    color: #4F46E5;
}

.preview-container {
    flex: 1;
    padding: 0;
    overflow: hidden;
    position: relative;
    background-color: #E8EAED;
    background-image: none;
    min-width: 0;
    min-height: 0;
    cursor: default;
}

#editor-root .preview-container,
#editor-root .uip-stage {
    background-color: #E8EAED;
    background-image: none;
}

.canvas-viewport {
    position: relative;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    isolation: isolate;
}

/* ─── 멀티 프레임 캔버스 ─────────────────────────────────── */
.canvas-frames-wrapper,
.canvas-stage {
    position: absolute;
    inset: 0 auto auto 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform-origin: 0 0;
    contain: layout style;
}

#editor-root .uip-stage__world,
#editor-root .canvas-frames-wrapper.uip-stage__world,
#editor-root .canvas-stage.uip-stage__world {
    width: auto;
    height: auto;
    min-width: auto;
    min-height: auto;
    will-change: auto;
}

#editor-root .uip-stage__world > .canvas-frame {
    position: absolute;
}

#editor-root .uip-stage .canvas-frame__body {
    background-color: #ffffff;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15), 0 4px 8px rgba(60, 64, 67, 0.08);
}

#editor-root .uip-stage .canvas-frame__header {
    color: #6B7280;
}

#editor-root .uip-stage .canvas-frame.active .canvas-frame__header {
    color: #4F46E5;
}

#editor-root .uip-stage .canvas-frame__name:focus {
    color: #111827;
    background: #ffffff;
}

.canvas-frame {
    position: absolute;
    display: flex;
    flex-direction: column;
    cursor: default;
    overflow: visible;
    user-select: none;
    contain: layout style;
}

.canvas-frame-node {
    position: absolute;
}

.canvas-frame__header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 0 8px 0;
    color: #9ca3af;
    font-size: 12px;
    font-family: 'Pretendard Variable', sans-serif;
    user-select: none;
    cursor: move;
}

.canvas-frame.active .canvas-frame__header {
    color: #818cf8;
}

.canvas-frame--master-source .canvas-frame__header {
    color: #6366F1;
}

.canvas-frame--dragging {
    z-index: 12;
}

.canvas-frame--dragging .canvas-frame__body {
    outline: 2px solid #818cf8;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.18);
}

/* 멀티 선택 상태 */
.canvas-frame--selected .canvas-frame__body {
    outline: 2px dashed #6366F1;
    outline-offset: -2px;
}

.canvas-frame--selected .canvas-frame__header {
    color: #6366F1;
    background: rgba(99, 102, 241, 0.04);
}

/* 멀티 선택 바운딩 박스 (Figma 스타일) */
.canvas-multi-selection {
    position: absolute;
    pointer-events: none;
    z-index: 13;
    border: 2px solid #6366F1;
    box-sizing: border-box;
}

.canvas-multi-selection__handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border: 2px solid #6366F1;
    box-sizing: border-box;
}

.canvas-multi-selection__handle--tl { top: -6px; left: -6px; }
.canvas-multi-selection__handle--tr { top: -6px; right: -6px; }
.canvas-multi-selection__handle--bl { bottom: -6px; left: -6px; }
.canvas-multi-selection__handle--br { bottom: -6px; right: -6px; }

.canvas-multi-selection__label {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 10px;
    background: #6366F1;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Pretendard Variable', sans-serif;
    white-space: nowrap;
    line-height: 1.2;
}

.canvas-frame__name {
    outline: none;
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 2px 4px;
    min-width: 20px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.canvas-frame__name:focus {
    cursor: text;
    color: #e5e7eb;
    background: rgba(255,255,255,0.08);
    overflow: visible;
    text-overflow: unset;
}

.canvas-frame__size-label {
    color: #6b7280;
    font-size: 11px;
    flex-shrink: 0;
}

.canvas-frame__master-badge {
    display: none;
    align-items: center;
    height: 18px;
    padding: 0 6px;
    border: 1px solid #6366F1;
    background: rgba(99, 102, 241, 0.10);
    color: #4F46E5;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
}

.canvas-frame--master-source .canvas-frame__master-badge {
    display: inline-flex;
}

.canvas-frame__menu-btn {
    background: none !important;
    border: none !important;
    color: #6b7280;
    cursor: pointer;
    padding: 2px !important;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.canvas-frame:hover .canvas-frame__menu-btn {
    opacity: 1;
}

.canvas-frame__menu-btn:hover {
    color: #e5e7eb !important;
}

.canvas-frame__body {
    background-color: #fff;
    position: relative;
    isolation: isolate;
    flex-shrink: 0;
    overflow: hidden;
    transition: outline 0.1s;
}

.canvas-frame.active .canvas-frame__body {
    outline: 2px solid #6366F1;
}

.canvas-frame__body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    position: relative;
    z-index: 0;
}

.frame-thumbnail {
    width: 100%;
    min-height: inherit;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 30px;
    background: #ffffff;
    color: #9ca3af;
    font-family: 'Pretendard Variable', sans-serif;
    pointer-events: none;
}

.frame-thumbnail__bar {
    width: 34%;
    height: 12px;
    background: #111827;
}

.frame-thumbnail__hero {
    width: 100%;
    height: 28%;
    min-height: 120px;
    background: #e5e7eb;
}

.frame-thumbnail__lines {
    display: grid;
    gap: 10px;
    width: 52%;
}

.frame-thumbnail__lines span {
    display: block;
    height: 8px;
    background: #e5e7eb;
}

.frame-thumbnail__lines span:nth-child(2) {
    width: 78%;
}

.frame-thumbnail__lines span:nth-child(3) {
    width: 56%;
}

.frame-thumbnail__caption {
    margin-top: auto;
    max-width: 70%;
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 프레임 스냅샷(비트맵) — 스켈레톤 대신 실제 UI 모습 (피그마식) */
.frame-thumbnail--snapshot {
    display: block;
    padding: 0;
    gap: 0;
}

.frame-snapshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    pointer-events: none;
}

.canvas-frame[data-render-state="thumbnail"] .canvas-frame__body,
.canvas-frame[data-render-state="unloaded"] .canvas-frame__body,
.canvas-frame[data-render-state="snapshot"] .canvas-frame__body,
.canvas-frame[data-render-state="loading"] .canvas-frame__body {
    background: #ffffff;
}

.canvas-frame[data-render-state="thumbnail"],
.canvas-frame[data-render-state="snapshot"],
.canvas-frame[data-render-state="unloaded"] {
    /* content-visibility:auto 금지 — 스케일된 캔버스에서 브라우저의 가시성 재판정이
       팬/줌을 늦게 따라와 프레임이 통째로 사라졌다 나타나는 팝인을 유발한다.
       원래 목적(리페인트 격리)은 contain으로 유지한다. */
    contain: content;
}

.canvas-frame[data-render-state="loading"] .canvas-frame__body::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.08), transparent);
    animation: frame-thumbnail-shimmer 1.2s linear infinite;
    pointer-events: none;
}

@keyframes frame-thumbnail-shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* 생성 중 스켈레톤 프레임(가상화로 라이브 iframe이 아닌 상태)용 로딩 카드 — 줌아웃에서도 읽히도록 전체 너비 인디고 진행바 */
.frame-thumbnail--loading {
    justify-content: center;
    gap: 14px;
    background: #F9FAFB;
    color: #111827;
}

.frame-thumbnail__loading-kicker {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: .04em;
    color: #4F46E5;
}

.frame-thumbnail__loading-title {
    font-size: 40px;
    font-weight: 850;
    line-height: 1.2;
    color: #111827;
}

.frame-thumbnail__loading-copy {
    font-size: 22px;
    color: #6B7280;
}

.frame-thumbnail__loading-bar {
    position: relative;
    height: 16px;
    background: #EEF2FF;
    overflow: hidden;
    width: 100%;
}

.frame-thumbnail__loading-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    width: 45%;
    background: linear-gradient(90deg, #4F46E5, #6366F1);
    animation: frame-thumbnail-loadbar 1.3s ease-in-out infinite;
}

@keyframes frame-thumbnail-loadbar {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(230%); }
}

.canvas-stage-empty {
    position: absolute;
    top: 40px;
    left: 40px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 320px;
    min-width: 280px;
    max-width: 320px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #E5E7EB;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    color: #374151;
    z-index: 2;
}

.canvas-stage-empty__title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.canvas-stage-empty__text {
    font-size: 12px;
    line-height: 1.6;
    color: #6B7280;
}

.canvas-hand-mode,
.canvas-hand-mode * {
    cursor: grab !important;
}

.canvas-hand-mode.canvas-panning,
.canvas-hand-mode.canvas-panning * {
    cursor: grabbing !important;
}

.canvas-frame__body iframe {
    pointer-events: none;
}

body.uip-zoom-modifier-active .canvas-frame__body iframe,
body.uip-zoom-modifier-active iframe.frame-iframe,
body.uip-zoom-modifier-active #preview-iframe,
body.uip-zoom-modifier-active.klavy-picker-active .canvas-frame__body iframe,
body.uip-zoom-modifier-active.klavy-picker-active iframe.frame-iframe,
body.uip-zoom-modifier-active.klavy-picker-active #preview-iframe {
    pointer-events: none !important;
}

/* 인라인 편집이 다시 필요해지면 아래 escape hatch만 열기:
.canvas-frame.is-editing .canvas-frame__body iframe { pointer-events: auto; }
*/
/* ─────────────────────────────────────────────────────────── */

.phone-frame {
    width: 360px;
    min-height: 640px;
    max-height: 5000px;
    height: auto;
    background-color: #fff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    position: relative;
    transition: transform 0.3s ease;
    border: none;
    display: flex;
    flex-direction: column;
    transform-origin: center center;
    flex-shrink: 0; /* 캔버스 크기 고정 */
}

.phone-frame.auto-height {
    height: auto;
    min-height: 100px;
}

iframe {
    width: 100%;
    height: 100%;
    min-height: 640px;
    border: none;
    flex: 1;
    overflow: hidden;
}

/* 파일 제목 스타일 */
#current-file-title {
    font-size: 14px;
    font-weight: 500;
    color: #16161D;
    outline: none;
    padding: 4px 8px;
    border-radius: 0;
    transition: all 0.2s;
    cursor: default;
}

#current-file-title:hover {
    background-color: rgba(99,102,241,0.08);
}

#current-file-title:focus {
    background-color: rgba(99,102,241,0.12);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.25);
}

/* iframe 내 요소 컨트롤 패널 숨기기 */
.element-controls {
    display: none !important;
}

/* ====================================================
   5. 툴바 및 패널
   ==================================================== */
/* 툴바 영역 */
.component-toolbar-container {
    position: fixed;
    bottom: 0;
    left: 240px;
    right: 320px;
    width: auto;
    height: 56px;
    border-top: 1px solid #EBEBEB;
    background-color: #fff;
    z-index: 100;
}

.component-toolbar-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 컴포넌트 툴바 스타일 */
.component-toolbar {
    display: flex;
    background-color: white;
    border-top: 1px solid #EBEBEB;
    padding: 12px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 16px;
    height: 56px;
    align-items: center;
    width: 100%;
}

.component-toolbar::-webkit-scrollbar {
    height: 4px;
}

.component-toolbar::-webkit-scrollbar-track {
    background: #F5F5F5;
}

.component-toolbar::-webkit-scrollbar-thumb {
    background: #EBEBEB;
    border-radius: 0
}

.component-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 6px;
    border-radius: 0;
    cursor: pointer;
    min-width: 64px;
    text-align: center;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.component-item:hover {
    background-color: #F5F5F5;
    border: 1px solid #EBEBEB;
}

.component-item:active {
    transform: translateY(1px);
}

.component-icon i {
    font-size: 16px;
}

/* 컴포넌트 미리보기 스타일 */
.component-preview {
    width: 100%;
    height: auto;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.component-preview-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 미리보기 아이콘 스타일 */
.preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 0;
    background-color: #F5F5F5;
    color: #16161D;
    margin: 8px 0;
}

.preview-icon i {
    font-size: 20px;
}

.empty-preview {
    color: #999;
    font-size: 12px;
    text-align: center;
}

/* 저장된 컴포넌트 정보 스타일 */
.component-info {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 8px;
}

.component-name {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.component-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 0;
    padding: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.saved-component-item:hover .component-actions {
    opacity: 1;
}

.edit-component-btn,
.delete-component-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.edit-component-btn:hover,
.delete-component-btn:hover {
    color: #6366F1;
}

.delete-component-btn:hover {
    color: #EF4444;
}

/* 저장된 컴포넌트 섹션 */
.saved-components-section {
    margin-top: 20px;
}

.saved-components-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.saved-component-item {
    border: 1px solid #EBEBEB;
    border-radius: 0;
    padding: 12px;
    background-color: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.saved-component-item:hover {
    border-color: #6366F1;
    background-color: #F9F9F9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.saved-component-item.deleting {
    opacity: 0.5;
    pointer-events: none;
}

/* 탭 스타일 */
.tab-container {
    display: flex;
    border-bottom: 1px solid #EBEBEB;
    background-color: #fff;
}

.tab-button {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    font-weight: 500;
    color: #666666;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-button:hover {
    color: #6366F1;
}

.tab-button.active {
    color: #6366F1;
    border-bottom: 2px solid #6366F1;
}

/* 화면 유형 선택기 */
.screen-type-selector {
    padding: 6px 12px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    margin-right: 10px;
    font-size: 13px;
    color: #16161D;
    background-color: #fff;
    transition: all 0.2s;
    display: none;
}

.screen-type-selector:hover {
    border-color: #6366F1;
}

.screen-type-selector:focus {
    outline: none;
    border-color: #6366F1;
}

#custom-size-controls {
    display: none;
    align-items: center;
    margin-right: 10px;
    gap: 6px;
}

#custom-size-controls input {
    width: 60px;
    padding: 6px 10px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    font-size: 13px;
}

#custom-size-controls input:focus {
    outline: none;
    border-color: #6366F1;
}

/* 컴포넌트 패널 스타일 */
.components-panel {
    width: 280px;
    min-width: 280px;
    background-color: #fff;
    border-left: 1px solid #EBEBEB;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: width 0.3s ease;
    overflow: hidden;
    z-index: 9;
}

.components-panel.collapsed {
    min-width: 0;
    width: 0;
}

.component-category-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.component-category {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
}

.component-category i {
    margin-right: 8px;
    font-size: 14px;
    color: #666666;
}

.component-category span {
    font-size: 13px;
    color: #16161D;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.component-category:hover {
    background-color: #F5F5F5;
}

.component-category.active {
    background-color: #F5F5F5;
    font-weight: 500;
    color: #6366F1;
}

.component-category.active i,
.component-category.active span {
    color: #6366F1;
}

.component-subcategory-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.component-subcategory-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border-radius: 0;
    border: 1px solid #EBEBEB;
    cursor: pointer;
    transition: all 0.2s;
}

.component-subcategory-item:hover {
    background-color: #F5F5F5;
    border-color: #6366F1;
}

.component-subcategory-item .component-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    border-radius: 0;
    background-color: #F5F5F5;
    color: #16161D;
}

.component-subcategory-item .component-label {
    font-size: 12px;
    color: #16161D;
    text-align: center;
}

.panel-header {
    padding: 0 16px;
    border-bottom: 1px solid #EBEBEB;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #FAFAFA;
    height: 56px;
}

.panel-title {
    font-size: 14px;
    font-weight: 700;
    color: #16161D;
}

.panel-toggle-btn {
    background: none;
    border: none;
    color: #666666;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0
}

.panel-toggle-btn:hover {
    background-color: #F5F5F5;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: calc(100% - 64px);
}

/* 속성 패널 섹션 스타일 개선 */
.property-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #EBEBEB; /* 섹션 구분선 추가 */
}

.property-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.property-section h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666666;
    margin-bottom: 12px;
    font-weight: 600;
}

.property-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.property-row:last-child {
    margin-bottom: 0;
}

.property-row label {
    font-size: 14px;
    margin-bottom: 6px;
    color: #333;
}

.property-row select,
.property-row input[type="number"],
.property-row input[type="text"] {
    flex: 1;
    width: 100%; /* 전체 너비 사용 */
    padding: 8px 10px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    font-size: 13px;
    height: 36px; /* 높이 통일 */
}

.property-row input[type="color"] {
    width: 36px;
    height: 36px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    padding: 2px;
    background-color: #fff;
}

/* 버튼 그룹 스타일 개선 */
.button-group {
    display: flex;
    gap: 8px;
    width: 100%; /* 전체 너비 사용 */
    justify-content: space-between; /* 버튼 간격 균등 배분 */
}

.style-btn {
    flex: 1; /* 버튼이 동일한 크기를 갖도록 설정 */
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    color: #666666;
    cursor: pointer;
    transition: all 0.2s;
}

.style-btn:hover {
    background-color: #F5F5F5;
}

.style-btn.active {
    background-color: #6366F1;
    color: white;
    border-color: #6366F1;
}

/* 테두리 스타일 버튼 */
.border-style-btn {
    padding: 0 4px;
    font-size: 12px;
    white-space: nowrap;
    min-width: 40px;
    flex-shrink: 0;
}

/* 컨트롤 컨테이너에 있는 경우 border-style-btn 스타일 조정 */
.controls-container .border-style-btn {
    width: auto;
    min-width: 40px;
    flex: 1;
}

/* 입력 필드와 단위 포함한 행 스타일 개선 */
.input-with-unit {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 70px;
    max-width: 100px;
}

.input-with-unit input {
    flex: 1;
    border-radius: 0;
    height: 36px; /* 높이 통일 */
}

/* px 단위가 제거된 입력 필드는 테두리가 완전한 형태여야 함 */
.controls-container .input-with-unit {
    flex: 1;
}

.input-with-unit .unit {
    padding: 8px 10px;
    height: 36px; /* 높이 통일 */
    background-color: #F5F5F5;
    border: 1px solid #EBEBEB;
    border-left: none;
    border-radius: 0;
    font-size: 13px;
    color: #666666;
    display: flex;
    align-items: center;
}

/* 색상 표시 영역 스타일 개선 */
.color-display {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1.5; /* flex-grow 값을 2에서 1.5로 감소 */
    width: 100%; /* 전체 너비 사용 */
}

/* 새로 추가하는 색상 컨트롤 관련 스타일 */
.color-controls-row {
    display: flex;
    width: 100%;
    gap: 12px;
    align-items: center;
}

.color-controls-row .color-display {
    flex: 1.7; /* flex-grow 값을 2에서 1.7로 더 감소 */
    margin-bottom: 0;
}

.opacity-control {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1; /* flex-grow 값을 0.8에서 1로 증가 */
    color: #333;
}

/* .opacity-label {
    font-size: 11px;
    color: #555;
    white-space: nowrap;
    margin-right: 4px;
} */

.opacity-value {
    width: 70px;
    text-align: right;
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 13px;
}

.opacity-percent {
    font-size: 12px;
    color: #555;
}

.color-box {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    background-color: #fff;
    cursor: pointer;
}

.color-value {
    flex: 1;
    height: 36px; /* 높이 통일 */
    padding: 8px 10px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    font-size: 12px;
    font-family: 'Roboto Mono', monospace;
    width: calc(100% - 44px);
}

/* 전체 너비 버튼 스타일 개선 */
.full-width-btn {
    width: 100%;
    padding: 10px 12px;
    height: 40px; /* 버튼 높이 증가 */
    background-color: #F5F5F5;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    font-size: 13px;
    color: #16161D;
    cursor: pointer;
    transition: all 0.2s;
}

.full-width-btn:hover {
    background-color: #EBEBEB;
}

.full-width-btn i {
    margin-right: 6px;
}

/* 디스크립션 패널 스타일 */
.description-panel {
    width: 320px;
    min-width: 320px;
    max-width: 400px;
    background-color: #fff;
    border-left: 1px solid #EBEBEB;
    border-right: 1px solid #EBEBEB;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: width 0.3s ease;
    overflow: hidden;
    z-index: 10;
    flex-shrink: 0; /* 디스크립션 패널 크기 고정 */
}

.description-panel.collapsed {
    min-width: 0;
    max-width: 0;
    width: 0;
}

.description-container .phone-frame {
    width: 100%;
    height: calc(100vh - 104px); /* 컨테이너 패딩을 제외한 높이 */
    border: 1px solid #E4E4E4;
    border-radius: 0;
    background: #ffffff;
    overflow: hidden;
    position: relative;
}

.description-container iframe {
    width: 100%;
    height: calc(100vh - 160px); /* 헤더(56px)와 여백을 고려한 높이 */
    border: none;
    background: #ffffff;
}

.description-panel .loading-spinner {
    display: none !important;
}

.description-panel .save-button, 
.description-panel [class*="save-btn"],
.description-panel button[class*="save"] {
    display: none !important;
}

.description-actions {
    padding: 16px;
    border-top: 1px solid #E4E4E4;
}

#save-description-btn {
    display: none !important;
}

#save-description-btn:hover {
    background-color: #4F46E5;
}

.description-btn.active {
    color: #6366F1;
    opacity: 1;
}

.panel-toggle-btn.description-panel-toggle {
    width: 24px;
    height: 24px;
    color: #666666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin-left: auto;
}

.panel-toggle-btn.description-panel-toggle:hover {
    background-color: #EEEEEE;
}

.description-panel .panel-content {
    flex: 1;
    height: 100% !important; /* 전체 높이 사용 */
    overflow: auto !important;
    display: flex !important; /* flex로 복원 */
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
}

.description-container iframe body {
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

.description-container .loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: none !important; /* 항상 숨김 처리 */
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.description-header {
    height: 56px;
    border-bottom: 1px solid #E4E4E4;
    background-color: #ffffff;
}

.description-header h1 {
    margin: 0;
    padding-left: 20px;
    font-size: 24px;
    font-weight: 600;
    line-height: 56px;
    color: #1f2937;
}

/* === 요소 편집 패널 (내용 스타일은 ui-planning-element-edit-panel.css) === */
#ep-element-edit-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 320px;
    min-width: 320px;
    background-color: #fff;
    border-left: 1px solid #EBEBEB;
    height: 100%;
    max-height: 100%;
    transition: width 0.3s ease;
    overflow: hidden;
    z-index: 11;
    flex-shrink: 0;
    min-height: 0;
}

#ep-element-edit-panel.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-left: 0;
    overflow: hidden;
}

/* ====================================================
   6. 채팅 영역
   ==================================================== */
.chat-container {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 320px;
    min-width: 320px;
    background-color: #fff;
    border-left: 1px solid #EBEBEB;
    height: 100%;
    max-height: 100%;
    transition: width 0.3s ease;
    overflow: hidden;
    z-index: 11;
    flex-shrink: 0; /* 채팅 패널 크기 고정 */
    min-height: 0;
}

.chat-container.collapsed {
    width: 0 !important;
    min-width: 0;
    border-left: 0;
    overflow: hidden;
}

.project-comments__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 320px;
    min-width: 320px;
    height: 100%;
    max-height: 100%;
    background-color: #fff;
    border-left: 1px solid #EBEBEB;
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    overflow: hidden;
    transition-property: width, min-width, border-color;
    transition-duration: 0.3s;
    transition-timing-function: ease;
    flex-shrink: 0;
    min-height: 0;
}

.project-comments__panel.collapsed {
    width: 0 !important;
    min-width: 0;
    border-left: 0;
    overflow: hidden;
}

.project-comments__header {
    flex: 0 0 auto;
    padding: 12px 16px;
    border-bottom: 1px solid #EBEBEB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-comments__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.project-comments__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    transition-property: color, background-color;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.project-comments__close:hover {
    background-color: #F9FAFB;
    color: #111827;
}

.project-comments__status {
    flex: 0 0 auto;
    min-height: 0;
    margin: 0;
    padding: 0 16px;
    color: #6B7280;
    font-size: 12px;
    line-height: 1.5;
}

.project-comments__status:not(:empty) {
    padding-top: 10px;
}

.project-comments__list {
    flex: 1 1 auto;
    min-height: 0;
    list-style: none;
    padding: 16px;
    margin: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-comments__item {
    padding: 10px 12px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    border-radius: 0;
}

.project-comments__author {
    display: block;
    margin-bottom: 4px;
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    word-break: break-word;
}

.project-comments__body {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.project-comments__form {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid #EBEBEB;
    background: #fff;
}

.project-comments__label {
    color: #374151;
    font-size: 12px;
    font-weight: 700;
}

.project-comments__input {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #E5E7EB;
    font-size: 13px;
    line-height: 1.5;
    font-family: inherit;
    resize: vertical;
    border-radius: 0;
    transition-property: border-color, box-shadow;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.project-comments__input:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.project-comments__submit {
    align-self: flex-end;
    min-height: 36px;
    padding: 0 16px;
    background: #6366F1;
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0;
    transition-property: background-color, transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.project-comments__submit:hover {
    background: #4F46E5;
}

.project-comments__submit:active {
    transform: scale(0.96);
}

.project-comments__readonly {
    flex: 0 0 auto;
    padding: 12px 16px 16px;
    border-top: 1px solid #EBEBEB;
    font-size: 12px;
    color: #6B7280;
    margin: 0;
}

.chat-header {
    flex: 0 0 auto;
    padding: 12px 16px;
    border-bottom: 1px solid #EBEBEB;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 49px;
}
.chat-actions button:hover { color: #374151 !important; }
.chat-history-item:hover { background: #F9FAFB; }

.chat-title {
    font-size: 14px;
    color: #16161D;
    display: flex;
    align-items: center;
}

/* 환영 메시지 */
.uip-welcome-msg {
    padding: 20px 16px;
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}
.uip-welcome-msg p {
    margin: 0 0 8px 0;
}
.uip-welcome-msg strong {
    color: #111827;
}
.uip-welcome-label {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    margin: 12px 0 8px;
}
.uip-quick-btn {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    background: #FFFFFF;
    color: #374151;
    border: 1px solid #D1D5DB;
    cursor: pointer;
    margin: 2px;
    font-family: inherit;
}
.uip-quick-btn:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
    color: #111827;
}

.uip-quick-btn.uip-template-library-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #EEF2FF;
    border-color: #C7D2FE;
    color: #4338CA;
    font-weight: 700;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.uip-quick-btn.uip-template-library-btn:hover {
    background: #E0E7FF;
    border-color: #A5B4FC;
    color: #3730A3;
}

.uip-quick-btn.uip-template-library-btn:active {
    transform: scale(0.96);
}

.chat-actions {
    display: flex;
}

.chat-actions button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666666;
    margin-left: 2px;
    transition: color 0.2s;
}

.chat-actions button:hover {
    color: #6366F1;
}

#reset-chat-btn {
    transition: all 0.3s ease;
}

#reset-chat-btn:hover {
    color: #6366F1;
    transform: rotate(180deg);
}

.chat-messages {
    flex: 1;
    min-height: 0; /* flex item이 콘텐츠 크기 이하로 줄어들 수 있게 */
    padding: 16px 16px 40px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #FAFAFA;
    min-width: 0;
    scrollbar-gutter: stable;
}

.chat-decision-panel {
    display: none;
    flex: 0 0 auto;
    max-height: min(280px, 42%);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 16px;
    border-top: 1px solid #EBEBEB;
    background-color: #FFFFFF;
}

.chat-decision-panel.is-visible {
    display: block;
}

.message {
    display: block;
    padding: 0;
    border-radius: 0;
    max-width: 100%;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
    min-width: 0;
}

.message-content {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 12px 16px;
    line-height: 1.6;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.message-content h1,
.message-content h2,
.message-content h3 {
    margin: 10px 0 4px;
    font-weight: 600;
    line-height: 1.4;
}

.message-content h1 { font-size: 15px; }
.message-content h2 { font-size: 14px; }
.message-content h3 { font-size: 13px; }

.message-content p {
    margin: 4px 0;
}

.message-content ul,
.message-content ol {
    margin: 4px 0;
    padding-left: 18px;
}

.message-content li {
    margin: 2px 0;
}

.message-content strong { font-weight: 600; }
.message-content em { font-style: italic; }
.message-content code {
    font-family: monospace;
    font-size: 12px;
    background: #f4f4f8;
    padding: 1px 4px;
}
.message-content pre {
    background: #f4f4f8;
    padding: 8px 12px;
    overflow-x: auto;
    font-size: 12px;
    margin: 6px 0;
}

.message-content > :first-child {
    margin-top: 0;
}

.message-content > :last-child {
    margin-bottom: 0;
}

.user-message {
    align-self: flex-end;
    background-color: #6366F1;
    color: white;
    border-bottom-right-radius: 2px;
    max-width: 85%;
}

.ai-message {
    align-self: flex-start;
    background-color: #fff;
    color: #16161D;
    border-bottom-left-radius: 2px;
    border: 1px solid #EBEBEB;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.image-message {
    padding: 8px;
}

.image-message img {
    max-width: 100%;
    border-radius: 0
}

.chat-input-container {
    flex: 0 0 auto;
    flex-shrink: 0; /* 입력 영역이 압축되지 않도록 보호 */
    padding: 16px;
    border-top: 1px solid #EBEBEB;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    position: relative;
    z-index: 1;
    overflow: visible; /* 모델 드롭다운이 위로 펼쳐지므로 visible 유지 */
}

.chat-input-wrapper {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    overflow: visible;
    transition: border-color 0.2s ease;
}

.chat-input-wrapper:focus-within {
    border-color: #6366F1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}

/* 입력창 하단 영역 */
.chat-input-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid #f0f0f0;
    overflow: visible;
    border-radius: 0
}

/* 프로젝트 규칙 토글 버튼 */
.chat-input-left-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: visible;
}

/* 사고 깊이 선택기 스타일 */
.think-depth__wrapper {
    position: relative;
    display: inline-block;
    z-index: 999999;
}

.think-depth__btn {
    /* 우측 .chat-input-buttons 버튼(28px)과 같은 높이로 정렬 */
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    background-color: transparent;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 12px;
    padding: 0 8px;
    font-weight: 600;
    white-space: nowrap;
}

.think-depth__btn:hover,
.think-depth__btn.active {
    border-color: #6366F1;
    color: #6366F1;
}

.think-depth__btn svg:last-of-type {
    transition: transform 0.2s ease;
}

.think-depth__btn.active svg:last-of-type {
    transform: rotate(180deg);
}

.think-depth__dropdown {
    position: absolute;
    bottom: 100%;
    left: auto;
    right: 0;
    width: max-content;
    min-width: 112px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 999999;
    margin-bottom: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.think-depth__dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.think-depth__header {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #6B7280;
    line-height: 1.3;
}

.think-depth__option {
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.2s ease;
}

.think-depth__option:hover {
    background-color: #f5f5f5;
}

.think-depth__option.selected {
    background-color: rgba(99,102,241,0.1);
}

.think-depth__option-title {
    font-size: 13px;
    color: #374151;
    font-weight: 600;
    line-height: 1.3;
}

.think-depth__option.selected .think-depth__option-title {
    color: #6366F1;
}

.project-rules-toggle-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.project-rules-toggle {
    height: 32px;
    display: flex;
    align-items: stretch;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    background-color: #FFFFFF;
    box-sizing: border-box;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.project-rules-toggle__open,
.project-rules-toggle__state {
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    margin: 0;
    transition:
        color 0.18s ease,
        background-color 0.18s ease;
}

.project-rules-toggle__open {
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}

.project-rules-toggle__state {
    min-width: 48px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: #6B7280;
    font-variant-numeric: tabular-nums;
}

.project-rules-toggle__divider {
    width: 1px;
    background: #E5E7EB;
    flex-shrink: 0;
    margin: 0;
}

.project-rules-toggle .toggle-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.custom-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    padding: 4px 8px;
    background-color: #333;
    color: white;
    font-size: 11px;
    border-radius: 0;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 999999;
}

.custom-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: #333;
}

.project-rules-toggle-wrapper:hover .custom-tooltip {
    opacity: 1;
    visibility: visible;
}

.project-rules-toggle:hover {
    background-color: #F9FAFB;
    border-color: #D1D5DB;
}

.project-rules-toggle:hover .project-rules-toggle__open {
    color: #111827;
}

.project-rules-toggle.active {
    border-color: #E5E7EB;
}

.project-rules-toggle.active .project-rules-toggle__open {
    color: #374151;
}

.project-rules-toggle.active .project-rules-toggle__state {
    background: #EEF2FF;
    color: #4F46E5;
}

.project-rules-toggle.active:hover {
    border-color: #D1D5DB;
}

.uip-rules-sidebar-expanded {
    width: 540px;
    min-width: 540px;
}

.uip-rules-sidebar-section {
    position: relative;
}

.uip-rules-panel-host {
    position: relative;
    height: 100%;
    min-height: 320px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #E5E7EB;
}

.uip-rules-collapsed-toggle {
    padding: 8px 0;
}

.uip-rules-collapsed-toggle__button {
    width: 100%;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #111827;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.uip-left-rules-overlay {
    position: absolute;
}

.uip-left-rules-overlay.is-split {
    flex-direction: row;
}

.ba-rule-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    color: #9CA3AF;
    font-size: 13px;
    text-align: center;
}

.ba-quick-btn {
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #E5E7EB;
    color: #374151;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, color 0.15s;
}

.ba-quick-btn:hover {
    border-color: #6366F1;
    color: #6366F1;
}

.ba-rule-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #F3F4F6;
    cursor: pointer;
    transition: background 0.1s;
}

.ba-rule-item:hover {
    background: #F9FAFB;
}

.ba-rule-item--inactive {
    opacity: 0.5;
}

.ba-rule-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ba-rule-item-preview {
    font-size: 11px;
    color: #6B7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.ba-rule-delete-btn {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.ba-rule-delete-btn:hover {
    color: #EF4444;
}

.ba-chk-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.ba-chk-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ba-chk-box {
    width: 14px;
    height: 14px;
    border: 1px solid #D1D5DB;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.ba-chk-input:checked + .ba-chk-box {
    background: #6366F1;
    border-color: #6366F1;
}

.ba-chk-input:checked + .ba-chk-box::after {
    content: '';
    width: 8px;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") center/contain no-repeat;
}

.ba-rules-page-btn {
    padding: 4px 8px;
    border: 1px solid #E5E7EB;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    color: #374151;
}

.ba-rules-page-btn.active {
    background: #6366F1;
    color: #fff;
    border-color: #6366F1;
}

.ba-rules-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.ba-rule-overlay {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 20;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ba-rule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.ba-rule-header-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.ba-rule-body {
    flex: 1;
    overflow-y: auto;
}

.ba-rule-footer {
    padding: 10px 16px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ba-rule-input {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    border: 1px solid #E5E7EB;
    outline: none;
    color: #111827;
    font-family: inherit;
    box-sizing: border-box;
}

.ba-rule-input:focus {
    border-color: #6366F1;
}

.ba-rule-textarea {
    width: 100%;
    flex: 1;
    padding: 10px;
    font-size: 13px;
    border: 1px solid #E5E7EB;
    outline: none;
    color: #111827;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    box-sizing: border-box;
}

.ba-rule-textarea:focus {
    border-color: #6366F1;
}

.ba-rule-save-btn {
    height: 36px;
    background: #6366F1;
    color: #fff;
    border: 1px solid #6366F1;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.ba-rule-save-btn:hover {
    background: #4F46E5;
}

.ba-rule-active-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
}

.ba-rule-hint {
    font-size: 11px;
    color: #9CA3AF;
    text-align: center;
    margin-top: 8px;
}

.ba-rules-batch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #F3F4F6;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.ba-rules-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    border-top: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.ba-dropdown {
    background: #fff;
}

.ba-mode-opt {
    padding: 9px 12px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
}

.ba-mode-opt:hover,
.ba-mode-opt.selected {
    background: #F9FAFB;
    color: #4F46E5;
}

.ba-rchat-msg {
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.ba-rchat-msg--user {
    background: #6366F1;
    color: #fff;
    padding: 8px 12px;
    margin: 4px 8px 4px auto;
    max-width: 80%;
    width: fit-content;
}

.ba-rchat-msg--assistant {
    background: #F3F4F6;
    color: #111827;
    padding: 8px 12px;
    margin: 4px auto 4px 8px;
    max-width: 90%;
    width: fit-content;
}

.uip-rules-history-item {
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: none;
    border-bottom: 1px solid #F3F4F6;
    text-align: left;
    color: #374151;
    cursor: pointer;
    font-size: 12px;
}

.uip-rules-history-item.is-active,
.uip-rules-history-item:hover {
    background: #F9FAFB;
    color: #4F46E5;
}

.uip-project-rules-add-btn,
.uip-project-rules-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 8px;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    background: #fff;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.uip-project-rules-add-btn:hover,
.uip-project-rules-ai-btn:hover {
    border-color: #C7D2FE;
    background: #F9FAFB;
    color: #4338CA;
    transform: translateY(-1px);
}

.uip-project-rules-add-btn {
    width: 24px;
    padding: 0;
    color: #6366F1;
}

.uip-project-rules__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 11px;
    color: #9CA3AF;
}

.uip-project-rules__meta-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 20px;
    padding: 0 8px;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    color: #6366F1;
    font-weight: 700;
}

.uip-project-rules__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.uip-project-rules__item {
    border: 1px solid #E5E7EB;
    background: #fff;
    padding: 10px 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.uip-project-rules__item:hover {
    border-color: #C7D2FE;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}

.uip-project-rules__item.is-inactive {
    opacity: 0.55;
}

.uip-project-rules__item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.uip-project-rules__item-title-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.uip-project-rules__item-title {
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.uip-project-rules__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 8px;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    color: #6B7280;
    font-size: 11px;
    font-weight: 700;
}

.uip-project-rules__item-body {
    margin-top: 8px;
    color: #6B7280;
    font-size: 12px;
    line-height: 1.6;
    word-break: keep-all;
}

.uip-project-rules__menu {
    position: relative;
    flex: 0 0 auto;
}

.uip-project-rules__menu-btn {
    width: 26px;
    height: 26px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px solid #E5E7EB;
    background: #fff;
    cursor: pointer;
}

.uip-project-rules__menu-btn span {
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #6B7280;
}

.uip-project-rules__menu-popover {
    position: absolute;
    top: 30px;
    right: 0;
    z-index: 20;
    min-width: 110px;
    border: 1px solid #E5E7EB;
    background: #fff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    padding: 4px;
}

.uip-project-rules__menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: none;
    background: transparent;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
}

.uip-project-rules__menu-item:hover {
    background: #F9FAFB;
    color: #111827;
}

.uip-project-rules__menu-item.is-danger {
    color: #DC2626;
}

.uip-project-rules__menu-item.is-danger:hover {
    background: #FEF2F2;
}

.uip-project-rules__empty {
    padding: 18px 14px;
    border: 1px dashed #D1D5DB;
    background: #FAFAFA;
}

.uip-project-rules__empty-title {
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.uip-project-rules__empty-text {
    margin-top: 6px;
    color: #6B7280;
    font-size: 12px;
    line-height: 1.6;
}

.uip-project-rules__empty-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.uip-project-rules__primary-btn,
.uip-project-rules__ghost-btn {
    height: 28px;
    padding: 0 10px;
    border: 1px solid #6366F1;
    border-radius: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.uip-project-rules__primary-btn {
    background: #6366F1;
    color: #fff;
}

.uip-project-rules__ghost-btn {
    background: #fff;
    color: #6366F1;
}

.uip-project-rules__primary-btn:hover,
.uip-project-rules__ghost-btn:hover {
    transform: translateY(-1px);
}

.uip-project-rules-modal {
    position: fixed;
    inset: 0;
    z-index: 25000;
    display: none;
}

.uip-project-rules-modal.is-open {
    display: block;
}

.uip-project-rules-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.52);
}

.uip-project-rules-modal__card {
    position: relative;
    z-index: 1;
    width: min(92vw, 720px);
    max-height: min(88vh, 820px);
    margin: 5vh auto 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #E5E7EB;
    box-shadow: 0 32px 70px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.uip-project-rules-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid #E5E7EB;
}

.uip-project-rules-modal__eyebrow {
    color: #6366F1;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.uip-project-rules-modal__title {
    margin: 4px 0 0;
    color: #111827;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

.uip-project-rules-modal__close {
    width: 32px;
    height: 32px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #6B7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.uip-project-rules-modal__body {
    padding: 18px 20px;
    overflow: auto;
}

.uip-project-rules-modal__notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #C7D2FE;
    background: #EEF2FF;
    color: #3730A3;
    font-size: 13px;
    line-height: 1.6;
    font-weight: 600;
}

.uip-project-rules-modal__field + .uip-project-rules-modal__field {
    margin-top: 14px;
}

.uip-project-rules-modal__label {
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
}

.uip-project-rules-modal__input,
.uip-project-rules-modal__textarea {
    width: 100%;
    border: 1px solid #D1D5DB;
    border-radius: 0;
    background: #fff;
    color: #111827;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.uip-project-rules-modal__input {
    height: 42px;
    padding: 0 12px;
}

.uip-project-rules-modal__textarea {
    min-height: 240px;
    padding: 12px;
    resize: vertical;
    line-height: 1.65;
}

.uip-project-rules-modal__input:focus,
.uip-project-rules-modal__textarea:focus {
    border-color: #6366F1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.uip-project-rules-modal__switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.uip-project-rules-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 20px;
    border-top: 1px solid #E5E7EB;
    background: #FAFAFA;
}

.uip-project-rules-modal__secondary,
.uip-project-rules-modal__primary {
    height: 36px;
    padding: 0 14px;
    border-radius: 0;
    border: 1px solid #D1D5DB;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.uip-project-rules-modal__secondary {
    background: #fff;
    color: #374151;
}

.uip-project-rules-modal__primary {
    border-color: #6366F1;
    background: #6366F1;
    color: #fff;
}

.uip-project-rules-modal__secondary:hover,
.uip-project-rules-modal__primary:hover {
    transform: translateY(-1px);
}

#chat-input {
    width: 100%;
    min-height: 40px;
    max-height: 120px;
    padding: 12px 14px;
    border: none;
    resize: none;
    font-size: 13px;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
    outline: none;
    line-height: 1.5;
    overflow-y: auto;
    border-radius: 0;
    transition-property: height, max-height;
    transition-duration: 0.18s;
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.chat-input-wrapper.is-expanded #chat-input {
    height: clamp(220px, 34dvh, 340px);
    max-height: clamp(220px, 34dvh, 340px);
}

.uip-chat-input-expand-toggle {
    position: relative;
    width: 32px;
    height: 32px;
    margin: -4px -6px -4px auto;
    padding: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: #6B7280;
    cursor: pointer;
    border-radius: 0;
    font-family: inherit;
    transition-property: background-color, border-color, color, transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.uip-chat-input-expand-toggle::before {
    content: "";
    position: absolute;
    inset: -4px;
}

.uip-chat-input-expand-toggle:hover {
    background: #FFFFFF;
    border-color: #E5E7EB;
    color: #4F46E5;
}

.uip-chat-input-expand-toggle:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.28);
    outline-offset: 2px;
}

.uip-chat-input-expand-toggle:active {
    transform: scale(0.96);
}

.uip-chat-input-expand-toggle__icon {
    width: 15px;
    height: 15px;
    transition-property: opacity, transform, filter;
    transition-duration: 0.16s;
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.uip-chat-input-expand-toggle__icon--collapse {
    position: absolute;
    opacity: 0;
    transform: scale(0.25);
    filter: blur(4px);
}

.uip-chat-input-expand-toggle.is-expanded .uip-chat-input-expand-toggle__icon--expand {
    opacity: 0;
    transform: scale(0.25);
    filter: blur(4px);
}

.uip-chat-input-expand-toggle.is-expanded .uip-chat-input-expand-toggle__icon--collapse {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.chat-input-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-buttons button {
    /* 기본 icon-btn 스타일 상속 */
    background: transparent;
    border: 1px solid #EBEBEB;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
    color: #666666;
}

.chat-input-buttons button:hover {
    background-color: #F5F5F5;
    color: #6366F1;
}

.chat-input-buttons button:disabled,
.chat-input-buttons button.is-disabled {
    cursor: not-allowed;
    opacity: 0.45;
    color: #9CA3AF;
    background-color: #F9FAFB;
}

.chat-input-buttons button:disabled:hover,
.chat-input-buttons button.is-disabled:hover {
    color: #9CA3AF;
    background-color: #F9FAFB;
}

#send-btn {
  background-color: #6366F1;
  color: white;
  border: 1px solid #6366F1;
  border-radius: 0;
  width: 28px;
  height: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

#auto-desc-btn {
  /* 기본 icon-btn 스타일 상속 */
  width: 28px;
  height: 28px;
}

#image-upload-btn {
  /* 기본 icon-btn 스타일 상속 */
}

#auto-desc-btn:hover {
  /* 기본 icon-btn 호버 스타일 상속 */
}

/* description 모드일 때 버튼 강조 */
input[name="chat-mode"][value="description"]:checked ~ .chat-input-wrapper #auto-desc-btn {
  background-color: #f0e6ff;
  color: #6366F1;
  box-shadow: none;
}

#send-btn:hover {
  background-color: #4F46E5;
}

#send-btn:disabled {
  background-color: #9CA3AF;
  border-color: #9CA3AF;
  cursor: not-allowed;
  opacity: 0.6;
}

#send-btn:disabled:hover {
  background-color: #9CA3AF;
}

/* 기능정의 모드: 입력 필드 비활성화 */
#chat-input:disabled {
  background-color: #F5F5F5;
  cursor: not-allowed;
  opacity: 0.6;
}

#image-upload-btn:hover {
  /* 기본 icon-btn 호버 스타일 상속 */
}

/* 생성된 이미지 관련 스타일 */
.generated-image-container {
  margin: 10px 0;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  background: #f9f9f9;
}

.generated-image-container img {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: block;
  cursor: pointer;
}

.image-caption {
  padding: 8px 12px;
  font-size: 12px;
  color: #666;
  background: #fff;
  border-top: 1px solid #e0e0e0;
}

.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: pointer;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 0
}

/* 이미지 미리보기 영역 */
.image-preview-container {
    display: none;
    margin-bottom: 12px;
    position: relative;
    flex-wrap: wrap;
    gap: 10px;
}

/* placeholder.svg 이미지 기본적으로 숨김 처리 */
.image-preview-container img[src="/placeholder.svg"] {
    display: none;
}

.uploaded-image-preview {
    background: #fff;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin: 15px 0;
    overflow: hidden;
    width: 100%;
}

.preview-header {
    background: #FAFAFA;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #EBEBEB;
}

.preview-header span {
    font-weight: 500;
    color: #16161D;
}

.close-preview {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666666;
    transition: color 0.2s;
}

.close-preview:hover {
    color: #6366F1;
}

.uploaded-image-preview img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
    padding: 12px;
}

.remove-image-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background-color: #fff;
    color: #6B7280;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 12px;
}

.remove-image-btn:hover {
    background-color: #F3F4F6;
    color: #111827;
    border-color: #D1D5DB;
}

/* 다중 이미지 관련 스타일 */
.image-preview-item {
    position: relative;
    width: calc(50% - 5px);
    max-width: 200px;
    margin-bottom: 5px;
}

.multi-image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.image-preview-item .uploaded-image-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0;
    border: 1px solid #EBEBEB;
}

.image-preview-item .remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    z-index: 10;
}

/* ── 문서 첨부 프리뷰 ───────────────────────── */
.attachment-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px 2px;
}

.attachment-preview-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 0;
  max-width: 220px;
  position: relative;
}

.attachment-preview-item__icon {
  flex-shrink: 0;
  color: #6366F1;
  width: 14px;
  height: 14px;
}

.attachment-preview-item__name {
  font-size: 12px;
  color: #374151;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.attachment-preview-item__size {
  font-size: 11px;
  color: #9CA3AF;
  flex-shrink: 0;
}

.attachment-preview-item__remove {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #9CA3AF;
  padding: 0;
  margin-left: 2px;
}

.attachment-preview-item__remove:hover {
  color: #EF4444;
}

/* ── URL 인라인 입력창 ─────────────────────── */
.url-input-panel {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid #E5E7EB;
  background: #F9FAFB;
}

.url-input-panel__input {
  flex: 1;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  border: 1px solid #D1D5DB;
  border-radius: 0;
  outline: none;
  color: #374151;
  background: #fff;
  font-family: 'Pretendard Variable', sans-serif;
}

.url-input-panel__input:focus {
  border-color: #6366F1;
}

.url-input-panel__btn {
  flex-shrink: 0;
  height: 28px;
  padding: 0 10px;
  background: #6366F1;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font-family: 'Pretendard Variable', sans-serif;
}

.url-input-panel__btn:hover {
  background: #4F46E5;
}

/* ── URL 프리뷰 카드 ─────────────────────── */
.url-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px 2px;
}

.url-preview-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 0;
  max-width: 220px;
}

.url-preview-item--loading {
  opacity: 0.6;
}

.url-preview-item__icon {
  flex-shrink: 0;
  color: #6366F1;
  width: 11px;
  height: 11px;
}

.url-preview-item__domain {
  font-size: 12px;
  color: #374151;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.url-preview-item__size {
  font-size: 11px;
  color: #9CA3AF;
  flex-shrink: 0;
}

.url-preview-item__remove {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #9CA3AF;
  padding: 0;
  margin-left: 2px;
}

.url-preview-item__remove:hover {
  color: #EF4444;
}

/* ── PRD 감지 배너 ───────────────────────────── */
.prd-banner {
  margin: 4px 10px 0;
  padding: 8px 12px;
  background: #EEF2FF;
  border: 1px solid #6366F1;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prd-banner__msg {
  font-size: 12px;
  color: #4338CA;
  font-weight: 500;
  flex: 1;
}

.prd-banner__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.prd-banner__btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  border-radius: 0;
  background: #6366F1;
  color: #fff;
}

.prd-banner__btn:hover {
  background: #4F46E5;
}

.prd-banner__btn--secondary {
  background: transparent;
  color: #4F46E5;
  border: 1px solid #6366F1;
}

.prd-banner__btn--secondary:hover {
  background: #EEF2FF;
}

/* ── 텍스트 응답 화면 생성 CTA ─────────────────────── */
.text-response-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 12px;
  margin: 4px 0;
}

.text-response-cta__hint {
  font-size: 11px;
  color: #9CA3AF;
}

.text-response-cta__btn {
  padding: 6px 14px;
  background: #6366F1;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
}

.text-response-cta__btn:hover {
  background: #4F46E5;
}

/* ── 사용자 버블 — 첨부 파일 태그 ───────────────────── */
.user-attachment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.user-attachment-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px 2px 5px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  font-size: 11px;
  color: #fff;
  border-radius: 0;
}

.user-attachment-tag__size {
  opacity: 0.7;
  margin-left: 2px;
}

.progress-bar {
    height: 3px;
    background: #F5F5F5;
    margin: 0 12px;
}

.progress-inner {
    height: 100%;
    background: #6366F1;
    width: 0;
    transition: width 0.3s;
}

.preview-status {
    padding: 10px 14px;
    color: #666666;
    font-size: 13px;
    text-align: center;
}

/* 채팅 모드 선택 UI 스타일 */
/* 상위 카테고리 선택기 스타일 */






/* 기본 라디오 버튼 숨기기 */


/* 선택된 카테고리 스타일 */


/* 선택된 카테고리 배경색 변경 */


/* 카테고리 인디케이터 숨김 처리 */


/* 카테고리 텍스트 */


/* 하위 모드 선택기 스타일 - 모델 선택기와 동일한 룩앤필 */
.chat-mode-selector {
    display: flex;
    gap: 1px;
    margin-bottom: 12px;
    width: 100%;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    padding: 1px;
}

.chat-mode-option {
    position: relative;
    padding: 8px 12px;
    background-color: transparent;
    border: none;
    border-radius: 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    user-select: none;
    flex: 1;
}

.chat-mode-option:hover {
    background-color: #efefef;
}

/* 기본 라디오 버튼 숨기기 */
.chat-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* 선택된 옵션 스타일 */
.chat-mode-option:has(input[type="radio"]:checked) span {
    color: #6366F1;
    font-weight: 600;
}

/* 선택된 옵션 배경색 변경 */
.chat-mode-option:has(input[type="radio"]:checked) {
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 활성 인디케이터 - 사용하지 않음 */
.chat-mode-option input[type="radio"]:checked ~ .indicator {
    display: none;
}

/* 활성 인디케이터 - 숨김 처리 */
.chat-mode-option .indicator {
    display: none;
}

/* 텍스트가 배경 위에 오도록 설정 */
.chat-mode-option span {
    position: relative;
    z-index: 2;
}

/* KlavyAgent composer 접힘/펼침 */
.uip-composer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 26px;
    margin: -4px 0 8px;
}

.uip-composer-toolbar__title {
    color: #6B7280;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.uip-composer-toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 24px;
    padding: 0 7px;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    color: #4B5563;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    border-radius: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.uip-composer-toggle-button:hover {
    background: #F9FAFB;
    border-color: #C7D2FE;
    color: #4F46E5;
}

.uip-composer-toggle-button:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.28);
    outline-offset: 2px;
}

.uip-composer-toggle-button__icon {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
}

.uip-composer-compact-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 28px;
    margin-bottom: 8px;
    padding: 0 0 7px;
    border-bottom: 1px solid #EEF2FF;
}

.uip-composer-compact-summary {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #4B5563;
    font-size: 12px;
    line-height: 1.35;
}

.uip-composer-compact-summary__mode {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 6px;
    background: #EEF2FF;
    color: #4F46E5;
    font-size: 11px;
    font-weight: 900;
}

.uip-composer-compact-summary__divider {
    width: 1px;
    height: 12px;
    background: #E5E7EB;
    flex: 0 0 auto;
}

.uip-composer-compact-summary__target {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111827;
    font-weight: 700;
}

.chat-input-container.is-composer-collapsed {
    padding: 10px 12px 12px;
}

.chat-input-container.is-composer-collapsed .uip-composer-toolbar,
.chat-input-container.is-composer-collapsed .chat-mode-selector,
.chat-input-container.is-composer-collapsed .model-selector-container,
.chat-input-container.is-composer-collapsed .model-picker-row,
.chat-input-container.is-composer-collapsed .uip-generation-target {
    display: none;
}

.chat-input-container.is-composer-collapsed .uip-composer-compact-bar {
    display: flex;
}

.chat-input-container.is-composer-collapsed .chat-input-wrapper {
    border-color: #E5E7EB;
    box-shadow: none;
}

.chat-input-container.is-composer-collapsed .chat-input-left-controls {
    display: none;
}

.chat-input-container.is-composer-collapsed #chat-input,
.chat-input-container.is-composer-collapsed .chat-input-wrapper.is-expanded #chat-input {
    min-height: 50px;
    height: 50px;
    max-height: 72px;
    padding: 10px 12px 6px;
}

.chat-input-container.is-composer-collapsed .chat-input-bottom {
    padding: 6px 8px;
}

.chat-input-container.is-composer-collapsed .chat-input-buttons {
    margin-left: auto;
    gap: 6px;
}

/* 이미지 타입 선택기 스타일 - 모델 선택기와 동일한 룩앤필 */






















/* 프롬프트 템플릿 선택기 스타일 - 모델 선택기와 동일한 룩앤필 */






















/* 이미지 스타일 선택기 - 모델 선택기와 동일한 룩앤필 */
.image-style-selector {
    margin-bottom: 12px;
}

.image-style-container {
    position: relative;
    width: 100%;
}

.image-style-selector-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.image-style-selector-btn:hover {
    background-color: #efefef;
    border-color: #d0d0d0;
}

.image-style-selector-btn i:last-child {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.image-style-selector-btn.active i:last-child {
    transform: rotate(180deg);
}

.image-style-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.image-style-dropdown.show {
    max-height: 300px;
    opacity: 1;
    overflow-y: auto;
}

.image-style-option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background 0.2s ease;
}

.image-style-option:hover {
    background-color: #f5f5f5;
}

.image-style-option.selected {
    background-color: rgba(99,102,241,0.1);
    color: #6366F1;
    font-weight: 500;
}

/* 크기 비율 선택기 - 모델 선택기와 동일한 룩앤필 */
.aspect-ratio-selector {
    margin-bottom: 12px;
}

.aspect-ratio-container {
    position: relative;
    width: 100%;
}

.aspect-ratio-selector-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.aspect-ratio-selector-btn:hover {
    background-color: #efefef;
    border-color: #d0d0d0;
}

.aspect-ratio-selector-btn i:last-child {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.aspect-ratio-selector-btn.active i:last-child {
    transform: rotate(180deg);
}

.aspect-ratio-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.aspect-ratio-dropdown.show {
    max-height: 300px;
    opacity: 1;
    overflow-y: auto;
}

.aspect-ratio-option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background 0.2s ease;
}

.aspect-ratio-option:hover {
    background-color: #f5f5f5;
}

.aspect-ratio-option.selected {
    background-color: rgba(99,102,241,0.1);
    color: #6366F1;
    font-weight: 500;
}

/* 색상 톤 선택기 - 모델 선택기와 동일한 룩앤필 */
.color-tone-selector {
    margin-bottom: 12px;
}

.color-tone-container {
    position: relative;
    width: 100%;
}

.color-tone-selector-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.color-tone-selector-btn:hover {
    background-color: #efefef;
    border-color: #d0d0d0;
}

.color-tone-selector-btn i:last-child {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.color-tone-selector-btn.active i:last-child {
    transform: rotate(180deg);
}

.color-tone-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.color-tone-dropdown.show {
    max-height: 300px;
    opacity: 1;
    overflow-y: auto;
}

.color-tone-option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background 0.2s ease;
}

.color-tone-option:hover {
    background-color: #f5f5f5;
}

.color-tone-option.selected {
    background-color: rgba(99,102,241,0.1);
    color: #6366F1;
    font-weight: 500;
}

/* ====================================================
   7. 코드 영역
   ==================================================== */
/* 코드 블록 */
.code-block {
    background-color: #FAFAFA;
    border-radius: 0;
    overflow: hidden;
    font-family: 'Roboto Mono', monospace;
    margin-top: 10px;
    border: 1px solid #EBEBEB;
    max-width: 100%;
    box-sizing: border-box;
}

.code-block pre,
.code-block code,
.generated-code {
    overflow-x: auto;
    white-space: pre;
    word-break: normal;
    max-width: 100%;
    box-sizing: border-box;
}

.code-container {
    padding: 12px 16px;
    position: relative;
}

.copy-code-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    background: #16161D;
    color: white;
    border: none;
    border-radius: 0;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-code-btn:hover {
    background: #555555;
}

.copy-code-btn.copied {
    background: #6366F1;
    color: white;
}

.copy-code-btn.error {
    background: #EF4444;
    color: white;
}

.code-description,
.ui-apply-status {
    font-size: 13px;
    line-height: 1.6;
    color: #4B5563;
    margin: 8px 0 0;
    padding: 10px 12px;
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
}

.generated-code {
    background: #FAFAFA;
    padding: 14px;
    border-radius: 0;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    margin: 5px 0 0;
    white-space: pre-wrap;
    border: 1px solid #EBEBEB;
}

.code-actions button:hover {
    color: #6366F1;
    background-color: rgba(99,102,241,0.1);
}

.code-actions button.active,
#view-full-code-btn.active,
#view-ui-code-btn.active {
    color: #6366F1;
    background-color: transparent;
}

.code-actions button.active i,
#view-full-code-btn.active i,
#view-ui-code-btn.active i {
    color: #6366F1;
}

.code-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 14px;
    min-height: 0;
}

.code-export-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.code-export-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.code-export-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4f46e5;
}

.code-export-note {
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
}

.code-export-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.code-export-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid #dbe3f0;
    background: #ffffff;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: 0;
}

.code-export-tab.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.code-display-shell {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    flex: 1;
    border: 1px solid #dbe3f0;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.code-display-shell-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.code-display-shell-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #111827;
}

.code-display-shell-meta {
    font-size: 11px;
    color: #64748b;
}

#code-display {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    height: auto !important;
    min-height: 0;
    min-width: 0;
    background: #1e1e1e;
}

.code-footer {
    padding: 12px 16px;
    border-top: 1px solid #EBEBEB;
    display: flex;
    justify-content: space-between;
    background-color: #fff;
}

.code-footer .action-button {
    background-color: #F5F5F5;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
    color: #16161D;
    transition: all 0.2s;
}

.code-footer .action-button:hover {
    background-color: #EBEBEB;
}

.CodeMirror {
    flex: 1;
    height: auto !important;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow: auto;
}

.CodeMirror-gutters {
    border-right: 1px solid #ddd;
    background-color: #f7f7f7;
}

.CodeMirror-linenumber {
    color: #999;
}

.CodeMirror-foldgutter {
    width: 18px;
}

.CodeMirror-foldgutter-open,
.CodeMirror-foldgutter-folded {
    cursor: pointer;
}

.CodeMirror-foldgutter-open:after {
    content: "-";
}

.CodeMirror-foldgutter-folded:after {
    content: "+";
}

.code-btn.active {
    color: #6366F1;
    background-color: rgba(99,102,241,0.1);
}

.file-btn.active {
    color: #6366F1;
    background-color: rgba(99,102,241,0.1);
}

/* AI 생각 중 애니메이션 */
.typing-indicator.ai-thinking {
    display: block;
    margin: 12px 0;
    padding: 12px 14px;
    background: #EEF2FF;
    border: 1px solid #E0E7FF;
}

.thinking-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(90deg, #4F46E5 31%, #6366F1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.thinking-avatar i,
.thinking-avatar svg {
    color: white;
    width: 14px;
    height: 14px;
}

.thinking-bubble {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    min-height: 0;
    min-width: 0;
}

.thinking-bubble::before,
.thinking-bubble::after {
    display: none;
}

.thinking-dots {
    display: none;
}

.thinking-primary-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 3px;
    min-width: 0;
    max-width: 100%;
    font-size: 13px;
    line-height: 1.45;
}

.thinking-text {
    font-size: 13px;
    color: #111827;
    font-weight: 600;
    margin-bottom: 0;
    line-height: 1.45;
}

.thinking-separator {
    font-size: 13px;
    color: #111827;
    font-weight: 600;
    line-height: 1.45;
}

.thinking-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-top: 0;
    min-width: 0;
}

.thinking-meta > span:not(:last-child)::after {
    content: none;
}

.thinking-time {
    font-size: 13px;
    color: #6B7280;
    font-weight: 400;
    display: inline;
    line-height: 1.45;
}

.thinking-chars {
    font-size: 11px;
    color: #6366F1;
    font-weight: 500;
    display: none !important;
    line-height: 1.45;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 0;
}

.thinking-eta {
    font-size: 11px;
    color: #6B7280;
    line-height: 1.45;
    min-width: 0;
}

.thinking-chars:empty {
    display: none;
}

.thinking-estimate {
    font-size: 11px;
    color: #6B7280;
    font-weight: 400;
    display: block;
    line-height: 1.45;
    max-width: 100%;
}

.thinking-estimate:empty {
    display: none;
}

.thinking-bar {
    width: 100%;
    height: 2px;
    background: #E5E7EB;
    margin-top: 6px;
    overflow: hidden;
}

.thinking-bar-inner {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, #4F46E5 31%, #6366F1 100%);
    animation: uipBarSlide 1.4s ease-in-out infinite;
}

@keyframes avatarPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 멘션 드롭다운 스타일 */
.mention-suggestions {
    position: absolute;
    background-color: #16161D;
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999;
    min-width: 220px;
    width: auto;
}

.mention-item {
    padding: 8px 10px;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
    transition: all 0.2s;
}

.mention-item:hover, .mention-item.active {
    background-color: rgba(99,102,241,0.2);
}

/* 멘션된 항목 스타일 */
.message .mention {
    color: #6366F1;
    background-color: rgba(99,102,241,0.1);
    padding: 2px 4px;
    border-radius: 0;
    font-weight: 500;
    cursor: pointer;
}

/* ====================================================
   8. 모달 및 대화상자
   ==================================================== */
/* 모달 스타일 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    border-radius: 0;
    width: 400px;
    max-width: 95%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.modal-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #EBEBEB;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #16161D;
}

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 16px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #EBEBEB;
    background-color: #FAFAFA;
}

.modal-footer button {
    padding: 8px 14px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-footer button:first-child {
    margin-right: 10px;
    background-color: #F5F5F5;
    color: #16161D;
    border: 1px solid #EBEBEB;
}

.modal-footer button:first-child:hover {
    background-color: #EBEBEB;
}

.modal-footer button:last-child {
    background-color: #6366F1;
    color: white;
    border: none;
}

.modal-footer button:last-child:hover {
    background-color: #6366F1;
}

/* HTML 코드 편집 모달 스타일 */
/* 모든 코드 에디터 모달에 적용되도록 ID 선택자를 클래스 선택자로 변경 */
[id^="code-editor-modal"] {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(4px);
}

[id^="code-editor-modal"] .modal-body {
    flex: 1;
    padding: 16px;
    overflow: auto;
    height: calc(100% - 120px);
}

[id^="code-editor-modal"] .modal-content {
    width: 600px;
    max-width: 90%;
    height: 90%;
}

[id^="code-editor-modal"] textarea {
    width: 100%;
    height: 100%;
    font-family: monospace;
    font-size: 14px;
    padding: 8px;
    resize: none;
    border: 1px solid #E4E4E4;
    border-radius: 0
}

.modal-close-btn {
    border: none;
    background: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: background-color 0.2s;
}

.modal-close-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.cancel-btn {
    background-color: white;
    color: #1f2937;
    border: 1px solid #1f2937;
    padding: 8px 16px;
    border-radius: 0;
    cursor: pointer;
    margin-right: 8px;
}

.save-code-btn {
    background-color: #1f2937;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 0;
    cursor: pointer;
}

/* 컴포넌트 모달 스타일 */
.component-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    backdrop-filter: blur(4px);
}

.component-modal-container {
    background-color: white;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 80%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.component-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #EBEBEB;
}

.component-modal-title {
    font-size: 18px;
    font-weight: 600;
}

.component-modal-close {
    cursor: pointer;
    font-size: 20px;
    color: #666;
}

.component-modal-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.subcomponent-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border-radius: 0;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    border: 1px solid #EBEBEB;
}

.subcomponent-item:hover {
    background-color: #F5F5F5;
}

/* 컴포넌트 저장 모달 스타일 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #16161D;
}

.modal-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    background-color: #FFFFFF;
}

.modal-input:focus {
    border-color: #6366F1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}

.modal-textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    background-color: #FFFFFF;
    min-height: 80px;
    resize: vertical;
}

.modal-textarea:focus {
    border-color: #6366F1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}

/* 컬러 픽커 스타일 */
.color-picker-wrapper {
    position: relative;
}

.color-picker-wrapper input[type="color"] {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.color-display {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    width: 100%; /* 전체 너비 사용 */
}

.color-box {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    background-color: #fff;
    cursor: pointer;
}

.color-value {
    flex: 1;
    height: 36px; /* 높이 통일 */
    padding: 8px 10px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    font-size: 12px;
    font-family: 'Roboto Mono', monospace;
    width: calc(100% - 44px);
}

.color-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.color-picker-content {
    background-color: white;
    border-radius: 0;
    width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.color-picker-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #EBEBEB;
}

.color-picker-title {
    font-size: 16px;
    font-weight: 600;
    color: #16161D;
}

.color-picker-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    outline: none;
}

.color-picker-close:hover {
    color: #333;
}

.color-picker-body {
    padding: 12px;
}

.color-picker-input-row {
    display: flex;
    margin-bottom: 16px;
    align-items: center;
}

.color-picker-selected {
    width: 48px;
    height: 48px;
    border-radius: 0;
    border: 1px solid #EBEBEB;
    margin-right: 12px;
}

.color-picker-input-group {
    flex: 1;
}

.color-picker-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    font-size: 14px;
    font-family: 'Roboto Mono', monospace;
}

.color-format-tabs {
    display: flex;
    margin-bottom: 8px;
}

.color-format-tab {
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #EBEBEB;
    background-color: #F5F5F5;
}

.color-format-tab:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.color-format-tab:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.color-format-tab.active {
    background-color: #6366F1;
    color: white;
    border-color: #6366F1;
}

.color-picker-presets {
    margin-top: 16px;
}

.color-picker-presets-title {
    font-size: 12px;
    color: #666666;
    margin-bottom: 8px;
}

.color-picker-presets-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.color-preset {
    width: 22px;
    height: 22px;
    border-radius: 0;
    cursor: pointer;
    border: 1px solid #EBEBEB;
}

.color-preset:hover {
    transform: scale(1.1);
}

.color-picker-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    gap: 8px;
}

.color-picker-button {
    padding: 6px 12px;
    border-radius: 0;
    font-size: 12px;
    cursor: pointer;
}

.color-picker-button.cancel {
    background-color: #F5F5F5;
    border: 1px solid #EBEBEB;
    color: #16161D;
}

.color-picker-button.apply {
    background-color: #6366F1;
    color: white;
    border: none;
}

/* 테두리 색상 디스플레이 스타일 추가 */
#border-color-display {
    cursor: pointer;
    transition: all 0.2s;
}

#border-color-display:hover {
    opacity: 0.8;
}

/* 모달 닫기 버튼 스타일 개선 */
#close-border-settings-modal,
.color-picker-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    outline: none;
}

#close-border-settings-modal:hover,
.color-picker-close:hover {
    color: #333;
}

/* ====================================================
   9. 메시지 및 알림
   ==================================================== */
/* 로그 메시지 스타일 */
.system-message {
    padding: 10px 12px;
    margin: 0;
    border-radius: 0;
    font-size: 12px;
    font-weight: 500;
    position: relative;
    animation: fadeIn 0.3s ease-out;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* message-content가 있는 경우 바깥 패딩 제거 (중복 방지) */
.system-message:has(.message-content) {
    padding: 0;
}
.system-message .message-content {
    padding: 9px 12px;
    font-size: 12px;
    line-height: 1.5;
}

.system-message.reference {
    background-color: #F9F5FF;
}

.system-message.info,
.system-message.info-message {
    background-color: #e8f4fd;
    color: #0d47a1;
}

.system-message.success,
.system-message.success-message {
    background-color: #EEF2FF;
    color: #4F46E5;
    padding: 6px 12px;
    gap: 0;
}
.system-message.success::before,
.system-message.success-message::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234F46E5' stroke-width='2' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.system-message.warning,
.system-message.warning-message {
    background-color: #fff8e1;
    color: #ff6f00;
}

.system-message.error,
.system-message.error-message {
    background-color: #ffebee;
    color: #b71c1c;
}

/* 향상된 오류 메시지 스타일 */
.system-message .error-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    color: #d32f2f;
}

.system-message .error-content {
    line-height: 1.5;
}

.system-message .error-content ul {
    margin-top: 5px;
    margin-bottom: 5px;
    padding-left: 20px;
}

.system-message .error-content li {
    margin-bottom: 5px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.reference-log {
    background-color: #F9F5FF;
    border-left: 3px solid #6366F1;
    padding: 10px 14px;
    font-size: 13px;
    color: #16161D;
    border-radius: 0
}

/* ====================================================
   10. 컨텍스트 메뉴
   ==================================================== */
.context-menu {
    position: absolute;
    background: #FFFFFF;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 150px;
    padding: 8px 0;
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu-item:hover {
    background: #F5F5F5;
}

.context-menu-divider {
    height: 1px;
    background: #E0E0E0;
    margin: 8px 0;
}

/* ====================================================
   11. 버튼 및 컨트롤
   ==================================================== */
/* 피그마 스타일 아이콘 버튼 */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 0;
    background: transparent;
    border: 1px solid #EBEBEB;
    color: #666666;
    cursor: pointer;
    transition: all 0.2s;
}

/* 캔버스 사이즈 버튼 스타일 - 기본 icon-btn 스타일 상속 */
#canvas-size-btn {
    width: auto;
    min-width: 90px;
    padding: 0 6px;
    gap: 4px;
    /* 기본 icon-btn 스타일 상속 */
}

#canvas-size-btn:hover {
    /* 기본 icon-btn 호버 스타일 상속 */
}

#canvas-size-btn span {
    font-size: 12px;
    white-space: nowrap;
    font-weight: 400;
    color: inherit;
}

.icon-btn:hover {
    background-color: #F5F5F5;
    color: #6366F1;
}

/* Figma 내보내기 버튼 */
.figma-export-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: #FFFFFF;
  color: #111827;
  border: 1px solid #D1D5DB;
  border-radius: 0;
  cursor: pointer;
  min-width: 80px;
  justify-content: center;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.figma-export-btn:hover {
  background-color: #F9FAFB;
  border-color: #9CA3AF;
  color: #111827;
}

.figma-export-btn.loading {
  background-color: #F3F4F6;
  border-color: #D1D5DB;
  color: #6B7280;
  cursor: not-allowed;
  opacity: 0.8;
}

.figma-export-btn span {
  font-size: 13px;
  font-weight: 500;
}

.figma-settings-btn {
  color: #4B5563;
  border-color: #D1D5DB;
}

.figma-settings-btn:hover {
  background-color: #F9FAFB;
  border-color: #9CA3AF;
  color: #111827;
}

/* Figma 설정 모달 */
.figma-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.figma-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.figma-modal__card {
  position: relative;
  background: #fff;
  width: 460px;
  max-width: calc(100vw - 32px);
  border: 1px solid #E5E7EB;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 1;
}

.figma-modal__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #E5E7EB;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.figma-modal__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.figma-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.figma-modal__field label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.figma-modal__field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #E5E7EB;
  border-radius: 0;
  font-size: 13px;
  color: #111827;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.figma-modal__field input:focus {
  border-color: #6366F1;
}
.figma-modal__select {
  width: 100%;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid #E5E7EB;
  font-size: 13px;
  color: #111827;
  outline: none;
  appearance: none;
  cursor: pointer;
}
.figma-modal__select:focus {
  border-color: #6366F1;
}

.figma-modal__field small {
  font-size: 12px;
  color: #6B7280;
}

.figma-modal__field small a {
  color: #6366F1;
  text-decoration: none;
}

.figma-modal__field small a:hover {
  text-decoration: underline;
}

.figma-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #E5E7EB;
}

.figma-modal__btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  border-radius: 0;
  transition: background-color 0.2s;
}

.figma-modal__btn--cancel {
  background: #F3F4F6;
  color: #374151;
}

.figma-modal__btn--cancel:hover {
  background: #E5E7EB;
}

.figma-modal__btn--save {
  background: #1E1E1E;
  color: white;
  min-width: 130px;
}

.figma-modal__btn--save:hover {
  background: #333;
}

.figma-modal__btn--save:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
}

/* Figma 토스트 알림 */
.figma-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  color: white;
  z-index: 99999;
  white-space: nowrap;
  animation: figmaToastIn 0.2s ease;
}

.figma-toast.success,
.figma-toast.figma-toast--success { background: #111827; }

.figma-toast.error,
.figma-toast.figma-toast--error { background: #DC2626; }

.figma-toast.info,
.figma-toast.figma-toast--info { background: #111827; }

@keyframes figmaToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.figma-export-panel {
  width: 320px;
  min-width: 320px;
  max-width: 400px;
  z-index: 11;
}

.figma-export-panel.collapsed {
  min-width: 0;
  max-width: 0;
  width: 0;
}

.figma-export-panel__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.figma-export-panel .panel-content.figma-export-panel__content {
  padding: 16px 18px 18px !important;
  margin: 0 !important;
  overflow: auto !important;
  box-sizing: border-box;
}

.figma-export-panel__tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.figma-export-panel__intro {
  padding: 10px 12px;
  border: 1px solid #E5E7EB;
  background: #F9FAFB;
  color: #4B5563;
  font-size: 12px;
  line-height: 1.6;
  text-wrap: pretty;
}

.figma-export-panel__intro strong {
  color: #111827;
  font-weight: 700;
}

.figma-export-panel__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #E5E7EB;
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.figma-export-panel__tab.is-active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.figma-export-panel__mode {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.figma-export-panel__section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.figma-export-panel__label {
  font-size: 11px;
  font-weight: 700;
  color: #6B7280;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0;
}

.figma-export-panel__url,
.figma-export-panel__message,
.figma-export-panel__error-text {
  font-size: 13px;
  line-height: 1.6;
  color: #16161D;
  word-break: break-word;
}

.figma-export-panel__url {
  padding: 10px 12px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
}

.figma-export-panel__inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.figma-export-panel__input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #E5E7EB;
  background: #fff;
  font-size: 13px;
  color: #16161D;
}

.figma-export-panel__help {
  font-size: 12px;
  line-height: 1.6;
  color: #6B7280;
}

.figma-export-panel__guidance {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.figma-export-panel__guidance-item {
  padding: 10px 12px;
  border: 1px solid #C7D2FE;
  background: #EEF2FF;
  color: #3730A3;
  font-size: 13px;
  line-height: 1.6;
}

.figma-export-panel__frames {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.figma-export-panel__frame {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #E5E7EB;
  background: #fff;
}

.figma-export-panel__frame-main {
  min-width: 0;
  flex: 1;
}

.figma-export-panel__frame-name {
  min-width: 0;
  font-size: 13px;
  color: #16161D;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.figma-export-panel__frame-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #6B7280;
}

.figma-export-panel__frame-link {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: #4F46E5;
  text-decoration: none;
}

.figma-export-panel__empty {
  padding: 14px 12px;
  border: 1px dashed #D1D5DB;
  font-size: 13px;
  color: #9CA3AF;
  background: #FCFCFD;
}

.figma-export-panel__error {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid #FECACA;
  background: #FEF2F2;
}

.figma-export-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.figma-export-panel__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #E5E7EB;
  background: #fff;
  color: #16161D;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
}

.figma-export-panel__action:hover {
  background: #F9FAFB;
}

.figma-export-panel__action--primary {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.figma-export-panel__action--primary:hover {
  background: #1F2937;
}

.figma-export-panel__code {
  margin: 0;
  padding: 12px;
  border: 1px solid #E5E7EB;
  background: #F9FAFB;
  color: #16161D;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}

/* 자동 저장 상태 스타일 */
.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #F8FAFC;
  color: #64748B;
  border: 1px solid #E5E7EB;
  border-radius: 0;
  min-width: 96px;
  justify-content: center;
  white-space: nowrap;
  user-select: none;
  transition-property: background-color, border-color, color, box-shadow, transform;
  transition-duration: 0.2s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.save-status span {
  font-size: 13px;
  font-weight: 500;
  display: inline-block;
}

.save-status svg {
  flex-shrink: 0;
}

.save-status[data-state="saved"] {
  color: #9CA3AF;
  background: transparent;
  border-color: transparent;
  padding: 6px;
  min-width: auto;
  box-shadow: none;
}

.save-status[data-state="saved"] span {
  display: none;
}

.save-status[data-state="saving"] {
  color: #4338CA;
  background: #EEF2FF;
  border-color: #C7D2FE;
}

.save-status[data-state="error"] {
  color: #B91C1C;
  background: #FEF2F2;
  border-color: #FECACA;
}

.save-status[data-state="conflict"] {
  color: #9A3412;
  background: #FFF7ED;
  border-color: #FDBA74;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(154, 52, 18, 0.08);
}

.save-status[data-state="conflict"]:hover,
.save-status[data-state="conflict"]:focus-visible {
  color: #7C2D12;
  background: #FFEDD5;
  border-color: #FB923C;
  box-shadow: 0 16px 38px rgba(154, 52, 18, 0.12);
}

.save-status[data-state="conflict"]:active {
  transform: scale(0.96);
}

.save-status[data-state="manual"] {
  color: #065F46;
  background: #ECFDF5;
  border-color: #A7F3D0;
}


/* 컴포넌트 버튼 스타일 */
.save-component-btn.active {
    color: #6366F1;
    background-color: rgba(99,102,241,0.1);
}

/* 버튼 상태 스타일 */
.properties-btn.active,
.code-btn.active,
.chat-btn.active {
    color: #6366F1;
    opacity: 1;
}

/* ====================================================
   12. 리사이즈 및 조작 핸들
   ==================================================== */
/* 리사이즈 핸들 스타일 추가 */
.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #6366F1;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    z-index: 10000;
}

.resize-handles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9000;
}

.handle-nw { cursor: nw-resize; }
.handle-n { cursor: n-resize; }
.handle-ne { cursor: ne-resize; }
.handle-e { cursor: e-resize; }
.handle-se { cursor: se-resize; }
.handle-s { cursor: s-resize; }
.handle-sw { cursor: sw-resize; }
.handle-w { cursor: w-resize; }

/* ====================================================
   13. 로딩 및 애니메이션
   ==================================================== */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ====================================================
   14. 숨김 및 표시 제어
   ==================================================== */
/* CSS 추가: 편집, 스타일, 삭제 버튼 숨기기 */
.edit-tabs,
.element-edit-tabs,
[data-role="edit-tabs"],
.tab-container button {
    display: none !important;
}

/* 기본 스타일 */
.screen-type-selector,
.screen-type-selector:hover,
.screen-type-selector:focus,
#custom-size-controls,
#custom-size-controls input,
#custom-size-controls input:focus,
#apply-size-btn {
    display: none;
}

/* ====================================================
   15. 모델 선택기 스타일
   ==================================================== */
.model-picker-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
    position: relative;
}

.model-picker-row[hidden] {
    display: none !important;
}

.model-picker-row .model-selector-container {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
    width: auto;
}

.model-picker-row .think-depth__wrapper {
    flex: 0 0 auto;
}

.model-picker-row .think-depth__btn {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    color: #374151;
    border-color: #e0e0e0;
    background: #fff;
}

.model-selector-container {
    position: relative;
    margin-bottom: 12px;
    width: 100%;
}

.model-selector-btn {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 14px;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #374151;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.model-selector-btn:hover {
    border-color: #d0d0d0;
}

.model-selector-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-selector-badges {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    flex-shrink: 0;
}

.model-selector-badges .model-badge {
    height: 16px;
    font-size: 10px;
}

.model-selector-caret {
    width: 14px;
    height: 14px;
    color: #6B7280;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.model-selector-btn.active .model-selector-caret {
    transform: rotate(180deg);
}

.model-dropdown {
    position: absolute;
    bottom: 100%;
    left: -16px;
    right: -16px;
    width: auto;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.model-dropdown.show {
    max-height: 300px;
    opacity: 1;
    overflow-y: auto;
}

.model-group-header {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #9CA3AF;
    text-transform: uppercase;
}

.model-group-header + .model-group-header {
    border-top: 1px solid #f0f0f0;
}

.model-group-header:not(:first-child) {
    border-top: 1px solid #f0f0f0;
}

.model-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: background 0.2s ease;
}

.model-option:hover {
    background-color: #f5f5f5;
}

.model-option.selected {
    background-color: #EEF2FF;
    color: #6366F1;
    font-weight: 500;
}

.model-option-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-option-meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    flex-shrink: 0;
}

.model-badge {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    border: 1px solid transparent;
}

.model-option-meta .model-badge {
    height: 16px;
    font-size: 10px;
}

.model-badge--weight {
    border-color: #FDE68A;
    background: #FFFBEB;
    color: #92400E;
}

.model-badge--free {
    border-color: #A7F3D0;
    background: #ECFDF5;
    color: #047857;
}

.model-badge--recommended {
    border-color: #C7D2FE;
    background: #EEF2FF;
    color: #4338CA;
}

.model-badge--label {
    border-color: #E5E7EB;
    background: #F9FAFB;
    color: #4B5563;
}

.model-badge--image { color: #4B5563; border: 1px solid #E5E7EB; background: #F9FAFB; display: inline-flex; align-items: center; }
.model-badge--image .model-badge__icon, .model-badge--image svg { width: 11px; height: 11px; }

.model-badge--credential {
    border-color: #E5E7EB;
    background: #F9FAFB;
    color: #6B7280;
}

.model-badge--credential.is-user {
    border-color: #C7D2FE;
    background: #EEF2FF;
    color: #4338CA;
}

.model-badge--credential.is-oauth {
    border-color: #A7F3D0;
    background: #ECFDF5;
    color: #047857;
}

.model-badge--credential.is-system {
    border-color: #E5E7EB;
    background: #F9FAFB;
    color: #6B7280;
}

.model-badge--credential.is-missing {
    border-color: #FECACA;
    background: #FEF2F2;
    color: #B91C1C;
}

.model-badge--credential.is-unsupported {
    border-color: #FDE68A;
    background: #FEF3C7;
    color: #92400E;
}

/* 잠긴 모델 옵션 */
.model-option.is-locked {
    cursor: not-allowed;
    opacity: 0.65;
}
.model-option.is-locked .model-option-name {
    color: #6B7280;
}
.model-badge--locked {
    background: #F3F4F6;
    color: #6B7280;
    border: 1px solid #E5E7EB;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.6875rem;
    padding: 1px 5px;
}

/* 요소 삭제 버튼 스타일 개선 */
[id$="delete-btn"],
.delete-element-btn,
button:has(i.fa-trash),
button[aria-label="삭제"] {
    background-color: #fff !important;
    color: #EF4444 !important;
    border: 1px solid #FFC8C8 !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    width: 100% !important;
    height: 40px !important;
    border-radius: 0;
    font-weight: 500 !important;
    margin-top: 4px !important;
}

[id$="delete-btn"]:hover,
.delete-element-btn:hover,
button:has(i.fa-trash):hover,
button[aria-label="삭제"]:hover {
    background-color: #FFF0F0 !important;
    border-color: #EF4444 !important;
}

[id$="delete-btn"] i,
.delete-element-btn i,
button[aria-label="삭제"] i {
    font-size: 14px !important;
}

/* ====================================================
   16. 캔버스 사이즈 모달 스타일
   ==================================================== */
.size-preset {
    padding: 14px 16px;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    position: relative;
}
.size-preset:hover {
    border-color: #C7D2FE;
}

.size-preset.active {
    border-color: #6366F1;
    background: #EEF2FF;
}

.size-dimensions-text {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 0;
    transition: all 0.2s;
    display: inline-block;
}

.size-dimensions-text:hover {
    background-color: #EEF2FF;
    color: #6366F1;
}

.dimensions-edit-form {
    display: none;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 4px;
    gap: 8px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 0
}

.dimension-input {
    width: 70px !important;
    padding: 6px 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 0;
    font-size: 13px !important;
    text-align: center !important;
}

.edit-actions {
    display: flex;
    gap: 4px;
}

.dimension-apply-btn,
.dimension-cancel-btn,
.dimension-swap-btn {
    background: none;
    border: 1px solid #eee;
    border-radius: 0;
    padding: 4px;
    cursor: pointer;
    font-size: 13px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dimension-swap-btn {
    color: #6366F1;
}

.dimension-swap-btn:hover {
    background-color: #EEF2FF;
    color: #4F46E5;
    border-color: #C7D2FE;
}

.dimension-apply-btn {
    color: #6366F1;
}

.dimension-apply-btn:hover {
    background-color: #EEF2FF;
    color: #4F46E5;
    border-color: #C7D2FE;
}

.dimension-cancel-btn {
    color: #EF4444;
}

.dimension-cancel-btn:hover {
    background-color: #FEF2F2;
    color: #DC2626;
    border-color: #ef9a9a;
}

.size-category-tab {
    position: relative;
    color: #6B7280;
    font-weight: 500;
    padding: 10px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}
.size-category-tab:hover { color: #374151; }
.size-category-tab.active { color: #6366F1; font-weight: 700; }
.size-category-tab.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #6366F1;
}

/* ── 사이즈 모달 레이아웃 (uip-help-modal 디자인 언어) ── */
.size-category-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #E5E7EB;
    overflow-x: auto;
    scrollbar-width: none;
}
.size-category-tabs::-webkit-scrollbar { display: none; }

.size-category-content { display: none; }
.size-category-content.active { display: block; }

.sizes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-right: 8px;
}

/* 사이즈 모달 내부 모든 모서리 직각 보장 */
#size-modal,
#size-modal * {
    border-radius: 0 !important;
}

.size-preview {
    display: block;
    margin: 0 auto 10px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
}

.size-info { text-align: center; }

.size-name {
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.size-dimensions {
    color: #6B7280;
    font-size: 12px;
    line-height: 1.4;
}

/* 참고문서 드롭다운 메뉴 스타일 */
.reference-menu-dropdown {
    display: none;
    position: absolute;
    top: 30px;
    right: 0;
    z-index: 9999;
    background-color: #16161D;
    border: 1px solid #444;
    border-radius: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.5);
    width: 100px;
    padding: 5px 0;
    overflow: visible;
}

.reference-menu-dropdown.show {
    display: block !important;
}

.reference-menu-item {
    padding: 5px 8px;
    cursor: pointer;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
}

.reference-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.reference-actions {
    position: relative;
    z-index: 9999;
}

/* 기존 파일 메뉴 드롭다운 스타일 */
.file-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 120px;
    padding: 5px 0;
}

.file-menu-dropdown.show {
    display: block;
}

.file-menu-item {
    padding: 4px 8px;
    cursor: pointer;
    color: var(--sidebar-text);
    font-size: 12px;
    white-space: nowrap;
}

.file-menu-item:hover {
    background-color: #EEF2FF !important;
    color: #4F46E5 !important;
}

/* 드롭다운 메뉴 공통 스타일 */
.file-menu-dropdown,
.reference-menu-dropdown {
    display: none;
    position: absolute;
    top: 30px;
    right: 0;
    z-index: 9999;
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100px;
    padding: 5px 0;
    overflow: visible;
}

.file-menu-dropdown.show,
.reference-menu-dropdown.show {
    display: block !important;
}

.file-menu-item,
.reference-menu-item {
    padding: 5px 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.file-menu-item:hover,
.folder-menu-item:hover,
.reference-menu-item:hover {
    background-color: #EEF2FF !important;
    color: #4F46E5 !important;
}

.file-menu-item.delete-file-btn:hover {
    background-color: #FEE2E2 !important;
    color: #DC2626 !important;
}

/* 파일 메뉴 아이템 내 아이콘 여백 */
.file-menu-item i,
.reference-menu-item i {
    margin-right: 6px;
    font-size: 10px;
}

/* 프로젝트 규칙 메뉴 버튼 스타일 */
.reference-menu-btn {
    background: none;
    border: none;
    color: var(--sidebar-icon);
    cursor: pointer;
    padding: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.reference-menu-btn:hover {
    background-color: var(--sidebar-hover);
    color: var(--highlight-color);
}

/* 프로젝트 규칙 아이템 호버 시 메뉴 버튼 표시 */
.reference-item:hover .reference-menu-btn {
    opacity: 1;
}

/* 드롭다운이 열려있을 때 메뉴 버튼 유지 */
.reference-menu-dropdown[style*="display: block"] + .reference-menu-btn,
.reference-menu-dropdown[style*="display: block"] ~ .reference-menu-btn {
    opacity: 1;
}


/* 사이드바 새 폴더/파일 버튼 호버 */
.new-folder-btn:hover, .new-file-btn:hover {
  background: rgba(99,102,241,0.08) !important;
  color: #6366F1 !important;
  border-color: rgba(99,102,241,0.3) !important;
}
.new-folder-btn:hover svg, .new-file-btn:hover svg {
  stroke: #6366F1;
}

/* 선택/검색 버튼 호버 */
#select-individual-btn:hover,
#search-files-btn:hover {
  color: #6366F1 !important;
}
#select-individual-btn:hover svg,
#search-files-btn:hover svg {
  stroke: #6366F1;
}

/* 체크박스와 삭제 버튼 스타일 유지 */
.select-all-container {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
}

.select-all-checkbox,
#editor-root .uip-filmstrip__check {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--sidebar-border);
  border-radius: 0;
  background-color: var(--sidebar-btn-bg);
  cursor: pointer;
  position: relative;
  margin: 0;
  flex-shrink: 0;
}

#editor-root .uip-filmstrip__check {
  position: absolute;
}

.select-all-checkbox:checked,
#editor-root .uip-filmstrip__check:checked {
  background-color: var(--highlight-color);
  border-color: var(--highlight-color);
}

.select-all-checkbox:checked::after,
#editor-root .uip-filmstrip__check:checked::after {
  content: "\2713";
  position: absolute;
  color: white;
  font-size: 12px;
  line-height: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.select-all-checkbox:indeterminate,
#editor-root .uip-filmstrip__check:indeterminate {
  background-color: var(--highlight-color);
  border-color: var(--highlight-color);
}

.select-all-checkbox:indeterminate::after,
#editor-root .uip-filmstrip__check:indeterminate::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 2px;
  background: #fff;
  transform: translate(-50%, -50%);
}

.select-all-checkbox:focus-visible,
#editor-root .uip-filmstrip__check:focus-visible {
  outline: 2px solid var(--highlight-color);
  outline-offset: 1px;
}

.file-checkbox, .folder-checkbox {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid #666;
    border-radius: 0;
    background-color: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.file-checkbox:checked, .folder-checkbox:checked {
    background-color: #6366F1;
    border-color: #6366F1;
}

.file-checkbox:checked::after, .folder-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: -1px;
    left: 1px;
    font-size: 12px;
    color: white;
    font-weight: bold;
}

/* 선택된 항목 강조 */
.file-checkbox:checked + i, .folder-checkbox:checked + div i {
    color: #6366F1;
}

/* 중간 상태(일부만 선택됨) 체크박스 스타일 */
.folder-checkbox:indeterminate {
    background-color: #6366F1;
    opacity: 0.6;
    border-color: #6366F1;
}

.folder-checkbox:indeterminate::after {
    content: "−"; /* 대시("-") 문자 */
    position: absolute;
    top: -1px;
    left: 2px;
    font-size: 12px;
    color: white;
    font-weight: bold;
}

/* 삭제 버튼 스타일 */
.delete-selected-btn {
    transition: all 0.2s ease;
}

/* 선택 상태 표시 스타일 */
.selection-status {
    transition: all 0.2s ease;
}

.file-item-content, .folder-item-content {
  display: flex;
  align-items: center;
  flex: 1;
}

.file-item-checkbox-container, .folder-item-checkbox-container {
  display: none;
  margin-right: 6px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.show-checkboxes .file-item-checkbox-container,
.show-checkboxes .folder-item-checkbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 기존 파일/폴더 아이템 여백 조정 */
.file-item-left, .folder-item-left {
  display: flex;
  align-items: center;
}

/* 파일/폴더 목록에 체크박스가 표시될 때 여백 조정 */
.show-checkboxes .file-item-left,
.show-checkboxes .folder-item-left {
  margin-left: 0;
}

/* 폴더 아이템 스타일 개선 */
.folder-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background-color: var(--sidebar-bg);
    border-radius: 0;
    cursor: pointer;
    min-height: 32px; /* 최소 높이 설정 */
}

.folder-header:hover {
  background-color: var(--sidebar-hover);
}

.folder-item.active .folder-header {
  background-color: var(--selected-item-bg);
}

.folder-toggle {
    margin-right: 2px;
    width: 12px;
    text-align: center;
    color: var(--sidebar-icon);
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-icon {
    margin-right: 6px;
    color: var(--sidebar-icon);
    display: flex;
    align-items: center;
}

.folder-icon i {
  color: var(--sidebar-icon);
}

.folder-name {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    white-space: normal;
    overflow: hidden;
    word-break: break-word;
    line-height: 1.3;
    max-height: 2.6em; /* 2줄 제한 (line-height * 2) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--sidebar-text);
    flex: 1; /* flex 컨테이너에서 남은 공간 차지 */
    min-width: 0; /* flex 아이템이 축소될 수 있도록 */
    margin-right: 8px; /* 메뉴 버튼과의 여백 확보 */
}

/* 폴더 액션 버튼 영역 고정 */
.folder-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* 크기 고정 */
    width: 32px; /* 고정 너비 */
    justify-content: center;
}

.folder-action-btn {
    background: none;
    border: none;
    color: var(--sidebar-icon);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 0;
    transition: all 0.2s;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-action-btn:hover {
    background-color: var(--sidebar-hover);
    color: var(--highlight-color);
}

.folder-item-left {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: calc(100% - 40px); /* 메뉴 버튼 영역 확보 */
    overflow: hidden;
}

/* 체크박스 관련 스타일 */
.show-checkboxes .folder-item-checkbox-container,
.show-checkboxes .file-item-checkbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 입력 필드와 없음 버튼을 위한 스타일 */
.input-with-reset {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.input-with-reset .input-with-unit {
  flex: 1;
}

.reset-value-btn {
  background-color: #f1f1f1;
  border: 1px solid #ddd;
  border-radius: 0;
  padding: 0 8px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reset-value-btn:hover {
  background-color: #e5e5e5;
  color: #333;
}

.reset-value-btn:active {
  background-color: #d9d9d9;
}

/* 수치 버튼 컨테이너 */
.value-buttons-container {
  display: flex;
  flex-direction: row;
  gap: 4px;
  margin-top: 6px;
  justify-content: space-between;
}

/* 수치 버튼 스타일 */
.quick-value-btn {
  background-color: #f1f1f1;
  border: 1px solid #ddd;
  border-radius: 0;
  padding: 0;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-value-btn:hover {
  background-color: #e5e5e5;
  color: #333;
}

.quick-value-btn:active {
  background-color: #d9d9d9;
}

/* 새로운 레이아웃 구조 */
.controls-container {
  display: flex;
  flex-direction: row;
  gap: 4px;
  width: 100%;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: visible;
}

/* 텍스트 서식 버튼을 위한 특별 스타일 */
.controls-container .style-btn {
  min-width: 36px;
  height: 36px;
  flex: 0.5;
  padding: 0;
}

.reset-value-btn {
  background-color: #fff;
  border: 1px solid #EBEBEB;
  border-radius: 0;
  padding: 0 4px;
  font-size: 12px;
  color: #666666;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  flex-shrink: 0;
}

.reset-value-btn:hover {
  background-color: #F5F5F5;
}

.reset-value-btn:active, .reset-value-btn.active {
  background-color: #6366F1;
  color: white;
  border-color: #6366F1;
}

/* 수치 버튼 컨테이너 */
.value-buttons-container {
  display: flex;
  gap: 4px;
  justify-content: space-between;
  width: 100%;
  height: 28px;
}

/* 수치 버튼 스타일 */
.quick-value-btn {
  background-color: #fff;
  border: 1px solid #EBEBEB;
  border-radius: 0;
  padding: 0;
  font-size: 12px;
  color: #666666;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  max-width: 32px;
  flex: 0.5;
}

.quick-value-btn:hover {
  background-color: #F5F5F5;
}

.quick-value-btn:active, .quick-value-btn.active {
  background-color: #6366F1;
  color: white;
  border-color: #6366F1;
}

/* 검색 아이콘 버튼 스타일 */
#search-files-btn {
    transition: all 0.2s ease;
}

#search-files-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 검색 영역 스타일 */
.search-container {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid #E5E7EB;
    transition: all 0.3s ease;
    overflow: hidden;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #F3F4F6;
    border-radius: 0;
    padding: 0 10px;
    height: 32px;
}

.search-icon {
    color: #6B7280;
    font-size: 13px;
    margin-right: 8px;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #111827;
    font-size: 13px;
    outline: none;
    width: 100%;
    height: 100%;
}

.search-input:focus {
    color: #111827;
    border-bottom: 1px solid #6366F1;
}

.search-input::placeholder {
    color: #9CA3AF;
}

.search-replace-btn {
    background: none;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 0;
    margin-right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 0;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.search-replace-btn i,
.search-replace-btn svg {
    width: 14px;
    height: 14px;
}

.search-replace-btn:hover {
    background-color: rgba(0, 0, 0, 0.07);
    color: #111827;
}

.clear-search-btn {
    background: none;
    border: none;
    color: #6B7280;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 0;
    transition: background-color 0.2s;
}

.clear-search-btn:hover {
    background-color: rgba(0, 0, 0, 0.07);
    color: #111827;
}

.search-results-container {
    border-top: 1px solid #E5E7EB;
    margin-top: 8px;
    padding-top: 8px;
    background-color: #ffffff;
    color: #374151;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
    width: 100%;
    position: relative;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: #D1D5DB transparent;
}

.search-results-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.search-results-container::-webkit-scrollbar-track {
    background: transparent;
}

.search-results-container::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 0;
}

.search-results-container::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

.search-result-item {
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 0;
    margin-bottom: 2px;
    font-size: 0.8em; /* 폰트 크기 20% 축소 */
}

.search-result-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.search-result-item:active {
    background-color: rgba(99, 102, 241, 0.2);
}

.search-result-item .result-icon {
    margin-right: 8px;
    color: #6B7280;
    font-size: 14px;
}

.search-result-item .result-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #111827;
}

.search-result-item .result-path {
    font-size: 11px;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.search-highlight {
    color: #4F46E5;
    background-color: #e8e2ff;
    font-weight: 500;
    padding: 1px 3px;
    border-radius: 0;
}

.no-search-results {
    padding: 16px;
    text-align: center;
    color: #6B7280;
    font-size: 13px;
}

/* 검색 결과 섹션 제목 (페이지 / 화면 내용) */
.search-result-section-title {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
}

/* 폴더 인라인 이름 편집 */
.folder-rename-input {
    width: 100%;
    font-size: 12px;
    padding: 1px 4px;
    border: 1px solid #6366F1;
    outline: none;
    background: #fff;
    color: #374151;
    font-family: inherit;
    box-sizing: border-box;
}

/* 폴더 강조 효과 스타일 */
.highlight-folder {
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
    0% { background-color: rgba(99,102,241,0); }
    25% { background-color: rgba(99,102,241,0.2); }
    50% { background-color: rgba(99,102,241,0.3); }
    75% { background-color: rgba(99,102,241,0.2); }
    100% { background-color: rgba(99,102,241,0); }
}

/* 아이콘 관련 스타일 */
.icon-preview-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    width: 100%;
    justify-content: space-between;
}

.current-icon-preview {
    /* font-family: Lucide SVG icons */
    font-size: 24px;
    border: 1px solid #ddd;
    border-radius: 0;
    padding: 8px;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    font-feature-settings: 'liga';
}

.btn-purple {
    background-color: #4F46E5;
    color: white;
    border: none;
}

.btn-purple:hover {
    background-color: #4F46E5;
}

#change-icon-btn {
    display: block;
    padding: 8px 16px;
    background-color: #4F46E5;
    color: white;
    border: none;
    border-radius: 0;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#change-icon-btn:hover {
    background-color: #4F46E5;
}

#icon-panel-container {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 10px;
    max-height: 400px;
    overflow-y: auto;
}

/* 아이콘 라이브러리 스타일 */
.icon-library-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.icon-search-container {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.icon-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 14px;
}

.icon-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.icon-tab {
    padding: 10px 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.icon-tab.active {
    color: #4F46E5;
    border-bottom: 2px solid #4F46E5;
    font-weight: 500;
}

.icon-content-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.icon-content {
    display: none;
}

.icon-content.active {
    display: block;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 10px 0;
}

.icon-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    cursor: pointer;
    background: none;
    transition: all 0.2s ease;
    font-size: 20px;
}

.icon-item:hover {
    background-color: #f5f5f5;
    border-color: #bbb;
    transform: scale(1.05);
}

.icon-item.selected {
    background-color: #ede7f6;
    border-color: #4F46E5;
}

.icon-item 

.icon-item.selected 

.icon-categories-accordion {
    display: flex;
    flex-direction: column;
}

.category-item {
    border-bottom: 1px solid #e0e0e0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    cursor: pointer;
    font-weight: 500;
}

.category-header:hover {
    background-color: #f5f5f5;
}

.category-content {
    display: none;
    padding: 0 10px;
}

.category-item.active .category-content {
    display: block;
}

.folder-item.active {
    background-color: var(--selected-item-bg);
}

.folder-item.active .folder-icon i,
.folder-item.active .folder-icon svg,
.folder-item.active .folder-name {
    color: var(--highlight-color);
    stroke: var(--highlight-color);
    font-weight: 500;
}

/* 파일 목록 컨테이너 스크롤 설정 */
#file-list {
    height: 100%;
    overflow-y: auto;
    position: relative;
}

/* 취소 선택 버튼 스타일도 함께 조정 */
.cancel-selection-btn {
  background-color: transparent; /* 배경색 투명하게 */
  color: #666; /* 아이콘 색상을 회색으로 */
  border: none;
  padding: 2px 6px;
  border-radius: 0;
  font-size: 16px; /* 아이콘을 위해 폰트 크기 증가 */
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;

}

.folder-item:hover {
    background-color: var(--sidebar-hover);
}

/* 선택 상태 텍스트와 해제 버튼을 묶는 컨테이너 */
.selection-info-container {
  display: flex;
  align-items: center;
  gap: 8px; /* 텍스트와 버튼 사이 간격 */
  flex: 1;
}

/* 일괄 삭제 확인은 선택 툴바의 다음 줄 전체를 사용한다. */
.uip-sidebar-add-page-wrap .selection-controls {
  flex-wrap: wrap;
}

.uip-sidebar-add-page-wrap .selection-controls > .file-delete-confirm {
  flex: 0 0 100%;
  max-width: 100%;
}

/* 선택 상태 텍스트 스타일 */
.selection-status {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* 취소 선택 버튼 스타일 수정 */
.cancel-selection-btn {
  background-color: transparent;
  color: #666;
  border: none;
  padding: 4px 8px;
  border-radius: 0;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.cancel-selection-btn:hover {
  background-color: var(--sidebar-hover);
  color: var(--highlight-color);
}

/* 삭제 버튼을 오른쪽 끝으로 배치 */
.delete-selected-btn {
  margin-left: auto;
  background-color: #EF4444;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 0;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.delete-selected-btn:hover {
  background-color: #d32f2f;
}

.delete-selected-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* ====================================================
   17. 프로젝트 규칙 모달 스타일
   ==================================================== */
/* 프로젝트 규칙 모달 기본 스타일 */
#reference-modal.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

#reference-modal.modal[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

#reference-modal .modal-content {
    width: 80%;
    max-width: 800px;
    max-height: 90vh;
    background-color: #fff !important;
    border-radius: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(10px);
    transition: transform 0.3s ease;
    animation: reference-modal-appear 0.3s forwards;
}

@keyframes reference-modal-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#reference-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background-color: #fff !important;
}

#reference-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827 !important;
}

.modal-header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.project-rules-modal-toggle-container {
    display: flex;
    align-items: center;
}

.project-rules-modal-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    user-select: none;
}

.project-rules-modal-toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #e5e7eb;
    border-radius: 0;
    transition: background-color 0.2s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.project-rules-modal-toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background-color: #6366F1;
}

.project-rules-modal-toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-text {
    font-weight: 500;
}

#reference-modal .modal-close-btn {
    border: none;
    background: none;
    color: #6b7280 !important;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
}

#reference-modal .modal-close-btn:hover {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
}

#reference-modal .modal-close-btn svg {
    width: 24px;
    height: 24px;
}

#reference-modal .modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
    flex: 1;
    background-color: #fff !important;
}

#reference-modal .form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

#reference-modal .form-row:last-child {
    margin-bottom: 0;
}

#reference-modal .form-label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151 !important;
    font-size: 14px;
}

#reference-modal .modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    color: #111827 !important;
    background-color: #ffffff !important;
}

#reference-modal .modal-input:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

#reference-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    background-color: #fff !important;
}

#reference-modal .secondary-button {
    background-color: #f9fafb !important;
    color: #111827 !important;
    border: 1px solid #e5e7eb;
    padding: 9px 16px;
    border-radius: 0;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 4px;
}

#reference-modal .secondary-button:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

#reference-modal .primary-button {
    background-color: #6366F1;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 0;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#reference-modal .primary-button:hover {
    background-color: #4F46E5;
}

/* CKEditor 스타일 */
.ck-editor__editable_inline {
    min-height: 500px !important;
    max-height: 500px !important;
    padding: 12px !important;
    background-color: #ffffff !important;
    color: #111827 !important;
}

.ck.ck-editor__main > .ck-editor__editable {
    border-radius: 0;
    border-color: #e5e7eb !important;
    background-color: #ffffff !important;
    color: #111827 !important;
}

.ck.ck-editor__main > .ck-editor__editable:focus {
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1) !important;
    background-color: #ffffff !important;
    color: #111827 !important;
}

.ck.ck-toolbar {
    border-radius: 0;
    border-color: #e5e7eb !important;
    background-color: #f9fafb !important;
}

.ck.ck-button {
    border-radius: 0;
    transition: all 0.2s ease !important;
    color: #374151 !important;
}

.ck.ck-button:hover {
    background-color: #e5e7eb !important;
    color: #111827 !important;
}

.ck.ck-button.ck-on {
    background-color: #e5e7eb !important;
    color: #6366F1 !important;
}

/* CKEditor 내부 컨텐츠 스타일 강제 적용 */
.ck-content {
    background-color: #ffffff !important;
    color: #111827 !important;
}

.ck-content p {
    color: #111827 !important;
}

.ck-content h1, .ck-content h2, .ck-content h3, .ck-content h4, .ck-content h5, .ck-content h6 {
    color: #111827 !important;
}

.ck-content ul, .ck-content ol, .ck-content li {
    color: #111827 !important;
}

.ck-content strong, .ck-content b {
    color: #111827 !important;
}

.ck-content em, .ck-content i {
    color: #111827 !important;
}

/* "Rich Text Editor" 레이블 숨김 처리 */
.ck-editor .ck-voice-label,
.ck-editor .ck-editor__label,
.ck-reset_all .ck-voice-label {
    display: none !important;
}

/* CKEditor 플레이스홀더 텍스트 스타일 */
.ck-editor__editable[data-placeholder]::before {
    color: #9ca3af !important;
    background-color: transparent !important;
}

/* CKEditor 모든 텍스트 요소 강제 스타일 적용 */
.ck-editor__editable * {
    color: #111827 !important;
}

/* CKEditor 드롭다운 메뉴 스타일 */
.ck.ck-dropdown__panel {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
}

.ck.ck-list__item {
    color: #111827 !important;
}

.ck.ck-list__item:hover {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    #reference-modal .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    #reference-modal .modal-body {
        padding: 16px;
    }
    
    .ck-editor__editable_inline {
        min-height: 300px !important;
        max-height: 300px !important;
    }
}

/* 섹션 관련 스타일 */
/* 섹션 아이템 스타일 - 파일 리스트와 동일한 디자인 */
/* 섹션 아이템은 파일 아이템 스타일을 재사용 */
.section-item {
    /* sticky 헤더 아래에 표시되도록 여백 확보 */
    scroll-margin-top: 110px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    margin-top: 2px;
    margin-bottom: 2px;
    border-radius: 0;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    color: var(--sidebar-text);
}

.section-item:hover {
    background-color: var(--sidebar-hover);
}

.section-item.active {
    background-color: var(--selected-item-bg);
    color: var(--highlight-color);
    font-weight: 500;
}

.section-icon {
    font-size: 14px;
    min-width: 18px;
    color: var(--sidebar-icon);
}

.section-item.active .section-icon {
    color: var(--highlight-color);
}

.section-name {
    flex: 1;
    font-size: 13px;
    color: inherit;
    font-weight: inherit;
}

.section-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 4px;
    border-radius: 0;
    transition: all 0.2s;
    font-size: 12px;
}

.section-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.section-btn.edit-section-btn:hover {
    color: #2196F3;
}

.section-btn.preview-section-btn:hover {
    color: #6366F1;
}

.section-btn.move-up-btn:hover,
.section-btn.move-down-btn:hover {
    color: #FF9800;
}

.section-btn.delete-section-btn:hover {
    color: #EF4444;
}

/* 섹션 편집 모달 스타일 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: #16161D;
    border-radius: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #444;
}

.modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 18px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 8px;
    border-radius: 0;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #fff;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px;
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 0;
    color: #fff;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #6366F1;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Courier New', monospace;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #444;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #6366F1;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #666;
    color: white;
}

.btn-secondary:hover {
    background-color: #777;
}

/* 미리보기 헤더 이미지 추가 버튼 스타일 */
.action-buttons .icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: transparent;
    border: none;
    font-size: 16px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 42px;
    height: 42px;
    box-shadow: none;
}

.action-buttons .icon-btn:hover {
    color: #6C5CE7;
    transform: none;
}

.action-buttons .icon-btn i {
    font-size: 20px;
    color: #555;
}

.action-buttons #add-frame-btn.uip-toolbar-add-frame-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: 0;
    height: 32px;
    padding: 0 12px;
    box-sizing: border-box;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    color: #374151;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.action-buttons #add-frame-btn.uip-toolbar-add-frame-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #111827;
}

/* 리사이저블 핸들 호버 효과 */
.resizer-handle:hover {
    background-color: #16161D !important;
}

.resizer-handle:hover .resizer-line {
    opacity: 1;
}

.resizer-line {
    opacity: 0;
    transition: opacity 0.2s;
}

/* 디스크립션 패널 편집 버튼 스타일 */
.panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-edit-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 0;
    transition: all 0.2s ease;
}

.panel-edit-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

.panel-edit-btn i {
    font-size: 14px;
}

/* 이미지 편집 관련 스타일 */
.image-source-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.image-source-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #EBEBEB;
    border-radius: 0;
    font-size: 12px;
    color: #666;
    background-color: #F9F9F9;
    font-family: 'Roboto Mono', monospace;
}

.border-radius-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.border-radius-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 0;
    background: #EBEBEB;
    outline: none;
    -webkit-appearance: none;
}

.border-radius-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6366F1;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.border-radius-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6366F1;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-purple {
    background-color: #6366F1;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.btn-purple:hover {
    background-color: #4F46E5;
}

.btn-purple i {
    margin-right: 6px;
}

/* 확대/축소 관련 스타일 */
.zoom-level {
    font-size: 12px;
    color: #666666;
    padding: 0 8px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-weight: 500;
    min-width: 40px;
    justify-content: center;
}

/* 프리뷰 컨테이너 줌 기능은 위에서 이미 정의됨 */

/* 확대/축소 컨트롤 스타일 */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.zoom-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #D9D9D9;
    border-radius: 0;
    background-color: #FFFFFF;
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
    box-sizing: border-box;
    font-family: inherit;
}

.zoom-btn:hover {
    background-color: #F5F5F5;
    color: #6366F1;
    border-color: #6366F1;
}

.zoom-btn:active {
    background-color: #E9E9E9;
}

.zoom-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.zoom-btn:disabled:hover {
    background-color: #FFFFFF;
    color: #1f2937;
    border-color: #D9D9D9;
}

.zoom-level-container {
    display: flex;
    align-items: center;
    border: 1px solid #D9D9D9;
    border-radius: 0;
    background-color: #FFFFFF;
    height: 28px;
    padding: 0 8px;
    gap: 2px;
}

.zoom-level-input {
    width: 35px;
    border: none;
    background-color: transparent;
    color: #1f2937;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    outline: none;
    padding: 0;
    margin: 0;
    -moz-appearance: textfield; /* Firefox에서 스피너 제거 */
}

.zoom-level-input::-webkit-outer-spin-button,
.zoom-level-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.zoom-percent {
    font-size: 12px;
    color: #666666;
    font-weight: 500;
    user-select: none;
}

/* ====================================================
   ASK 모드 스타일 - 기본 메시지 스타일 재정의
   ==================================================== */
.ai-message.ask-mode {
    background: transparent !important;
    padding: 0 !important;
    margin: 8px 0 !important;
    border: none !important;
    border-radius: 0;
    box-shadow: none !important;
    max-width: 100% !important;
    align-self: flex-start !important;
    overflow: visible !important;
}

.ai-message.ask-mode .message-content.ask-content {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 1px solid #e6e9ff;
    border-radius: 0;
    padding: 16px 20px;
    max-width: 85%;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(99,102,241,0.1);
    position: relative;
    margin: 0;
}

.ai-message.ask-mode .message-content.ask-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #f8f9ff;
}

.ai-message.ask-mode .message-content.ask-content p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: #333;
}

.ai-message.ask-mode .message-content.ask-content p:last-child {
    margin-bottom: 0;
}

.ai-message.ask-mode .message-content.ask-content h1,
.ai-message.ask-mode .message-content.ask-content h2,
.ai-message.ask-mode .message-content.ask-content h3,
.ai-message.ask-mode .message-content.ask-content h4,
.ai-message.ask-mode .message-content.ask-content h5,
.ai-message.ask-mode .message-content.ask-content h6 {
    margin: 16px 0 8px 0;
    color: #16161D;
    font-weight: 600;
}

.ai-message.ask-mode .message-content.ask-content h1:first-child,
.ai-message.ask-mode .message-content.ask-content h2:first-child,
.ai-message.ask-mode .message-content.ask-content h3:first-child {
    margin-top: 0;
}

.ai-message.ask-mode .message-content.ask-content ul,
.ai-message.ask-mode .message-content.ask-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.ai-message.ask-mode .message-content.ask-content li {
    margin: 4px 0;
    line-height: 1.5;
    color: #444;
}

.ai-message.ask-mode .message-content.ask-content strong,
.ai-message.ask-mode .message-content.ask-content b {
    color: #16161D;
    font-weight: 600;
}

.ai-message.ask-mode .message-content.ask-content em,
.ai-message.ask-mode .message-content.ask-content i {
    color: #555;
    font-style: italic;
}

.ai-message.ask-mode .message-content.ask-content code {
    background: rgba(99,102,241,0.1);
    color: #6366F1;
    padding: 2px 6px;
    border-radius: 0;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9em;
}

.ai-message.ask-mode .message-content.ask-content blockquote {
    border-left: 3px solid #6366F1;
    margin: 12px 0;
    padding: 8px 16px;
    background: rgba(99,102,241,0.05);
    border-radius: 0;
    color: #555;
    font-style: italic;
}

.ai-message.ask-mode .message-content.ask-content a {
    color: #6366F1;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s ease;
}

.ai-message.ask-mode .message-content.ask-content a:hover {
    border-bottom-color: #6366F1;
}

/* ASK 모드 복사 버튼 */
.ai-message.ask-mode .ask-copy-btn {
    position: absolute;
    bottom: -12px;
    right: 16px;
    width: 24px;
    height: 24px;
    background: #f8f9ff;
    border: 1px solid #e6e9ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    font-size: 11px;
    color: #666;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.ai-message.ask-mode:hover .ask-copy-btn {
    opacity: 1;
}

.ai-message.ask-mode .ask-copy-btn:hover {
    background: #6366F1;
    color: white;
    border-color: #6366F1;
    transform: scale(1.1);
}

.ai-message.ask-mode .ask-copy-btn.copied {
    background: #10B981;
    color: white;
    border-color: #10B981;
}

.ai-message.ask-mode .ask-copy-btn.copied i {
    display: none;
}

.ai-message.ask-mode .ask-copy-btn.copied::before {
    content: '✓';
    font-size: 10px;
    font-weight: bold;
}

/* ====================================================
   다크모드에서의 AI 생각 중 애니메이션
   ==================================================== */

/* ====================================================
   Think 모드 스타일
   ==================================================== */

/* Think 모드 메시지 컨테이너 */
.ai-message.think-mode {
    background: linear-gradient(145deg, #f0f8ff, #e6f3ff);
    border: 2px solid #4a90e2;
    border-radius: 0;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.think-section {
    margin-bottom: 16px;
}

.think-section:last-child {
    margin-bottom: 0;
}

.think-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #2c5282;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #4a90e2;
}

.think-section-header i {
    color: #4a90e2;
    font-size: 16px;
}

.think-section-logo {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    object-fit: contain;
}

.enhanced-prompt-section {
    background: #FFFFFF;
    border: 1px solid #C7D2FE;
    border-radius: 0;
    padding: 0;
    margin-bottom: 16px;
    overflow: hidden;
}

.enhanced-prompt-section .think-section-header {
    min-height: 46px;
    margin: 0;
    padding: 11px 14px;
    color: #3730A3;
    background: #F5F7FF;
    border-bottom: 1px solid #E0E7FF;
    font-size: 15px;
    font-weight: 700;
}

.think-section-content {
    font-size: 14px;
    line-height: 1.6;
}

.enhanced-prompt-section .think-section-content {
    padding: 14px 16px 16px;
}

.think-section-content p {
    margin: 0;
    color: #2d3748;
}

.result-section {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0;
    padding: 16px;
}

.result-section .think-section-header {
    color: #2d3748;
    border-bottom-color: #e2e8f0;
}

/* ====================================================
   Auto 모드 스타일
   ==================================================== */

/* Auto 모드 메시지 컨테이너 */
.ai-message.auto-mode {
    background: linear-gradient(145deg, #f0fff4, #e6fffa);
    border: 2px solid #38a169;
    border-radius: 0;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.15);
}

.ai-message.auto-question-message {
    overflow: visible;
    padding: 0;
    margin: 12px 0 20px;
}

.ai-message.auto-rules-review-message {
    overflow: visible;
    padding: 0;
    margin: 12px 0 20px;
}

.auto-question-card {
    box-sizing: border-box;
    overflow: visible;
}

.auto-rules-review-card {
    box-sizing: border-box;
    overflow: visible;
}

.auto-progress-section {
    margin-bottom: 16px;
}

.auto-progress-section:last-child {
    margin-bottom: 0;
}

.auto-progress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #2f855a;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #38a169;
}

.auto-progress-header i {
    color: #38a169;
    font-size: 16px;
}

.auto-generation-section .auto-progress-header i {
    color: #3182ce;
    animation: spin 1s linear infinite;
}

.auto-generation-section {
    background: #ebf8ff;
    border: 1px solid #3182ce;
    border-radius: 0;
    padding: 16px;
    margin-bottom: 16px;
}

.auto-generation-section .auto-progress-header {
    color: #2c5282;
    border-bottom-color: #3182ce;
}

.auto-progress-content {
    font-size: 14px;
    line-height: 1.6;
}

.auto-progress-content p {
    margin: 0;
    color: #276749;
}

.auto-summary-section {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0;
    padding: 16px;
}

.auto-summary-section .auto-progress-header {
    color: #2d3748;
    border-bottom-color: #e2e8f0;
}

.auto-page-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
}

.auto-page-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.auto-page-item:last-child {
    border-bottom: none;
}

.auto-page-status {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.auto-page-status.success {
    background: #38a169;
    color: white;
}

.auto-page-status.error {
    background: #e53e3e;
    color: white;
}

.auto-page-status.loading {
    background: #3182ce;
    color: white;
    animation: pulse 1.5s infinite;
}

.auto-page-title {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
}

.auto-completion-summary {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(145deg, #f0fff4, #e6fffa);
    border: 2px solid #38a169;
    border-radius: 0;
    font-size: 14px;
}

.auto-completion-summary h4 {
    margin: 0 0 12px 0;
    color: #2f855a;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-completion-summary h4 i {
    color: #38a169;
    font-size: 18px;
}

.auto-completion-summary p {
    margin: 8px 0 0 0;
    color: #2d5a3f;
    line-height: 1.5;
}

.auto-page-link {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 8px;
    background: #e6fffa;
    color: #2f855a;
    text-decoration: none;
    border-radius: 0;
    font-size: 12px;
    border: 1px solid #38a169;
    font-weight: 500;
    transition: all 0.2s ease;
}

.auto-page-link:hover {
    background: #2f855a;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(56, 161, 105, 0.3);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 요소 순서 버튼 스타일 */
#element-order-section .controls-container {
    display: flex !important;
    gap: 4px !important;
    justify-content: center !important;
}

#element-order-section .controls-container .btn-purple {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 8px 4px !important;
    border-radius: 0;
    font-size: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#element-order-section .controls-container .btn-purple i {
    margin: 0 !important;
}

@keyframes uipBarSlide {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(150%); }
    100% { transform: translateX(350%); }
}

/* ====================================================
   Think 모드 확인 UI 스타일
   ==================================================== */

.think-confirmation-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding: 0 12px 12px;
}

.think-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    color: #374151;
    font-size: 13px;
    font-family: 'Pretendard Variable', sans-serif;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.think-btn:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

.think-approve-btn {
    background: #6366F1;
    color: #FFFFFF;
    border-color: #6366F1;
}

.think-approve-btn:hover {
    background: #4F46E5;
    border-color: #4F46E5;
}

.think-cancel-btn {
    color: #6B7280;
}

.think-cancel-btn:hover {
    background: #FEE2E2;
    color: #EF4444;
    border-color: #FECACA;
}

.think-edit-area {
    padding: 0 12px 12px;
}

.think-edit-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    color: #111827;
    font-size: 13px;
    font-family: 'Pretendard Variable', sans-serif;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.think-edit-textarea:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.think-confirm-edit-btn {
    background: #6366F1;
    color: #FFFFFF;
    border-color: #6366F1;
}

.think-confirm-edit-btn:hover {
    background: #4F46E5;
    border-color: #4F46E5;
}

/* === 배치 설정 모달 === */
.layout-modal__dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 80px);
    background: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    z-index: 9001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.layout-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #E5E7EB;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.layout-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9CA3AF;
}

.layout-modal__close:hover {
    color: #111827;
}

.layout-modal__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
}

.layout-modal__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.layout-modal__presets {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid #E5E7EB;
}

.layout-modal__preset-btn {
    flex: 1;
    padding: 6px 0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    color: #6B7280;
    font-family: 'Pretendard Variable', Pretendard, sans-serif;
}

.layout-modal__preset-btn:hover {
    border-color: #6366F1;
    color: #6366F1;
}

.layout-modal__preset-btn.is-active {
    border-color: #6366F1;
    color: #6366F1;
    background: #EEF2FF;
    font-weight: 600;
}

.layout-modal__field-label {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.layout-modal__slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.layout-modal__range {
    flex: 1;
    height: 4px;
    accent-color: #6366F1;
    cursor: pointer;
}

.layout-modal__number {
    width: 52px;
    padding: 5px 6px;
    border: 1px solid #E5E7EB;
    font-size: 13px;
    color: #111827;
    background: #F9FAFB;
    outline: none;
    text-align: center;
    font-family: 'Pretendard Variable', Pretendard, sans-serif;
}

.layout-modal__number:focus {
    border-color: #6366F1;
    background: #ffffff;
}

.layout-modal__unit {
    font-size: 12px;
    color: #9CA3AF;
    min-width: 16px;
}

.layout-modal__footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #E5E7EB;
}

.layout-modal__btn {
    flex: 1;
    padding: 9px 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    color: #374151;
    font-family: 'Pretendard Variable', Pretendard, sans-serif;
}

.layout-modal__btn:hover {
    background: #F3F4F6;
}

.layout-modal__btn--primary {
    background: #6366F1;
    color: #ffffff;
    border-color: #6366F1;
}

.layout-modal__btn--primary:hover {
    background: #4F46E5;
    border-color: #4F46E5;
}

/* ===== Sidebar: Add Page 버튼 ===== */
.uip-sidebar-add-page-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #E5E7EB;
}

.uip-sidebar-add-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 32px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid #E5E7EB;
  border-radius: 0;
  color: #374151;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}

.uip-sidebar-add-page-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
}

.uip-sidebar-add-page-btn:hover {
  background: #F5F5F5;
  border-color: #D1D5DB;
  color: #4F46E5;
}

.uip-sidebar-add-page-btn:active {
  background: #EEF0FF;
}

.uip-sidebar-add-page-btn:focus-visible {
  outline: 2px solid #6366F1;
  outline-offset: -2px;
}

/* ===== 기능정의 생성 오버레이 (DescLoadingOverlay) ===== */
.uip-desc-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
  pointer-events: auto;
}
.uip-desc-overlay--waiting {
  background: rgba(249, 250, 251, 0.88);
}
.uip-desc-overlay--error {
  background: rgba(254, 242, 242, 0.92);
}
.uip-desc-overlay__label {
  font-size: 13px;
  font-weight: 600;
  color: #4F46E5;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.uip-desc-overlay--waiting .uip-desc-overlay__label {
  color: #6B7280;
}
.uip-desc-overlay--error .uip-desc-overlay__label {
  color: #B91C1C;
}
.uip-desc-overlay__counter {
  font-size: 11px;
  color: #6B7280;
  font-weight: 500;
  margin-left: 4px;
}
.uip-desc-overlay__bars {
  width: 72%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.uip-desc-overlay__bar {
  height: 10px;
  background: linear-gradient(90deg, #EEF0F3 0%, #D9DCE1 40%, #EEF0F3 80%);
  background-size: 220% 100%;
  animation: uip-desc-shimmer 1.6s infinite linear;
}
.uip-desc-overlay__bar:nth-child(2) { width: 85%; }
.uip-desc-overlay__bar:nth-child(3) { width: 60%; }
.uip-desc-overlay--waiting .uip-desc-overlay__bar {
  animation: none;
  opacity: 0.55;
}
.uip-desc-overlay__dot {
  width: 6px;
  height: 6px;
  background: #6366F1;
  display: inline-block;
  animation: uip-desc-pulse 1.2s infinite ease-in-out;
}
.uip-desc-overlay__dot:nth-child(2) { animation-delay: 0.15s; }
.uip-desc-overlay__dot:nth-child(3) { animation-delay: 0.3s; }
.uip-desc-overlay--waiting .uip-desc-overlay__dot {
  background: #9CA3AF;
  animation: none;
  opacity: 0.6;
}
@keyframes uip-desc-shimmer {
  0%   { background-position: 220% 0; }
  100% { background-position: -220% 0; }
}
@keyframes uip-desc-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1); }
}

/* ====================================================
   편집 헤더 UX 재구성 (2026-04-18)
   ==================================================== */

/* === 도구 모드 segmented control === */
.tool-mode-toggle {
  display: inline-flex;
  align-items: center;
  height: var(--uip-header-control-height);
  border: 1px solid #E5E7EB;
  border-radius: 0;
}
.tool-mode-toggle > .icon-btn {
  border: none;
  border-radius: 0;
  width: var(--uip-header-icon-size);
  height: 100%;
  background: #fff;
  color: #6B7280;
}
.tool-mode-toggle > .icon-btn + .icon-btn {
  border-left: 1px solid #E5E7EB;
}
.tool-mode-toggle > .icon-btn.is-active,
.tool-mode-toggle > .icon-btn[aria-pressed="true"] {
  background: #EEF2FF;
  color: #4F46E5;
}
.tool-mode-toggle > .icon-btn:hover:not(.is-active):not([aria-pressed="true"]) {
  background: #F9FAFB;
  color: #111827;
}

/* === 내보내기 드롭다운 (details/summary 네이티브) === */
.header-export { position: relative; }
.header-export__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--uip-header-control-height);
  padding: 0 12px;
  font-size: var(--uip-header-control-font-size);
  font-weight: 500;
  color: #374151;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  list-style: none;
  white-space: nowrap;
}
.header-export__trigger::-webkit-details-marker { display: none; }
.header-export__trigger::marker { content: ""; }
.header-export__trigger:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
  color: #111827;
}
.header-export[open] .header-export__trigger {
  background: #F9FAFB;
  border-color: #D1D5DB;
  color: #111827;
}
.header-export__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  z-index: 10;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}
.header-export__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #374151;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}
.header-export__item:hover { background: #F9FAFB; color: #111827; }

/* === 보기 드롭다운 === */
.header-view-menu { position: relative; }
.header-view-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--uip-header-control-height);
  padding: 0 10px;
  font-size: var(--uip-header-control-font-size);
  font-weight: 500;
  color: #374151;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  list-style: none;
  white-space: nowrap;
}
.header-view-menu__trigger::-webkit-details-marker { display: none; }
.header-view-menu__trigger::marker { content: ""; }
.header-view-menu__trigger:hover,
.header-view-menu[open] .header-view-menu__trigger {
  background: #F9FAFB;
  border-color: #D1D5DB;
  color: #111827;
}
.header-view-menu__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 30;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}
.header-view-menu__item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  color: #374151;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
}
.header-view-menu__item:hover {
  background: #F9FAFB;
  color: #111827;
}
.header-view-menu__check {
  width: 18px;
  color: #4F46E5;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
}
.header-view-menu__item.is-checked .header-view-menu__check { opacity: 1; }
.header-view-menu__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-view-menu__shortcut {
  color: #9CA3AF;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  justify-self: end;
  min-width: 32px;
  text-align: right;
}
.header-view-menu__separator {
  height: 1px;
  background: #E5E7EB;
  margin: 4px 0;
}

/* === 저장 상태 (프로젝트명 옆 좌측 배치) === */
.save-status.save-status--compact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 11px;
  color: #6B7280;
  background: transparent;
  border: none;
  margin-left: 4px;
}
.save-status.save-status--compact[data-state="saving"] { color: #F59E0B; }
.save-status.save-status--compact[data-state="error"] { color: #EF4444; }


/* UI Planning guide modal styles */
.uip-project-rules-guide-modal {
    position: fixed;
    inset: 0;
    z-index: 22600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition-property: opacity;
    transition-duration: 160ms;
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.uip-project-rules-guide-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.uip-project-rules-guide-modal__overlay {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(17, 24, 39, 0.52);
    cursor: default;
}

.uip-project-rules-guide-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 880px);
    max-height: min(86vh, 820px);
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    box-shadow: 0 22px 56px rgba(15, 23, 42, 0.22), 0 2px 8px rgba(15, 23, 42, 0.08);
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
    transform: translateY(8px) scale(0.98);
    opacity: 0;
    transition-property: transform, opacity, width;
    transition-duration: 180ms;
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.uip-project-rules-guide-modal.is-open .uip-project-rules-guide-modal__dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.uip-project-rules-guide-modal.is-split .uip-project-rules-guide-modal__dialog {
    width: min(96vw, 1040px);
}

.uip-project-rules-guide-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.uip-project-rules-guide-modal__eyebrow {
    margin-bottom: 4px;
    color: #6366F1;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: uppercase;
}

.uip-project-rules-guide-modal__title {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
    text-wrap: balance;
}

.uip-project-rules-guide-modal__subtitle {
    margin: 6px 0 0;
    color: #6B7280;
    font-size: 13px;
    line-height: 1.5;
    text-wrap: pretty;
}

.uip-project-rules-guide-modal__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.uip-project-rules-guide-modal__state {
    min-width: 118px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #C7D2FE;
    background: #EEF2FF;
    color: #4F46E5;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.uip-project-rules-guide-modal__state.is-off {
    border-color: #E5E7EB;
    background: #F9FAFB;
    color: #6B7280;
}

.uip-project-rules-guide-modal__close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    color: #6B7280;
    cursor: pointer;
    transition-property: background-color, border-color, color, transform;
    transition-duration: 140ms;
    transition-timing-function: ease;
}

.uip-project-rules-guide-modal__close:hover {
    background: #F9FAFB;
    border-color: #C7D2FE;
    color: #111827;
}

.uip-project-rules-guide-modal__close:active {
    transform: scale(0.96);
}

.uip-project-rules-guide-modal__body {
    min-height: 0;
    height: min(68vh, 620px);
    display: flex;
    flex-direction: column;
    padding: 14px 16px 16px;
    overflow: hidden;
}

.uip-rules-panel-host {
    position: relative;
    height: 100%;
    min-height: 320px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #E5E7EB;
}

.ba-rule-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    color: #9CA3AF;
    font-size: 13px;
    text-align: center;
}

.ba-quick-btn {
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #E5E7EB;
    color: #374151;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, color 0.15s;
}

.ba-quick-btn:hover {
    border-color: #6366F1;
    color: #6366F1;
}

.ba-rule-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #F3F4F6;
    cursor: pointer;
    transition: background 0.1s;
}

.ba-rule-item:hover {
    background: #F9FAFB;
}

.ba-rule-item--inactive {
    opacity: 0.5;
}

.ba-rule-item--planning-guide {
    background: #F8FAFF;
}

.ba-rule-item--planning-guide:hover {
    background: #EEF2FF;
}

.ba-rule-item-title {
    font-size: 12px;
    font-weight: 500;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ba-rule-item-preview {
    font-size: 11px;
    color: #6B7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.ba-rule-kind-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 6px;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    color: #6B7280;
    font-size: 10px;
    font-weight: 500;
}

.ba-rule-kind-badge--planning {
    border-color: #C7D2FE;
    background: #EEF2FF;
    color: #4F46E5;
}

.uip-planning-guide-callout {
    margin: 10px 12px;
    padding: 12px;
    border: 1px solid #C7D2FE;
    background: #EEF2FF;
    color: #374151;
    font-size: 12px;
}

.ba-rule-delete-btn {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.ba-rule-delete-btn:hover {
    color: #EF4444;
}

.ba-chk-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.ba-chk-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ba-chk-box {
    width: 14px;
    height: 14px;
    border: 1px solid #D1D5DB;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.ba-chk-input:checked + .ba-chk-box {
    background: #6366F1;
    border-color: #6366F1;
}

.ba-chk-input:checked + .ba-chk-box::after {
    content: '';
    width: 8px;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") center/contain no-repeat;
}

.ba-rules-page-btn {
    padding: 4px 8px;
    border: 1px solid #E5E7EB;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    color: #374151;
}

.ba-rules-page-btn.active {
    background: #6366F1;
    color: #fff;
    border-color: #6366F1;
}

.ba-rules-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.ba-rule-overlay {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 20;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ba-rule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.ba-rule-header-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #111827;
}

.ba-rule-body {
    flex: 1;
    overflow-y: auto;
}

.ba-rule-footer {
    padding: 10px 16px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ba-rule-footer--edit {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ba-rule-footer--edit > button {
    width: 100%;
    height: 36px;
    min-width: 0;
    padding: 0 12px;
    white-space: nowrap;
}

.ba-rule-input {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    border: 1px solid #E5E7EB;
    outline: none;
    color: #111827;
    font-family: inherit;
    box-sizing: border-box;
}

.ba-rule-input:focus {
    border-color: #6366F1;
}

.ba-rule-textarea {
    width: 100%;
    flex: 1;
    padding: 10px;
    font-size: 13px;
    border: 1px solid #E5E7EB;
    outline: none;
    color: #111827;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    box-sizing: border-box;
}

.ba-rule-textarea:focus {
    border-color: #6366F1;
}

.ba-rule-save-btn {
    height: 36px;
    background: #6366F1;
    color: #fff;
    border: 1px solid #6366F1;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.ba-rule-save-btn:hover {
    background: #4F46E5;
}

.ba-rule-danger-btn {
    height: 36px;
    min-width: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid #FCA5A5;
    background: #FFFFFF;
    color: #DC2626;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition-property: background-color, border-color, color, transform;
    transition-duration: 140ms;
    transition-timing-function: ease;
}

.ba-rule-danger-btn:hover {
    border-color: #EF4444;
    background: #FEF2F2;
    color: #B91C1C;
}

.ba-rule-danger-btn:active {
    transform: scale(0.98);
}

.ba-rule-active-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
}

.ba-rule-prompt-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border: 1px solid #E5E7EB;
    background: #F8FAFF;
    color: #374151;
    font-size: 11px;
    line-height: 1.45;
}

.ba-rule-prompt-preview__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #4F46E5;
    font-size: 11px;
    font-weight: 500;
}

.ba-rule-prompt-preview__warning {
    padding: 7px 8px;
    border: 1px solid #FCD34D;
    background: #FFFBEB;
    color: #92400E;
}

.ba-rule-prompt-preview pre {
    max-height: 112px;
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: #6B7280;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
}

.ba-rule-hint {
    font-size: 11px;
    color: #9CA3AF;
    text-align: center;
    margin-top: 8px;
}

.ba-rules-batch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #F3F4F6;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.ba-rules-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    border-top: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.ba-dropdown {
    background: #fff;
}

.ba-mode-opt {
    padding: 9px 12px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
}

.ba-mode-opt:hover,
.ba-mode-opt.selected {
    background: #F9FAFB;
    color: #4F46E5;
}

.ba-guide-builder {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #111827;
    font-size: 12px;
    -webkit-font-smoothing: antialiased;
}

.ba-guide-builder__intro,
.ba-guide-builder__section,
.ba-guide-builder__draft {
    border: 1px solid #E5E7EB;
    background: #fff;
}

.ba-guide-builder__intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: #F8FAFF;
}

.ba-guide-builder__eyebrow {
    margin-bottom: 4px;
    color: #6366F1;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0;
}

.ba-guide-builder__title {
    margin: 0;
    color: #111827;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-wrap: balance;
}

.ba-guide-builder__text {
    margin: 5px 0 0;
    color: #6B7280;
    font-size: 12px;
    line-height: 1.5;
    text-wrap: pretty;
}

.ba-guide-builder__count {
    min-width: 42px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #C7D2FE;
    background: #EEF2FF;
    color: #4F46E5;
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.ba-guide-builder__section,
.ba-guide-builder__draft {
    padding: 12px;
}

.ba-guide-builder__section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.ba-guide-builder__section-head strong {
    display: block;
    color: #111827;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

.ba-guide-builder__section-head span {
    display: block;
    margin-top: 3px;
    color: #9CA3AF;
    font-size: 11px;
    line-height: 1.45;
}

.ba-guide-builder__filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.ba-guide-builder__search {
    grid-column: 1 / -1;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #9CA3AF;
}

.ba-guide-builder__search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #111827;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
}

.ba-guide-builder__dropdown {
    position: relative;
    min-width: 0;
}

.ba-guide-builder__dropdown-btn {
    width: 100%;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 9px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #374151;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    outline: 0;
    cursor: pointer;
    transition-property: border-color, background-color, color;
    transition-duration: 140ms;
    transition-timing-function: ease;
}

.ba-guide-builder__dropdown-btn:hover,
.ba-guide-builder__dropdown.is-open .ba-guide-builder__dropdown-btn {
    border-color: #C7D2FE;
    background: #F8FAFF;
    color: #111827;
}

.ba-guide-builder__dropdown-btn:focus-visible {
    border-color: #6366F1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.16);
}

.ba-guide-builder__dropdown-btn span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ba-guide-builder__dropdown-icon {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    color: #6B7280;
    transition: transform 140ms ease;
}

.ba-guide-builder__dropdown.is-open .ba-guide-builder__dropdown-icon {
    transform: rotate(180deg);
}

.ba-guide-builder__dropdown-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    display: none;
    max-height: 204px;
    overflow: auto;
    padding: 4px;
    border: 1px solid #E5E7EB;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.08);
}

.ba-guide-builder__dropdown.is-open .ba-guide-builder__dropdown-menu {
    display: block;
}

.ba-guide-builder__dropdown-option {
    width: 100%;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: #374151;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
}

.ba-guide-builder__dropdown-option:hover {
    background: #F8FAFF;
    color: #111827;
}

.ba-guide-builder__dropdown-option.is-selected {
    background: #EEF2FF;
    color: #4338CA;
}

.ba-guide-builder__dropdown-option span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ba-guide-builder__dropdown-check {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
}

.ba-guide-builder__references {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 260px;
    overflow: auto;
    padding-right: 2px;
}

.ba-guide-builder__reference {
    position: relative;
    min-height: 122px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: 0 0 9px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #111827;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition-property: border-color, background-color, color, transform;
    transition-duration: 140ms;
    transition-timing-function: ease;
}

.ba-guide-builder__reference:hover {
    border-color: #C7D2FE;
    background: #F8FAFF;
}

.ba-guide-builder__reference:active {
    transform: scale(0.98);
}

.ba-guide-builder__reference.is-selected {
    border-color: #4F46E5;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.16);
}

.ba-guide-builder__reference.is-disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.ba-guide-builder__reference-color {
    display: block;
    width: 100%;
    height: 42px;
}

.ba-guide-builder__reference-check {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.88);
    color: transparent;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
    box-sizing: border-box;
}

.ba-guide-builder__reference:hover .ba-guide-builder__reference-check {
    border-color: #6366F1;
    background: #FFFFFF;
}

.ba-guide-builder__reference.is-selected .ba-guide-builder__reference-check {
    border-color: #6366F1;
    background: #6366F1;
    color: #FFFFFF;
}

.ba-guide-builder__reference-check .uip-project-rules-action-icon {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
}

.ba-guide-builder__reference-title,
.ba-guide-builder__reference-family,
.ba-guide-builder__reference-tags {
    display: block;
    min-width: 0;
    padding: 0 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ba-guide-builder__reference-title {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 500;
    color: #111827;
}

.ba-guide-builder__reference-family {
    color: #6B7280;
    font-size: 11px;
}

.ba-guide-builder__reference-tags {
    color: #9CA3AF;
    font-size: 10px;
}

.ba-guide-builder__empty {
    grid-column: 1 / -1;
    padding: 20px 12px;
    border: 1px dashed #D1D5DB;
    color: #9CA3AF;
    text-align: center;
}

.ba-guide-builder__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    color: #374151;
    font-size: 12px;
    font-weight: 400;
}

.ba-guide-builder__option-group + .ba-guide-builder__option-group {
    margin-top: 10px;
}

.ba-guide-builder__option-title {
    margin-bottom: 6px;
    color: #6B7280;
    font-size: 11px;
    font-weight: 500;
}

.ba-guide-builder__option-list,
.ba-guide-builder__color-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.ba-guide-builder__option,
.ba-guide-builder__color {
    min-height: 44px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    padding: 8px 9px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #374151;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition-property: border-color, background-color, color, transform;
    transition-duration: 140ms;
    transition-timing-function: ease;
}

.ba-guide-builder__option:hover,
.ba-guide-builder__color:hover {
    border-color: #C7D2FE;
    background: #F8FAFF;
}

.ba-guide-builder__option:active,
.ba-guide-builder__color:active {
    transform: scale(0.98);
}

.ba-guide-builder__option.is-selected,
.ba-guide-builder__color.is-selected {
    border-color: #4F46E5;
    background: #EEF2FF;
    color: #3730A3;
}

.ba-guide-builder__option span,
.ba-guide-builder__color span {
    font-size: 12px;
    font-weight: 500;
}

.ba-guide-builder__option small {
    color: #9CA3AF;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.35;
}

.ba-guide-builder__color {
    min-height: 38px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

.ba-guide-builder__swatch {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border: 1px solid rgba(17, 24, 39, 0.12);
}

.ba-guide-builder__draft {
    background: #F8FAFF;
}

.ba-guide-builder__draft-title {
    color: #111827;
    font-size: 12px;
    font-weight: 500;
}

.ba-guide-builder__draft pre {
    max-height: 220px;
    overflow: auto;
    margin: 8px 0 0;
    padding: 10px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #374151;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.55;
    white-space: pre-wrap;
}

.ba-guide-builder__actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px;
    padding: 10px 0 0;
    margin-top: 2px;
    border-top: 1px solid #E5E7EB;
    background: #fff;
}

.ba-guide-builder__actions > button {
    width: 100%;
    min-width: 0;
    height: 36px;
    box-sizing: border-box;
    white-space: nowrap;
}

.ba-rchat-msg {
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.ba-rchat-msg--user {
    background: #6366F1;
    color: #fff;
    padding: 8px 12px;
    margin: 4px 8px 4px auto;
    max-width: 80%;
    width: fit-content;
}

.ba-rchat-msg--assistant {
    background: #F3F4F6;
    color: #111827;
    padding: 8px 12px;
    margin: 4px auto 4px 8px;
    max-width: 90%;
    width: fit-content;
}

.uip-rules-history-item {
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: none;
    border-bottom: 1px solid #F3F4F6;
    text-align: left;
    color: #374151;
    cursor: pointer;
    font-size: 12px;
}

.uip-rules-history-item.is-active,
.uip-rules-history-item:hover {
    background: #F9FAFB;
    color: #4F46E5;
}

.uip-project-rules-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    background: #fff;
    color: #374151;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.uip-project-rules-action-icon {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    display: block;
}

.uip-project-rules-guide-modal__close .uip-project-rules-action-icon {
    width: 15px;
    height: 15px;
}

.uip-project-rules-empty-icon {
    width: 28px;
    height: 28px;
    color: #D1D5DB;
    display: block;
}

.uip-project-rules-ai-btn:hover {
    border-color: #C7D2FE;
    background: #F9FAFB;
    color: #4338CA;
    transform: translateY(-1px);
}

.uip-project-rules-guide-modal__actions > button {
    height: 32px;
    min-height: 32px;
    box-sizing: border-box;
}

.uip-project-rules__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 11px;
    color: #9CA3AF;
}

.uip-project-rules__meta-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 20px;
    padding: 0 8px;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    color: #6366F1;
    font-weight: 500;
}

.uip-project-rules__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.uip-project-rules__item {
    border: 1px solid #E5E7EB;
    background: #fff;
    padding: 10px 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.uip-project-rules__item:hover {
    border-color: #C7D2FE;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}

.uip-project-rules__item.is-inactive {
    opacity: 0.55;
}

.uip-project-rules__item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.uip-project-rules__item-title-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.uip-project-rules__item-title {
    color: #111827;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.uip-project-rules__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 8px;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    color: #6B7280;
    font-size: 11px;
    font-weight: 500;
}

.uip-project-rules__item-body {
    margin-top: 8px;
    color: #6B7280;
    font-size: 12px;
    line-height: 1.6;
    word-break: keep-all;
}

.uip-project-rules__menu {
    position: relative;
    flex: 0 0 auto;
}

.uip-project-rules__menu-btn {
    width: 26px;
    height: 26px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px solid #E5E7EB;
    background: #fff;
    cursor: pointer;
}

.uip-project-rules__menu-btn span {
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #6B7280;
}

.uip-project-rules__menu-popover {
    position: absolute;
    top: 30px;
    right: 0;
    z-index: 20;
    min-width: 110px;
    border: 1px solid #E5E7EB;
    background: #fff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    padding: 4px;
}

.uip-project-rules__menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: none;
    background: transparent;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
}

.uip-project-rules__menu-item:hover {
    background: #F9FAFB;
    color: #111827;
}

.uip-project-rules__menu-item.is-danger {
    color: #DC2626;
}

.uip-project-rules__menu-item.is-danger:hover {
    background: #FEF2F2;
}

.uip-project-rules__empty {
    padding: 18px 14px;
    border: 1px dashed #D1D5DB;
    background: #FAFAFA;
}

.uip-project-rules__empty-title {
    color: #111827;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.uip-project-rules__empty-text {
    margin-top: 6px;
    color: #6B7280;
    font-size: 12px;
    line-height: 1.6;
}

.uip-project-rules__empty-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.uip-project-rules__primary-btn,
.uip-project-rules__ghost-btn {
    height: 28px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #6366F1;
    border-radius: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.uip-project-rules__primary-btn {
    background: #6366F1;
    color: #fff;
}

.uip-project-rules__ghost-btn {
    background: #fff;
    color: #6366F1;
}

.uip-project-rules__primary-btn:hover,
.uip-project-rules__ghost-btn:hover {
    transform: translateY(-1px);
}

.ba-rule-footer--edit .uip-project-rules__ghost-btn,
.ba-rule-footer--edit .ba-rule-danger-btn,
.ba-rule-footer--edit .ba-rule-save-btn {
    height: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.uip-project-rules-modal {
    position: fixed;
    inset: 0;
    z-index: 25000;
    display: none;
}

.uip-project-rules-modal.is-open {
    display: block;
}

.uip-project-rules-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.52);
}

.uip-project-rules-modal__card {
    position: relative;
    z-index: 1;
    width: min(92vw, 720px);
    max-height: min(88vh, 820px);
    margin: 5vh auto 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #E5E7EB;
    box-shadow: 0 32px 70px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.uip-project-rules-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid #E5E7EB;
}

.uip-project-rules-modal__eyebrow {
    color: #6366F1;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.uip-project-rules-modal__title {
    margin: 4px 0 0;
    color: #111827;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

.uip-project-rules-modal__close {
    width: 32px;
    height: 32px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #6B7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.uip-project-rules-modal__body {
    padding: 18px 20px;
    overflow: auto;
}

.uip-project-rules-modal__notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #C7D2FE;
    background: #EEF2FF;
    color: #3730A3;
    font-size: 13px;
    line-height: 1.6;
    font-weight: 600;
}

.uip-project-rules-modal__field + .uip-project-rules-modal__field {
    margin-top: 14px;
}

.uip-project-rules-modal__label {
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
}

.uip-project-rules-modal__input,
.uip-project-rules-modal__textarea {
    width: 100%;
    border: 1px solid #D1D5DB;
    border-radius: 0;
    background: #fff;
    color: #111827;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.uip-project-rules-modal__input {
    height: 42px;
    padding: 0 12px;
}

.uip-project-rules-modal__textarea {
    min-height: 240px;
    padding: 12px;
    resize: vertical;
    line-height: 1.65;
}

.uip-project-rules-modal__input:focus,
.uip-project-rules-modal__textarea:focus {
    border-color: #6366F1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.uip-project-rules-modal__switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.uip-project-rules-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 20px;
    border-top: 1px solid #E5E7EB;
    background: #FAFAFA;
}

.uip-project-rules-modal__secondary,
.uip-project-rules-modal__primary {
    height: 36px;
    padding: 0 14px;
    border-radius: 0;
    border: 1px solid #D1D5DB;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.uip-project-rules-modal__secondary {
    background: #fff;
    color: #374151;
}

.uip-project-rules-modal__primary {
    border-color: #6366F1;
    background: #6366F1;
    color: #fff;
}

.uip-project-rules-modal__secondary:hover,
.uip-project-rules-modal__primary:hover {
    transform: translateY(-1px);
}

#chat-input {
    width: 100%;
    min-height: 40px;
    max-height: 120px;
    padding: 12px 14px;
    border: none;
    resize: none;
    font-size: 13px;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
    outline: none;
    line-height: 1.5;
    overflow-y: auto;
    border-radius: 0;
    transition-property: height, max-height;
    transition-duration: 0.18s;
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.chat-input-wrapper.is-expanded #chat-input {
    height: clamp(220px, 34dvh, 340px);
    max-height: clamp(220px, 34dvh, 340px);
}

.uip-chat-input-expand-toggle {
    position: relative;
    width: 32px;
    height: 32px;
    margin: -4px -6px -4px auto;
    padding: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: #6B7280;
    cursor: pointer;
    border-radius: 0;
    font-family: inherit;
    transition-property: background-color, border-color, color, transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.uip-chat-input-expand-toggle::before {
    content: "";
    position: absolute;
    inset: -4px;
}

.uip-chat-input-expand-toggle:hover {
    background: #FFFFFF;
    border-color: #E5E7EB;
    color: #4F46E5;
}

.uip-chat-input-expand-toggle:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.28);
    outline-offset: 2px;
}

.uip-chat-input-expand-toggle:active {
    transform: scale(0.96);
}

.uip-chat-input-expand-toggle__icon {
    width: 15px;
    height: 15px;
    transition-property: opacity, transform, filter;
    transition-duration: 0.16s;
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.uip-chat-input-expand-toggle__icon--collapse {
    position: absolute;
    opacity: 0;
    transform: scale(0.25);
    filter: blur(4px);
}

.uip-chat-input-expand-toggle.is-expanded .uip-chat-input-expand-toggle__icon--expand {
    opacity: 0;
    transform: scale(0.25);
    filter: blur(4px);
}

.uip-chat-input-expand-toggle.is-expanded .uip-chat-input-expand-toggle__icon--collapse {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.chat-input-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-buttons button {
    /* 기본 icon-btn 스타일 상속 */
    background: transparent;
    border: 1px solid #EBEBEB;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
    color: #666666;
}

.chat-input-buttons button:hover {
    background-color: #F5F5F5;
    color: #6366F1;
}

.chat-input-buttons button:disabled,
.chat-input-buttons button.is-disabled {
    cursor: not-allowed;
    opacity: 0.45;
    color: #9CA3AF;
    background-color: #F9FAFB;
}

.chat-input-buttons button:disabled:hover,
.chat-input-buttons button.is-disabled:hover {
    color: #9CA3AF;
    background-color: #F9FAFB;
}

#send-btn {
  background-color: #6366F1;
  color: white;
  border: 1px solid #6366F1;
  border-radius: 0;
  width: 28px;
  height: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

#auto-desc-btn {
  /* 기본 icon-btn 스타일 상속 */
  width: 28px;
  height: 28px;
}

#image-upload-btn {
  /* 기본 icon-btn 스타일 상속 */
}

#auto-desc-btn:hover {
  /* 기본 icon-btn 호버 스타일 상속 */
}

/* description 모드일 때 버튼 강조 */
input[name="chat-mode"][value="description"]:checked ~ .chat-input-wrapper #auto-desc-btn {
  background-color: #f0e6ff;
  color: #6366F1;
  box-shadow: none;
}

#send-btn:hover {
  background-color: #4F46E5;
}

#send-btn:disabled {
  background-color: #9CA3AF;
  border-color: #9CA3AF;
  cursor: not-allowed;
  opacity: 0.6;
}

#send-btn:disabled:hover {
  background-color: #9CA3AF;
}

/* 기능정의 모드: 입력 필드 비활성화 */
#chat-input:disabled {
  background-color: #F5F5F5;
  cursor: not-allowed;
  opacity: 0.6;
}

#image-upload-btn:hover {
  /* 기본 icon-btn 호버 스타일 상속 */
}

/* 생성된 이미지 관련 스타일 */
.generated-image-container {
  margin: 10px 0;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  background: #f9f9f9;
}

.generated-image-container img {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: block;
  cursor: pointer;
}

.image-caption {
  padding: 8px 12px;
  font-size: 12px;
  color: #666;
  background: #fff;
  border-top: 1px solid #e0e0e0;
}

.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: pointer;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 0
}

/* 이미지 미리보기 영역 */
.image-preview-container {
    display: none;
    margin-bottom: 12px;
    position: relative;
    flex-wrap: wrap;
    gap: 10px;
}

/* placeholder.svg 이미지 기본적으로 숨김 처리 */
.image-preview-container img[src="/placeholder.svg"] {
    display: none;
}

.uploaded-image-preview {
    background: #fff;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin: 15px 0;
    overflow: hidden;
    width: 100%;
}

.preview-header {
    background: #FAFAFA;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #EBEBEB;
}

.preview-header span {
    font-weight: 500;
    color: #16161D;
}

.close-preview {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666666;
    transition: color 0.2s;
}

.close-preview:hover {
    color: #6366F1;
}

.uploaded-image-preview img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
    padding: 12px;
}

.remove-image-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background-color: #fff;
    color: #6B7280;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 12px;
}

.remove-image-btn:hover {
    background-color: #F3F4F6;
    color: #111827;
    border-color: #D1D5DB;
}

/* 다중 이미지 관련 스타일 */
.image-preview-item {
    position: relative;
    width: calc(50% - 5px);
    max-width: 200px;
    margin-bottom: 5px;
}

.multi-image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.image-preview-item .uploaded-image-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0;
    border: 1px solid #EBEBEB;
}

.image-preview-item .remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    z-index: 10;
}

.progress-bar {
    height: 3px;
    background: #F5F5F5;
    margin: 0 12px;
}

.progress-inner {
    height: 100%;
    background: #6366F1;
    width: 0;
    transition: width 0.3s;
}

.preview-status {
    padding: 10px 14px;
    color: #666666;
    font-size: 13px;
    text-align: center;
}

/* 채팅 모드 선택 UI 스타일 */
/* 상위 카테고리 선택기 스타일 */






/* 기본 라디오 버튼 숨기기 */


/* 선택된 카테고리 스타일 */


/* 선택된 카테고리 배경색 변경 */


/* 카테고리 인디케이터 숨김 처리 */


/* 카테고리 텍스트 */


/* 하위 모드 선택기 스타일 - 모델 선택기와 동일한 룩앤필 */
.chat-mode-selector {
    display: flex;
    gap: 1px;
    margin-bottom: 12px;
    width: 100%;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    padding: 1px;
}

.chat-mode-option {
    position: relative;
    padding: 8px 12px;
    background-color: transparent;
    border: none;
    border-radius: 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    user-select: none;
    flex: 1;
}

.chat-mode-option:hover {
    background-color: #efefef;
}

/* 기본 라디오 버튼 숨기기 */
.chat-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* 선택된 옵션 스타일 */
.chat-mode-option:has(input[type="radio"]:checked) span {
    color: #6366F1;
    font-weight: 600;
}

/* 선택된 옵션 배경색 변경 */
.chat-mode-option:has(input[type="radio"]:checked) {
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 활성 인디케이터 - 사용하지 않음 */
.chat-mode-option input[type="radio"]:checked ~ .indicator {
    display: none;
}

/* 활성 인디케이터 - 숨김 처리 */
.chat-mode-option .indicator {
    display: none;
}

/* 텍스트가 배경 위에 오도록 설정 */
.chat-mode-option span {
    position: relative;
    z-index: 2;
}

/* 이미지 타입 선택기 스타일 - 모델 선택기와 동일한 룩앤필 */

/* ===== 저장 상태 배너 (SaveButtonHandler가 동적 생성) — save-status 아래 드롭다운 카드 ===== */
.project-header-left {
  position: relative;
}

.save-status-banner {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: #374151;
  text-align: left;
  white-space: normal;
}

.save-status-banner[hidden] {
  display: none;
}

.save-status-banner[data-state="error"] {
  border-color: #FECACA;
}

.save-status-banner[data-state="conflict"] {
  border-color: #FDBA74;
}

.save-status-banner__copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.save-status-banner__copy strong {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
}

.save-status-banner[data-state="error"] .save-status-banner__copy strong {
  color: #B91C1C;
}

.save-status-banner[data-state="conflict"] .save-status-banner__copy strong {
  color: #9A3412;
}

.save-status-banner__copy span {
  font-size: 12px;
}

#save-status-banner-meta {
  color: #6B7280;
}

.save-status-banner__error {
  margin: 0;
  font-size: 12px;
  color: #B91C1C;
}

.save-status-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.save-status-banner__action {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  cursor: pointer;
  border: 1px solid #E5E7EB;
  background: #FFFFFF;
  color: #374151;
  border-radius: 0;
}

.save-status-banner__action:hover {
  background: #F9FAFB;
}

.save-status-banner__action--primary {
  background: #4F46E5;
  border-color: #4F46E5;
  color: #FFFFFF;
}

.save-status-banner__action--primary:hover {
  background: #6366F1;
  border-color: #6366F1;
}

.save-status-banner__action:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ============================================================
   version-history — 버전 기록 패널 (Agent D / VersionHistory.js)
   네임스페이스: .version-history__*
   border-radius: 0 (전체)
   ============================================================ */

.version-history__backdrop {
  position: fixed;
  inset: 0;
  z-index: 10100;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.version-history__panel {
  width: 760px;
  max-width: 100%;
  height: 100%;
  background: #FFFFFF;
  border-left: 1px solid #E5E7EB;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  border-radius: 0;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, sans-serif;
  color: #374151;
  font-size: 13px;
}

/* ── 헤더 ────────────────────────────────────── */
.version-history__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0;
  background: #FFFFFF;
  border-radius: 0;
}

.version-history__header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.version-history__header-icon {
  width: 16px;
  height: 16px;
  color: #6366F1;
  flex-shrink: 0;
}

.version-history__header-icon svg {
  width: 16px;
  height: 16px;
}

.version-history__title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
}

.version-history__frame-name {
  font-size: 13px;
  color: #6B7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-history__close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: #6B7280;
  border-radius: 0;
  flex-shrink: 0;
  padding: 0;
}

.version-history__close-btn:hover {
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #111827;
}

.version-history__close-btn svg {
  width: 14px;
  height: 14px;
}

/* ── 바디 레이아웃 ───────────────────────────── */
.version-history__body {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

/* ── 목록 컬럼 ───────────────────────────────── */
.version-history__list-col {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #E5E7EB;
  background: #F9FAFB;
}

.version-history__list-area {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-gutter: stable;
}

/* ── 버전 행 ─────────────────────────────────── */
.version-history__row {
  display: flex;
  align-items: flex-start;
  padding: 10px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 0;
  margin: 0 8px 2px;
  background: #FFFFFF;
  transition: border-color 0.12s, background 0.12s;
}

.version-history__row:hover {
  border-color: #D1D5DB;
  background: #FFFFFF;
}

.version-history__row--selected {
  border: 1px solid #6366F1;
  background: #EEF2FF;
}

.version-history__row--selected:hover {
  border-color: #6366F1;
}

.version-history__row-meta {
  flex: 1;
  min-width: 0;
}

.version-history__row-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.version-history__version-num {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.version-history__event-badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid #E5E7EB;
  background: #F9FAFB;
  color: #6B7280;
  border-radius: 0;
  white-space: nowrap;
}

.version-history__event-badge--restore {
  background: #EEF2FF;
  border-color: #C7D2FE;
  color: #4F46E5;
}

.version-history__row-bottom {
  font-size: 11px;
  color: #6B7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 복원 바 ─────────────────────────────────── */
.version-history__restore-bar {
  padding: 10px 12px;
  border-top: 1px solid #E5E7EB;
  flex-shrink: 0;
  background: #F9FAFB;
}

.version-history__restore-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
  padding: 8px 14px;
  background: #4F46E5;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;
  font-family: inherit;
  transition: background 0.12s;
}

.version-history__restore-btn:hover {
  background: #6366F1;
}

.version-history__restore-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── 미리보기 컬럼 ───────────────────────────── */
.version-history__preview-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #F3F4F6;
  position: relative;
  border-radius: 0;
}

.version-history__preview-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #6B7280;
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
  padding: 24px;
}

.version-history__preview-placeholder svg {
  width: 28px;
  height: 28px;
  color: #D1D5DB;
}

.version-history__preview-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.version-history__preview-iframe {
  width: 100%;
  height: 100%;
  border: 1px solid #E5E7EB;
  background: #FFFFFF;
  border-radius: 0;
}

.version-history__preview-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 250, 251, 0.8);
  z-index: 1;
}

/* ── 스피너 ─────────────────────────────────── */
.version-history__spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  width: 100%;
}

.version-history__spinner-ring {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid #E5E7EB;
  border-top-color: #6366F1;
  border-radius: 50%;
  animation: vh-spin 0.7s linear infinite;
}

@keyframes vh-spin {
  to { transform: rotate(360deg); }
}

/* ── 빈 상태 ─────────────────────────────────── */
.version-history__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 16px;
  text-align: center;
  color: #6B7280;
  font-size: 12px;
  line-height: 1.6;
}

.version-history__empty svg {
  width: 24px;
  height: 24px;
  color: #D1D5DB;
}

/* ── 오류 상태 ───────────────────────────────── */
.version-history__error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 16px;
  text-align: center;
  color: #6B7280;
  font-size: 12px;
  line-height: 1.6;
}

.version-history__error svg {
  width: 24px;
  height: 24px;
  color: #FCA5A5;
}

.version-history__retry-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 14px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  color: #374151;
  font-size: 12px;
  cursor: pointer;
  border-radius: 0;
  font-family: inherit;
  transition: border-color 0.12s;
}

.version-history__retry-btn:hover {
  border-color: #6366F1;
  color: #6366F1;
}

/* ====================================================
   캔버스 실행 취소/다시 실행/버전 기록 툴바 (.canvas-undo__)
   ==================================================== */
.canvas-undo__group {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.canvas-undo__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--uip-header-control-height, 32px);
  height: var(--uip-header-control-height, 32px);
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 1px solid transparent;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.canvas-undo__btn:hover:not(:disabled) {
  background: #F3F4F6;
  color: #111827;
}

.canvas-undo__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.canvas-undo__btn--history {
  margin-left: 2px;
  border-left: 1px solid #E5E7EB;
  padding-left: 6px;
  width: calc(var(--uip-header-control-height, 32px) + 6px);
}

.uip-limit-wall {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
}

.uip-limit-wall__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
}

.uip-limit-wall__card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 32px));
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 0;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.16);
  padding: 24px;
}

.uip-limit-wall__title {
  margin: 0 0 8px;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.uip-limit-wall__message {
  margin: 0;
  color: #374151;
  font-size: 14px;
  line-height: 1.6;
}

.uip-limit-wall__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.uip-limit-wall__dismiss,
.uip-limit-wall__consult {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.uip-limit-wall__dismiss {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  color: #374151;
}

.uip-limit-wall__consult {
  background: #6366F1;
  border: 1px solid #4F46E5;
  color: #FFFFFF;
}
