/* Pretendard Variable — 번들 (SIL OFL 1.1, fonts/LICENSE 참조) */
@font-face {
  font-family: 'Pretendard';
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url('./fonts/PretendardVariable.woff2') format('woff2-variations'),
       url('./fonts/PretendardVariable.woff2') format('woff2');
}

:root {
  /* INSIGHT Design System — Foundation Color (Figma 추출, 2026-05-13) */
  /* Blue */
  --blue-25:  #F7F9FD;
  --blue-50:  #EBF0FC;
  --blue-100: #C1D1F6;
  --blue-200: #A3BAF2;
  --blue-300: #799BEC;
  --blue-400: #5F88E8;
  --blue-500: #376AE2;
  --blue-600: #3260CE;
  --blue-700: #274BA0;
  --blue-800: #1E3A7C;
  --blue-900: #172D5F;
  /* Grey / Neutral */
  --grey-white: #FFFFFF;
  --grey-25:  #F9F9FB;
  --grey-50:  #F1F1F3;
  --grey-100: #D9DBDD;
  --grey-200: #B1B5BB;
  --grey-300: #8E949D;
  --grey-400: #787F89;
  --grey-500: #565F6C;
  --grey-600: #4E5662;
  --grey-700: #3D434D;
  --grey-800: #2F343B;
  --grey-900: #24282D;
  --grey-black: #000000;
  /* Cyan */
  --cyan-50: #F1FAFA; --cyan-100: #D5EFF0; --cyan-200: #C0E8E9; --cyan-300: #A3DDDF; --cyan-400: #91D6D9;
  --cyan-500: #76CCCF; --cyan-600: #6BBABC; --cyan-700: #549193; --cyan-800: #417072; --cyan-900: #325657;
  /* Purple */
  --purple-50: #F8EFFC; --purple-100: #E8CCF6; --purple-200: #DDB4F1; --purple-300: #CE91EB; --purple-400: #C57CE7;
  --purple-500: #B65BE1; --purple-600: #A653CD; --purple-700: #8141A0; --purple-800: #64327C; --purple-900: #4C265F;
  /* Red */
  --red-50: #FCEEEE; --red-100: #F5CCCC; --red-200: #F1B3B3; --red-300: #EA9090; --red-400: #E67A7A;
  --red-500: #E05959; --red-600: #CC5151; --red-700: #9F3F3F; --red-800: #7B3131; --red-900: #5E2525;
  /* Yellow */
  --yellow-50: #FFFBEB; --yellow-100: #FEF8E0; --yellow-200: #FDF1BF; --yellow-300: #FBE68D; --yellow-400: #FADE66;
  --yellow-500: #FAD232; --yellow-600: #E1BD2D; --yellow-700: #C8A828; --yellow-800: #967E1E; --yellow-900: #705E16;
  /* Green */
  --green-50: #E8F8E8; --green-100: #B8E9B6; --green-200: #96DE93; --green-300: #66CF62; --green-400: #48C544;
  --green-500: #1AB715; --green-600: #18A713; --green-700: #12820F; --green-800: #0E650C; --green-900: #0B4D09;
  /* Carrot */
  --carrot-50: #FFF3D5; --carrot-100: #FFE4AB; --carrot-200: #FFD181; --carrot-300: #FFBE62; --carrot-400: #FFA02E;
  --carrot-500: #DB7E21; --carrot-600: #B75F17; --carrot-700: #93450E; --carrot-800: #7A3108; --carrot-900: #602706;
  /* Transparent */
  --transparent-default: rgba(142, 148, 157, 0);
  --transparent-hover: rgba(142, 148, 157, 0.10);
  --dimmed: rgba(36, 40, 45, 0.30);

  /* ===== Hover variants (color.md 정의된 hover 값 노출) =====
     Hover state = 같은 토큰의 -hover variant로 swap */
  /* Blue */
  --blue-25-hover: #B9C9EE; --blue-50-hover: #A6BCF2; --blue-100-hover: #7E9FEC; --blue-200-hover: #5E86E8;
  --blue-300-hover: #3669E2; --blue-400-hover: #1F57DA; --blue-500-hover: #1A47B2; --blue-600-hover: #224390;
  --blue-700-hover: #182E62; --blue-800-hover: #0F1D3E; --blue-900-hover: #081021;
  /* Grey */
  --grey-white-hover: #EBEBEB; --grey-25-hover: #E4E4E7; --grey-50-hover: #E4E4E7; --grey-100-hover: #C4C7CA;
  --grey-200-hover: #9A9FA7; --grey-300-hover: #79808B; --grey-400-hover: #646A72; --grey-500-hover: #444B55;
  --grey-600-hover: #3D434D; --grey-700-hover: #2B2F36; --grey-800-hover: #1D2125; --grey-900-hover: #121417;
  /* Cyan */
  --cyan-50-hover: #D2EFEF; --cyan-100-hover: #B8E4E5; --cyan-200-hover: #A0DCDE; --cyan-300-hover: #86D2D5; --cyan-400-hover: #73CBCF;
  --cyan-500-hover: #59C1C5; --cyan-600-hover: #4FADB0; --cyan-700-hover: #457678; --cyan-800-hover: #325658; --cyan-900-hover: #233C3E;
  /* Green */
  --green-50-hover: #C8EEC8; --green-100-hover: #98DF95; --green-200-hover: #76D472; --green-300-hover: #48C644; --green-400-hover: #39AB35;
  --green-500-hover: #159211; --green-600-hover: #12800F; --green-700-hover: #0D5B0B; --green-800-hover: #094008; --green-900-hover: #062905;
  /* Yellow */
  --yellow-50-hover: #FFF3C2; --yellow-100-hover: #FDEFBA; --yellow-200-hover: #FCE897; --yellow-300-hover: #FADE66; --yellow-400-hover: #F9D53E;
  --yellow-500-hover: #F9C90B; --yellow-600-hover: #C9A61D; --yellow-700-hover: #A68B21; --yellow-800-hover: #736017; --yellow-900-hover: #4D400F;
  /* Red */
  --red-50-hover: #F6CBCB; --red-100-hover: #EEAAAA; --red-200-hover: #EA8F8F; --red-300-hover: #E36D6D; --red-400-hover: #DF5858;
  --red-500-hover: #D93535; --red-600-hover: #BE3737; --red-700-hover: #833434; --red-800-hover: #5E2626; --red-900-hover: #421A1A;
  /* Purple */
  --purple-50-hover: #E8CBF6; --purple-100-hover: #D8A8F0; --purple-200-hover: #CF94EB; --purple-300-hover: #BF70E5; --purple-400-hover: #B65BE1;
  --purple-500-hover: #A739DB; --purple-600-hover: #9337BE; --purple-700-hover: #693583; --purple-800-hover: #4D265E; --purple-900-hover: #341A42;
  /* Carrot */
  --carrot-50-hover: #FFDEA8; --carrot-100-hover: #FFC77A; --carrot-200-hover: #FFB251; --carrot-300-hover: #FF9824; --carrot-400-hover: #FE8001;
  --carrot-500-hover: #DF7007; --carrot-600-hover: #BC5B0B; --carrot-700-hover: #93440C; --carrot-800-hover: #672D09; --carrot-900-hover: #451D07;

  /* Convenience aliases */
  --white: #FFFFFF;

  /* Spacing — 4px grid, 20 tokens */
  --spacing-1:  1px;
  --spacing-2:  2px;
  --spacing-3:  3px;
  --spacing-4:  4px;
  --spacing-5:  5px;
  --spacing-6:  6px;
  --spacing-8:  8px;
  --spacing-12: 12px;
  --spacing-16: 16px;
  --spacing-20: 20px;
  --spacing-24: 24px;
  --spacing-28: 28px;
  --spacing-32: 32px;
  --spacing-40: 40px;
  --spacing-48: 48px;
  --spacing-56: 56px;
  --spacing-64: 64px;
  --spacing-72: 72px;
  --spacing-80: 80px;
  --spacing-96: 96px;

  /* Radius */
  --radius-none: 0;
  --radius-4:   4px;
  --radius-6:   6px;
  --radius-8:    8px;
  --radius-10:   10px;
  --radius-12:   12px;
  --radius-pill: 9999px;

  /* Shadow */
  --shadow-none:   none;
  --shadow-sm:     0 1px 2px rgba(36, 40, 45, 0.06);
  --shadow-md:     0 2px 8px rgba(36, 40, 45, 0.08);
  --shadow-lg:     0 6px 20px rgba(36, 40, 45, 0.10);
  --shadow-xl:     0 16px 40px rgba(36, 40, 45, 0.14);
  --shadow-bottom: 0 -1px 2px rgba(36, 40, 45, 0.06);

  /* Focus ring (interaction state — 모든 interactive component 공통) */
  --focus-ring:        0 0 0 3px var(--blue-100);
  --focus-ring-danger: 0 0 0 3px var(--red-100);

  /* Semantic — site usage (mapped to primitives above) */
  --primary: var(--blue-500);
  --primary-dark: var(--blue-700);
  --text-primary: var(--grey-900);     /* 텍스트 기본 */
  --text-body: var(--grey-700);
  --text-sub: var(--grey-500);          /* 텍스트 보조 */
  --text-caption: var(--grey-300);     /* 텍스트 캡션 */
  --text-disabled: var(--grey-200);    /* 텍스트 비활성 */
  --text-muted: var(--grey-300);       /* legacy alias = caption */
  --border: var(--grey-50);             /* border 기본 */
  --border-strong: var(--grey-100);    /* site-internal only, not in spec */
  --bg: var(--grey-white);
  --bg-soft: var(--grey-25);
  --bg-page: var(--grey-25);
  --sidebar-w: 240px;
  --content-max: 1280px;

  /* Breakpoints — 표준 4단계. CSS @media 에는 raw px 로 써야 함 (var() 불가).
     컨벤션: min-width 로 "이 tier 이상" 을 지정. max-width 는 (bp - 1)px 사용.
       sm 이상: @media (min-width: 640px)
       md 이상: @media (min-width: 768px)
       lg 이상: @media (min-width: 1024px)
       xl 이상: @media (min-width: 1280px)
     mobile only: @media (max-width: 767px)  ← md 미만 */
  --bp-sm:  640px;
  --bp-md:  768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;

  /* Font family */
  --font-sans: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-body);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ===== Layout ===== */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  padding: 32px 20px;
  overflow-y: auto;
  /* 자식 간 spacing 은 sibling padding-top 규칙으로 (margin-top/bottom 금지 룰) */
}

.sidebar-logo {
  /* heading/4 (17 Semibold 1.5) */
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-sub {
  /* caption (13 Regular 1.5) */
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-muted);
}

.sidebar-section {
  /* label/3 (13 Medium 1.4) — uppercase 처리는 시각 treatment */
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Sidebar spacing — sibling padding-top 로 표현 (원래: logo mb:4, sub mb:28, section m:24 0 8) */
.sidebar-logo + .sidebar-sub { padding-top: 4px; }
.sidebar-sub  + .sidebar-section { padding-top: 28px; }
.sidebar-section + .sidebar-nav { padding-top: 8px; }
.sidebar-nav + .sidebar-section { padding-top: 24px; }

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 15px;
  color: var(--text-body);
  font-weight: 500;
  transition: background 0.12s ease;
}

.sidebar-nav li a:hover {
  background: var(--bg-soft);
}

.sidebar-nav li a.active {
  background: var(--blue-50);
  color: var(--primary);
  font-weight: 600;
}

.main {
  margin-left: var(--sidebar-w);
  padding: 56px 64px 96px;
  flex: 1;
  min-width: 0;
}

.content {
  max-width: var(--content-max);
}

/* ===== Header ===== */
.page-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  /* 자식 간(eyebrow → title → desc) 및 다음 형제(.section)와의 spacing 은 sibling padding-top 로 */
}

.page-eyebrow {
  /* label/3 (13 Medium 1.4) — uppercase 처리는 시각 treatment */
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.page-title {
  /* heading/1 (27 Bold 1.5) */
  font-size: 27px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-desc {
  /* body/1 (17 Regular 1.7) */
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-sub);
  max-width: 640px;
}

/* page-header 자식 spacing — 원래: eyebrow mb:8, title mb:12 */
.page-eyebrow + .page-title { padding-top: 8px; }
.page-title + .page-desc { padding-top: 12px; }

/* content 안 스택 — 원래: page-header mb:48, section mb:64 */
.content > .page-header + .section { padding-top: 48px; }
.content > .section + .section { padding-top: 64px; }

/* ===== Sections ===== */
.section {
  /* 자식(section-title → section-desc → 콘텐츠) spacing 은 아래 sibling padding-top 규칙으로 */
}

.section-title {
  /* heading/3 (19 Semibold 1.5) — Bold(700)는 heading/1에만 */
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-desc {
  /* body/2 (15 Regular 1.5) */
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-sub);
}

/* .section 내부 spacing — 원래: title mb:8, desc mb:24
   sibling `+ *` 로 다음 요소에 padding-top 걸면 배경 있는 컨테이너(.table-wrap 등) 안에
   빈 공간이 시각화되는 회귀 발생. 텍스트 전용인 title/desc 자체에 padding-bottom 을 걸어
   같은 spacing 을 만들되 시각 side-effect 없앰 */
.section > .section-title:not(:last-child) { padding-bottom: 8px; }
.section > .section-desc:not(:last-child)  { padding-bottom: 24px; }

/* ===== Token Table ===== */
/* .token-table — DEPRECATED. <table class="table"> + <div class="table-wrap"> 사용. .table 는 COMPONENT LIBRARY 참조 */

/* ===== Typography samples ===== */
.type-sample {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.type-sample:last-child { border-bottom: none; }

.type-meta {
  flex-shrink: 0;
  width: 200px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
  /* strong → 이후 텍스트 spacing 은 sibling padding-top 로 (원래: strong mb:4) */
  display: flex;
  flex-direction: column;
}

.type-meta strong {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
}

.type-meta strong + * { padding-top: 4px; }

.type-preview {
  flex: 1;
  color: var(--text-primary);
}

/* ===== Color swatches ===== */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.swatch {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.swatch-color {
  height: 100px;
  border-bottom: 1px solid var(--border);
}

.swatch-meta {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.swatch-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.swatch-value {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-muted);
}

/* ===== Spacing samples ===== */
.spacing-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.spacing-row:last-child { border-bottom: none; }

.spacing-meta {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spacing-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.spacing-value {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-muted);
}

.spacing-bar {
  background: var(--primary);
  height: 16px;
  border-radius: 3px;
}

/* ===== Radius samples ===== */
.radius-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.radius-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 16px;
  /* 자식 스택: shape → name → value. 가운데 정렬 + 자식 간 spacing (원래: shape mb:16, name mb:4) */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.radius-shape {
  width: 80px;
  height: 80px;
  background: var(--primary);
}

.radius-card .radius-shape + * { padding-top: 16px; }
.radius-card .radius-name + * { padding-top: 4px; }

.radius-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.radius-value {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-muted);
}

/* ===== Shadow samples ===== */
.shadow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  padding: 12px 0 24px;
}

.shadow-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
  border-radius: 12px;
  padding: 32px 16px 24px;
  text-align: center;
}

.shadow-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.shadow-value {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Overview cards ===== */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--spacing-16);
}

.overview-card {
  display: flex; flex-direction: column;
  gap: var(--spacing-16);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-12);
  padding: var(--spacing-24);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}

.overview-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.overview-text {
  display: flex; flex-direction: column;
  gap: var(--spacing-4);
}
.overview-name {
  font-size: 17px; font-weight: 600; line-height: 1.5;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.overview-desc {
  font-size: 15px; font-weight: 400; line-height: 1.5;
  color: var(--text-sub);
}

/* ===== Misc ===== */
/* .note (callout) — DEPRECATED per design.md. typography hierarchy로 대체 */
/* .tbd — DEPRECATED. <span class="badge pc-sm yellow">TBD</span> 사용 */

/* Scope/feature list — index 페이지 ✅/❌ 리스트 */
.scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-24);
}
@media (max-width: 1023px) { .scope-grid { grid-template-columns: 1fr; } }

.scope-block {
  display: flex; flex-direction: column;
  gap: var(--spacing-12);
  padding: var(--spacing-20) var(--spacing-24);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-10);
}
.scope-head {
  font-size: 15px; font-weight: 600; line-height: 1.5;
  color: var(--text-primary);
  display: inline-flex; align-items: center; gap: var(--spacing-8);
}
.scope-head.is-good { color: var(--green-700); }
.scope-head.is-bad  { color: var(--red-700); }
.scope-list {
  list-style: none;
  display: flex; flex-direction: column;
  gap: var(--spacing-8);
}
.scope-list li {
  font-size: 15px; font-weight: 400; line-height: 1.6;
  color: var(--text-body);
  padding-left: var(--spacing-16);
  position: relative;
}
.scope-list li::before {
  content: '';
  position: absolute;
  left: 4px; top: 11px;
  width: 4px; height: 4px;
  background: var(--text-caption);
  border-radius: var(--radius-pill);
}

.usage-list {
  list-style: none;
  display: flex; flex-direction: column;
  gap: var(--spacing-4);
}
.usage-list li {
  font-size: 15px; line-height: 1.7;
  color: var(--text-sub);
  padding-left: var(--spacing-16);
  position: relative;
}
.usage-list li::before {
  content: '';
  position: absolute;
  left: 4px; top: 10px;
  width: 4px; height: 4px;
  background: var(--text-caption);
  border-radius: var(--radius-pill);
}

@media (max-width: 1023px) {
  .sidebar { position: relative; width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 20px; }
  .main { margin-left: 0; padding: 32px 20px 64px; }
  .layout { flex-direction: column; }
  .page-title { font-size: 28px; }
}

/* ============================================================
   Shared showcase styles — used by component pages
   ============================================================ */
.showcase {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  display: flex; flex-direction: column;
  gap: 20px;
}
.showcase-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 16px;
}
.showcase-row.dark { background: var(--bg-soft); border-radius: 8px; padding: 16px; }
.showcase-label {
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 500; line-height: 1.4;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  width: 80px; flex-shrink: 0;
}
/* .platform-tag — DEPRECATED. <span class="badge pc-sm neutral/blue">PC/Mobile</span> 사용 */

.state-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.state-cell {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 8px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.state-name {
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 500; line-height: 1.4;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}

.variant-head {
  font-size: 15px; font-weight: 600; line-height: 1.45;
  color: var(--text-primary);
  margin: 0;
}
.variant-sub {
  font-size: 15px; font-weight: 400; line-height: 1.5;
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 1023px) { .form-grid { grid-template-columns: 1fr; } }

.subsection-title {
  font-size: 19px; font-weight: 600; line-height: 1.5;
  color: var(--text-primary);
  /* 앞/뒤 spacing 은 부모 컨테이너의 flex column gap 로 처리
     (예: typography.html 의 .ty-subsection gap:8, padding-top:48).
     기존 shorthand 는 라이브러리에서 걷어냄 — margin-top/bottom 금지 룰. */
}

/* ==========================================================================
   COMPONENT LIBRARY
   - 여러 페이지에서 재사용하는 컴포넌트 클래스
   - 단일 페이지 전용 컴포넌트는 해당 .html 의 <style>에 두고, 2개 이상 페이지에서 사용되면 여기로 이동
   ========================================================================== */

/* ===== Input =====
   Default = PC md (40 / 13). Size override = .pc-sm / .pc-lg / .m-md / .m-lg */
.input {
  display: block; width: 100%;
  background: var(--white);
  border: 1px solid var(--grey-50);
  border-radius: var(--radius-6);
  color: var(--text-primary);
  font-family: inherit;
  letter-spacing: 0; line-height: 1;
  padding: 0 var(--spacing-12);
  height: 40px;       /* default — PC md */
  font-size: 15px;    /* default — PC md (container-wrapped = 14) */
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--text-caption); }
.input:hover:not(:disabled):not(:focus),
.input.is-hover { border-color: var(--grey-200-hover); }
.input:focus,
.input.is-focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.input:disabled,
.input.is-disabled { background: var(--bg-soft); color: var(--text-disabled); cursor: not-allowed; }
.input.is-error { border-color: var(--red-500); }
.input.is-error:focus,
.input.is-error.is-focus { box-shadow: var(--focus-ring-danger); }
/* Size overrides — default 외 사이즈가 필요할 때만 */
.input.pc-sm { height: 32px; font-size: 15px; }
.input.pc-lg { height: 48px; font-size: 15px; }
.input.m-md  { height: 48px; font-size: 15px; }
.input.m-lg  { height: 56px; font-size: 15px; }

/* Input wrap (prefix/suffix icon) */
.input-wrap {
  display: flex; align-items: center;
  gap: var(--spacing-8);
  background: var(--white);
  border: 1px solid var(--grey-50);
  border-radius: var(--radius-6);
  padding: 0 var(--spacing-12);
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
}
.input-wrap:hover:not(.is-focus):not(.is-disabled):not(.is-error),
.input-wrap.is-hover { border-color: var(--grey-200-hover); }
.input-wrap:focus-within,
.input-wrap.is-focus { border-color: var(--primary); box-shadow: var(--focus-ring); }
.input-wrap.is-disabled { background: var(--bg-soft); cursor: not-allowed; }
.input-wrap.is-error { border-color: var(--red-500); }
.input-wrap.is-error.is-focus,
.input-wrap.is-error:focus-within { box-shadow: var(--focus-ring-danger); }
.input-wrap > input {
  flex: 1; min-width: 0;
  border: none; outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  letter-spacing: 0; line-height: 1;
  padding: 0;
}
.input-wrap > input::placeholder { color: var(--text-caption); }
.input-wrap > input:disabled { color: var(--text-disabled); cursor: not-allowed; }
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
/* Hide native number spinners (use custom .input-spinner) */
.input-wrap > input[type="number"]::-webkit-inner-spin-button,
.input-wrap > input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.input-wrap > input[type="number"] { -moz-appearance: textfield; text-align: left; }
.input-wrap > .input-icon { color: var(--text-caption); line-height: 1; flex-shrink: 0; display: inline-flex; align-items: center; }
.input-wrap > .input-icon.clickable { cursor: pointer; color: var(--text-sub); }
.input-wrap > .input-icon.clickable:hover { color: var(--text-primary); }
/* Number spinner — 1 wrapper with border+radius, 2 inner buttons share a divider */
.input-spinner {
  display: flex; flex-direction: column;
  /* 좌 4 · 우 -8 만 유지 (input-wrap padding-right 12 를 뚫어 시각 4 정렬).
     상/하는 .input-wrap 이 align-items:center 로 세로 중앙 정렬해주므로 별도 spacing 불필요. */
  margin-inline: var(--spacing-4) calc(-1 * var(--spacing-8));
  border: 1px solid var(--border);
  border-radius: var(--radius-4);
  background: var(--white);
  overflow: hidden;
  flex-shrink: 0;
}
.input-spinner-btn {
  background: transparent;
  border: none;
  width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  color: var(--text-sub);
  cursor: pointer;
  transition: background .1s, color .1s;
}
.input-spinner-btn:hover:not(:disabled) { background: var(--bg-soft); color: var(--text-primary); }
.input-spinner-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.input-spinner-btn:disabled { color: var(--text-disabled); cursor: not-allowed; }
.input-spinner-btn svg { width: 8px; height: 8px; display: block; }
.input-spinner-btn + .input-spinner-btn { border-top: 1px solid var(--border); }
.input-wrap.pc-sm { height: 32px; }
.input-wrap.pc-sm > input { font-size: 15px; }
.input-wrap.pc-sm > .input-icon { font-size: 15px; }
.input-wrap.pc-md { height: 40px; }
.input-wrap.pc-md > input { font-size: 15px; }
.input-wrap.pc-md > .input-icon { font-size: 16px; }
.input-wrap.pc-lg { height: 48px; }
.input-wrap.pc-lg > input { font-size: 15px; }
.input-wrap.pc-lg > .input-icon { font-size: 16px; }
.input-wrap.m-md { height: 48px; }
.input-wrap.m-md > input { font-size: 15px; }
.input-wrap.m-md > .input-icon { font-size: 16px; }
.input-wrap.m-lg { height: 56px; }
.input-wrap.m-lg > input { font-size: 15px; }
.input-wrap.m-lg > .input-icon { font-size: 18px; }

/* ===== Form Field (label · helper · error wrapper) ===== */
/* label = label/1 (15 Medium 1.4) · helper/error = caption (13 Regular 1.5) */
.field {
  display: flex; flex-direction: column;
  gap: var(--spacing-6);
}
.field-label {
  /* label/1 (15 Medium 1.4) */
  font-size: 15px; font-weight: 500; line-height: 1.4;
  color: var(--text-primary);
}
.field-helper {
  /* caption (13 Regular 1.5) */
  font-size: 15px; font-weight: 400; line-height: 1.5;
  color: var(--text-caption);
}
.field-error {
  /* caption (13 Regular 1.5) */
  font-size: 15px; font-weight: 400; line-height: 1.5;
  color: var(--red-500);
}
.field.is-disabled .field-label { color: var(--text-disabled); }

/* ==========================================================================
   DOCS PAGE PATTERN (Example pages — guide-style layouts)
   - 사용처: showcase/example-guide.html, showcase/example-login.html 등
   - 일반 .layout/.sidebar 와 다른 docs 사이트 톤
   ========================================================================== */

.docs-layout {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}
.docs-header {
  position: sticky; top: 0; z-index: 50;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  gap: var(--spacing-24);
  padding: 0 var(--spacing-24);
}
.docs-logo {
  font-size: 15px; font-weight: 600; line-height: 1.4;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  display: flex; align-items: center; gap: var(--spacing-8);
}
.docs-logo-mark {
  width: 24px; height: 24px;
  border-radius: var(--radius-6);
  background: var(--primary);
  color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.docs-search { flex: 1; max-width: 480px; position: relative; }
.docs-search-input {
  width: 100%; height: 36px;
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-6);
  padding: 0 var(--spacing-12) 0 36px;
  font-size: 15px; font-family: inherit;
  color: var(--text-primary);
  transition: border-color .12s, background .12s;
}
.docs-search-input::placeholder { color: var(--text-caption); }
.docs-search-input:focus {
  outline: none; background: var(--white);
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.docs-search-icon {
  position: absolute;
  left: var(--spacing-12); top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-caption);
  pointer-events: none;
}
.docs-search-kbd {
  position: absolute;
  right: var(--spacing-12); top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 500;
  color: var(--text-caption);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-4);
  padding: 1px var(--spacing-6);
  pointer-events: none;
}
.docs-header-tools { display: flex; align-items: center; gap: var(--spacing-8); flex-shrink: 0; }

.docs-body {
  display: grid;
  grid-template-columns: 260px 1fr;
}
@media (max-width: 1023px) { .docs-body { grid-template-columns: 1fr; } }

.docs-sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: var(--spacing-24) var(--spacing-16);
  position: sticky; top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  /* section 간 spacing 은 부모 gap 으로 (원래: .docs-sidebar-section mb:24) */
  display: flex; flex-direction: column;
  gap: var(--spacing-24);
}
.docs-sidebar-section {
  display: flex; flex-direction: column;
  gap: var(--spacing-4);
}
.docs-sidebar-title {
  font-size: 15px; font-weight: 600; line-height: 1.4;
  color: var(--text-primary);
  padding: var(--spacing-6) var(--spacing-12);
  letter-spacing: -0.01em;
}
.docs-sidebar-link {
  display: block;
  padding: var(--spacing-6) var(--spacing-12);
  border-radius: var(--radius-6);
  font-size: 15px; font-weight: 400; line-height: 1.4;
  color: var(--text-sub);
  transition: background .12s, color .12s;
}
.docs-sidebar-link:hover { background: var(--bg-soft); color: var(--text-primary); }
.docs-sidebar-link.is-active {
  background: var(--blue-50); color: var(--primary); font-weight: 500;
}

.docs-main {
  padding: var(--spacing-64) var(--spacing-48);
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
}
@media (max-width: 1023px) { .docs-main { padding: var(--spacing-32) var(--spacing-24); } }

.docs-content {
  display: flex; flex-direction: column;
  gap: var(--spacing-48);
}

.docs-hero {
  display: flex; flex-direction: column;
  gap: var(--spacing-16);
  padding-bottom: var(--spacing-32);
  border-bottom: 1px solid var(--border);
}
.docs-hero-eyebrow {
  display: inline-flex; align-items: center; gap: var(--spacing-8);
  font-size: 15px; font-weight: 500; line-height: 1.4;
  color: var(--text-sub);
}
.docs-hero-title {
  font-size: 36px; font-weight: 700; line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}
.docs-hero-desc {
  font-size: 17px; font-weight: 400; line-height: 1.7;
  color: var(--text-sub);
  margin: 0;
  max-width: 640px;
}
.docs-hero-actions {
  display: flex; gap: var(--spacing-12);
  flex-wrap: wrap;
}
/* 원래: .docs-hero-actions mt:8. 부모(.docs-hero)가 gap:16 이므로 desc → actions 사이는 padding-top 8 로 총 24 spacing */
.docs-hero-desc + .docs-hero-actions { padding-top: var(--spacing-8); }

.docs-section {
  display: flex; flex-direction: column;
  gap: var(--spacing-20);
}
.docs-section-title {
  font-size: 24px; font-weight: 700; line-height: 1.4;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
}
.docs-section-desc {
  font-size: 15px; font-weight: 400; line-height: 1.6;
  color: var(--text-sub);
  margin: 0;
}

.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-16);
}
@media (max-width: 767px) { .docs-card-grid { grid-template-columns: 1fr; } }

.docs-card {
  display: flex; flex-direction: column;
  gap: var(--spacing-12);
  padding: var(--spacing-24);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-12);
  transition: border-color .15s, transform .15s, box-shadow .15s;
  text-decoration: none;
  color: inherit;
}
.docs-card.is-link:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.docs-card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-10);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.docs-card-icon.bg-blue   { background: var(--blue-50);   color: var(--blue-500); }
.docs-card-icon.bg-purple { background: var(--purple-50); color: var(--purple-500); }
.docs-card-icon.bg-green  { background: var(--green-50);  color: var(--green-500); }
.docs-card-icon.bg-yellow { background: var(--yellow-50); color: var(--yellow-700); }
.docs-card-icon.bg-red    { background: var(--red-50);    color: var(--red-500); }
.docs-card-icon svg { width: 22px; height: 22px; }
.docs-card-title {
  font-size: 17px; font-weight: 600; line-height: 1.5;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: var(--spacing-8);
}
.docs-card-arrow {
  width: 16px; height: 16px;
  color: var(--text-caption);
  margin-left: auto;
  flex-shrink: 0;
  transition: transform .15s, color .15s;
}
.docs-card.is-link:hover .docs-card-arrow {
  color: var(--primary); transform: translateX(2px);
}
.docs-card-desc {
  font-size: 15px; font-weight: 400; line-height: 1.6;
  color: var(--text-sub);
}

.docs-value-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-16);
}
@media (max-width: 767px) { .docs-value-list { grid-template-columns: 1fr; } }

/* Docs prose (long-form text content) */
.docs-prose {
  display: flex; flex-direction: column;
  gap: var(--spacing-16);
  font-size: 15px; line-height: 1.7;
  color: var(--text-body);
}
.docs-prose p { margin: 0; }
.docs-prose strong { color: var(--text-primary); font-weight: 600; }
.docs-prose a {
  color: var(--primary); text-decoration: underline;
  text-underline-offset: 2px;
}

/* Docs steps (numbered) */
.docs-steps {
  list-style: none; padding: 0;
  display: flex; flex-direction: column;
  gap: var(--spacing-16);
  counter-reset: docs-step;
}
.docs-steps > li {
  counter-increment: docs-step;
  display: flex; gap: var(--spacing-16);
  align-items: flex-start;
}
.docs-steps > li::before {
  content: counter(docs-step);
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; line-height: 1;
}
.docs-step-body {
  flex: 1; padding-top: var(--spacing-4);
  font-size: 15px; line-height: 1.6; color: var(--text-body);
}
.docs-step-body strong { color: var(--text-primary); font-weight: 600; }

/* Docs callout (info banner replacement for .note) */
.docs-callout {
  display: flex; gap: var(--spacing-12);
  padding: var(--spacing-16);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-8);
}
.docs-callout.is-warning { background: var(--yellow-50); border-color: var(--yellow-200); }
.docs-callout-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--primary); }
.docs-callout.is-warning .docs-callout-icon { color: var(--yellow-800); }
.docs-callout-body {
  font-size: 15px; line-height: 1.6;
  color: var(--text-body);
}
.docs-callout-body strong { color: var(--text-primary); font-weight: 600; }
.docs-callout-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }

/* Image / figure placeholder */
.docs-figure {
  display: flex; flex-direction: column;
  gap: var(--spacing-8);
}
.docs-figure-img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-10);
  overflow: hidden;
  background: var(--bg-soft);
  display: block;
}
.docs-figure-caption {
  font-size: 15px; line-height: 1.5;
  color: var(--text-caption);
  text-align: center;
}

/* DS context banner (top of every example page) */
.ds-context-banner {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-8);
  padding: var(--spacing-12) var(--spacing-16);
  display: flex; align-items: center; gap: var(--spacing-12);
  font-size: 15px; line-height: 1.5;
  color: var(--text-primary);
}
/* 원래: .ds-context-banner mb:24. 다음 형제와의 spacing 은 sibling padding-top 으로 */
.ds-context-banner + * { padding-top: var(--spacing-24); }
.ds-context-banner strong { color: var(--primary); font-weight: 600; }
.ds-context-banner a {
  color: var(--primary); font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px;
  margin-left: auto;
}

/* ===== Button ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--spacing-6);
  border: 1px solid transparent;
  border-radius: var(--radius-6);
  cursor: pointer;
  font-family: var(--font-sans);
  letter-spacing: 0; line-height: 1;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { cursor: not-allowed; }
.btn:focus-visible,
.btn.is-focus { outline: none; box-shadow: var(--focus-ring); }
.btn.danger:focus-visible, .btn.danger.is-focus,
.btn.danger-outline:focus-visible, .btn.danger-outline.is-focus { box-shadow: var(--focus-ring-danger); }
/* Sizes (PC) */
.btn.pc-sm { height: 32px; padding: 0 var(--spacing-12); font-size: 15px; font-weight: 500; }
.btn.pc-md { height: 40px; padding: 0 var(--spacing-16); font-size: 15px; font-weight: 500; }
.btn.pc-lg { height: 48px; padding: 0 var(--spacing-20); font-size: 15px; font-weight: 500; }
/* Sizes (Mobile) */
.btn.m-sm { height: 40px; padding: 0 var(--spacing-16); font-size: 15px; font-weight: 500; }
.btn.m-md { height: 48px; padding: 0 var(--spacing-20); font-size: 15px; font-weight: 500; }
.btn.m-lg { height: 56px; padding: 0 var(--spacing-24); font-size: 15px; font-weight: 500; }
/* Variant: Fill (Main / Primary) */
.btn.fill { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn.fill:hover:not(:disabled), .btn.fill.is-hover { background: var(--blue-500-hover); border-color: var(--blue-500-hover); }
.btn.fill:active:not(:disabled), .btn.fill.is-active { background: var(--blue-600); border-color: var(--blue-600); }
.btn.fill:disabled { background: var(--grey-100); color: var(--grey-300); border-color: var(--grey-100); }
/* Variant: Secondary Primary (Blue outline) */
.btn.secondary-primary { background: var(--white); color: var(--primary); border-color: var(--primary); }
.btn.secondary-primary:hover:not(:disabled), .btn.secondary-primary.is-hover { background: var(--blue-50); }
.btn.secondary-primary:active:not(:disabled), .btn.secondary-primary.is-active { background: var(--blue-100); }
.btn.secondary-primary:disabled { background: var(--white); color: var(--blue-100); border-color: var(--blue-100); }
/* Variant: Secondary Neutral */
.btn.secondary { background: var(--white); color: var(--text-primary); border-color: var(--grey-50); }
.btn.secondary:hover:not(:disabled), .btn.secondary.is-hover { background: var(--bg-soft); }
.btn.secondary:active:not(:disabled), .btn.secondary.is-active { background: var(--grey-50); }
.btn.secondary:disabled { background: var(--white); color: var(--grey-200); border-color: var(--grey-50); }
/* Variant: Danger Fill */
.btn.danger { background: var(--red-500); color: var(--white); border-color: var(--red-500); }
.btn.danger:hover:not(:disabled), .btn.danger.is-hover { background: var(--red-500-hover); border-color: var(--red-500-hover); }
.btn.danger:active:not(:disabled), .btn.danger.is-active { background: var(--red-600); border-color: var(--red-600); }
.btn.danger:disabled { background: var(--grey-100); color: var(--grey-300); border-color: var(--grey-100); }
/* Variant: Danger Outline */
.btn.danger-outline { background: var(--white); color: var(--red-500); border-color: var(--red-500); }
.btn.danger-outline:hover:not(:disabled), .btn.danger-outline.is-hover { background: var(--red-50); }
.btn.danger-outline:active:not(:disabled), .btn.danger-outline.is-active { background: var(--red-100); }
.btn.danger-outline:disabled { background: var(--white); color: var(--red-100); border-color: var(--red-100); }
/* Variant: Ghost (Text-only) */
.btn.ghost { background: transparent; color: var(--primary); border-color: transparent; }
.btn.ghost:hover:not(:disabled), .btn.ghost.is-hover { background: var(--blue-50); }
.btn.ghost:active:not(:disabled), .btn.ghost.is-active { background: var(--blue-100); }
.btn.ghost:disabled { background: transparent; color: var(--grey-300); }
/* Loading spinner */
.btn.is-loading { pointer-events: none; gap: var(--spacing-8); }
.btn.is-loading::before {
  content: '';
  width: 12px; height: 12px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: var(--radius-pill);
  animation: btn-spin 0.8s linear infinite;
  display: inline-block; flex-shrink: 0;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ===== Anomaly list (yellow callout, used in spec docs) ===== */
.anomaly-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--spacing-8); }
.anomaly-list li {
  padding: var(--spacing-12) var(--spacing-16);
  background: var(--yellow-50);
  border: 1px solid var(--yellow-300);
  border-radius: var(--radius-8);
  font-size: 15px; line-height: 1.7;
  color: var(--text-body);
}
.anomaly-list strong { color: var(--yellow-800); }
.anomaly-list code {
  font-family: var(--font-mono);
  font-size: 15px; background: var(--bg-soft);
  padding: 2px 6px; border-radius: var(--radius-4);
}

/* ===== ty-spec (typography spec inline mono text, used in token displays) ===== */
.ty-spec {
  font-family: var(--font-mono);
  font-size: 15px; color: var(--text-muted);
  white-space: nowrap;
}

/* ===== Table =====
   본문 = body/3 (14 Regular 1.5) · 헤더 = label/3 (13 Medium 1.4)
   기본 사용: <div class="table-wrap"><table class="table">...</table></div>
   Toolbar + Table + Pagination 묶을 때: <div class="table-container">...</div>
   (table-container 안은 gap 0 — toolbar·table·pagination 이 시각적으로 1덩어리) */
.table-container { display: flex; flex-direction: column; }
.table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-10);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-family: inherit;
  font-size: 15px;
}
.table thead th {
  background: var(--bg-soft);
  text-align: left;
  padding: var(--spacing-12) var(--spacing-16);
  font-size: 15px; font-weight: 500; line-height: 1.4;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td {
  padding: var(--spacing-12) var(--spacing-16);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
  line-height: 1.5;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--bg-soft); }
.table tbody tr.is-selected { background: var(--white); }
.table tbody tr.is-selected:hover { background: var(--bg-soft); }
/* Sizes */
.table.is-dense { font-size: 15px; }
.table.is-dense thead th { padding: var(--spacing-8) var(--spacing-12); font-size: 15px; }
.table.is-dense tbody td { padding: var(--spacing-8) var(--spacing-12); }
.table.is-dense .row-primary { font-size: 15px; }
.table.is-comfortable { font-size: 15px; }
.table.is-comfortable thead th { padding: var(--spacing-16); }
.table.is-comfortable tbody td { padding: var(--spacing-16); }
.table.is-comfortable .row-primary { font-size: 15px; }
/* Column types */
.table .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-action { text-align: right; width: 1%; white-space: nowrap; }
.table .col-check { width: 44px; }
.table th.col-num { text-align: right; }
/* Sortable header */
.table th.sortable { cursor: pointer; user-select: none; transition: color .1s; }
.table th.sortable:hover { color: var(--text-primary); }
.th-sort { display: inline-flex; align-items: center; gap: var(--spacing-4); }
.th-sort svg { width: 14px; height: 14px; opacity: 0.4; transition: opacity .1s, color .1s; }
.table th.is-sorted { color: var(--text-primary); }
.table th.is-sorted .th-sort svg { opacity: 1; color: var(--primary); }
/* Row meta */
.row-primary { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.row-secondary { font-size: 15px; font-weight: 400; color: var(--text-sub); }
/* 원래: .row-secondary mt:2. sibling padding-top 으로 대체 */
.row-primary + .row-secondary { padding-top: 2px; }
.row-mono { font-family: var(--font-mono); font-size: 15px; }
/* Row checkbox */
.row-check {
  width: 16px; height: 16px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-4);
  background: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; vertical-align: middle;
  transition: border-color .12s, background .12s;
  color: var(--white);
}
.row-check.is-checked { border-color: var(--primary); background: var(--primary); }
.row-check.is-checked::after { content: '✓'; font-size: 15px; font-weight: 700; line-height: 1; }
/* Action button (icon-only) */
.row-action-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  border-radius: var(--radius-6);
  cursor: pointer; color: var(--text-sub);
  transition: background .1s, color .1s;
}
.row-action-btn:hover { background: var(--bg-soft); color: var(--text-primary); }
.row-action-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.row-action-btn svg { width: 16px; height: 16px; }
/* Empty state */
.table-empty { padding: var(--spacing-64) var(--spacing-24); text-align: center; color: var(--text-sub); }
.table-empty-title { font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--text-sub); }
.table-empty-desc { font-size: 15px; line-height: 1.5; color: var(--text-sub); }
/* 원래: .table-empty-title mb:4. sibling padding-top 으로 대체 */
.table-empty-title + .table-empty-desc { padding-top: var(--spacing-4); }
/* Loading row */
.table-loading td { text-align: center; color: var(--text-sub); padding: var(--spacing-32); font-size: 15px; }
/* Toolbar */
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--spacing-12);
  padding: var(--spacing-12) var(--spacing-16);
  background: var(--white);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius-10) var(--radius-10) 0 0;
}
.table-toolbar + .table-wrap { border-top-left-radius: 0; border-top-right-radius: 0; }
.table-wrap:has(+ .table-pagination) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: none; }
.table-toolbar-info { font-size: 15px; color: var(--text-sub); }
.table-toolbar-info strong { color: var(--text-primary); font-weight: 600; }
/* Pagination */
.table-pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--spacing-12);
  padding: var(--spacing-12) var(--spacing-16);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-10) var(--radius-10);
}
.pagination-info { font-size: 15px; color: var(--text-sub); }
.pagination-controls { display: flex; gap: var(--spacing-4); }
.pagination-btn {
  min-width: 32px; height: 32px;
  padding: 0 var(--spacing-8);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-6);
  cursor: pointer;
  font-size: 15px; font-weight: 500;
  color: var(--text-body);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .1s, border-color .1s, color .1s;
}
.pagination-btn:hover:not(:disabled):not(.is-active) { border-color: var(--grey-200-hover); background: var(--bg-soft); }
.pagination-btn.is-active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pagination-btn:disabled { color: var(--text-disabled); cursor: not-allowed; }

/* ===== Native Select (styled) ===== */
.select {
  appearance: none; -webkit-appearance: none;
  display: block; width: 100%;
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23787F89'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.9992 14.2297L19.4933 7.4176L21.0067 9.08255L11.999 17.2705L2.99316 9.08247L4.50677 7.41768L11.9992 14.2297Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--spacing-12) center;
  background-size: 16px 16px;
  border: 1px solid var(--grey-50);
  border-radius: var(--radius-6);
  color: var(--text-primary);
  font-family: inherit;
  letter-spacing: 0; line-height: 1;
  padding: 0 36px 0 var(--spacing-12);
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.select:hover:not(:disabled):not(:focus),
.select.is-hover { border-color: var(--grey-200-hover); }
.select:focus,
.select.is-focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.select:disabled,
.select.is-disabled { background-color: var(--bg-soft); color: var(--text-disabled); cursor: not-allowed; }
.select.is-error { border-color: var(--red-500); }
.select.is-error:focus,
.select.is-error.is-focus { box-shadow: var(--focus-ring-danger); }
.select.is-placeholder { color: var(--text-caption); }
.select.pc-sm { height: 32px; font-size: 15px; }
.select.pc-md { height: 40px; font-size: 15px; }
.select.pc-lg { height: 48px; font-size: 15px; }
.select.m-md  { height: 48px; font-size: 15px; }
.select.m-lg  { height: 56px; font-size: 15px; }

/* ===== Custom Dropdown (JS-driven) ===== */
.select-custom { position: relative; width: 100%; }
.select-custom-trigger {
  appearance: none;
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--grey-50);
  border-radius: var(--radius-6);
  color: var(--text-primary);
  font-family: inherit;
  letter-spacing: 0; line-height: 1;
  padding: 0 36px 0 var(--spacing-12);
  cursor: pointer;
  display: flex; align-items: center;
  transition: border-color .12s, box-shadow .12s;
  position: relative;
}
.select-custom-trigger:hover,
.select-custom.is-hover .select-custom-trigger { border-color: var(--grey-200-hover); }
.select-custom-trigger:focus-visible,
.select-custom.is-open .select-custom-trigger,
.select-custom.is-focus .select-custom-trigger {
  outline: none; border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.select-custom.is-error .select-custom-trigger { border-color: var(--red-500); }
.select-custom.is-error.is-focus .select-custom-trigger,
.select-custom.is-error.is-open .select-custom-trigger { box-shadow: var(--focus-ring-danger); }
.select-custom.is-disabled .select-custom-trigger {
  background: var(--bg-soft); color: var(--text-disabled); cursor: not-allowed;
}
.select-custom.is-placeholder .select-custom-value { color: var(--text-caption); }
.select-custom-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-custom-chevron {
  position: absolute;
  right: var(--spacing-12); top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  pointer-events: none;
  color: var(--text-sub);
  transition: transform .15s;
  flex-shrink: 0;
}
.select-custom.is-open .select-custom-chevron { transform: translateY(-50%) rotate(180deg); }
.select-custom.pc-sm .select-custom-trigger { height: 32px; font-size: 15px; }
.select-custom.pc-md .select-custom-trigger { height: 40px; font-size: 15px; }
.select-custom.pc-lg .select-custom-trigger { height: 48px; font-size: 15px; }
.select-custom.m-md  .select-custom-trigger { height: 48px; font-size: 15px; }
.select-custom.m-lg  .select-custom-trigger { height: 56px; font-size: 15px; }

/* Multi-select — trigger grows with selected badges */
.select-custom.is-multi .select-custom-trigger {
  height: auto;
  flex-wrap: wrap;
  align-items: center;
  padding-top: var(--spacing-4);
  padding-bottom: var(--spacing-4);
}
.select-custom.is-multi.pc-sm .select-custom-trigger { min-height: 32px; }
.select-custom.is-multi.pc-md .select-custom-trigger { min-height: 40px; }
.select-custom.is-multi.pc-lg .select-custom-trigger { min-height: 48px; }
.select-custom.is-multi.m-md  .select-custom-trigger { min-height: 48px; }
.select-custom.is-multi.m-lg  .select-custom-trigger { min-height: 56px; }
.select-custom-multi-values {
  display: flex; flex-wrap: wrap;
  gap: var(--spacing-4);
  flex: 1; min-width: 0;
  align-items: center;
}
.select-custom-multi-placeholder {
  flex: 1; color: var(--text-caption);
  display: none;
}
.select-custom.is-multi.is-placeholder .select-custom-multi-values { display: none; }
.select-custom.is-multi.is-placeholder .select-custom-multi-placeholder { display: block; }

/* ===== Dropdown Panel ===== */
.dropdown {
  background: var(--white);
  border: 1px solid var(--grey-50);
  border-radius: var(--radius-6);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-4);
  display: flex; flex-direction: column;
  min-width: 220px; max-height: 320px;
  overflow-y: auto;
}
.dropdown-option {
  display: flex; align-items: center;
  gap: var(--spacing-8);
  padding: var(--spacing-8) var(--spacing-12);
  border-radius: var(--radius-4);
  font-size: 15px; line-height: 1.5;
  color: var(--text-primary);
  cursor: pointer; user-select: none;
  transition: background .1s;
}
.dropdown-option:hover,
.dropdown-option.is-hover { background: var(--bg-soft); }
.dropdown-option.is-selected { background: var(--blue-50); color: var(--primary); font-weight: 500; }
.dropdown-option:not(.is-selected) { font-weight: 400; }
.dropdown-option:not(.is-selected) .dropdown-label { font-weight: 400; }
.dropdown-option.is-selected .dropdown-check { opacity: 1; }
.dropdown-option.is-disabled { color: var(--text-disabled); cursor: not-allowed; }
.dropdown-option .dropdown-label { flex: 1; min-width: 0; }
.dropdown-check {
  width: 16px; height: 16px; flex-shrink: 0;
  color: var(--primary);
  opacity: 0;
}
.dropdown-separator {
  /* 원래 정의: 4px 수직 spacing + L/R -4 로 dropdown padding 4 를 뚫어 full-width line.
     L/R 은 margin-inline 으로 유지, 수직 spacing 은 자체 box 9px (4 + 1 line + 4) 로 확보. */
  display: block;
  height: 9px;
  margin-inline: calc(-1 * var(--spacing-4));
  background: transparent;
}
.dropdown-separator::before {
  content: '';
  display: block;
  height: 1px;
  width: 100%;
  background: var(--border);
  transform: translateY(4px);
}
.dropdown-group-label {
  font-size: 15px; font-weight: 500;
  color: var(--text-caption);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: var(--spacing-8) var(--spacing-12) var(--spacing-4);
}
.dropdown-search {
  padding: var(--spacing-4);
  position: relative;
}
.dropdown-search input {
  width: 100%; height: 32px;
  border: 1px solid var(--grey-50);
  border-radius: var(--radius-4);
  padding: 0 var(--spacing-12) 0 32px;
  font-size: 15px; font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
}
.dropdown-search input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.dropdown-search-icon {
  position: absolute;
  left: calc(var(--spacing-4) + var(--spacing-12));
  top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--text-caption);
  pointer-events: none;
}
.dropdown-empty {
  padding: var(--spacing-16);
  text-align: center;
  font-size: 15px;
  color: var(--text-caption);
}
/* Absolute-positioned dropdown panel (inside .select-custom) */
.select-custom .dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  min-width: 0;
}
.select-custom:not(.is-open) .dropdown { display: none; }

/* ===== Tag ===== */
.badge {
  display: inline-flex; align-items: center;
  gap: var(--spacing-4);
  font-weight: 500; line-height: 1;
  border-radius: var(--radius-4);
  border: 1px solid transparent;
  white-space: nowrap; flex-shrink: 0;
  font-family: inherit;
  transition: background .12s, color .12s, border-color .12s;
}
.badge.pc-sm { padding: var(--spacing-4) var(--spacing-5); font-size: 15px; }
.badge.pc-md { padding: var(--spacing-4) var(--spacing-5); font-size: 15px; }
.badge.m-md  { padding: var(--spacing-4) var(--spacing-5); font-size: 15px; border-radius: var(--radius-6); }
.badge.m-lg  { padding: var(--spacing-6) var(--spacing-5); font-size: 15px; border-radius: var(--radius-6); }
/* Soft (default) */
.badge.grey { background: var(--grey-25);  color: var(--grey-700); }
.badge.blue    { background: var(--blue-50);   color: var(--blue-700); }
.badge.green   { background: var(--green-50);  color: var(--green-700); }
.badge.yellow  { background: var(--yellow-50); color: var(--yellow-800); }
.badge.red     { background: var(--red-50);    color: var(--red-700); }
.badge.purple  { background: var(--purple-50); color: var(--purple-700); }
.badge.cyan    { background: var(--cyan-50);   color: var(--cyan-700); }
.badge.carrot  { background: var(--carrot-50); color: var(--carrot-700); }
/* Solid */
.badge.is-solid.grey { background: var(--grey-700);   color: var(--white); }
.badge.is-solid.blue    { background: var(--blue-500);   color: var(--white); }
.badge.is-solid.green   { background: var(--green-500);  color: var(--white); }
.badge.is-solid.yellow  { background: var(--yellow-500); color: var(--grey-900); }
.badge.is-solid.red     { background: var(--red-500);    color: var(--white); }
.badge.is-solid.purple  { background: var(--purple-500); color: var(--white); }
.badge.is-solid.cyan    { background: var(--cyan-500);   color: var(--grey-900); }
.badge.is-solid.carrot  { background: var(--carrot-500); color: var(--white); }
/* Outline */
.badge.is-outline { background: transparent; }
.badge.is-outline.grey { color: var(--grey-700);   border-color: var(--grey-200); }
.badge.is-outline.blue    { color: var(--blue-600);   border-color: var(--blue-200); }
.badge.is-outline.green   { color: var(--green-700);  border-color: var(--green-200); }
.badge.is-outline.yellow  { color: var(--yellow-800); border-color: var(--yellow-300); }
.badge.is-outline.red     { color: var(--red-600);    border-color: var(--red-200); }
.badge.is-outline.purple  { color: var(--purple-600); border-color: var(--purple-200); }
.badge.is-outline.cyan    { color: var(--cyan-700);   border-color: var(--cyan-200); }
.badge.is-outline.carrot  { color: var(--carrot-700); border-color: var(--carrot-200); }
/* Disabled */
.badge.is-disabled { opacity: 0.5; cursor: not-allowed; }
/* Trailing remove button */
.badge-remove {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: inherit; opacity: 0.65;
  padding: 0; margin-right: -2px;
  width: 1em; height: 1em;
  border-radius: var(--radius-6);
  transition: opacity .12s, background .12s;
}
.badge-remove:hover { opacity: 1; background: var(--grey-25); }
.badge-remove:focus-visible { outline: none; box-shadow: var(--focus-ring); opacity: 1; }
.badge-remove svg { width: 0.85em; height: 0.85em; }
/* Leading dot indicator */
.badge-dot { display: inline-block; width: 6px; height: 6px; border-radius: var(--radius-pill); background: currentColor; flex-shrink: 0; }
/* Inline icon */
.badge svg.badge-icon { width: 1em; height: 1em; flex-shrink: 0; }

/* ==========================================================================
   ICON SYSTEM
   - Inline SVG with currentColor (shadcn/Lucide 패턴)
   - SVG 파일은 design-system/icons/ 에 보관
   - 단색: SVG 안 stroke/fill="currentColor" → color로 제어
   - 멀티컬러: SVG 안에 색상 고정값 (currentColor 미사용)
   - 크기는 width/height 또는 font-size (1em 기준)
   ========================================================================== */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: middle;
  line-height: 1;
}
.icon svg { display: block; width: 100%; height: 100%; }

/* Icon size tokens (Figma 컨벤션: XS 8 · S 16 · M 24 · L 32) */
.icon-xs { font-size: 15px; }
.icon-sm { font-size: 16px; }
.icon-md { font-size: 24px; }
.icon-lg { font-size: 32px; }
