/* ============================================================
 * SeraphTools Component Library v1  (seraph-components.css)
 * ------------------------------------------------------------
 * seraph-theme.css(토큰)에 의존한다. 반드시 theme 다음에 로드할 것.
 * 모든 클래스는 st- 접두사. 데모/사용법: GET /components
 * 원칙:
 *  - 색/치수 하드코딩 금지. 항상 var(--st-*) 사용.
 *  - 상태(hover/pressed/disabled/selected)는 토큰의 상태 색만 사용.
 *  - 라이트 서피스가 기본, 다크 서피스(툴바/메뉴/툴팁)는 Figma처럼 반전.
 * ============================================================ */

/* ---------- 버튼 ---------- */
.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--st-space-2);
  height: var(--st-control-medium);
  padding: 0 var(--st-space-3);
  border: 1px solid transparent;
  border-radius: var(--st-radius-medium);
  font: inherit;
  font-size: var(--st-text-body-medium-size);
  font-weight: var(--st-font-weight-strong);
  letter-spacing: var(--st-text-body-medium-ls);
  color: var(--st-text);
  background: transparent;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color var(--st-duration-fast) var(--st-easing),
              border-color var(--st-duration-fast) var(--st-easing);
}
.st-btn:disabled { cursor: not-allowed; }
.st-btn svg { width: 16px; height: 16px; flex: none; }

.st-btn--primary { background: var(--st-bg-brand); color: var(--st-text-onbrand); }
.st-btn--primary:hover { background: var(--st-bg-brand-hover); }
.st-btn--primary:active { background: var(--st-bg-brand-pressed); }
.st-btn--primary:disabled { background: var(--st-bg-disabled); color: var(--st-text-disabled); }

.st-btn--secondary { border-color: var(--st-border); background: var(--st-bg); }
.st-btn--secondary:hover { background: var(--st-bg-hover); }
.st-btn--secondary:active { background: var(--st-bg-pressed); }
.st-btn--secondary:disabled { color: var(--st-text-disabled); border-color: var(--st-border); background: var(--st-bg); }

.st-btn--ghost { color: var(--st-text-secondary); }
.st-btn--ghost:hover { background: var(--st-bg-hover); color: var(--st-text); }
.st-btn--ghost:active { background: var(--st-bg-pressed); }
.st-btn--ghost:disabled { color: var(--st-text-disabled); background: transparent; }

.st-btn--danger { background: var(--st-bg-danger); color: var(--st-text-onbrand); }
.st-btn--danger:hover { background: var(--st-red-600); }
.st-btn--danger:active { background: var(--st-red-700); }

/* 파괴적 동작의 보조형: 평소엔 조용히, hover에서만 위험 색 */
.st-btn--danger-ghost { color: var(--st-text-danger); }
.st-btn--danger-ghost:hover { background: var(--st-red-100); }
.st-btn--danger-ghost:active { background: var(--st-red-200); }

/* 다크 서피스(툴바) 위 버튼 */
.st-btn--on-dark { color: var(--st-text-toolbar); }
.st-btn--on-dark:hover { background: rgba(255, 255, 255, 0.1); }
.st-btn--on-dark:active { background: rgba(255, 255, 255, 0.16); }
.st-btn--on-dark[aria-pressed="true"],
.st-btn--on-dark.is-active { background: var(--st-bg-brand); color: var(--st-text-onbrand); }

.st-btn--small { height: var(--st-control-small); padding: 0 var(--st-space-2); }
.st-btn--large { height: var(--st-control-large); padding: 0 var(--st-space-4); font-size: var(--st-text-body-large-size); }

/* 아이콘 전용 버튼 (라이트 서피스) */
.st-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--st-control-medium);
  height: var(--st-control-medium);
  border: none;
  border-radius: var(--st-radius-medium);
  background: transparent;
  color: var(--st-icon-secondary);
  cursor: pointer;
  transition: background-color var(--st-duration-fast) var(--st-easing);
}
.st-icon-btn:hover { background: var(--st-bg-hover); color: var(--st-icon); }
.st-icon-btn:active { background: var(--st-bg-pressed); }
.st-icon-btn[aria-pressed="true"],
.st-icon-btn.is-active { background: var(--st-bg-selected); color: var(--st-icon-brand); }
.st-icon-btn--small { width: var(--st-control-small); height: var(--st-control-small); }
.st-icon-btn svg { width: 16px; height: 16px; }

/* ---------- 인풋 ---------- */
.st-input,
.st-textarea,
.st-select {
  display: block;
  width: 100%;
  height: var(--st-control-medium);
  padding: 0 var(--st-space-2);
  border: 1px solid transparent;
  border-radius: var(--st-radius-medium);
  font: inherit;
  font-size: var(--st-text-body-medium-size);
  letter-spacing: var(--st-text-body-medium-ls);
  color: var(--st-text);
  background: var(--st-bg-secondary);
  transition: border-color var(--st-duration-fast) var(--st-easing),
              background-color var(--st-duration-fast) var(--st-easing);
}
.st-input:hover, .st-textarea:hover, .st-select:hover { border-color: var(--st-border); }
.st-input:focus, .st-textarea:focus, .st-select:focus {
  outline: none;
  border-color: var(--st-border-selected);
  background: var(--st-bg);
  box-shadow: none;
}
.st-input::placeholder, .st-textarea::placeholder { color: var(--st-text-tertiary); }
.st-input:disabled, .st-textarea:disabled, .st-select:disabled {
  color: var(--st-text-disabled);
  background: var(--st-bg-secondary);
  cursor: not-allowed;
}
.st-input.is-invalid, .st-textarea.is-invalid { border-color: var(--st-border-danger); background: var(--st-red-100); }

.st-textarea { height: auto; min-height: 64px; padding: var(--st-space-2); resize: vertical; }

.st-select {
  appearance: none;
  padding-right: var(--st-space-6);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath d='M1 2.5l3 3 3-3' fill='none' stroke='%23757575' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--st-space-2) center;
  cursor: pointer;
}

.st-input--small, .st-select--small { height: var(--st-control-small); }
.st-input--large { height: var(--st-control-large); font-size: var(--st-text-body-large-size); }

/* 검색 인풋 (아이콘 포함) */
.st-search { position: relative; }
.st-search > svg {
  position: absolute;
  left: var(--st-space-2);
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--st-icon-tertiary);
  pointer-events: none;
}
.st-search > .st-input { padding-left: var(--st-space-6); }

/* 필드: 레이블 + 컨트롤 (세로) */
.st-field { display: flex; flex-direction: column; gap: var(--st-space-1); }
.st-field > label {
  font-size: var(--st-text-body-medium-size);
  color: var(--st-text-secondary);
  font-weight: var(--st-font-weight-default);
}
.st-field > .st-help { font-size: var(--st-text-body-small-size); color: var(--st-text-tertiary); }
.st-field > .st-error { font-size: var(--st-text-body-small-size); color: var(--st-text-danger); }

/* 속성 행: 레이블 + 컨트롤 (가로, 속성 패널용) */
.st-prop-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: var(--st-space-2);
  min-height: var(--st-control-small);
}
.st-prop-row > label { color: var(--st-text-secondary); font-size: var(--st-text-body-medium-size); }
.st-prop-row .st-input, .st-prop-row .st-select { height: var(--st-control-small); }

/* ---------- 체크박스 / 라디오 / 스위치 ---------- */
.st-checkbox, .st-radio {
  display: inline-flex;
  align-items: center;
  gap: var(--st-space-2);
  cursor: pointer;
  font-size: var(--st-text-body-medium-size);
}
.st-checkbox input, .st-radio input {
  appearance: none;
  width: 14px; height: 14px;
  margin: 0;
  border: 1px solid var(--st-grey-400);
  background: var(--st-bg);
  cursor: pointer;
  transition: background-color var(--st-duration-fast) var(--st-easing),
              border-color var(--st-duration-fast) var(--st-easing);
}
.st-checkbox input { border-radius: var(--st-radius-small); }
.st-radio input { border-radius: var(--st-radius-full); }
.st-checkbox input:checked, .st-radio input:checked {
  border-color: var(--st-bg-brand);
  background-color: var(--st-bg-brand);
}
.st-checkbox input:checked {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2L4.2 7.4 8 3' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
}
.st-radio input:checked {
  background-image: radial-gradient(circle, #ffffff 0 2.5px, transparent 3px);
}
.st-checkbox input:disabled, .st-radio input:disabled { border-color: var(--st-grey-300); background-color: var(--st-bg-secondary); cursor: not-allowed; }

.st-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--st-space-2);
  cursor: pointer;
  font-size: var(--st-text-body-medium-size);
}
.st-switch input {
  appearance: none;
  width: 28px; height: 16px;
  margin: 0;
  border-radius: var(--st-radius-full);
  background: var(--st-grey-300);
  position: relative;
  cursor: pointer;
  transition: background-color var(--st-duration-fast) var(--st-easing);
}
.st-switch input::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: var(--st-radius-full);
  background: #ffffff;
  box-shadow: var(--st-elevation-100);
  transition: transform var(--st-duration-fast) var(--st-easing);
}
.st-switch input:checked { background: var(--st-bg-brand); }
.st-switch input:checked::after { transform: translateX(12px); }

/* ---------- 세그먼트 컨트롤 (Figma 디자인/프로토타입 탭 스타일) ---------- */
.st-segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--st-radius-medium);
  background: var(--st-bg-secondary);
}
.st-segmented > button {
  border: none;
  height: 24px;
  padding: 0 var(--st-space-3);
  border-radius: 3px;
  font: inherit;
  font-size: var(--st-text-body-medium-size);
  font-weight: var(--st-font-weight-strong);
  color: var(--st-text-secondary);
  background: transparent;
  cursor: pointer;
}
.st-segmented > button.is-active {
  background: var(--st-bg);
  color: var(--st-text);
  box-shadow: var(--st-elevation-100);
}

/* ---------- 탭 (밑줄형) ---------- */
.st-tabs {
  display: flex;
  gap: var(--st-space-4);
  border-bottom: 1px solid var(--st-border);
}
.st-tabs > button {
  border: none;
  background: none;
  font: inherit;
  font-size: var(--st-text-body-medium-size);
  font-weight: var(--st-font-weight-strong);
  color: var(--st-text-secondary);
  padding: var(--st-space-2) 0;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.st-tabs > button:hover { color: var(--st-text); }
.st-tabs > button.is-active { color: var(--st-text); border-bottom-color: var(--st-text); }

/* ---------- 배지 / 칩 / 카운트 ---------- */
.st-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 var(--st-space-2);
  border-radius: var(--st-radius-full);
  font-size: var(--st-text-body-small-size);
  font-weight: var(--st-font-weight-strong);
  letter-spacing: var(--st-text-body-small-ls);
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
}
.st-badge--brand   { background: var(--st-blue-200);   color: var(--st-blue-700); }
.st-badge--success { background: var(--st-green-200);  color: var(--st-green-700); }
.st-badge--warning { background: var(--st-yellow-200); color: var(--st-yellow-1000); }
.st-badge--danger  { background: var(--st-red-200);    color: var(--st-red-700); }

.st-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--st-space-1);
  height: 24px;
  padding: 0 var(--st-space-2);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-full);
  font-size: var(--st-text-body-medium-size);
  background: var(--st-bg);
  color: var(--st-text);
  cursor: pointer;
}
.st-chip:hover { background: var(--st-bg-hover); }
.st-chip.is-selected { background: var(--st-bg-selected); border-color: var(--st-border-selected); color: var(--st-text-brand); }
.st-chip .st-chip-remove { display: inline-flex; color: var(--st-icon-tertiary); }
.st-chip .st-chip-remove:hover { color: var(--st-icon); }

.st-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 var(--st-space-1);
  border-radius: var(--st-radius-full);
  font-size: var(--st-text-body-small-size);
  font-weight: var(--st-font-weight-strong);
  background: var(--st-bg-tertiary);
  color: var(--st-text-secondary);
}

/* ---------- 드롭다운 메뉴 (Figma 다크 메뉴) ---------- */
.st-menu {
  min-width: 200px;
  padding: var(--st-space-2);
  border-radius: var(--st-radius-large);
  background: var(--st-bg-menu);
  color: var(--st-text-menu);
  box-shadow: var(--st-elevation-300);
}
.st-menu-item {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  width: 100%;
  height: 28px;
  padding: 0 var(--st-space-2);
  border: none;
  border-radius: var(--st-radius-medium);
  font: inherit;
  font-size: var(--st-text-body-medium-size);
  color: var(--st-text-menu);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.st-menu-item:hover { background: var(--st-bg-brand); }
.st-menu-item.is-disabled { color: var(--st-text-menu-secondary); pointer-events: none; }
.st-menu-item .st-menu-shortcut { margin-left: auto; color: var(--st-text-menu-secondary); font-size: var(--st-text-body-small-size); }
.st-menu-divider { height: 1px; margin: var(--st-space-2) 0; background: var(--st-border-onmenu); }
.st-menu-label { padding: var(--st-space-1) var(--st-space-2); color: var(--st-text-menu-secondary); font-size: var(--st-text-body-small-size); }

/* ---------- 툴팁 (다크) ---------- */
.st-tooltip {
  display: inline-block;
  padding: var(--st-space-1) var(--st-space-2);
  border-radius: var(--st-radius-medium);
  background: var(--st-bg-menu);
  color: var(--st-text-menu);
  font-size: var(--st-text-body-medium-size);
  box-shadow: var(--st-elevation-200);
  white-space: nowrap;
}
[data-st-tooltip] { position: relative; }
[data-st-tooltip]:hover::after {
  content: attr(data-st-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--st-space-1) var(--st-space-2);
  border-radius: var(--st-radius-medium);
  background: var(--st-bg-menu);
  color: var(--st-text-menu);
  font-size: var(--st-text-body-medium-size);
  line-height: var(--st-text-body-medium-lh);
  white-space: nowrap;
  box-shadow: var(--st-elevation-200);
  z-index: 50;
  pointer-events: none;
}

/* ---------- 모달 ---------- */
.st-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh var(--st-space-6) var(--st-space-6);
  background: var(--st-bg-overlay);
  z-index: 100;
}
.st-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: 80vh;
  border-radius: var(--st-radius-large);
  background: var(--st-bg);
  box-shadow: var(--st-elevation-500);
  overflow: hidden;
}
.st-modal--small { max-width: 400px; }
.st-modal--large { max-width: 960px; }
/* 런타임 화면을 모달 안에 재귀 렌더할 때(리스트 행 클릭 → 상세/입력 모달) 쓰는 큰 사이즈.
   좁은 화면에서는 전 사이즈가 full-bleed 로 떨어진다(아래 미디어쿼리). */
.st-modal--xl { max-width: 1200px; }
.st-modal--full {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
}
@media (max-width: 720px) {
  .st-modal-overlay { padding: 0; }
  .st-modal,
  .st-modal--small,
  .st-modal--large,
  .st-modal--xl {
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
}
.st-modal-header {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  padding: var(--st-space-4) var(--st-space-4) var(--st-space-2);
  flex: none;
}
.st-modal-header h2 {
  margin: 0;
  font-size: var(--st-text-heading-medium-size);
  line-height: var(--st-text-heading-medium-lh);
  font-weight: var(--st-font-weight-strong);
}
.st-modal-header .st-icon-btn { margin-left: auto; }
.st-modal-body {
  padding: var(--st-space-2) var(--st-space-4);
  overflow-y: auto;
  flex: 1;
}
.st-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--st-space-2);
  padding: var(--st-space-3) var(--st-space-4);
  border-top: 1px solid var(--st-border);
  flex: none;
}
.st-modal-footer .st-footer-note { margin-right: auto; color: var(--st-text-secondary); }

/* ---------- 파일 카드 (Figma 파일 브라우저 스타일) ---------- */
.st-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--st-space-4);
}
.st-file-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-large);
  background: var(--st-bg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--st-duration-fast) var(--st-easing),
              box-shadow var(--st-duration-fast) var(--st-easing);
}
.st-file-card:hover { box-shadow: var(--st-elevation-100); }
.st-file-card.is-selected { border-color: var(--st-border-selected); box-shadow: 0 0 0 1px var(--st-border-selected); }
.st-file-thumb {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--st-bg-secondary);
  border-bottom: 1px solid var(--st-border);
  color: var(--st-icon-tertiary);
  overflow: hidden;
}
.st-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.st-file-meta {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  padding: var(--st-space-2) var(--st-space-3);
  min-height: 44px;
}
.st-file-meta .st-file-icon { flex: none; width: 16px; height: 16px; color: var(--st-icon-brand); }
.st-file-name {
  font-size: var(--st-text-body-medium-size);
  font-weight: var(--st-font-weight-strong);
  color: var(--st-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-file-sub { font-size: var(--st-text-body-small-size); color: var(--st-text-secondary); }
.st-file-meta .st-icon-btn { margin-left: auto; visibility: hidden; }
.st-file-card:hover .st-icon-btn { visibility: visible; }

/* ---------- 카드(범용) ---------- */
.st-card {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-large);
  background: var(--st-bg);
  padding: var(--st-space-4);
}

/* ---------- 상단 바 / 다크 툴바 ---------- */
.st-topbar {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  height: var(--st-topbar-height);
  padding: 0 var(--st-space-3);
  background: var(--st-bg);
  border-bottom: 1px solid var(--st-border);
}
.st-topbar .st-topbar-title { font-weight: var(--st-font-weight-strong); font-size: var(--st-text-body-medium-size); }
.st-topbar .st-topbar-spacer { flex: 1; }

/* 브랜드 로고 + 브레드크럼.
   두 제품(PDF·Studio)의 상단바가 모두 [로고 / 경로 / 현재위치] 형태라 컴포넌트로 승격했다.
   이전에는 각 화면이 인라인 style 로 같은 값을 반복 선언해 드리프트가 발생했다
   (구분자 / vs ›, 로고 높이 20 vs 160px 등). 새 화면은 아래 클래스만 쓴다.

     <div class="st-topbar">
       <a class="st-topbar-brand" href="…"><img src="…logo.png" alt="SeraphTools"></a>
       <span class="st-crumb-sep">/</span>
       <a class="st-crumb" href="/studio">Studio</a>
       <span class="st-crumb-sep">/</span>
       <span class="st-topbar-title">현재 화면</span>
       <span class="st-topbar-spacer"></span>
       …액션…
     </div> */
.st-topbar .st-topbar-brand { display: inline-flex; align-items: center; flex: none; }
.st-topbar .st-topbar-brand img { height: 20px; width: auto; display: block; }
.st-topbar .st-crumb-sep { color: var(--st-text-tertiary); flex: none; user-select: none; }
.st-topbar .st-crumb {
  color: var(--st-text-secondary);
  font-size: var(--st-text-body-medium-size);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--st-duration-fast) var(--st-easing);
}
.st-topbar .st-crumb:hover { color: var(--st-text); }

.st-toolbar {
  display: inline-flex;
  align-items: center;
  gap: var(--st-space-1);
  height: 40px;
  padding: 0 var(--st-space-2);
  border-radius: var(--st-radius-large);
  background: var(--st-bg-toolbar);
  color: var(--st-text-toolbar);
  box-shadow: var(--st-elevation-300);
}
.st-toolbar .st-toolbar-divider { width: 1px; height: 20px; background: var(--st-border-onmenu); margin: 0 var(--st-space-1); }
.st-toolbar .st-icon-btn { color: rgba(255, 255, 255, 0.85); }
.st-toolbar .st-icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
.st-toolbar .st-icon-btn.is-active { background: var(--st-bg-brand); color: #ffffff; }

/* ---------- 패널 (레이어/속성) ---------- */
.st-panel {
  width: var(--st-panel-width);
  background: var(--st-bg);
  border-right: 1px solid var(--st-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.st-panel--right { border-right: none; border-left: 1px solid var(--st-border); }
.st-panel-section { padding: var(--st-space-2) var(--st-space-2) var(--st-space-3); border-bottom: 1px solid var(--st-border); }
.st-panel-section-title {
  display: flex;
  align-items: center;
  gap: var(--st-space-1);
  padding: var(--st-space-1) var(--st-space-2);
  font-size: var(--st-text-body-medium-size);
  font-weight: var(--st-font-weight-strong);
  color: var(--st-text);
}
.st-panel-section-title .st-count { margin-left: auto; }

.st-layer-row {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  height: 28px;
  padding: 0 var(--st-space-2);
  border-radius: var(--st-radius-medium);
  font-size: var(--st-text-body-medium-size);
  color: var(--st-text);
  cursor: pointer;
  user-select: none;
}
.st-layer-row:hover { background: var(--st-bg-hover); }
.st-layer-row.is-selected { background: var(--st-bg-selected); }
.st-layer-row.is-selected:hover { background: var(--st-bg-selected-hover); }
.st-layer-row svg { width: 12px; height: 12px; flex: none; color: var(--st-icon-secondary); }
.st-layer-row .st-layer-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-layer-row .st-layer-actions { display: none; gap: 2px; }
.st-layer-row:hover .st-layer-actions, .st-layer-row.is-selected .st-layer-actions { display: inline-flex; }

/* ---------- 테이블 (리스트 뷰) ---------- */
.st-table { width: 100%; border-collapse: collapse; font-size: var(--st-text-body-medium-size); }
.st-table th {
  height: var(--st-control-medium);
  padding: 0 var(--st-space-3);
  text-align: left;
  font-weight: var(--st-font-weight-default);
  color: var(--st-text-secondary);
  border-bottom: 1px solid var(--st-border);
  white-space: nowrap;
}
.st-table td {
  height: 40px;
  padding: 0 var(--st-space-3);
  border-bottom: 1px solid var(--st-border);
  color: var(--st-text);
}
.st-table tbody tr { cursor: pointer; }
.st-table tbody tr:hover { background: var(--st-bg-hover); }
.st-table tbody tr.is-selected { background: var(--st-bg-selected); }
.st-table .st-table-actions { display: flex; gap: var(--st-space-1); justify-content: flex-end; visibility: hidden; }
.st-table tbody tr:hover .st-table-actions { visibility: visible; }

/* ---------- 데이터그리드 (엑셀 미리보기 등 밀도 높은 그리드) ---------- */
.st-grid-wrap {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-medium);
  overflow: auto;
  background: var(--st-bg);
}
.st-grid { width: 100%; border-collapse: collapse; font-size: var(--st-text-body-medium-size); }
.st-grid th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 28px;
  padding: 0 var(--st-space-2);
  text-align: left;
  font-weight: var(--st-font-weight-strong);
  color: var(--st-text-secondary);
  background: var(--st-bg-secondary);
  border-bottom: 1px solid var(--st-border);
  border-right: 1px solid var(--st-border);
  white-space: nowrap;
}
.st-grid td {
  height: 28px;
  padding: 0 var(--st-space-2);
  border-bottom: 1px solid var(--st-border);
  border-right: 1px solid var(--st-border);
  color: var(--st-text);
  white-space: nowrap;
}
.st-grid th:last-child, .st-grid td:last-child { border-right: none; }
.st-grid tbody tr:last-child td { border-bottom: none; }
.st-grid tbody tr:hover { background: var(--st-bg-hover); }
.st-grid tbody tr.is-selected { background: var(--st-bg-selected); }
.st-grid tbody tr.is-selected:hover { background: var(--st-bg-selected-hover); }
.st-grid td.is-numeric { text-align: right; font-variant-numeric: tabular-nums; }
.st-grid .st-grid-rowno {
  width: 36px;
  text-align: center;
  color: var(--st-text-tertiary);
  background: var(--st-bg-secondary);
  font-variant-numeric: tabular-nums;
}

/* ---------- 알림 / 토스트 ---------- */
.st-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--st-space-2);
  padding: var(--st-space-3);
  border-radius: var(--st-radius-medium);
  font-size: var(--st-text-body-medium-size);
  border: 1px solid var(--st-border);
  background: var(--st-bg-secondary);
  color: var(--st-text);
}
.st-alert--info    { background: var(--st-blue-100);   border-color: var(--st-blue-300);   }
.st-alert--success { background: var(--st-green-100);  border-color: var(--st-green-300);  }
.st-alert--warning { background: var(--st-yellow-100); border-color: var(--st-yellow-300); }
.st-alert--danger  { background: var(--st-red-100);    border-color: var(--st-red-300);    }

.st-toast {
  display: inline-flex;
  align-items: center;
  gap: var(--st-space-2);
  padding: var(--st-space-2) var(--st-space-4);
  border-radius: var(--st-radius-medium);
  background: var(--st-bg-menu);
  color: var(--st-text-menu);
  font-size: var(--st-text-body-medium-size);
  box-shadow: var(--st-elevation-300);
}
.st-toast .st-toast-action {
  border: none;
  background: none;
  color: var(--st-blue-400);
  font: inherit;
  font-weight: var(--st-font-weight-strong);
  cursor: pointer;
}

/* ---------- 페이지네이션 ---------- */
.st-pagination { display: inline-flex; align-items: center; gap: var(--st-space-1); }
.st-pagination button {
  min-width: var(--st-control-small);
  height: var(--st-control-small);
  padding: 0 var(--st-space-1);
  border: none;
  border-radius: var(--st-radius-medium);
  background: transparent;
  font: inherit;
  font-size: var(--st-text-body-medium-size);
  color: var(--st-text-secondary);
  cursor: pointer;
}
.st-pagination button:hover { background: var(--st-bg-hover); color: var(--st-text); }
.st-pagination button.is-active { background: var(--st-bg-selected); color: var(--st-text-brand); font-weight: var(--st-font-weight-strong); }
.st-pagination button:disabled { color: var(--st-text-disabled); background: transparent; cursor: not-allowed; }

/* ---------- 빈 상태 ---------- */
.st-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--st-space-2);
  padding: var(--st-space-10) var(--st-space-6);
  text-align: center;
  color: var(--st-text-secondary);
}
.st-empty svg { width: 32px; height: 32px; color: var(--st-icon-tertiary); }
.st-empty .st-empty-title { font-weight: var(--st-font-weight-strong); color: var(--st-text); font-size: var(--st-text-body-large-size); }

/* ---------- 스피너 / 프로그레스 ---------- */
.st-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--st-border);
  border-top-color: var(--st-bg-brand);
  border-radius: var(--st-radius-full);
  animation: st-spin 0.7s linear infinite;
}
.st-spinner--large { width: 24px; height: 24px; }
@keyframes st-spin { to { transform: rotate(360deg); } }

.st-progress { width: 100%; height: 4px; border-radius: var(--st-radius-full); background: var(--st-bg-tertiary); overflow: hidden; }
.st-progress > div { height: 100%; border-radius: var(--st-radius-full); background: var(--st-bg-brand); transition: width var(--st-duration-normal) var(--st-easing); }

/* ---------- 아바타 / 구분선 ---------- */
.st-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: var(--st-radius-full);
  background: var(--st-bg-brand);
  color: var(--st-text-onbrand);
  font-size: var(--st-text-body-small-size);
  font-weight: var(--st-font-weight-strong);
  overflow: hidden;
}
.st-avatar img { width: 100%; height: 100%; object-fit: cover; }
.st-divider { border: none; border-top: 1px solid var(--st-border); margin: var(--st-space-4) 0; }

/* ---------- 공용 푸터 (콘텐츠 화면 공통) ---------- */
.st-footer {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  padding: var(--st-space-4) var(--st-space-6);
  border-top: 1px solid var(--st-border);
  background: var(--st-bg);
  font-size: var(--st-text-body-small-size);
  color: var(--st-text-tertiary);
}
.st-footer img { height: 16px; width: auto; opacity: 0.65; }
.st-footer .st-footer-spacer { flex: 1; }
.st-footer a { color: var(--st-text-tertiary); text-decoration: none; margin-left: var(--st-space-4); }
.st-footer a:hover { color: var(--st-text-secondary); }
@media (max-width: 640px) { .st-footer a { display: none; } }
