/* 페이지 공통 틀 (2026-11-18). 모든 메뉴가 같은 여백·제목·탭 위치를 쓴다.
   순서: 헤더 → 제목 묶음(h1 + 설명) → 탭 줄 → 내용. 이 파일은 맨 마지막에 불러온다. */

/* 1. 화면 바탕과 글자 (색은 역할 이름으로 쓴다. 다크 값은 맨 아래) */
:root{--t-bg:#ffffff;--t-ink:#171717;--t-muted:#626262;--t-line:#e5e5e5;--t-surface:#f5f5f5;--t-selected:#eeeeee;--page-top:48px;--head-gap:32px}
html,body{background:var(--t-bg);color:var(--t-ink)}

/* 2. 좌우 여백과 본문 폭: 1280px 이상은 60px, 본문은 그 안에서 꽉 채운다 */
@media(min-width:1280px){
 :root{--workspace-gutter:60px}
 main,main:has(.brand-layout){--canvas-width:100%}
 .brand-layout{grid-template-columns:var(--workspace-rail) minmax(0,1fr);grid-template-areas:"editor preview"}
 .component-layout{grid-template-columns:var(--workspace-rail) minmax(0,1fr)}
 #library{grid-template-columns:var(--workspace-rail) minmax(0,1fr)}
 #library .rail{grid-column:1}
 #library .matches{grid-column:2}
}
#design-library,#design-library:has(.brand-layout),#design-library:not(:has(.brand-layout)){width:100%;max-width:none;margin-inline:0}
#sectionHeading,.motion-navigation,#other,main>footer,.brand-main,#library .matches{width:100%;max-width:none;margin-inline:0}

/* 3. 제목 묶음: 모든 화면에서 같은 자리, 같은 크기 */
#design-library,#content{padding-top:var(--page-top)}
.library-heading,#sectionHeading.library-heading,#design-library:has(.brand-layout) .library-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;width:100%;max-width:none;margin:0 0 var(--head-gap)}
.library-heading h1,#sectionHeading h1{margin:0 0 20px;font-family:Urbanist,Pretendard,sans-serif;font-size:clamp(40px,5vw,72px);line-height:1.05;letter-spacing:-.035em;font-weight:650;font-style:normal;color:var(--t-ink)}
.library-heading p,#sectionHeading p{margin:0;font-size:16px;line-height:1.6;color:var(--t-muted);word-break:keep-all}
.library-heading p a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:4px;white-space:nowrap}
.library-heading p a:hover{color:var(--t-ink)}
@media(max-width:767px){
 #design-library,#content{padding-top:32px}
 .library-heading,#sectionHeading.library-heading,#design-library:has(.brand-layout) .library-heading{flex-direction:column;align-items:flex-start;gap:20px;margin-bottom:24px}
 .library-heading h1,#sectionHeading h1{margin-bottom:16px}
}

/* 4. 탭 줄: 제목 묶음 바로 아래. 컴포넌트 분류(src/montage.css)도 같은 값이다 */
.page-tabs,.motion-navigation.page-tabs{display:flex;flex-wrap:nowrap;justify-content:flex-start;gap:4px;width:100%;margin:0 0 var(--head-gap);padding:0;overflow-x:auto;scrollbar-width:none;order:0}
.page-tabs::-webkit-scrollbar{display:none}
.page-tabs button,.motion-navigation.page-tabs button{flex:none;min-height:40px;padding:0 16px;border:0;border-radius:99px;background:transparent;box-shadow:none;color:var(--t-muted);font:500 14px/20px Urbanist,Pretendard,sans-serif;white-space:nowrap;cursor:pointer}
.page-tabs button:hover{background:var(--t-surface);color:var(--t-ink)}
.page-tabs button.active,.motion-navigation.page-tabs button.active{background:var(--t-selected);color:var(--t-ink);font-weight:600}
@media(max-width:767px){.page-tabs,.motion-navigation.page-tabs{margin-bottom:24px}}

/* 5. 헤더: 본문과 같은 좌우 여백. 오른쪽에 검색 + 다크 전환 */
header{background:var(--t-bg);color:var(--t-ink)}
header .house-logo{color:var(--t-ink)}
.header-tools{grid-area:1/3;justify-self:end;display:flex;align-items:center;gap:8px;width:min(100%,476px);min-width:0}
.header-tools .search{flex:1 1 auto;width:auto;max-width:none;min-width:0;margin:0}
.theme-toggle{flex:none;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--t-ink);cursor:pointer}
.theme-toggle:hover{background:var(--t-surface)}
.theme-toggle .icon-sun{display:none}
html[data-theme=dark] .theme-toggle .icon-sun{display:block}
html[data-theme=dark] .theme-toggle .icon-moon{display:none}
@media(max-width:1000px){.header-tools{grid-area:2/1/3/3;justify-self:stretch;width:100%}}
@media(max-width:520px){.header-tools{grid-area:3/1}}

/* 6. 내용 격자: 넓어지면 열을 늘린다 */
.matches .cards{grid-template-columns:repeat(4,minmax(0,1fr))}
@container(max-width:1240px){.matches .cards{grid-template-columns:repeat(3,minmax(0,1fr))}}
@container(max-width:760px){.matches .cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container(max-width:520px){.matches .cards{grid-template-columns:minmax(0,1fr)}}
.lab-grid,.preset-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,360px),1fr));gap:24px}
.guide-grid{gap:24px}
#other .panel p{max-width:72ch}

/* 7. 다크 모드: 역할 변수. 낱개 무채색(--n-*)은 theme-dark.css에서 덮어쓴다 */
html[data-theme=dark]{color-scheme:dark;--t-bg:#121212;--t-ink:#f0f0f0;--t-muted:#b5b5b5;--t-line:#383838;--t-surface:#1e1e1e;--t-selected:#2e2e2e}

/* 8. 왼쪽 패널: 브랜드 설정·컴포넌트 필터·모션 필터가 같은 자리, 같은 폭(300px)을 쓴다.
      컴포넌트 필터는 모션 필터(#library .rail, #filter-toggle, #filter-body, #reset)와 같은 값이다 */
.component-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:24px;align-items:start}
@media(min-width:1280px){.component-layout{grid-template-columns:var(--workspace-rail) minmax(0,1fr);gap:var(--workspace-gap)}}
.component-layout .montage-catalog{min-width:0}
.component-rail{position:sticky;top:88px;max-height:calc(100dvh - 108px);border:1px solid var(--panel-line);border-radius:var(--panel-radius);background:var(--panel-bg);padding:0;overflow:hidden;box-shadow:none;z-index:auto}
.component-rail .panel-body{padding:22px 20px;max-height:calc(100dvh - 110px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.component-rail .panel-toggle{display:none}
.component-rail .panel-reset{display:inline-flex;align-items:center;gap:6px;min-height:32px;margin:24px 0 0;padding:6px 8px;border:0;border-radius:6px;background:transparent;color:var(--panel-muted);font-size:14px;cursor:pointer}
.component-rail .panel-reset:hover:not(:disabled){background:var(--t-surface);color:var(--t-ink)}
.component-rail .panel-reset:disabled{opacity:.45;cursor:default}
@media(pointer:coarse){.component-rail .panel-reset{min-height:44px}}
@media(max-width:1279px){
 .component-rail{position:static;max-height:640px}
 .component-rail .panel-body{max-height:520px}
 .component-rail .panel-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:48px;padding:12px 20px;border:0;border-radius:0;background:transparent;color:var(--t-ink);font-size:14px;font-weight:500;text-align:left;cursor:pointer}
 .component-rail .panel-toggle:after{content:'+';font-size:20px;font-weight:400;color:var(--panel-muted)}
 .component-rail .panel-toggle[aria-expanded=true]:after{content:'\2212'}
 .component-rail .panel-toggle[aria-expanded=false]+.panel-body{display:none}
 .component-rail .panel-toggle[aria-expanded=true]+.panel-body{display:block;border-top:1px solid var(--panel-line)}
 .component-rail .rail-title{display:none}
 .component-rail .filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
}
@media(max-width:767px){
 .component-rail .filters{grid-template-columns:repeat(2,minmax(0,1fr))}
 .component-rail .panel-body{padding:20px}
}

/* 9. 검색 (2026-11-19): 헤더에는 돋보기 버튼만 두고, 누르면 가운데 팝업이 열린다. 동작은 search.js */
.header-tools{width:auto;gap:4px}
.header-icon{flex:none;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--t-ink);cursor:pointer}
.header-icon:hover{background:var(--t-surface)}
@media(max-width:1000px){.header-tools{grid-area:1/3;justify-self:end;width:auto}}
@media(max-width:767px){
 header{grid-template-columns:minmax(0,1fr) auto auto}
 header nav{grid-area:1/2}
}
@media(max-width:520px){
 header{grid-template-columns:minmax(0,1fr) auto}
 header .house-logo{grid-area:1/1;justify-self:start}
 .header-tools{grid-area:1/2}
 header nav{grid-area:2/1/3/3;justify-self:center}
}
body.search-open{overflow-y:hidden}

dialog#search-dialog{--sp-bg:#ffffff;--sp-ink:#171719;--sp-muted:rgba(55,56,60,.78);--sp-faint:rgba(55,56,60,.42);--sp-field:rgba(112,115,124,.08);--sp-row:rgba(23,23,25,.055);--sp-line:rgba(112,115,124,.16);
 position:fixed;inset:0;margin:80px auto 20px;width:min(560px,calc(100% - 40px));height:min(760px,calc(100dvh - 100px));max-width:none;max-height:none;padding:0;border:0;border-radius:24px;background:var(--sp-bg);color:var(--sp-ink);box-shadow:none;overflow:hidden;font-size:14px;line-height:20px;
 transition:opacity .18s cubic-bezier(.22,1,.36,1),transform .18s cubic-bezier(.22,1,.36,1)}
dialog#search-dialog[open]{display:flex;flex-direction:column}
dialog#search-dialog::backdrop{background:rgba(23,23,25,.52);backdrop-filter:none;transition:opacity .18s ease-out}
@starting-style{
 dialog#search-dialog[open]{opacity:0;transform:translateY(8px) scale(.985)}
 dialog#search-dialog[open]::backdrop{opacity:0}
}
html[data-theme=dark] dialog#search-dialog{--sp-bg:#1b1c1e;--sp-ink:#f7f7f8;--sp-muted:rgba(194,196,200,.86);--sp-faint:rgba(174,176,182,.5);--sp-field:rgba(174,176,182,.12);--sp-row:rgba(255,255,255,.08);--sp-line:rgba(174,176,182,.2);box-shadow:0 0 0 1px var(--sp-line)}
html[data-theme=dark] dialog#search-dialog::backdrop{background:rgba(0,0,0,.6)}

.sp-head{flex:none;display:flex;align-items:center;gap:12px;padding:16px}
.sp-back{display:none;flex:none;align-items:center;justify-content:center;width:40px;height:40px;margin-left:-8px;padding:0;border:0;border-radius:10px;background:transparent;color:var(--sp-ink)}
.sp-field{flex:1;min-width:0;display:flex;align-items:center;gap:2px;height:40px;padding:8px 10px;border-radius:12px;background:var(--sp-field)}
.sp-field-icon{flex:none;display:grid;place-items:center;width:20px;height:20px;color:var(--sp-muted)}
.sp-field-icon svg{width:18px;height:18px}
.sp-field input{flex:1;min-width:0;height:24px;padding:0 4px;border:0;outline:0;background:transparent;color:var(--sp-ink);font-size:14px;line-height:20px;letter-spacing:.0145em}
.sp-field input::placeholder{color:var(--sp-muted);opacity:1}
.sp-clear{flex:none;display:grid;place-items:center;width:28px;height:28px;margin-right:-4px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--sp-faint)}
.sp-clear[hidden]{display:none}
.sp-clear svg{width:18px;height:18px}
.sp-clear:hover{color:var(--sp-muted)}
#search-dialog button:focus-visible{outline:2px solid var(--sp-ink);outline-offset:2px}

.sp-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sp-line) transparent;padding:12px 16px 24px}
#sp-results{display:flex;flex-direction:column;gap:24px;min-height:100%}
.sp-group h2{margin:0 0 10px;padding:0 12px;font-size:11px;line-height:14px;font-weight:600;letter-spacing:.031em;color:var(--sp-muted)}
.sp-group ul{margin:0;padding:0;list-style:none}
.sp-row{display:flex;align-items:flex-start;gap:4px;min-height:40px;padding:8px 12px;border-radius:12px;color:var(--sp-muted);cursor:pointer;scroll-margin:8px 0}
.sp-row[aria-selected=true]{background:var(--sp-row)}
.sp-icon,.sp-go{flex:none;display:grid;place-items:center;width:24px;height:24px}
.sp-icon svg,.sp-go svg{width:16px;height:16px}
.sp-go{color:var(--sp-ink);visibility:hidden}
.sp-row[aria-selected=true] .sp-go{visibility:visible}
.sp-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;padding:2px 0}
.sp-title{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:14px;line-height:20px;font-weight:500;letter-spacing:.0145em}
.sp-sub{margin-left:8px;font-weight:400}
.sp-sub:before{content:'•';margin-right:6px;font-size:12px}
.sp-snippet{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:13px;line-height:18px;letter-spacing:.0194em}
.sp-row mark{background:none;color:var(--sp-ink);font-weight:600}
.sp-row-text{padding-block:10px 8px}
.sp-row-text .sp-main{padding:0}
.sp-row-text .sp-icon,.sp-row-text .sp-go{height:20px}
.sp-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px;text-align:center;color:var(--sp-faint)}
.sp-empty p{margin:0;font-size:14px;line-height:20px;color:var(--sp-muted);word-break:keep-all}

.sp-foot{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 16px 20px;border-top:1px solid var(--sp-line);color:var(--sp-muted);font-size:12px;line-height:16px;font-weight:500}
.sp-keys{display:flex;align-items:center;gap:20px}
.sp-keys span{display:inline-flex;align-items:center;gap:4px}
.sp-keys kbd{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 5px;border:1px solid var(--sp-line);border-radius:6px;background:var(--sp-field);color:var(--sp-muted);font:600 11px/1 inherit;font-family:inherit}
.sp-keys kbd:last-of-type{margin-right:4px}
.sp-count{margin-left:auto;font-variant-numeric:tabular-nums}

@media(max-width:600px){
 dialog#search-dialog{margin:0;width:100%;height:100dvh;border-radius:0}
 .sp-back{display:inline-flex}
 .sp-keys{display:none}
 .sp-foot{padding-bottom:calc(16px + env(safe-area-inset-bottom))}
}
@media(pointer:coarse){.sp-row{min-height:44px;padding-block:10px}}
@media(prefers-reduced-motion:reduce){dialog#search-dialog,dialog#search-dialog::backdrop{transition:none}}

/* 10. 브랜드 설정 패널 (2026-11-19): 모든 항목을 펼쳐 두고 묶음(아이덴티티·색·서체·아이콘·형태)으로 나눈다.
       간격: 라벨↔입력 8 · 항목 사이 20 · 묶음 사이 24 + 선 + 24. 입력 높이 44, 둥글기 8. 마크업은 library.js의 brandEditor() */
#design-library .brand-editor .be{padding:22px 20px 24px;color:var(--t-ink)}
#design-library .brand-editor .be>h2{margin:0 0 24px;font-size:16px;line-height:24px;font-weight:600;color:var(--t-ink)}
#design-library .brand-editor .be-group{margin:0;padding:0 0 24px}
#design-library .brand-editor .be-group+.be-group{padding-top:24px;border-top:1px solid var(--t-line)}
#design-library .brand-editor .be-group>h3{margin:0 0 16px;font-size:14px;line-height:20px;font-weight:600;letter-spacing:0;color:var(--t-ink)}
#design-library .brand-editor .be-field{display:block;min-width:0;margin:0 0 20px;padding:0;border:0;font-size:14px;font-weight:400;color:var(--t-muted)}
#design-library .brand-editor .be-group>:last-child{margin-bottom:0}
#design-library .brand-editor .be-label{display:flex;align-items:center;gap:6px;margin:0;padding:0;font-size:14px;line-height:20px;font-weight:400;color:var(--t-muted);white-space:nowrap}
#design-library .brand-editor .be-label svg{flex:none;width:16px;height:16px}
#design-library .brand-editor .be-field>.be-label{margin-bottom:8px}
#design-library .brand-editor legend.be-label{float:left;width:100%}
#design-library .brand-editor .be-field small,#design-library .brand-editor .be-note{display:block;margin:8px 0 0;font-size:12px;line-height:18px;color:var(--t-muted);word-break:keep-all}
#design-library .brand-editor .brand-value-row{min-height:28px}

/* 글 입력 */
#design-library .brand-editor .be input.be-text{display:block;width:100%;height:44px;margin:0;padding:0 14px;border:1px solid var(--t-line);border-radius:8px;background:var(--t-bg);color:var(--t-ink);font:400 14px/20px Urbanist,Pretendard,sans-serif}
#design-library .brand-editor .be input.be-text:hover{border-color:var(--t-muted)}
#design-library .brand-editor .be input.be-text:focus-visible,#design-library .brand-editor .be-color:focus-within{border-color:var(--t-ink);outline:2px solid var(--t-ink);outline-offset:1px}

/* 심볼: 지금 심볼 미리보기 + 올리기 + 되돌리기 */
#design-library .brand-editor .be-symbol{display:flex;align-items:center;gap:8px}
#design-library .brand-editor .be-symbol-thumb{flex:none;display:grid;place-items:center;width:44px;height:44px;border-radius:8px;background:var(--t-surface);color:var(--t-ink);overflow:hidden}
#design-library .brand-editor .be-symbol-thumb :is(svg,img){width:26px!important;height:26px!important}
#design-library .brand-editor .be-symbol .quiet{flex:1;min-width:0;min-height:44px;font-size:14px}
#design-library .brand-editor .be-symbol .symbol-reset{flex:none;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:var(--t-surface);color:var(--t-muted)}
#design-library .brand-editor .be-symbol .symbol-reset:hover{background:var(--t-selected);color:var(--t-ink)}

/* 색: 색상환·톤 슬라이더(기존) + 동그란 견본 */
#design-library .brand-editor .accent-controls{margin-top:8px;gap:12px}
#design-library .brand-editor input[type=range].tone-slider{margin-top:8px}
#design-library .brand-editor input[type=color]{appearance:none;-webkit-appearance:none;flex:none;width:28px;height:28px;margin:0;padding:0;border:0;border-radius:50%;background:none;cursor:pointer}
#design-library .brand-editor input[type=color]::-webkit-color-swatch-wrapper{padding:0}
#design-library .brand-editor input[type=color]::-webkit-color-swatch{border:1px solid var(--t-line);border-radius:50%}
#design-library .brand-editor input[type=color]::-moz-color-swatch{border:1px solid var(--t-line);border-radius:50%}
#design-library .brand-editor .be-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 0 20px}
#design-library .brand-editor .be-pair .be-field{margin:0}
#design-library .brand-editor .be-color{display:flex;align-items:center;gap:8px;height:44px;padding:0 10px;border:1px solid var(--t-line);border-radius:8px;background:var(--t-bg)}
#design-library .brand-editor .be-color input[type=color]{width:24px;height:24px}
#design-library .brand-editor .be-color input[type=text]{flex:1;display:block;width:auto;min-width:0;height:28px;margin:0;padding:0;border:0;outline:0;background:transparent;color:var(--t-ink);font:400 14px/20px Urbanist,Pretendard,sans-serif;font-variant-numeric:tabular-nums}

/* 하나 고르기: 선택 카드(서체·아이콘 세트)와 세그먼트(굵기) */
#design-library .brand-editor .be-options{clear:both;display:grid;gap:8px}
#design-library .brand-editor .be-choice-font .be-options{grid-template-columns:repeat(3,minmax(0,1fr))}
#design-library .brand-editor .be-choice-icon .be-options{grid-template-columns:repeat(2,minmax(0,1fr))}
#design-library .brand-editor .be-option{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;margin:0;border:1px solid var(--t-line);border-radius:8px;background:var(--t-bg);color:var(--t-ink);font-size:13px;line-height:16px;font-weight:400;cursor:pointer}
#design-library .brand-editor .be-option input{position:absolute;inset:0;display:block;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;cursor:pointer}
#design-library .brand-editor .be-option:hover{background:var(--t-surface)}
#design-library .brand-editor .be-option:has(input:checked){border-color:var(--t-ink);box-shadow:inset 0 0 0 1px var(--t-ink)}
#design-library .brand-editor .be-option:has(input:focus-visible){outline:2px solid var(--t-ink);outline-offset:2px}
#design-library .brand-editor .be-option-name{min-width:0;overflow-wrap:anywhere}
#design-library .brand-editor .be-choice-font .be-option{flex-direction:column;gap:2px;height:68px;padding:0 4px}
#design-library .brand-editor .be-choice-font .be-sample{font-size:22px;line-height:28px;font-weight:500}
#design-library .brand-editor .be-choice-font .be-option-name{font-size:12px;line-height:16px;color:var(--t-muted)}
#design-library .brand-editor .be-choice-font .be-option:has(input:checked) .be-option-name{color:var(--t-ink);font-weight:500}
#design-library .brand-editor .be-choice-icon{margin-bottom:8px}
#design-library .brand-editor .be-choice-icon .be-option{justify-content:flex-start;gap:8px;min-height:44px;padding:6px 10px}
#design-library .brand-editor .be-choice-icon .be-sample{flex:none;display:grid;width:20px;height:20px}
#design-library .brand-editor .be-choice-icon .be-sample svg{width:20px;height:20px}
#design-library .brand-editor .be-choice-icon .be-option:has(input:checked) .be-option-name{font-weight:500}
#design-library .brand-editor .be-choice-segment .be-options{grid-template-columns:repeat(4,minmax(0,1fr));gap:0;padding:4px;border-radius:10px;background:var(--t-surface)}
#design-library .brand-editor .be-choice-segment .be-option{height:36px;border:0;border-radius:6px;background:transparent}
#design-library .brand-editor .be-choice-segment .be-option:hover{background:var(--t-selected)}
#design-library .brand-editor .be-choice-segment .be-option:has(input:checked){background:var(--t-bg);box-shadow:0 0 0 1px var(--t-line)}
#design-library .brand-editor .be-wide{display:flex;align-items:center;justify-content:center;width:100%;min-height:40px;margin:0;font-size:14px}

/* 이어지는 값: 슬라이더 + 숫자 직접 입력 */
#design-library .brand-editor input[type=range].be-range{appearance:none;-webkit-appearance:none;display:block;width:100%;height:20px;margin:6px 0 0;padding:0;border:0;background:transparent;cursor:pointer}
#design-library .brand-editor .be-range::-webkit-slider-runnable-track{height:4px;border-radius:4px;background:linear-gradient(to right,var(--t-ink) var(--fill,0%),var(--t-line) var(--fill,0%))}
#design-library .brand-editor .be-range::-moz-range-track{height:4px;border-radius:4px;background:linear-gradient(to right,var(--t-ink) var(--fill,0%),var(--t-line) var(--fill,0%))}
#design-library .brand-editor .be-range::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:16px;height:16px;margin-top:-6px;border:2px solid var(--t-ink);border-radius:50%;background:var(--t-bg);opacity:1;box-shadow:none}
#design-library .brand-editor .be-range::-moz-range-thumb{width:12px;height:12px;border:2px solid var(--t-ink);border-radius:50%;background:var(--t-bg);opacity:1}
#design-library .brand-editor .be-range:focus-visible{outline:2px solid var(--t-ink);outline-offset:2px;border-radius:4px}

/* 정해진 단계 값: − 값 + */
#design-library .brand-editor .be-stepper{display:flex;align-items:center;height:44px;border:1px solid var(--t-line);border-radius:8px;background:var(--t-bg)}
#design-library .brand-editor .be-stepper button{flex:none;display:grid;place-items:center;width:44px;height:42px;padding:0;border:0;border-radius:7px;background:transparent;color:var(--t-ink)}
#design-library .brand-editor .be-stepper button:hover{background:var(--t-surface)}
#design-library .brand-editor .be-stepper button[aria-disabled=true]{opacity:.3;cursor:default;background:transparent}
#design-library .brand-editor .be-stepper output{flex:1;float:none;text-align:center;font-size:14px;line-height:20px;color:var(--t-ink);font-variant-numeric:tabular-nums}

/* 맨 아래 */
#design-library .brand-editor .editor-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding-top:24px;border-top:1px solid var(--t-line)}
#design-library .brand-editor .editor-actions .quiet{min-height:40px;padding-inline:8px;font-size:13px}
@media(pointer:coarse){#design-library .brand-editor .be-choice-segment .be-option{height:40px}}
#design-library .brand-editor .be-choice-segment{margin-bottom:0}

/* 11. 강조색·톤 슬라이더 (2026-11-19): 색 띠가 깔린 홈(높이 32) 안에서 24px 손잡이가 움직인다.
       홈 좌우에 4px 안쪽 여백이 있어 손잡이가 끝에 붙지 않는다. 손잡이 색 = 지금 고른 색 */
#design-library .brand-editor .be-well{flex:1;min-width:0;display:flex;align-items:center;height:32px;margin:0;padding:0 4px;border-radius:999px;--thumb:#a1a1aa}
#design-library .brand-editor .be-well-hue{background:var(--spectrum,linear-gradient(90deg,#e63125,#9c7d00,#009c26,#00958e,#0083e5,#9756ed,#e63125))}
#design-library .brand-editor .be-well-tone{margin-top:8px;background:linear-gradient(to right,#a1a1aa,var(--accent,#171717))}
#design-library .brand-editor .be-well input[type=range]{appearance:none;-webkit-appearance:none;display:block;width:100%;height:32px;margin:0;padding:0;border:0;border-radius:999px;background:transparent;outline:0;cursor:pointer;accent-color:auto}
#design-library .brand-editor .be-well input::-webkit-slider-runnable-track{height:32px;border:0;background:transparent}
#design-library .brand-editor .be-well input::-moz-range-track{height:32px;border:0;background:transparent}
#design-library .brand-editor .be-well input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:24px;height:24px;margin-top:4px;border:2px solid #fff;border-radius:50%;background:var(--thumb);opacity:1;box-shadow:0 6px 16px -4px rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.06),0 0 0 1px rgba(0,0,0,.1);transition:box-shadow .15s cubic-bezier(.4,0,.2,1)}
#design-library .brand-editor .be-well input::-moz-range-thumb{width:20px;height:20px;border:2px solid #fff;border-radius:50%;background:var(--thumb);opacity:1;box-shadow:0 6px 16px -4px rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.06),0 0 0 1px rgba(0,0,0,.1)}
#design-library .brand-editor .be-well:hover input::-webkit-slider-thumb,#design-library .brand-editor .be-well input:active::-webkit-slider-thumb{box-shadow:0 6px 16px -4px rgba(0,0,0,.28),0 2px 4px -1px rgba(0,0,0,.14),0 0 0 1px rgba(0,0,0,.1)}
#design-library .brand-editor .be-well:has(input:focus-visible){outline:2px solid var(--t-ink);outline-offset:2px}
html[data-theme=dark] #design-library .brand-editor .be-well input::-webkit-slider-thumb{box-shadow:0 6px 18px -4px rgba(0,0,0,.28),0 2px 4px -1px rgba(0,0,0,.12),0 0 0 1px rgba(0,0,0,.2)}
#design-library .brand-editor .accent-controls{display:flex;align-items:center;gap:12px;margin-top:8px}
@media(prefers-reduced-motion:reduce){#design-library .brand-editor .be-well input::-webkit-slider-thumb{transition:none}}

/* 12. 톤이 페이지 바탕까지 물들인다 (2026-11-19). 브랜드·컴포넌트 화면에서 library.js가 --page-bg를 넣는다.
       왼쪽 패널(설정·필터)만 흰 바탕으로 남는다. 모션 화면에는 적용하지 않는다 */
html,body,header{background:var(--page-bg,var(--t-bg))}
#design-library .library-heading h1{color:var(--page-ink,var(--t-ink))}
#design-library .library-heading p{color:var(--page-muted,var(--t-muted))}
/* 브랜드 보드 묶음 자체는 바탕이 없다(타일만 카드 색). 뒤에 네모난 덩어리가 깔려 보이지 않게 */
#design-library .brand-preview.foundation-board{background:transparent}

/* 13. 모션 상세 팝업 (2026-11-23). 코드 칸과 "반복 켜짐" 버튼이 화면에서 혼자 검게 튀지 않게 낮춘다 */
#detail pre{background:var(--t-surface);color:var(--t-ink);border:1px solid var(--t-line)}
#detail #loop[aria-pressed=true]{background:color-mix(in srgb,var(--t-ink) 10%,transparent);color:var(--t-ink);border-color:color-mix(in srgb,var(--t-ink) 22%,transparent)}
/* 썸네일 속 스크롤 상자: 팝업과 같은 물건을 작게, 손대지 않아도 저절로 움직이게 */
.scrollbox.scroll-preview{width:62%;height:74%;padding:10px;overflow:hidden;pointer-events:none}
.scroll-preview .scrollitem{position:relative;top:0;padding:8px 10px;white-space:nowrap}
.shape .toggle-mark{line-height:1}

/* 14. 모션 필터의 묶음 이름("용어", "예시 모음") (2026-11-23) */
#filters .filter-heading{grid-column:1/-1;margin:16px 0 4px;padding:0 12px;font-size:12px;line-height:1.5;color:var(--t-muted)}

/* 15. 왼쪽 패널 공통 (2026-11-23): 옅은 그림자, 초기화 버튼은 제목 줄 오른쪽 끝 */
.brand-editor,.rail{box-shadow:0 1px 2px rgba(23,23,25,.05),0 12px 32px -8px rgba(23,23,25,.14)}
html[data-theme=dark] .brand-editor,html[data-theme=dark] .rail{box-shadow:0 1px 2px rgba(0,0,0,.3),0 12px 32px -10px rgba(0,0,0,.55)}
@media(max-width:767px){.rail{box-shadow:none}}
.rail-title .panel-reset{flex:none;display:inline-flex;align-items:center;gap:6px;min-height:32px;margin:-4px -8px -4px 0;padding:6px 8px;border:0;border-radius:6px;background:transparent;color:var(--t-muted);font-size:14px;font-weight:400;line-height:20px;text-decoration:none;cursor:pointer}
.rail-title .panel-reset:hover:not(:disabled){background:var(--t-surface);color:var(--t-ink)}
.rail-title .panel-reset:disabled{opacity:.45;cursor:default}
.rail-title .panel-reset svg{flex:none}
#design-library .brand-editor .be-title{margin:0 0 24px}
#design-library .brand-editor .be-title h2{margin:0}
#design-library .brand-editor .editor-actions{grid-template-columns:minmax(0,1fr)}

/* 16. 브랜드 설정: 서체 드롭다운, 둥글기 함께 조절 스위치 (2026-11-23) */
#design-library .brand-editor .be-dropdown{position:relative}
#design-library .brand-editor .be-select{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:8px 12px;border:1px solid var(--t-line);border-radius:8px;background:var(--t-bg);color:var(--t-ink);font-size:14px;line-height:20px;text-align:left;cursor:pointer}
#design-library .brand-editor .be-select:hover{background:var(--t-surface)}
#design-library .brand-editor .be-select[aria-expanded=true]{border-color:var(--t-ink)}
#design-library .brand-editor .be-select>svg{margin-left:auto;color:var(--t-muted);transition:transform .16s ease-out}
#design-library .brand-editor .be-select[aria-expanded=true]>svg{transform:rotate(180deg)}
#design-library .brand-editor .be-select-sample{flex:none;width:28px;font-size:18px;line-height:24px;font-weight:500;color:var(--t-ink)}
#design-library .brand-editor .be-menu{position:absolute;z-index:5;left:0;right:0;top:calc(100% + 4px);display:grid;gap:2px;padding:4px;border:1px solid var(--t-line);border-radius:10px;background:var(--t-bg);box-shadow:0 2px 4px rgba(23,23,25,.04),0 12px 28px -8px rgba(23,23,25,.18)}
#design-library .brand-editor .be-menu[hidden]{display:none}
#design-library .brand-editor .be-menu [role=option]{display:flex;align-items:center;gap:10px;width:100%;min-height:40px;padding:6px 8px;border:0;border-radius:6px;background:transparent;color:var(--t-ink);font-size:14px;line-height:20px;text-align:left;cursor:pointer}
#design-library .brand-editor .be-menu [role=option]:hover,#design-library .brand-editor .be-menu [role=option]:focus-visible{background:var(--t-surface);outline:none}
#design-library .brand-editor .be-menu [role=option][aria-selected=true]{font-weight:500}
#design-library .brand-editor .be-menu-check{margin-left:auto;opacity:0}
#design-library .brand-editor .be-menu [aria-selected=true] .be-menu-check{opacity:1}
html[data-theme=dark] #design-library .brand-editor .be-menu{box-shadow:0 12px 28px -8px rgba(0,0,0,.6)}
#design-library .brand-editor .be-switch{position:relative;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px;cursor:pointer}
#design-library .brand-editor .be-switch .be-label{margin:0}
#design-library .brand-editor .be-switch input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
#design-library .brand-editor .be-switch-track{flex:none;position:relative;width:40px;height:24px;border-radius:12px;background:var(--t-line);transition:background .16s ease-out}
#design-library .brand-editor .be-switch-track::after{content:"";position:absolute;left:3px;top:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2);transition:transform .16s ease-out}
#design-library .brand-editor .be-switch input:checked+.be-switch-track{background:var(--t-ink)}
#design-library .brand-editor .be-switch input:checked+.be-switch-track::after{transform:translateX(16px)}
html[data-theme=dark] #design-library .brand-editor .be-switch input:checked+.be-switch-track::after{background:var(--t-bg)}
#design-library .brand-editor .be-switch input:focus-visible+.be-switch-track{outline:2px solid var(--t-ink);outline-offset:2px}
@media(prefers-reduced-motion:reduce){#design-library .brand-editor .be-select>svg,#design-library .brand-editor .be-switch-track,#design-library .brand-editor .be-switch-track::after{transition:none}}

/* 17. 브랜드 보드 속 이미지 (2026-11-23). 이미지는 따로 모으지 않고 심볼·색·서체 타일 사이에 끼워 한 장의 무드보드로 본다.
       보드는 줄(fb-row)을 세로로 쌓은 것이고, 이미지는 자르지 않고 제 비율(--r = 가로÷세로)대로 놓인다.
       fb-fixed = 높이가 정해진 줄(이미지 폭이 비율로 정해지고 옆 타일이 남는 폭을 채움), fb-just = 이미지만 있는 줄(폭을 비율대로 나눠 높이가 같아짐).
       줄 구성은 library.js의 boardTiles가 정한다 */
#design-library .board-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 16px}
#design-library .board-head p{margin:0;font-size:14px;line-height:1.6;color:var(--page-muted,var(--t-muted))}
#design-library .board-head .quiet{flex:none}
#design-library .foundation-board{display:flex;flex-direction:column;gap:16px}
#design-library .foundation-board.is-drop{outline:2px solid var(--primary-normal);outline-offset:6px;border-radius:var(--radius-large)}
#design-library .fb-row{display:flex;gap:16px;min-width:0}
#design-library .fb-row>div{min-width:0;border:1px solid var(--line-normal);border-radius:var(--radius-large);background:var(--background-normal);overflow:hidden}
#design-library .fb-row>.fb-1{flex:1 1 0}
/* 두 타일이 나란한 줄(2+4, 3+3, 4+2): 안쪽 여백과 상관없이 정확히 6칸 기준으로 나눈다 */
#design-library .fb-row>.fb-2{flex:0 0 calc((100% - 16px) / 3)}
#design-library .fb-row>.fb-3{flex:0 0 calc((100% - 16px) / 2)}
#design-library .fb-row>.fb-4{flex:0 0 calc((100% - 16px) * 2 / 3)}
#design-library .foundation-image{position:relative;flex:0 1 auto;min-width:0;margin:0;overflow:hidden;aspect-ratio:var(--r,1.4);border:1px solid var(--line-normal);border-radius:var(--radius-large);background:var(--background-alternative)}
#design-library .foundation-image img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover}
/* 높이가 정해진 줄: 이미지 높이 = 줄 높이, 폭은 비율이 정한다 */
#design-library .fb-fixed>.foundation-image{height:100%}
#design-library .fb-mid{height:240px}
#design-library .fb-mid>div{min-width:200px}
#design-library .fb-tall{height:360px}
#design-library .fb-tall>.foundation-type{min-width:52%}
#design-library .fb-low{height:220px}
#design-library .fb-fixed>.foundation-neutrals{min-width:220px}
#design-library .foundation-neutrals.is-wide{flex-direction:row}
#design-library .foundation-neutrals.is-wide>div{flex-direction:column;align-items:flex-start;justify-content:flex-end;min-height:120px}
#design-library .fb-mid>.foundation-icons{gap:20px;padding:24px}
/* 이미지만 있는 줄: 폭을 비율만큼 나눠 가지면 높이가 같아진다 */
#design-library .fb-just>.foundation-image{flex:var(--r,1.4) var(--r,1.4) 0}
@media(max-width:1100px){
 #design-library .foundation-board,#design-library .fb-row{gap:12px}
 #design-library .fb-row{flex-wrap:wrap;height:auto}
 #design-library .fb-row>div{flex:1 1 260px}
 #design-library .fb-row>:is(.foundation-type,.foundation-neutrals){flex-basis:100%}
 #design-library .foundation-neutrals{flex-direction:row}
 #design-library .foundation-neutrals>div{flex-direction:column}
 #design-library .fb-fixed>.foundation-image{flex:var(--r,1.4) 1 200px;height:auto}
}
@media(max-width:767px){#design-library .fb-row>div{flex-basis:100%}#design-library .fb-row>.foundation-image{flex:1 1 100%;height:auto;aspect-ratio:var(--r,1.4)}#design-library .board-head{flex-direction:column;align-items:flex-start}}
/* 한 줄을 채우기엔 이미지가 적은 줄: 크기 단계에 맞는 높이로 가운데에 둔다 */
#design-library .fb-solo{justify-content:center}
#design-library .fb-solo-1{height:200px}
#design-library .fb-solo-2{height:300px}
#design-library .fb-solo-3{height:480px}
/* 작게로 바꾼 이미지 두 장을 위아래로 쌓은 칸. 칸의 비율(--r)은 두 장을 같은 폭으로 쌓았을 때의 비율이다 */
#design-library .fb-stack{display:flex;flex-direction:column;gap:16px;min-width:0;aspect-ratio:var(--r,1)}
#design-library .fb-just>.fb-stack{flex:var(--r,1) var(--r,1) 0}
#design-library .fb-fixed>.fb-stack{flex:0 1 auto;height:100%}
#design-library .fb-stack>.foundation-image{flex:calc(1 / var(--r,1.4)) 1 0;width:100%;height:auto;min-height:0;aspect-ratio:auto}
/* 이미지 위의 크기 버튼(작게 · 보통 · 크게) */
#design-library .mood-size{position:absolute;top:10px;left:10px;display:flex;align-items:center;gap:2px;padding:0;border-radius:16px;background:rgba(23,23,25,.62);color:#fff;font-size:12px;line-height:32px;opacity:0;transition:opacity .15s ease-out}
#design-library .mood-size button{display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer}
#design-library .mood-size button:hover:not(:disabled){background:rgba(255,255,255,.18)}
#design-library .mood-size button:disabled{opacity:.35;cursor:default}
#design-library .mood-size button:focus-visible{outline:2px solid #fff;outline-offset:-4px}
#design-library .foundation-image:hover .mood-size,#design-library .mood-size:focus-within{opacity:1}
@media(hover:none){#design-library .mood-size{opacity:1}}
@media(prefers-reduced-motion:reduce){#design-library .mood-size{transition:none}}
#design-library .mood-remove{position:absolute;top:10px;right:10px;display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:rgba(23,23,25,.62);color:#fff;opacity:0;cursor:pointer;transition:opacity .15s ease-out}
#design-library .foundation-image:hover .mood-remove,#design-library .mood-remove:focus-visible{opacity:1}
#design-library .mood-remove:focus-visible{outline:2px solid #fff;outline-offset:-4px}
@media(hover:none){#design-library .mood-remove{opacity:1}}
@media(prefers-reduced-motion:reduce){#design-library .mood-remove{transition:none}}

/* 18. 브랜드 보드 오토레이아웃 (2026-11-23). 줄(fb-line) 안에 타일과 이미지(fb-item)가 세 개까지 나란히 놓인다.
       끌면 자리가 바뀌고(fb-drop이 놓일 자리), 네 변의 손잡이(fb-handle)로 폭과 줄 높이를 바꾼다. 같은 줄은 높이가 같다 */
#design-library .board-actions{flex:none;display:flex;gap:8px}
#design-library .foundation-board.is-flow{display:flex;flex-direction:column;gap:16px;position:relative}
#design-library .is-flow>.fb-line{display:flex;align-items:stretch;gap:16px;min-width:0;border:0;border-radius:0;background:none;overflow:visible}
#design-library .fb-line>.fb-item{position:relative;display:grid;flex:1 1 0;min-width:0;box-sizing:border-box;border:1px solid var(--line-normal);border-radius:var(--radius-large);background:var(--background-normal);overflow:hidden;container-type:size;cursor:grab;user-select:none;-webkit-user-select:none;touch-action:none;transition:box-shadow .15s ease-out}
#design-library .fb-line>.fb-item:is([data-item=symbol],[data-item=wordmark]){min-height:180px}
#design-library .fb-line>.fb-item:is([data-item=icons],[data-item=colors]){min-height:228px}
#design-library .fb-line>.fb-item[data-item=neutrals]{min-height:220px}
/* 서체 타일은 글 길이가 높이를 정한다. 이미지는 줄 높이를 따르고 사진은 칸을 꽉 채운다 */
#design-library .fb-line>.fb-item[data-item=type]{container-type:inline-size}
#design-library .fb-line>.fb-item-image{container-type:normal}
#design-library .fb-line>.fb-item:hover{box-shadow:0 0 0 1px var(--label-alternative)}
#design-library .fb-line>.fb-item:focus-visible{outline:2px solid var(--primary-normal);outline-offset:2px}
#design-library .fb-line>.fb-item:is(.is-dragging,.is-resizing){z-index:5;box-shadow:0 0 0 1px var(--label-alternative),0 16px 36px -10px rgba(0,0,0,.3);transition:none}
#design-library .fb-line>.fb-item.is-dragging{opacity:.88;cursor:grabbing}
#design-library .fb-item>:is(div,figure){width:100%;height:auto;min-width:0;min-height:0;margin:0;border:0;border-radius:0;aspect-ratio:auto;grid-column:auto}
/* 손잡이: 네 변 가운데의 짧은 막대. 왼쪽·오른쪽은 폭, 위·아래는 줄 높이 */
#design-library .fb-handle{position:absolute;z-index:2;color:var(--label-alternative);opacity:0;transition:opacity .15s ease-out}
#design-library .fb-handle::after{content:"";position:absolute;border-radius:2px;background:currentColor}
#design-library .fb-handle:is(.fb-handle-l,.fb-handle-r){top:25%;bottom:25%;width:18px;cursor:ew-resize}
#design-library .fb-handle:is(.fb-handle-l,.fb-handle-r)::after{top:50%;width:4px;height:min(40px,70%);transform:translateY(-50%)}
#design-library .fb-handle-l{left:0}
#design-library .fb-handle-l::after{left:6px}
#design-library .fb-handle-r{right:0}
#design-library .fb-handle-r::after{right:6px}
#design-library .fb-handle:is(.fb-handle-t,.fb-handle-b){left:25%;right:25%;height:18px;cursor:ns-resize}
#design-library .fb-handle:is(.fb-handle-t,.fb-handle-b)::after{left:50%;width:min(40px,70%);height:4px;transform:translateX(-50%)}
#design-library .fb-handle-t{top:0}
#design-library .fb-handle-t::after{top:6px}
#design-library .fb-handle-b{bottom:0}
#design-library .fb-handle-b::after{bottom:6px}
#design-library .fb-item-image .fb-handle{color:#fff;filter:drop-shadow(0 0 1px rgba(0,0,0,.7))}
#design-library .fb-item:is(:hover,:focus-visible,.is-resizing) .fb-handle{opacity:1}
#design-library .fb-item .mood-remove{z-index:3}
@media(hover:none){#design-library .fb-handle{opacity:1}}
/* 놓일 자리 표시: 세로 막대는 그 줄 안에 끼우기, 가로 막대는 새 줄 */
#design-library .fb-drop{position:absolute;z-index:6;border-radius:2px;background:var(--primary-normal);pointer-events:none}
/* 타일 내용이 타일 크기를 따라간다 */
#design-library .fb-item>.foundation-symbol{padding:14cqmin}
#design-library .fb-item>.foundation-symbol :is(svg,img){width:100%;height:100%;max-width:none}
#design-library .fb-item>.foundation-wordmark{padding:6cqmin;font-size:clamp(14px,min(14cqw,50cqh),160px);text-align:center}
#design-library .fb-item>.foundation-icons{align-content:center;gap:clamp(8px,6cqmin,28px);padding:clamp(12px,8cqmin,36px)}
#design-library .fb-item>.foundation-colors{grid-template-rows:1.3fr 1fr}
#design-library .fb-item .foundation-colors [data-color-chip]{min-height:0;padding:clamp(10px,5cqmin,20px)}
/* 회색 단계는 폭과 상관없이 위에서 아래로 쌓는다 */
#design-library .fb-item>.foundation-neutrals{flex-direction:column}
#design-library .fb-item>.foundation-neutrals>div{flex-direction:row;align-items:center;justify-content:space-between;min-height:0}
@media(prefers-reduced-motion:reduce){#design-library .fb-line>.fb-item,#design-library .fb-handle{transition:none}}

/* 19. 카드 공통 · 툴팁 · 기능 아이콘 (2026-11-24)
   모션 카드와 컴포넌트 카드는 같은 틀이다: 섬네일 상자 안에 미리보기 + (작은 분류 글 위, 이름 아래) + 오른쪽 끝 복사 버튼.
   설명·조절·코드는 카드를 눌러 뜨는 팝업에서 본다. 컴포넌트 카드 쪽 모양은 kit-app.js의 frameCSS에 같은 값으로 있다.
   기능 아이콘은 ui-icons.js(Lucide 한 세트)만 쓴다. */
.ui-icon{flex:none;display:block;pointer-events:none}
.cards .card{display:flex;flex-direction:column;min-width:0;border:1px solid var(--t-line);border-radius:16px;background:var(--t-bg);cursor:pointer;transition:border-color .16s ease-out}
.cards .card .card-open,.cards .card .card-visual,.cards .card:nth-child(n) .card-visual{border:0;border-radius:15px 15px 0 0}
.cards .card-body{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 12px 14px 20px;border-top:1px solid var(--t-line)}
.cards .card-text{min-width:0}
.cards .card .card-meta{margin:0;font-size:12px;line-height:18px;color:var(--t-muted)}
.cards .card .term-open{display:block;min-height:0;margin-top:2px;max-width:100%}
.cards .card h3{margin:0;font-size:18px;line-height:24px;font-weight:600;color:var(--t-ink)}
.cards .copy-title{position:relative;flex:none;display:grid;place-items:center;width:36px;height:36px;padding:0;border-radius:8px;background:transparent;color:var(--t-muted)}
.cards .copy-title:hover{background:var(--t-surface);color:var(--t-ink)}
@media(hover:hover){.cards .card:hover{border-color:color-mix(in srgb,var(--t-ink) 32%,var(--t-line))}}
@media(pointer:coarse){.cards .copy-title{width:44px;height:44px}}
/* 툴팁: 올리거나 초점이 가면 버튼이 하는 일을 알려 준다 */
[data-tip]::after{content:attr(data-tip);position:absolute;right:0;bottom:calc(100% + 8px);z-index:5;padding:6px 10px;border-radius:6px;background:var(--t-ink);color:var(--t-bg);font:500 12px/16px Pretendard,sans-serif;letter-spacing:0;white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .12s ease-out,visibility 0s linear .12s}
[data-tip]:hover::after,[data-tip]:focus-visible::after{opacity:1;visibility:visible;transition:opacity .12s ease-out .15s,visibility 0s linear .15s}
/* 글자 기호(↻ ⧉ ✕ ↕) 대신 아이콘을 쓰는 버튼 */
#sort,#replay,#copy,#compare,[data-pplay],[data-pcopy]{display:inline-flex;align-items:center;justify-content:center;gap:6px}
#sort{max-width:none}
[data-pplay]+[data-pcopy]{margin-left:8px}
#detail #close{display:grid;place-items:center;width:36px;height:36px;padding:0;border-radius:8px}
#detail #close:hover,.icon-library-head>button:hover{background:var(--t-surface)}
@media(pointer:coarse){#detail #close{width:44px;height:44px}}
@media(prefers-reduced-motion:reduce){.cards .card,[data-tip]::after{transition:none}}


/* 20. 라이브러리 화면 정리 (2026-11-25): 큰 라인 탭, 중립 바탕, 흰 미리보기. */
:root{--catalog-bg:#f5f5f5;--catalog-preview-bg:#ffffff;--workspace-panel-shadow:0 1px 2px rgba(23,23,25,.05),0 12px 32px -8px rgba(23,23,25,.14)}
html[data-theme=dark]{--catalog-bg:#121212;--catalog-preview-bg:#1e1e1e;--workspace-panel-shadow:0 1px 2px rgba(0,0,0,.3),0 12px 32px -10px rgba(0,0,0,.55)}
html[data-workspace=motion],html[data-workspace=components],html[data-workspace=motion] body,html[data-workspace=components] body{background:var(--catalog-bg)}
header{height:88px;min-height:88px;background:var(--t-bg)}
header .house-logo{font-size:28px;gap:12px}
header .brand-name{font-size:28px}
header .house-logo svg{width:42px;height:42px}
header nav{align-self:stretch;align-items:stretch;gap:24px}
header nav button{position:relative;min-height:56px;padding:0 8px;border:0;border-radius:0;background:transparent;font-size:16px;line-height:24px;font-weight:500;color:var(--t-muted)}
header nav button:hover,header nav button.active{background:transparent;color:var(--t-ink);box-shadow:none}
header nav button::after{content:'';position:absolute;left:8px;right:8px;bottom:16px;height:2px;border-radius:2px;background:currentColor;opacity:0;transform:scaleX(.5);transition:transform .16s ease-out,opacity .16s ease-out}
header nav button.active::after{opacity:1;transform:scaleX(1)}
.brand-editor,#library .rail,.component-rail{box-shadow:var(--workspace-panel-shadow)}
@media(min-width:1280px){.brand-editor,#library .rail,.component-rail{top:104px;max-height:calc(100dvh - 124px)}#filter-body,.component-rail .panel-body{max-height:calc(100dvh - 126px)}}
.cards .card,.cards .card .card-visual,.cards .card:nth-child(n) .card-visual{background:var(--catalog-preview-bg)}
.cards .card .card-body{border-top:0}
.cards .card-visual .trackline{display:none}
@media(hover:hover){.cards .card:hover .card-visual{background:var(--catalog-preview-bg)}}
.cards .card:focus-visible .card-visual{background:var(--catalog-preview-bg)}
@media(max-width:767px){header{height:auto;min-height:80px;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding-block:12px}header nav{grid-area:2/1/3/3;justify-self:center;width:auto}.header-tools{grid-area:1/2}header .house-logo{font-size:22px}header .brand-name{font-size:24px}header .house-logo svg{width:36px;height:36px}header nav{gap:12px}header nav button{padding-inline:8px;font-size:16px}header nav button::after{left:8px;right:8px;bottom:4px}}
@media(max-width:520px){header nav{min-height:48px;gap:24px}header nav button{min-height:48px}header nav button::after{bottom:0}}
@media(prefers-reduced-motion:reduce){header nav button::after{transition:none}}

/* 20. 브랜드 색 셋 (2026-12-02): 짧고 큰 제목(Display)은 Primary Vivid */
#design-library .foundation-type h2{color:var(--primary-vivid,inherit)}

/* 21. 워드마크 이미지 (2026-12-02): 올린 로고 이미지를 타일 안에 비율 그대로 맞춘다 */
#design-library .fb-item>.foundation-wordmark img{display:block;width:80%;height:70%;min-height:0;object-fit:contain}
#design-library .brand-editor .be-wordmark{margin-top:8px}
#design-library .brand-editor .be-wordmark .symbol-reset:disabled{opacity:.4;cursor:default}
