/* ============================================================================
   코마스에디터 디자인 시스템 (UI 고도화 2026-09-03)
   - 기존 클래스명/ID는 전부 유지 (JS가 생성/참조하는 셀렉터 계약 보존)
   - 시안: ui_reference/01~04 PNG. Modern Japanese SaaS, 카드 기반 레이아웃
   ============================================================================ */

:root {
  --bg-card: var(--bg-surface);
  --bg-panel: var(--bg-surface);
  --bg-input: var(--bg-surface);
  --card-bg: var(--bg-surface);
  --surface: var(--bg-surface);
  --surface-soft: var(--bg-subtle);
  --border-color: var(--border-default);
  /* 공통 컴포넌트용 의미 토큰. 화면 전용 토큰과 다크 override는 후속 반영한다. */
  --bg-page: #eceef2;
  --bg-surface: #ffffff;
  --bg-subtle: #f5f6f9;
  --bg-soft: var(--bg-subtle);
  --bg-control: #f1f2f5;
  --bg-hover: #e8e9ee;
  --bg-table-row-hover: #fafbfd;
  --bg-inverse: #1b1c20;
  --bg-inverse-hover: #33343b;
  --text-primary: #1b1c20;
  --text-secondary: #55575e;
  --text-inverse: #fff;
  --border-default: #dfe1e6;
  --border-subtle: #e9ebef;
  --border-danger: #f2c6c2;
  --bg-danger-hover: #fbdcd9;
  --border-warning-action: #e0c46a;
  --accent: #C2410C;
  --accent-hover: #9A3412;
  --accent-soft: #FFF7ED;
  --on-accent: #fff;
  --link-default: #148c67;
  --status-danger: #d1483f;
  --status-danger-soft: #fdedeb;
  --status-warning: #9a6b00;
  --status-warning-soft: #fff7e0;
  --status-warning-border: #f2d98a;
  --status-success: #148c67;
  --status-success-soft: #e2f4ec;
  --status-info: #3b5bdb;
  --status-info-soft: #eef2fd;
  --overlay-backdrop: rgba(23, 24, 29, 0.55);
  --text-muted: #8a8d96;
  --link-hover: #10714f;
  --text-on-dark: #fff;

  /* 대시보드·관리자 사이드바 및 카드 액션 */
  --bg-sidebar: #17181d;
  --bg-sidebar-soft: #23242b;
  --bg-sidebar-control: #3a3b43;
  --bg-sidebar-control-hover: #2b2c33;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.07);
  --text-sidebar: #c7c8ce;
  --text-sidebar-muted: #8b8d95;
  --border-sidebar: #2e2f36;
  --overlay-card-action: rgba(23, 24, 29, 0.62);

  /* 에디터 상단바·레일·패널·작업영역 */
  --bg-editor-topbar: #17181d;
  --bg-editor-topbar-control: #23242b;
  --bg-editor-topbar-hover: #2b2c33;
  --bg-editor-topbar-hover-overlay: rgba(255, 255, 255, 0.08);
  --bg-editor-topbar-hover-overlay-strong: rgba(255, 255, 255, 0.1);
  --bg-editor-rail: #1c1c28;
  --bg-editor-workspace: #eceef2;
  --text-editor-tab: #a3a3b2;
  --text-editor-tab-muted: #8a8a98;
  --text-editor-panel-muted: #9a9aa8;
  --text-editor-chip: #4a4a58;
  --text-editor-dirty: #f0a92e;
  --border-editor-topbar: #2e2f36;
  --border-editor-topbar-bottom: #000;
  --border-editor-panel: #e6e6ec;
  --border-editor-panel-subtle: #f0f0f4;
  --border-editor-chip: #e0e0e8;
  --overlay-editor-workspace-dot: rgba(27, 28, 32, 0.045);
  --shadow-editor-mobile-panel: 0 -10px 28px rgba(20, 21, 26, 0.2);
  --text-editor-input: FieldText;
  --bg-editor-input: Field;
  --bg-editor-select: ButtonFace;

  /* 에디터 썸네일·선택 보조 UI */
  --bg-editor-thumbnail: #fafafc;
  --text-editor-card-muted: #7a7a88;
  --text-editor-card-label: currentColor;
  --bg-editor-skeleton-base: #ececf2;
  --bg-editor-skeleton-highlight: #f7f7fa;
  --bg-editor-decoration-skeleton-base: #E8E8EC;
  --bg-editor-decoration-skeleton-highlight: #F3F3F5;
  --bg-editor-preview-swatch: color-mix(in srgb, var(--accent) 30%, white);
  --overlay-editor-control: rgba(255, 255, 255, 0.92);
  --focus-editor-flash: color-mix(in srgb, var(--accent) 28%, transparent);
  --focus-editor-selection: color-mix(in srgb, var(--accent) 18%, transparent);

  /* 워터마크·로고 설정 UI (콘텐츠 합성에는 사용하지 않음) */
  --text-editor-watermark-notice: #f5d897;
  --bg-editor-watermark-notice: #fff7e5;
  --text-editor-watermark-warning: #8a5c12;
  --bg-editor-transparent-checker: #f2f3f6;
  --overlay-editor-action: rgba(23, 24, 29, 0.68);
  --overlay-editor-watermark-action: rgba(40, 40, 45, 0.8);
  --shadow-toggle-knob: 0 1px 3px rgba(20, 21, 26, 0.25);
  --bg-watermark-toggle-knob: #fff;
  --bg-watermark-settings-section: transparent;

  /* 인증 화면 토큰 */
  --bg-auth-page: #f2f3f7;
  --overlay-auth-glow-primary: color-mix(in srgb, var(--accent) 10%, transparent);
  --overlay-auth-glow-secondary: color-mix(in srgb, var(--accent) 8%, transparent);
  --focus-auth-ring: color-mix(in srgb, var(--accent) 14%, transparent);
  --border-success: #bfe3d4;
  --text-auth-input: FieldText;

  /* 잉크 / 텍스트 */
  --ink: #1b1c20;
  --ink-soft: #55575e;
  --ink-faint: #8a8d96;

  /* 다크 사이드바 계열 */
  --sidebar-bg: #17181d;
  --sidebar-bg-soft: #23242b;
  --sidebar-border: #2e2f36;
  --sidebar-text: #c7c8ce;
  --sidebar-text-dim: #8b8d95;

  /* 서피스 */
  --workspace-bg: #eceef2;
  --panel-bg: #ffffff;
  --surface-muted: #f5f6f9;
  --surface-elevated: #ffffff;

  /* 보더 */
  --border: #dfe1e6;
  --border-soft: #e9ebef;

  /* 액센트 */
  --accent-ai: var(--accent);
  --accent-ai-hover: var(--accent-hover);
  --accent-ai-soft: var(--accent-soft);
  --accent-primary: #148c67;
  --accent-primary-hover: #10714f;
  --accent-primary-soft: #e2f4ec;

  /* 상태색 */
  --danger: #d1483f;
  --danger-soft: #fdedeb;
  --warning: #9a6b00;
  --warning-soft: #fff7e0;
  --warning-border: #f2d98a;
  --success: #148c67;
  --success-soft: #e2f4ec;
  --info: #3b5bdb;
  --info-soft: #eef2fd;

  /* 그림자 / 라운드 */
  --shadow-sm: 0 1px 2px rgba(20, 21, 26, 0.05), 0 1px 4px rgba(20, 21, 26, 0.05);
  --shadow-md: 0 6px 20px rgba(20, 21, 26, 0.1);
  --shadow-lg: 0 16px 48px rgba(20, 21, 26, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius: 10px;

  font-size: 15px;
}

html[data-theme="dark"] {
  /* 구형 UI 별칭도 같은 의미 토큰을 사용한다. 캔버스 디자인 데이터는 변경하지 않는다. */
  --ink: var(--text-primary);
  --ink-soft: var(--text-secondary);
  --ink-faint: var(--text-muted);
  --workspace-bg: var(--bg-page);
  --panel-bg: var(--bg-surface);
  --surface-muted: var(--bg-subtle);
  --surface-elevated: var(--bg-surface);
  --border: var(--border-default);
  --border-soft: var(--border-subtle);
  --danger: var(--status-danger);
  --danger-soft: var(--status-danger-soft);
  --warning: var(--status-warning);
  --warning-soft: var(--status-warning-soft);
  --warning-border: var(--status-warning-border);
  --success: var(--status-success);
  --success-soft: var(--status-success-soft);
  --info: var(--status-info);
  --info-soft: var(--status-info-soft);
  --text-editor-watermark-notice: #FCD34D;
  --bg-editor-watermark-notice: #3A2A05;
  --text-editor-watermark-warning: #FDE68A;
  --bg-editor-transparent-checker: #2A2E36;
  --overlay-editor-action: rgba(0, 0, 0, 0.78);
  --overlay-editor-watermark-action: rgba(0, 0, 0, 0.82);
  --shadow-toggle-knob: 0 1px 3px rgba(0, 0, 0, 0.60);
  --bg-watermark-toggle-knob: #F8FAFC;
  --bg-watermark-settings-section: var(--bg-page);

  --bg-editor-thumbnail: #22252B;
  --text-editor-card-muted: #A7ADB8;
  --text-editor-card-label: var(--text-primary);
  --bg-editor-skeleton-base: #2A2E36;
  --bg-editor-skeleton-highlight: #363B45;
  --bg-editor-decoration-skeleton-base: #2A2E36;
  --bg-editor-decoration-skeleton-highlight: #363B45;
  --bg-editor-preview-swatch: #7C2D12;
  --overlay-editor-control: rgba(28, 30, 36, 0.98);
  --focus-editor-flash: rgba(249, 115, 22, 0.58);
  --focus-editor-selection: rgba(249, 115, 22, 0.28);

  --bg-editor-topbar: #0E1013;
  --bg-editor-topbar-control: #1A1D23;
  --bg-editor-topbar-hover: #272B32;
  --bg-editor-topbar-hover-overlay: rgba(255, 255, 255, 0.10);
  --bg-editor-topbar-hover-overlay-strong: rgba(255, 255, 255, 0.14);
  --bg-editor-rail: #151820;
  --bg-editor-workspace: #101217;
  --text-editor-tab: #CDD2DB;
  --text-editor-tab-muted: #9EA4AE;
  --text-editor-panel-muted: #A7ADB8;
  --text-editor-chip: #D2D6DE;
  --text-editor-dirty: #FBBF24;
  --border-editor-topbar: #2B3038;
  --border-editor-topbar-bottom: #050608;
  --border-editor-panel: #333842;
  --border-editor-panel-subtle: #292E36;
  --border-editor-chip: #3A404A;
  --overlay-editor-workspace-dot: rgba(255, 255, 255, 0.055);
  --shadow-editor-mobile-panel: 0 -10px 28px rgba(0, 0, 0, 0.56), 0 -1px 0 rgba(255, 255, 255, 0.05);
  --text-editor-input: var(--text-primary);
  --bg-editor-input: var(--bg-surface);
  --bg-editor-select: var(--bg-surface);

  --bg-auth-page: #101217;
  --overlay-auth-glow-primary: rgba(249, 115, 22, 0.16);
  --overlay-auth-glow-secondary: rgba(249, 115, 22, 0.12);
  --focus-auth-ring: rgba(249, 115, 22, 0.42);
  --border-success: #176B54;
  --text-auth-input: var(--text-primary);

  --bg-sidebar: #0E1013;
  --bg-sidebar-soft: #171A1F;
  --bg-sidebar-control: #252931;
  --bg-sidebar-control-hover: #30353D;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
  --text-sidebar: #E5E7EB;
  --text-sidebar-muted: #9EA4AE;
  --border-sidebar: #292D35;
  --overlay-card-action: rgba(0, 0, 0, 0.76);

  --bg-page: #111217;
  --bg-surface: #191B20;
  --bg-subtle: #22252B;
  --bg-control: #272A31;
  --bg-hover: #30343C;
  --bg-table-row-hover: #202329;
  --bg-inverse: #F3F4F6;
  --bg-inverse-hover: #E2E8F0;
  --text-primary: #F3F4F6;
  --text-secondary: #C2C6CE;
  --text-muted: #959AA5;
  --text-inverse: #111217;
  --text-on-dark: #F8FAFC;
  --border-default: #373B44;
  --border-subtle: #2B2F37;
  --border-danger: #7F1D1D;
  --bg-danger-hover: #4A1D22;
  --border-warning-action: #A16207;
  --accent: #F97316;
  --accent-hover: #EA580C;
  --accent-soft: #3D1B09;
  --on-accent: #1B1C20;
  --link-default: #6EE7B7;
  --link-hover: #A7F3D0;
  --status-danger: #F87171;
  --status-danger-soft: #3A1618;
  --status-warning: #FBBF24;
  --status-warning-soft: #3A2A05;
  --status-warning-border: #8A650B;
  --status-success: #34D399;
  --status-success-soft: #0A3027;
  --status-info: #60A5FA;
  --status-info-soft: #0B2745;
  --overlay-backdrop: rgba(0, 0, 0, 0.72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.38), 0 1px 4px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-lg: 0 18px 56px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* panel-bg의 다크 별칭은 에디터에만 적용해 관리자 폼을 보존한다. */
html[data-theme="dark"] #app { --panel-bg: var(--bg-surface); }

* { box-sizing: border-box; }

/* hidden 속성이 CSS display 선언에 지지 않도록 전역 보정
   (모달/배너/크롭버튼 등 hidden 토글 요소가 flex 지정 때문에 항상 보이던 버그 방지) */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  font-family: 'Pretendard', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  color: var(--ink);
  background: var(--workspace-bg);
  -webkit-font-smoothing: antialiased;
}

/* 접근성: 키보드 포커스 표시 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ============================================================================
   공통 프리미티브: 버튼 / 링크 / 아이콘버튼 / 뱃지 / 토스트
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-inverse);
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.btn:disabled { opacity: 0.55; cursor: default; }

/* 주요 CTA: 퍼플 (시안의 ログイン/エクスポート/購入 버튼) */
.btn--primary { background: var(--accent); }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn--ai { background: var(--accent); width: 100%; margin-top: 10px; }
.btn--ai:hover:not(:disabled) { background: var(--accent-hover); }

.btn--block { background: var(--bg-inverse); width: 100%; }
.btn--block:hover:not(:disabled) { background: var(--bg-inverse-hover); }

.btn--danger {
  background: var(--status-danger-soft);
  color: var(--status-danger);
  border-color: var(--border-danger);
  width: 100%;
  margin-top: 8px;
}
.btn--danger:hover:not(:disabled) { background: var(--bg-danger-hover); border-color: var(--status-danger); }

/* 보조(아웃라인) 버튼 */
.btn--secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
  width: 100%;
}
.btn--secondary:hover:not(:disabled) { border-color: var(--text-secondary); background: var(--bg-subtle); }

/* 다크 톱바 위의 밝은 버튼 (에디터 保存) */
.btn--ghost-light {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.btn--ghost-light:hover:not(:disabled) { background: var(--bg-hover); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-control);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { border-color: var(--text-secondary); }

.link { color: var(--link-default); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

.count-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

.admin-badge {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
}

.warn-badge {
  background: var(--status-warning-soft);
  color: var(--status-warning);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

/* 결제 상태 뱃지 (색 + 텍스트로 상태 구분) */
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}
.status-badge--success { background: var(--status-success-soft); color: var(--status-success); }
.status-badge--pending { background: var(--status-warning-soft); color: var(--status-warning); }
.status-badge--failure { background: var(--status-danger-soft); color: var(--status-danger); }
.status-badge--refunded { background: var(--status-info-soft); color: var(--status-info); }

.credit-positive { color: var(--status-success); font-weight: 700; }
.credit-negative { color: var(--status-danger); font-weight: 700; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-inverse);
  color: var(--text-inverse);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  z-index: 1100;
  box-shadow: var(--shadow-md);
  max-width: min(90vw, 480px);
}
.toast--error { background: var(--status-danger); }

/* ============================================================================
   공통: 테이블 / 페이지네이션 / 배너 / 모달
   ============================================================================ */

/* 테이블 래퍼: 라운드 카드 + 좁은 화면 가로 스크롤 */
.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  font-size: 13px;
  min-width: 480px;
}

.admin-table th {
  text-align: left;
  background: var(--bg-subtle);
  padding: 11px 14px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg-table-row-hover); }

.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.pager__btn {
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
}
.pager__btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pager__btn:disabled { opacity: 0.4; cursor: default; }
.pager__info { font-size: 12px; color: var(--text-secondary); }

.banner {
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-size: 13px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.banner--warn { background: var(--status-warning-soft); border: 1px solid var(--status-warning-border); color: var(--status-warning); }
.banner__icon { flex: 0 0 auto; display: inline-flex; }
.banner__icon svg { width: 20px; height: 20px; }
.banner__text { flex: 1 1 240px; }
.banner__action {
  background: var(--bg-surface);
  border: 1px solid var(--border-warning-action);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--status-warning);
  margin-left: auto;
}
.banner__action:hover { border-color: var(--status-warning); }

.modal {
  position: fixed;
  inset: 0;
  background: var(--overlay-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

/* display: flex가 hidden 속성보다 우선하지 않도록 (전역 [hidden] 보정과 이중 안전장치) */
.modal[hidden] { display: none; }

.modal__card {
  width: 360px;
  max-width: 100%;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.image-replace-modal__card { width: 460px; }
.image-replace-modal__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.image-replace-modal__header h3 { margin: 0; font-size: 17px; }
.work-image-picker__card { width: min(720px, 100%); }
.work-image-picker__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.work-image-picker__header h3 { margin: 0; font-size: 17px; color: var(--text-primary); }
.work-image-picker .marketplace-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; max-height: min(62vh, 560px); overflow: auto; padding: 2px; margin: 0 0 16px; }
.work-image-picker .marketplace-grid { scrollbar-color: var(--border-default) transparent; }
.work-image-picker .marketplace-card { display: block; width: 100%; min-width: 0; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--surface-muted); cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.work-image-picker .marketplace-card:hover,
.work-image-picker .marketplace-card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent); outline: none; }
.work-image-picker .marketplace-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.work-image-picker .marketplace-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.work-image-preview { display: block; width: 120px; height: 120px; margin-top: 10px; object-fit: cover; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--surface-muted); }
#myWorksGrid .marketplace-card__preview,
#marketplaceGrid .marketplace-card__preview,
#marketplacePurchasesGrid .marketplace-card__preview { display: block; width: 100%; max-width: 240px; height: 180px; margin: 0 0 12px; object-fit: contain; background: var(--bg-subtle); border-radius: var(--radius-md); }
#marketplaceDetail .marketplace-card__preview { display: block; width: auto; max-width: 100%; max-height: min(60vh, 640px); margin: 0 auto 16px; object-fit: contain; background: var(--bg-subtle); border-radius: var(--radius-md); }
@media (max-width: 520px) {
  .work-image-picker__card { padding: 20px 16px; }
  .work-image-picker .marketplace-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 9px; }
}
/* 마켓 화면만 대상으로 지정해 이미지 선택 모달과 내 작품 스타일을 보존한다. */
.marketplace-section { color: var(--text-primary); }
.marketplace-section input, .marketplace-section select, .marketplace-section button { font-family: inherit; }
.marketplace-section .marketplace-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 20px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md); }
.marketplace-section .marketplace-filter label { display: grid; gap: 8px; flex: 1 1 180px; min-width: 0; color: var(--text-secondary); font-size: 13px; }
.marketplace-section .marketplace-filter label:first-child { flex: 2 1 260px; }
.marketplace-section .marketplace-filter input,
.marketplace-section .marketplace-filter select { width: 100%; min-width: 0; height: 42px; margin: 0; padding: 9px 12px; color: var(--text-primary); background: var(--bg-subtle); border: 1px solid var(--border-default); border-radius: var(--radius-md); }
.marketplace-filter__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.marketplace-filter__actions .btn { width: auto; min-height: 42px; }
.marketplace-section .marketplace-filter { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.marketplace-section .marketplace-filter > label { grid-column: span 6; }
.marketplace-section .marketplace-filter > label:last-of-type { grid-column: span 3; }
.marketplace-price-range { grid-column: span 6; min-width: 0; margin: 0; padding: 0; border: 0; }
.marketplace-price-range legend { margin-bottom: 8px; color: var(--text-secondary); font-size: 13px; }
.marketplace-price-range__inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 10px; }
.marketplace-price-range__inputs > span { padding-bottom: 12px; color: var(--text-secondary); }
.marketplace-price-hint { margin: 6px 0 0; font-size: 12px; color: var(--text-secondary); }
.marketplace-section .marketplace-filter > label:last-of-type,
.marketplace-section .marketplace-filter__actions { margin-bottom: 23px; }
.marketplace-section .marketplace-filter__actions { grid-column: span 3; }
.marketplace-filter-error { color: var(--status-danger); line-height: 1.6; margin: 12px 0; }
.marketplace-section .marketplace-filter [aria-invalid="true"] { border-color: var(--status-danger); }
@media (max-width: 1100px) {
  .marketplace-section .marketplace-filter > label:last-of-type { grid-column: span 6; }
  .marketplace-section .marketplace-filter__actions { grid-column: span 12; margin-bottom: 0; }
}
@media (max-width: 600px) {
  .marketplace-section .marketplace-filter > label,
  .marketplace-section .marketplace-filter > label:last-of-type,
  .marketplace-price-range { grid-column: span 12; margin-bottom: 0; }
}
.marketplace-applied { margin: 14px 0 6px; color: var(--text-secondary); font-size: 13px; overflow-wrap: anywhere; }
.marketplace-results { margin: 0 0 16px; font-size: 14px; font-weight: 600; min-height: 1.5em; }
.marketplace-section .marketplace-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.marketplace-section .marketplace-card { display: flex; flex-direction: column; min-width: 0; padding: 16px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.marketplace-section .marketplace-card:hover,
.marketplace-section .marketplace-card:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent); }
.marketplace-section .marketplace-card h4 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 0 0 10px; font-size: 16px; line-height: 1.5; min-height: 3em; overflow-wrap: anywhere; }
.marketplace-card__title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.marketplace-card__title:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.marketplace-section .marketplace-card__description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; height: 4.5em; margin: 0 0 14px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.marketplace-section .marketplace-card__seller { margin: 0 0 8px; color: var(--text-secondary); font-size: 12px; }
.marketplace-section .marketplace-card__meta { margin: auto 0 14px; font-size: 14px; font-weight: 600; }
.marketplace-section .marketplace-card > .btn { margin-top: auto; width: 100%; text-align: center; }
.marketplace-section .marketplace-card__preview { align-self: center; flex-shrink: 0; }
.marketplace-section .marketplace-detail { margin-top: 24px; padding: 24px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow-wrap: anywhere; }
.marketplace-section .marketplace-detail p { white-space: pre-wrap; line-height: 1.6; }
.marketplace-purchases-title { margin-top: 32px; }
.marketplace-status { grid-column: 1 / -1; display: grid; justify-items: center; gap: 16px; padding: 40px 20px; text-align: center; color: var(--text-secondary); background: var(--bg-surface); border: 1px dashed var(--border-default); border-radius: var(--radius-md); }
.marketplace-status p { margin: 0; line-height: 1.6; }
.marketplace-loading { grid-column: 1 / -1; margin: 0; color: var(--text-secondary); font-size: 14px; }
.marketplace-skeleton { padding: 16px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md); }
.marketplace-skeleton span { display: block; background: var(--surface-muted); border-radius: var(--radius-md); animation: marketplace-pulse 1.5s ease-in-out infinite; }
.marketplace-skeleton__image { height: 180px; margin-bottom: 16px; }
.marketplace-skeleton__title { width: 72%; height: 22px; margin-bottom: 18px; }
.marketplace-skeleton__line { height: 14px; margin-bottom: 12px; }
@keyframes marketplace-pulse { 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .marketplace-skeleton span { animation: none; } }
@media (max-width: 520px) {
  .marketplace-section .marketplace-filter { padding: 16px; gap: 12px; }
  .marketplace-filter__actions { width: 100%; }
  .marketplace-filter__actions .btn { flex: 1; }
}
.image-replace-upload { height: 58px; margin-top: 14px; }
.image-replace-upload__progress { display: flex; align-items: center; gap: 9px; margin-top: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.image-replace-upload__progress progress { flex: 1; height: 6px; accent-color: var(--accent); }
.image-replace-grid { margin-top: 14px; max-height: 54vh; overflow-y: auto; padding-right: 2px; }

.package-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }

.package-card {
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: var(--bg-surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.package-card:hover { border-color: var(--accent); }
.package-card.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.package-card__credits { font-weight: 700; font-size: 14px; }
.package-card__price { font-size: 13px; color: var(--text-secondary); font-weight: 600; }

.card-fields label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 12px 0 5px;
}

.card-fields input {
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
}
.card-fields input:focus { border-color: var(--accent); outline: none; }

/* ============================================================================
   인증 페이지 (01_LOGIN_UI_TARGET)
   ============================================================================ */

.auth-page {
  color: var(--text-primary);
  --ink: var(--text-primary);
  --ink-soft: var(--text-secondary);
  --ink-faint: var(--text-muted);
  --border: var(--border-default);
  --border-soft: var(--border-subtle);
  --surface-muted: var(--bg-subtle);
  --info: var(--status-info);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(480px 320px at 18% 68%, var(--overlay-auth-glow-primary), transparent 70%),
    radial-gradient(520px 360px at 84% 24%, var(--overlay-auth-glow-secondary), transparent 70%),
    var(--bg-auth-page);
}

.auth-card {
  width: 420px;
  max-width: 100%;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 34px 30px;
}

.auth-card__brand {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
  text-align: center;
  margin-bottom: 22px;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

.auth-tabs__item {
  flex: 1;
  background: none;
  border: none;
  padding: 11px 0;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.auth-tabs__item:hover { color: var(--ink); }
.auth-tabs__item.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 16px 0 7px;
}

.input-wrap { position: relative; }
.input-wrap > svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--ink-faint);
  pointer-events: none;
}

.auth-card input {
  background: var(--bg-surface);
  color: var(--text-auth-input);
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-wrap input { padding-left: 40px; }
.password-field { position: relative; }
.auth-card .password-field input { padding-right: 52px; }
.password-field > .password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  background: transparent;
  border-color: transparent;
}
.password-field > .password-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-default);
}
.password-toggle svg { width: 18px; height: 18px; pointer-events: none; }

.auth-card input::placeholder { color: var(--ink-faint); }
.auth-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-auth-ring);
  outline: none;
}

.auth-submit { width: 100%; margin-top: 22px; padding: 13px 16px; font-size: 14px; }

.auth-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 16px 0 0;
  font-size: 13px;
}
.auth-links .link { color: var(--accent); font-weight: 600; }

/* 「はじめてご利用の方」 구분선 + 보조 CTA */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--ink-faint);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* 보조 CTA는 auth-tabs__item을 겸하지만 (탭 전환 JS 재사용) 버튼 형태로 표시 */
.auth-alt-cta,
.auth-alt-cta.is-active {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink);
  padding: 12px 0;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 0;
}
.auth-alt-cta:hover { border-color: var(--ink-soft); color: var(--ink); }

.auth-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.auth-note svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--info); margin-top: 1px; }
.auth-note strong { display: block; color: var(--ink); font-size: 13px; margin-bottom: 2px; }

.auth-error,
.auth-info {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.6;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
}
.auth-error { background: var(--status-danger-soft); border: 1px solid var(--border-danger); color: var(--status-danger); }
.auth-info { background: var(--status-success-soft); border: 1px solid var(--border-success); color: var(--status-success); }
.auth-language-toggle,
.app-language-toggle {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}
.auth-language-toggle { align-self: flex-end; margin-bottom: 12px; }
.auth-language-toggle button,
.app-language-toggle button {
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 7px;
}
.auth-language-toggle button:first-child,
.app-language-toggle button:first-child { border-left: 0; }
.auth-language-toggle button.is-active,
.app-language-toggle button.is-active { background: var(--accent); color: #fff; }

/* 공유 앱 언어 버튼의 다른 화면 색상은 유지한다. */
.auth-page .auth-language-toggle { background: var(--bg-surface); }
.auth-page .auth-language-toggle button.is-active { color: var(--on-accent); }

/* ============================================================================
   대시보드 / 관리자 공통 셸 (02, 03 시안)
   ============================================================================ */

.dashboard { display: flex; min-height: 100vh; background: var(--workspace-bg); }

.dash-sidebar {
  flex: 0 0 244px;
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  padding: 16px 14px 12px;
}

.dash-sidebar__brand {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  margin-bottom: 14px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-language-toggle { margin-left: auto; flex-shrink: 0; }
.app-language-toggle button { color: var(--sidebar-text); border-color: var(--sidebar-border); }
.dash-sidebar .app-language-toggle button { color: var(--text-sidebar); border-color: var(--border-sidebar); }
.dash-sidebar .app-language-toggle button.is-active { background: var(--accent); color: #fff; }

.dash-new-btn { margin-bottom: 12px; padding: 10px 14px; }

.dash-nav { display: flex; flex-direction: column; gap: 2px; }

.dash-nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-sidebar);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.dash-nav__item svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: 0.85; }
.dash-nav__item.is-active { background: var(--accent); color: #fff; }
.dash-nav__item.is-active svg { opacity: 1; }
.dash-nav__item:hover:not(.is-active) { background: var(--bg-sidebar-hover); color: #fff; }

.dash-sidebar__bottom { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 10px; }

.dash-theme-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-sidebar-soft);
  border: 1px solid var(--border-sidebar);
  border-radius: var(--radius-md);
  padding: 6px 8px 6px 11px;
  margin-top: 6px;
}

.dash-theme-switch__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sidebar);
  white-space: nowrap;
}

.dash-theme-switch__label svg {
  width: 15px;
  height: 15px;
  opacity: 0.85;
  flex: 0 0 auto;
}

.dash-theme-switch__pills {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 2px;
  border-radius: var(--radius-sm);
  background: var(--bg-sidebar-control);
  border: 1px solid var(--border-sidebar);
}

.dash-theme-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: calc(var(--radius-sm) - 2px);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-sidebar-muted);
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dash-theme-switch__btn svg {
  width: 12.5px;
  height: 12.5px;
  flex: 0 0 auto;
}

.dash-theme-switch__btn:hover:not(.is-active) {
  color: var(--text-sidebar);
  background: var(--bg-sidebar-hover);
}

.dash-theme-switch__btn.is-active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.dash-theme-switch__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dash-storage {
  background: var(--bg-sidebar-soft);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 8px;
}
.dash-storage__label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-sidebar);
  margin-bottom: 6px;
}
.dash-storage__label span:last-child { color: var(--text-sidebar-muted); }
.dash-storage__bar { height: 6px; background: var(--bg-sidebar-control); border-radius: 3px; overflow: hidden; }
.dash-storage__fill { height: 100%; background: var(--accent-primary); border-radius: 3px; transition: width 0.3s ease; }

.dash-user {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 4px 0;
  font-size: 12px;
  color: var(--text-sidebar);
  border-top: 1px solid var(--border-sidebar);
  margin-top: 10px;
}

.dash-user__row { display: flex; align-items: center; gap: 9px; min-width: 0; }

.dash-user__avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dash-user__avatar svg { width: 15px; height: 15px; }

.dash-user #userEmail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dash-user__logout {
  background: none;
  border: 1px solid var(--border-sidebar);
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  padding: 7px 10px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.dash-user__logout:hover { border-color: var(--text-sidebar); color: #fff; }

.dash-main { flex: 1; padding: 28px 34px 40px; overflow-y: auto; min-width: 0; }

.dash-section { display: none; }
.dash-section.is-active { display: block; }

.dash-sidebar__toggle { display: none; }
.dash-sidebar__body { display: flex; flex-direction: column; flex: 1; min-height: 0; scrollbar-width: none; -ms-overflow-style: none; }
.dash-sidebar::-webkit-scrollbar,
.dash-sidebar__body::-webkit-scrollbar,
.dash-nav::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* 데스크톱에서는 본문과 메뉴의 스크롤 영역을 분리하고 좌측 메뉴 스크롤바 노출을 막는다. */
@media (min-width: 881px) {
  .dashboard { --dashboard-sidebar-width: 244px; }
  .dash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--dashboard-sidebar-width);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .dash-sidebar__brand { flex-shrink: 0; }
  .dash-sidebar__body {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
  .dash-sidebar__body > * { flex-shrink: 0; }
  .dash-main {
    min-height: 100vh;
    margin-left: var(--dashboard-sidebar-width);
    overflow: visible;
  }
}

.dash-section-title { font-size: 15px; font-weight: 700; margin: 0 0 14px; }
.dash-section-title:not(:first-child) { margin-top: 30px; }

/* 섹션 제목 + 우측 링크 행 */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head .dash-section-title { margin: 0; }
.section-head:not(:first-child) { margin-top: 30px; }

/* ---------- 플랜 / 크레딧 요약 카드 ---------- */
.plan-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.plan-card__row { display: flex; align-items: center; gap: 13px; }
.plan-card__col { display: flex; flex-direction: column; gap: 5px; }

.plan-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.plan-card__icon svg { width: 21px; height: 21px; }
.plan-card__icon--plan { background: var(--accent-soft); color: var(--accent); }
.plan-card__icon--credit { background: var(--accent-primary-soft); color: var(--accent-primary); }

.plan-card__divider { width: 1px; align-self: stretch; background: var(--border-soft); }

.plan-card__label { font-size: 12px; color: var(--ink-soft); }
.plan-card__value { font-size: 24px; font-weight: 700; line-height: 1.1; }
.plan-card__value-wrap { display: flex; align-items: baseline; gap: 4px; }
.plan-card__unit { font-size: 13px; font-weight: 600; color: var(--ink-soft); }

.plan-card__badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.plan-card__buy { width: auto; margin: 0 0 0 auto; padding: 11px 20px; }

/* ---------- 프로젝트 카드 ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.project-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.project-card__thumb {
  height: 140px;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-soft);
}
.project-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-card__name {
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-card__date { font-size: 11.5px; color: var(--ink-soft); padding: 0 12px 11px; }
.project-card__empty { font-size: 12px; color: var(--ink-faint); }

.project-card__delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--overlay-card-action);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.project-card:hover .project-card__delete,
.project-card__delete:focus-visible { opacity: 1; }
.project-card__delete:hover { background: var(--danger); }

/* ---------- 퀵스타트 스텝 카드 ---------- */
.quick-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  counter-reset: step;
}
.quick-steps li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px 16px 52px;
  position: relative;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.quick-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 17px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 시안처럼 스텝별 색상 교차 (초록/퍼플) */
.quick-steps li:nth-child(odd)::before { background: var(--accent-primary); }
.quick-steps li:nth-child(even)::before { background: var(--accent); }
.quick-steps strong { display: block; margin-bottom: 5px; font-size: 13.5px; }
.quick-steps span { color: var(--ink-soft); font-size: 12px; line-height: 1.55; }

/* ---------- 템플릿 ---------- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.template-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.template-card__preview {
  height: 116px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-muted));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.6;
}
.template-card__name { font-weight: 700; font-size: 14px; }
.template-card__desc { font-size: 12px; color: var(--ink-soft); line-height: 1.55; flex: 1; }
.template-card__use { margin-top: 4px; }

/* ---------- 업로드 / 이미지 라이브러리 ---------- */
.upload-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 120px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: center;
  background: #fff;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.upload-drop:hover { border-color: var(--accent); color: var(--accent); }
.upload-drop--wide { height: 84px; margin-bottom: 18px; }

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.image-item {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.image-item img { width: 100%; height: 122px; object-fit: cover; display: block; background: var(--surface-muted); }
.image-item__meta { font-size: 11px; color: var(--ink-soft); padding: 7px 10px; }
.image-item__delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--overlay-card-action);
  color: #fff;
  cursor: pointer;
}
.image-item__delete:hover { background: var(--danger); }

/* ---------- 설정 / 헬프 ---------- */
.settings-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 8px;
  max-width: 520px;
  box-shadow: var(--shadow-sm);
}
.settings-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.settings-row:last-child { border-bottom: none; }
.settings-row span:first-child { color: var(--ink-soft); }
.settings-row span:last-child { font-weight: 600; }
.settings-card label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin: 12px 0 5px; }
.settings-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
}
.settings-card input:focus { border-color: var(--accent); outline: none; }

/* 테마 선택 카드에만 적용해 다른 설정 폼의 표시를 보존한다. */
.theme-settings-card { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-default); }
.theme-settings-card__hint { margin: 0 0 14px; color: var(--text-secondary); line-height: 1.6; }
.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.theme-options .theme-option { position: relative; display: block; min-width: 0; margin: 0; cursor: pointer; }
.theme-options .theme-option__input,
.theme-options .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.theme-option__label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-control);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-align: center;
}
.theme-option:hover .theme-option__label { border-color: var(--accent); }
.theme-option__input:checked + .theme-option__label { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.theme-option__input:focus-visible + .theme-option__label { outline: 2px solid var(--accent); outline-offset: 2px; }

.help-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  max-width: 760px;
  font-size: 13px;
  line-height: 1.75;
  box-shadow: var(--shadow-sm);
}
.help-card h4 { margin: 20px 0 6px; font-size: 14px; }
.help-card h4:first-child { margin-top: 0; }
.help-card p { margin: 0; color: var(--ink-soft); }

/* ============================================================================
   관리자 (03_ADMIN_UI_TARGET)
   ============================================================================ */

.admin-back {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  text-align: left;
  text-decoration: none;
  color: var(--text-sidebar);
  background: var(--bg-sidebar-soft);
  border: 1px solid var(--border-sidebar);
  font-weight: 600;
}
.admin-back:hover:not(:disabled) { background: var(--bg-sidebar-control-hover); color: #fff; }

.admin-section { display: none; }
.admin-section.is-active { display: block; }

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.admin-page-header__title { margin: 0; font-size: 20px; font-weight: 700; }
.admin-language-toggle {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.admin-language-toggle__button {
  border: 0;
  border-left: 1px solid var(--border);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 11px;
}
.admin-language-toggle__button:first-child { border-left: 0; }
.admin-language-toggle__button:hover { background: var(--surface-muted); }
.admin-language-toggle__button.is-active { background: var(--accent); color: #fff; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  max-width: 1120px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.stat-card__icon svg { width: 21px; height: 21px; }
.stat-card__icon--users { background: var(--accent-soft); color: var(--accent); }
.stat-card__icon--revenue { background: var(--accent-primary-soft); color: var(--accent-primary); }
.stat-card__icon--month { background: var(--info-soft); color: var(--info); }
.stat-card__icon--today { background: var(--warning-soft); color: var(--warning); }
.stat-card__icon--projects { background: var(--accent-soft); color: var(--accent); }
.stat-card__icon--credits { background: var(--accent-primary-soft); color: var(--accent-primary); }
.stat-card__icon--storage { background: var(--info-soft); color: var(--info); }

.stat-card__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-card__label { font-size: 12px; color: var(--ink-soft); }
.stat-card__value-row { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.stat-card__value { font-size: 23px; font-weight: 700; line-height: 1.15; }
.stat-card__unit { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.stat-card__sub { font-size: 11px; color: var(--ink-soft); }

.toolbar-row { display: flex; gap: 8px; margin-bottom: 14px; }
.search-input {
  flex: 0 0 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}
.search-input:focus { border-color: var(--accent); outline: none; }
.toolbar-row .btn { width: auto; }

.plan-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
}

.credit-adjust { display: flex; gap: 6px; align-items: center; }
.credit-adjust__input {
  width: 76px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
}
.credit-adjust__btn { width: auto; padding: 6px 12px; font-size: 12px; }

/* 테이블 내 위험 액션은 컴팩트하게 */
.admin-table .btn--danger { width: auto; margin: 0; padding: 6px 12px; font-size: 12px; white-space: nowrap; }

/* ============================================================================
   에디터 (04_EDITOR_UI_TARGET)
   ============================================================================ */

/* ---------- 톱바 ---------- */
.topbar {
  min-height: 58px;
  height: auto;
  flex-wrap: wrap;
  flex: 0 0 auto;
  background: var(--bg-editor-topbar);
  color: var(--text-on-dark);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  row-gap: 8px;
  border-bottom: 1px solid var(--border-editor-topbar-bottom);
}

/* 버튼 내부 글자를 압축하지 않고 컨트롤 단위로 다음 행에 배치한다. */
.topbar > * { flex-shrink: 0; white-space: nowrap; }

.topbar__brand { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.topbar__brand + .topbar__canvas-size { margin-left: 8px; }

.topbar__back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-editor-topbar-control);
  border: 1px solid var(--border-editor-topbar);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 13px;
  transition: background 0.15s ease;
}
.topbar__back:hover { background: var(--bg-editor-topbar-hover); }
.topbar__back svg { width: 15px; height: 15px; }

.topbar__project-name {
  background: var(--bg-editor-topbar-control);
  border: 1px solid var(--border-editor-topbar);
  color: var(--text-on-dark);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  width: 190px;
}
.topbar__project-name:hover,
.topbar__project-name:focus {
  border-color: var(--accent);
  outline: none;
}

.topbar__canvas-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sidebar-muted);
}

.topbar__canvas-size select {
  background: var(--bg-editor-topbar-control);
  color: var(--text-on-dark);
  border: 1px solid var(--border-editor-topbar);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}

.topbar__zoom {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-editor-topbar-control);
  border: 1px solid var(--border-editor-topbar);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.topbar__zoom .icon-btn {
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-on-dark);
  width: 30px;
  height: 32px;
}
.topbar__zoom .icon-btn:hover { background: var(--bg-editor-topbar-hover-overlay); }
.topbar__zoom-value {
  background: transparent;
  border: none;
  color: var(--text-on-dark);
  padding: 5px 8px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  min-width: 52px;
  cursor: pointer;
  height: 32px;
}
.topbar__zoom-value:hover { background: var(--bg-editor-topbar-hover-overlay); }

.topbar__history { display: flex; gap: 6px; }
.topbar .icon-btn {
  background: transparent;
  border: 1px solid var(--border-editor-topbar);
  color: var(--text-on-dark);
}
.topbar .icon-btn:hover { background: var(--bg-editor-topbar-hover-overlay); }

.topbar__status {
  font-size: 12px;
  color: var(--text-sidebar-muted);
  margin-left: auto;
  white-space: nowrap;
}
/* 미저장 변경이 있을 때 (editor.js가 is-dirty를 토글) */
.topbar__status.is-dirty { color: var(--text-editor-dirty); font-weight: 600; }
.topbar__status + #saveBtn { margin-left: 8px; }
.topbar .app-language-toggle { margin-left: 0; background: var(--bg-editor-topbar-control); border-color: var(--border-editor-topbar); }
.topbar .app-language-toggle button { color: var(--text-sidebar); border-color: var(--border-editor-topbar); }
.topbar .app-language-toggle button.is-active { color: #fff; }

/* 우측 버튼 그룹은 topbar__status의 margin-left:auto 뒤에 gap으로 정렬됨 */
#previewBtn, #saveBtn, #exportBtn, #exportAllBtn { padding: 9px 16px; flex: 0 0 auto; }
#previewBtn { display: inline-flex; align-items: center; gap: 6px; }
#previewBtn svg { width: 16px; height: 16px; }

/* ---------- 섹션 스택 (블록 섹션 에디터) ---------- */
.section-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  width: 100%;
  padding: 0 72px;
  box-sizing: border-box;
}

.section-block {
  position: relative;
  background: #fff;
  box-shadow: var(--shadow-md);
  border: 2px solid transparent;
  border-radius: 4px;
  transition: border-color 0.15s ease;
}
.section-block.is-active { border-color: var(--accent); }
.section-block.sortable-ghost { opacity: 0.45; }
.section-block.sortable-chosen { box-shadow: var(--shadow-lg); }

.section-block__canvas-wrap { line-height: 0; }

.section-block__handle {
  position: absolute;
  top: 4px;
  left: -38px;
  z-index: 5;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay-editor-control);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 15px;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s ease;
  user-select: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.section-block__handle:active { cursor: grabbing; }

.section-block__toolbar {
  position: absolute;
  top: 4px;
  right: -62px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.section-block:hover .section-block__handle,
.section-block:hover .section-block__toolbar,
.section-block.is-active .section-block__handle,
.section-block.is-active .section-block__toolbar { opacity: 1; }

.section-block__toolbar button {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
}
.section-block__toolbar button:hover { border-color: var(--ink-soft); }
.section-block__toolbar .section-block__delete { color: var(--danger); }
.section-block__toolbar .section-block__delete:hover { border-color: var(--danger); background: var(--danger-soft); }

.section-block__resize-handle {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  z-index: 5;
  width: 58px;
  height: 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  cursor: ns-resize;
  touch-action: none;
}
.section-block__resize-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 3px;
  border-top: 1px solid var(--text-muted);
  border-bottom: 1px solid var(--text-muted);
}
.section-block__resize-handle:hover { border-color: var(--accent); }

.section-add-between {
  display: block;
  margin: 20px auto 60px;
  background: #fff;
  border: 1.5px dashed var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  padding: 11px 24px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.section-add-between:hover { background: var(--accent-soft); }

/* ---------- 캔버스 요소 선택 툴바 / 컨텍스트 메뉴 ---------- */
.object-floating-ui {
  position: fixed;
  z-index: 1300;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-family: inherit;
}
.object-floating-ui[hidden] { display: none; }
.object-toolbar { gap: 2px; max-width: calc(100vw - 16px); padding: 4px; overflow-x: auto; }
.object-context-menu {
  min-width: 156px;
  flex-direction: column;
  align-items: stretch;
  padding: 5px;
}
.object-floating-ui button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.object-toolbar button { padding: 7px 9px; }
.object-toolbar__opacity {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 118px;
  padding: 0 5px 0 3px;
  color: var(--ink-soft);
}
.object-toolbar__opacity input[type="range"] { width: 58px; margin: 0; accent-color: var(--accent); }
.object-toolbar__opacity output { width: 32px; color: var(--ink-soft); font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.object-toolbar__text {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 2px;
  border-left: 1px solid var(--border-soft);
}
.object-toolbar__type-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 2px;
  border-left: 1px solid var(--border-soft);
}
.object-toolbar__text select {
  width: 104px;
  min-width: 0;
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  padding: 0 20px 0 6px;
}
.object-toolbar__font-size { display: flex; align-items: center; }
.object-toolbar__font-size button { min-width: 24px; padding: 7px 5px; }
.object-toolbar__font-size input {
  width: 38px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  text-align: center;
}
.object-toolbar__font-size input::-webkit-inner-spin-button { margin: 0; }
.object-toolbar__color { width: 28px; height: 28px; padding: 2px; border: 0; border-radius: 5px; background: transparent; cursor: pointer; }
.object-toolbar [data-text-action="bold"].is-active,
.object-toolbar [data-text-action="italic"].is-active { background: var(--accent-soft); color: var(--accent); }
.text-toolbar-more {
  z-index: 1301;
  display: block;
  width: min(234px, calc(100vw - 16px));
  padding: 10px;
}
.text-toolbar-more__styles,
.text-toolbar-more__align { display: grid; gap: 4px; }
.text-toolbar-more__styles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.text-toolbar-more__align { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.text-toolbar-more button { min-width: 0; padding: 7px 4px; font-size: 11px; }
.text-toolbar-more button.is-active { background: var(--accent-soft); color: var(--accent); }
.text-toolbar-more__label { display: block; margin: 10px 0 5px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.text-toolbar-more input[type="range"] { width: 100%; margin: 0; accent-color: var(--accent); }
.media-toolbar-more {
  z-index: 1301;
  display: block;
  width: min(234px, calc(100vw - 16px));
  padding: 10px;
}
.media-toolbar-more__label { display: block; margin: 9px 0 5px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.media-toolbar-more__label:first-child { margin-top: 0; }
.media-toolbar-more input[type="range"] { width: 100%; margin: 0; accent-color: var(--accent); }
.media-toolbar-more__choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.media-toolbar-more__choices button { min-width: 0; padding: 7px 4px; font-size: 11px; }
.media-toolbar-more__choices button.is-active { background: var(--accent-soft); color: var(--accent); }
.media-toolbar-more__hint { margin: 6px 0 0; color: var(--ink-faint); font-size: 10px; line-height: 1.4; }
.media-toolbar-more input:disabled { opacity: .45; cursor: not-allowed; }
.object-context-menu button { padding: 8px 10px; text-align: left; }
.object-floating-ui button:hover,
.object-floating-ui button:focus-visible { background: var(--accent-soft); outline: none; }
.object-floating-ui .object-floating-ui__danger { color: var(--danger); }
.object-floating-ui .object-floating-ui__danger:hover,
.object-floating-ui .object-floating-ui__danger:focus-visible { background: var(--danger-soft); }
.object-context-menu button[hidden] { display: none; }
.upper-canvas.editor-canvas-focus:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 작성 중 결과물 반응형 미리보기 ---------- */
body.is-preview-open { overflow: hidden; }
.editor-preview {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--workspace-bg);
}
.editor-preview[hidden] { display: none; }
.editor-preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 24px;
  color: #fff;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
}
.editor-preview__header h2 { margin: 0; font-size: 16px; }
.editor-preview__header p { margin: 3px 0 0; color: var(--sidebar-text-dim); font-size: 12px; }
.editor-preview__actions { display: flex; align-items: center; gap: 12px; }
.editor-preview__devices {
  display: inline-flex;
  overflow: hidden;
  background: var(--sidebar-bg-soft);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
}
.editor-preview__devices button {
  min-height: 34px;
  padding: 7px 12px;
  color: var(--sidebar-text);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--sidebar-border);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.editor-preview__devices button:first-child { border-left: 0; }
.editor-preview__devices button[aria-selected="true"] { color: #fff; background: var(--accent); }
.editor-preview__devices button:focus-visible,
.editor-preview__devices button:hover { outline: none; background: rgba(255, 255, 255, 0.1); }
.editor-preview__devices button[aria-selected="true"]:focus-visible,
.editor-preview__devices button[aria-selected="true"]:hover { background: var(--accent); }
.editor-preview__stage {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  padding: 28px;
  overflow: auto;
}
.editor-preview__device {
  align-self: flex-start;
  flex: 0 1 1200px;
  width: 1200px;
  min-width: 0;
  max-width: 100%;
  min-height: min-content;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transition: width 0.2s ease, flex-basis 0.2s ease;
}
.editor-preview__device[data-preview-device="tablet"] { flex-basis: 768px; width: 768px; }
.editor-preview__device[data-preview-device="mobile"] { flex-basis: 375px; width: 375px; }
.editor-preview__pages { width: 100%; }
.editor-preview__page { width: 100%; background: #fff; }
.editor-preview__page + .editor-preview__page { border-top: 0; }
.editor-preview__page img { display: block; width: 100%; height: auto; }

/* ---------- 워크스페이스 레이아웃 ---------- */
.workspace {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

/* ---------- 좌측 탭 레일 (아이콘 + 라벨, 핸드오프 2b 스펙) ---------- */
.tabs {
  flex: 0 0 64px;
  background: var(--bg-editor-rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 4px;
}

.tabs__item {
  width: 52px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-editor-tab);
  font-size: 10px;
  font-weight: 500;
  font-family: inherit;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tabs__item svg { width: 18px; height: 18px; }

.tabs__item.is-active { color: #fff; background: var(--accent); }
.tabs__item:hover:not(.is-active) { background: var(--bg-editor-topbar-hover-overlay-strong); }
.tabs__item--ai.is-active { background: var(--accent); }

/* 레일 하단 패널 접기 버튼 */
.tabs__collapse {
  margin-top: auto;
  width: 52px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-editor-tab-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tabs__collapse:hover { background: var(--bg-editor-topbar-hover-overlay-strong); color: #fff; }
.tabs__collapse svg { transition: transform 0.2s ease; }
.tabs__collapse.is-collapsed svg { transform: rotate(180deg); }

/* ---------- 좌/우 패널 ---------- */
.panel { background: var(--panel-bg); overflow-y: auto; }

.panel--left {
  flex: 0 0 320px;
  border-right: 1px solid var(--border-editor-panel);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* 데스크톱: 패널 접기 (레일만 남기고 320px → 0) */
@media (min-width: 881px) {
  .panel--left { transition: flex-basis 0.2s ease, border-color 0.2s ease; }
  .panel--left.is-collapsed {
    flex-basis: 0;
    border-right-width: 0;
  }
}

.panel--right {
  flex: 0 0 268px;
  border-left: 1px solid var(--border-default);
  padding: 20px 18px;
}

.panel--right.is-highlighted { animation: properties-panel-highlight 0.7s ease-out; }
@keyframes properties-panel-highlight {
  0% { box-shadow: inset 0 0 0 0 transparent; }
  35% { box-shadow: inset 0 0 0 3px var(--focus-editor-flash); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}

.panel-content { display: none; }
.panel-content.is-active {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 18px;
}

/* 블록 패널은 헤더 고정 + 그리드만 스크롤되는 세로 flex */
.panel-content.is-active[data-panel="blocks"],
.panel-content.is-active[data-panel="section-templates"] {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.block-panel__head {
  padding: 18px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--border-editor-panel-subtle);
  flex: 0 0 auto;
}
.block-panel__head .panel-title { margin: 0; font-size: 15px; }
.block-panel__sub { margin: 2px 0 0; font-size: 11px; color: var(--text-editor-panel-muted); }

/* 카테고리 필터 칩 */
.block-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.block-chip {
  border: 1px solid var(--border-editor-chip);
  background: var(--bg-surface);
  color: var(--text-editor-chip);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.block-chip:hover { border-color: var(--accent); }
.block-chip.is-active { background: #1c1c28; color: #fff; border-color: #1c1c28; }

/* 2열 썸네일 그리드 (블록 패널 전용 — 図形 탭의 .block-card와 별개) */
.block-grid {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 16px 14px 16px 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  box-sizing: border-box;
}

.block-grid__empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 12px;
  color: var(--text-editor-panel-muted);
  margin: 24px 0;
}

.block-grid-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
  min-width: 0;
}

.block-grid-card__thumb {
  min-width: 0;
  height: 88px;
  border: 1px solid var(--border-editor-panel);
  border-radius: 10px;
  background: var(--bg-editor-thumbnail);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.block-grid-card:hover .block-grid-card__thumb { border-color: var(--accent); background: var(--accent-soft); }

.block-grid-card__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0 16px;
}

.block-grid-card__add {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.9;
}
.block-grid-card__add:hover { opacity: 1; }

.block-grid-card__label {
  min-width: 0;
  min-height: 2.8em;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
  padding: 0 2px;
  color: var(--text-editor-card-label);
}
.block-grid-card__desc {
  min-width: 0;
  min-height: 3em;
  color: var(--text-editor-card-muted);
  display: -webkit-box;
  font-size: 10.5px;
  line-height: 1.5;
  margin-top: -7px;
  overflow: hidden;
  overflow-wrap: anywhere;
  padding: 0 2px;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* 간략 프리뷰 조각 */
.bp-bar { display: block; border-radius: 3px; }
.bp-cols { display: flex; gap: 8px; width: 100%; min-width: 0; justify-content: center; }
.bp-col { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 22px; }
.bp-sq { width: 14px; height: 14px; border-radius: 4px; background: var(--bg-editor-preview-swatch); }
.bp-pill {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.panel-title { font-size: 14px; font-weight: 700; margin: 0 0 4px; }
:where(#app) .panel-title { color: var(--text-primary); }
.panel-title--ai { color: var(--accent); }

.panel-desc {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 14px;
  line-height: 1.55;
}

:where(#app) .panel-desc { color: var(--text-secondary); }

.panel-subtitle {
  font-size: 12.5px;
  font-weight: 700;
  margin: 18px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- 블록 카드 ---------- */
.block-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.block-list--grid { grid-template-columns: 1fr 1fr; }

.block-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-md);
  padding: 13px 14px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  text-align: left;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.block-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }

.block-card__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-weight: 700;
}
.block-card__icon svg { width: 19px; height: 19px; }

.block-card__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.block-card__label { font-size: 13px; font-weight: 700; }
.block-card__desc { font-size: 11.5px; color: var(--ink-soft); line-height: 1.5; }

/* 도형 카드: 2열 그리드에서 세로 정렬 */
.block-list--grid .block-card {
  flex-direction: column;
  gap: 8px;
  text-align: center;
  padding: 14px 8px;
}

/* ---------- 아이콘 그리드 ---------- */
.icon-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.icon-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 9px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.icon-card svg { width: 20px; height: 20px; fill: var(--ink); display: block; margin: 0 auto; }
.icon-card:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- 업로드 (에디터 이미지 탭) ---------- */
.library-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.library-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}
.library-item img { width: 100%; height: 66px; object-fit: cover; display: block; }
.library-item:hover { border-color: var(--accent); }

.chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink-soft);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- AI 도구 카드 ---------- */
.ai-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 12px;
  background: #fff;
}
.ai-block:first-of-type { margin-top: 0; }

.ai-block h4 {
  font-size: 13px;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cost-badge {
  font-size: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  margin-left: auto;
}

.ai-block input[type="text"],
.ai-block select,
.ai-block textarea {
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 12.5px;
  margin-bottom: 8px;
  font-family: inherit;
  resize: vertical;
  background: var(--bg-editor-input);
  color: var(--text-editor-input);
}
.ai-block select { background: var(--bg-editor-select); }
.ai-block input:focus,
.ai-block select:focus,
.ai-block textarea:focus { border-color: var(--accent); outline: none; }

.copy-results { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.copy-result-item {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, white);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.55;
}
.copy-result-item:hover { border-color: var(--accent); }
.copy-result-item small { display: block; color: var(--accent); font-weight: 700; margin-bottom: 2px; }

.panel-mobile-close { display: none; }

/* ---------- 캔버스 영역 (세로 스크롤 섹션 컨테이너) ---------- */
.canvas-area {
  flex: 1 1 auto;
  overflow: auto;
  display: block;
  padding: 36px 20px;
  background-color: var(--bg-editor-workspace);
  background-image:
    radial-gradient(var(--overlay-editor-workspace-dot) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ---------- 속성 패널 ---------- */
.properties-body label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 14px 0 6px;
}

.align-row, .filter-row { display: flex; gap: 6px; }

/* 정렬 세그먼트 (左/中/右) */
.align-row .icon-btn { flex: 1; width: auto; font-weight: 600; }
.align-row .icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* 슬라이더 */
.properties-body input[type="range"],
.prop-group input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin: 2px 0;
}

/* 컬러 피커 */
.properties-body input[type="color"] {
  width: 100%;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  cursor: pointer;
}

.properties-body select {
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--text-editor-input);
}
.properties-body select:focus { border-color: var(--accent); outline: none; }

/* 체크박스 → 스위치 스타일 (太字 / 影をつける 등) */
.checkbox-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 12px 0 8px;
  cursor: pointer;
}
.checkbox-line input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
  flex: 0 0 auto;
  margin: 0;
}
.checkbox-line input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 21, 26, 0.25);
  transition: transform 0.15s ease;
}
.checkbox-line input[type="checkbox"]:checked { background: var(--accent); }
.checkbox-line input[type="checkbox"]:checked::after { transform: translateX(16px); }

.prop-group { display: none; }
.prop-group.is-visible { display: block; }
.prop-group--common { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 14px; display: block; }

/* ============================================================================
   반응형: 에디터 (태블릿/모바일 바텀시트 유지)
   ============================================================================ */

/* 중간 폭(~1200px): 톱바가 넘치지 않게 요소를 축소/줄바꿈 허용 */
@media (min-width: 1201px) and (max-width: 1600px) {
  .topbar { column-gap: 8px; }
  .topbar__project-name { width: 150px; }
}

@media (max-width: 1200px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 58px; padding: 8px 12px; row-gap: 8px; }
  .topbar__project-name { width: 130px; }
  .topbar__back span { display: none; }
}

@media (max-width: 880px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 56px;
    padding: 8px 12px;
    gap: 8px;
  }

  .topbar__back span { display: none; }
  .topbar__project-name { width: 110px; font-size: 13px; }
  .topbar__canvas-size label { display: none; }
  .topbar__canvas-size select { font-size: 12px; padding: 6px 8px; }
  #previewBtn, #saveBtn, #exportBtn, #exportAllBtn { padding: 8px 12px; font-size: 12px; }
  .object-toolbar { max-width: calc(100vw - 16px); overflow-x: auto; }
  .object-toolbar button { padding: 8px; font-size: 11px; }
  .editor-preview__header { align-items: flex-start; padding: 12px 16px; }
  .editor-preview__actions { flex-wrap: wrap; justify-content: flex-end; }
  .editor-preview__stage { justify-content: flex-start; padding: 16px; }

  /* 모바일에서는 섹션 컨트롤을 항상 표시 (hover 불가 환경) */
  .section-block__handle,
  .section-block__toolbar { opacity: 1; }

  .workspace { position: relative; }

  /* 좌/우 패널은 화면 아래에서 올라오는 바텀시트로 전환 */
  .panel--left,
  .panel--right {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 56px;
    max-height: 52vh;
    width: auto;
    border-right: none;
    border-left: none;
    border-top: 1px solid var(--border-default);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-editor-mobile-panel);
    transform: translateY(110%);
    transition: transform 0.2s ease;
    z-index: 55;
  }

  .panel--left.is-open,
  .panel--right.is-open { transform: translateY(0); }

  .panel-mobile-close {
    display: block;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-default);
    padding: 11px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
  }

  /* 탭바를 화면 하단 고정 바로 전환 */
  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    height: 56px;
    padding: 4px 6px;
    z-index: 60;
    border-top: 1px solid #000;
    gap: 4px;
  }

  .tabs__item {
    flex: 1;
    width: auto;
    height: auto;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
    padding: 5px 2px;
  }
  .tabs__item svg { width: 17px; height: 17px; }

  /* 접기 버튼은 데스크톱 전용 (모바일은 바텀시트 UX 유지) */
  .tabs__collapse { display: none; }

  .canvas-area { padding: 16px 10px 72px; }
}

/* ============================================================================
   반응형: 대시보드 / 관리자
   ============================================================================ */
@media (max-width: 880px) {
  .dashboard { flex-direction: column; }
  .dash-sidebar { flex: 0 0 auto; padding: 12px 16px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .dash-sidebar__brand { margin-bottom: 0; flex: 1; }
  .dash-sidebar__toggle {
    display: block;
    background: none;
    border: 1px solid var(--border-sidebar);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 7px 11px;
    cursor: pointer;
    font-size: 14px;
  }
  .dash-sidebar__body { display: none; width: 100%; margin-top: 12px; }
  .dash-sidebar__body.is-open { display: flex; }
  .dash-sidebar__bottom { margin-top: 14px; }
  .dash-main { padding: 18px 14px; }

  .plan-card { flex-wrap: wrap; gap: 16px; }
  .plan-card__divider { display: none; }
  .plan-card__buy { width: 100%; margin-left: 0; }

  .section-head { flex-wrap: wrap; }
  .admin-page-header { margin-bottom: 18px; }
  .search-input { flex: 1; }
  .banner__action { margin-left: 0; }

  .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .auth-card { padding: 28px 22px 24px; }
}

/* ---------- 섹션 캔버스 속성 ---------- */
.section-properties__title {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--ink);
}
.section-properties__group {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 2px;
}
.section-properties__size-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
}
.section-properties__size-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.section-properties__size-field label {
  display: flex;
  align-items: center;
  min-height: 18px;
  margin: 0 0 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.section-properties__input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
}
.section-properties__input-with-suffix input[type="number"] { padding-right: 28px; }
.section-properties__input-with-suffix span {
  position: absolute;
  right: 8px;
  color: var(--text-secondary);
  font-size: 11px;
  pointer-events: none;
}
.section-properties input[type="number"] {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 9px 8px;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  background: var(--panel-bg);
}
.section-properties input[type="number"]:focus { border-color: var(--accent); outline: none; }
.section-properties__preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.section-properties__preset-grid .icon-btn {
  width: auto;
  padding: 8px 4px;
  font-size: 11px;
}
.section-properties__apply-all { width: 100%; margin-top: 14px; font-size: 12px; }

.properties-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 14px 0 12px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}
.properties-tabs__button {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  padding: 7px 5px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.properties-tabs__button.is-active {
  background: var(--panel-bg);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.position-panel { min-width: 0; }
.position-panel__group {
  min-width: 0;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.position-panel__title {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}
.position-panel__label {
  margin: 13px 0 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}
.position-panel__button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.position-panel__button-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.position-panel__button-grid button {
  min-width: 0;
  min-height: 34px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-bg);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.position-panel__button-grid button:hover { border-color: var(--accent); color: var(--accent); }
.position-panel__button-grid button:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 28%, transparent); outline-offset: 1px; }
.position-panel__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 8px;
  margin-top: 12px;
}
.position-panel__fields label { display: block; min-width: 0; }
.position-panel__fields label > span {
  display: block;
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}
.position-panel__fields input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: var(--panel-bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.position-panel__fields input:focus { border-color: var(--accent); outline: none; }
.position-panel__fields input[readonly] { background: var(--surface-muted); color: var(--ink-faint); cursor: default; }
.position-panel__field--wide { grid-column: 1 / -1; }
.position-panel__notice {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.shortcut-help-modal__card { width: min(620px, 100%); }
.shortcut-help-modal__intro { margin: 14px 0 18px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.shortcut-help-modal__section + .shortcut-help-modal__section { margin-top: 18px; }
.shortcut-help-modal__section h4 { margin: 0 0 8px; color: var(--ink); font-size: 13px; }
.shortcut-help-modal__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; margin: 0; }
.shortcut-help-modal__list > div { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr); align-items: center; gap: 7px; min-width: 0; }
.shortcut-help-modal__list dt,
.shortcut-help-modal__list dd { min-width: 0; margin: 0; }
.shortcut-help-modal__list dt { color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.shortcut-help-modal__list dd { color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.shortcut-help-modal__list kbd { display: inline-block; padding: 1px 4px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface-muted); color: var(--ink); font-family: inherit; font-size: 10px; line-height: 1.4; }

@media (max-width: 560px) {
  .shortcut-help-modal__card { padding: 20px 16px; }
  .shortcut-help-modal__list { grid-template-columns: 1fr; }
}

.editor-view-aids-popover {
  position: fixed;
  z-index: 1300;
  display: grid;
  gap: 8px;
  min-width: 156px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-bg);
  box-shadow: var(--shadow-lg);
}
.editor-view-aids-popover[hidden] { display: none; }
.editor-view-aids-popover label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; }
.editor-view-aids-popover input { accent-color: var(--accent); }

.section-block.has-editor-rulers { padding: 20px 0 0 20px; }
/* 눈금자 20px 영역이 있어도 이동/복제/삭제 컨트롤은 블록 좌우 바깥에 유지한다. */
.section-block.has-editor-rulers .section-block__handle,
.section-block.has-editor-rulers .section-block__toolbar { top: 22px; }
.section-block.has-editor-rulers .section-block__handle { left: -38px; }
.section-block.has-editor-rulers .section-block__toolbar { right: -62px; }
.editor-ruler-grid { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.section-block__canvas-wrap .upper-canvas { z-index: 2; }
.editor-ruler {
  position: absolute;
  z-index: 5;
  box-sizing: border-box;
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
  background: var(--panel-bg);
  border-color: var(--border);
  border-style: solid;
}
.editor-ruler--top { top: 0; left: 20px; height: 20px; border-width: 0 0 1px; }
.editor-ruler--left { top: 20px; left: 0; width: 20px; border-width: 0 1px 0 0; }
.section-block:not(.is-active) .editor-ruler { opacity: .68; }
.editor-persistent-guides {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.editor-persistent-guides__items { position: absolute; inset: 0; }
.editor-persistent-guide {
  position: absolute;
  z-index: 1;
  pointer-events: auto;
  touch-action: none;
}
.editor-persistent-guide--horizontal {
  left: 0;
  width: 100%;
  height: 7px;
  transform: translateY(-3px);
  cursor: ns-resize;
  background: linear-gradient(to bottom, transparent 3px, var(--editor-guide-line, #DB2777) 3px, var(--editor-guide-line, #DB2777) 4px, transparent 4px);
}
.editor-persistent-guide--vertical {
  top: 0;
  width: 7px;
  height: 100%;
  transform: translateX(-3px);
  cursor: ew-resize;
  background: linear-gradient(to right, transparent 3px, var(--editor-guide-line, #DB2777) 3px, var(--editor-guide-line, #DB2777) 4px, transparent 4px);
}
.editor-persistent-guide--preview { pointer-events: none; opacity: .72; }

.text-decoration-grid .block-grid-card__thumb { height: 108px; }
.text-decoration-grid .block-thumbnail__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}
.text-decoration-grid .block-thumbnail__skeleton {
  display: none;
  position: absolute;
  inset: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-editor-decoration-skeleton-base, #E8E8EC) 25%, var(--bg-editor-decoration-skeleton-highlight, #F3F3F5) 37%, var(--bg-editor-decoration-skeleton-base, #E8E8EC) 63%);
  background-size: 400% 100%;
  animation: text-decoration-thumbnail-loading 1.2s ease-in-out infinite;
}
.text-decoration-grid .block-grid-card__thumb.is-thumbnail-loading .block-thumbnail__fallback { opacity: 0; }
.text-decoration-grid .block-grid-card__thumb.is-thumbnail-loading .block-thumbnail__skeleton { display: block; }
.text-decoration-grid .block-grid-card__thumb.is-thumbnail-ready .block-thumbnail__fallback,
.text-decoration-grid .block-grid-card__thumb.is-thumbnail-ready .block-thumbnail__skeleton,
.text-decoration-grid .block-grid-card__thumb.is-thumbnail-fallback .block-thumbnail__skeleton { display: none; }
@keyframes text-decoration-thumbnail-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Picre 서비스 로고: 기존 언어 전환 및 화면 테마와 독립된 이미지 표시 */
.picre-login-logo {
  display: inline-flex;
  padding: 14px;
  border-radius: 16px;
  background: #ffffff;
  vertical-align: middle;
}
.picre-login-logo img { display: block; width: 120px; height: auto; }
.picre-brand { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
a.picre-brand { color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
a.picre-brand:hover { color: inherit; text-decoration: none; opacity: 0.88; }
a.picre-brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a.mobile-drawer-topbar__title { color: inherit; text-decoration: none; }
a.mobile-drawer-topbar__title:hover { color: inherit; text-decoration: none; opacity: 0.88; }
a.mobile-drawer-topbar__title:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }
.picre-brand__icon { display: block; width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.topbar__logo { align-self: center; }

/* Moart 벡터 로고 (라이트/다크 자동 전환) */
.moart-logo-img { display: block; height: auto; max-width: 100%; object-fit: contain; flex-shrink: 0; }
.moart-logo-img--dark { display: none; }
html[data-theme="dark"] .moart-logo-img--light { display: none; }
html[data-theme="dark"] .moart-logo-img--dark { display: block; }
.moart-logo-img--sidebar { width: 192px; height: auto; }
.moart-logo-img--admin { width: 138px; height: auto; }
.moart-logo-img--topbar { height: 28px; width: auto; }
.moart-logo-img--auth-nav { height: 34px; width: auto; }
.moart-logo-img--auth-card { width: 244px; height: auto; }

/* 프레임 카드 및 내부 이미지 조정 */
.frame-adjust-dialog {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  margin: auto; padding: 20px; overflow: auto; border-radius: 12px;
  background: var(--bg-surface, var(--panel-bg)); color: var(--text-primary, var(--ink)); border: 1px solid var(--border-default, var(--border));
}
.frame-adjust-dialog::backdrop { background: var(--overlay-backdrop, rgba(0, 0, 0, .45)); }
.frame-adjust-stage { width: 100%; aspect-ratio: 440 / 360; background: var(--bg-editor-workspace, var(--workspace-bg)); touch-action: none; cursor: grab; }
.frame-adjust-stage:active { cursor: grabbing; }
.frame-adjust-stage canvas { width: 100% !important; height: 100% !important; display: block; }
.frame-adjust-zoom { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.frame-adjust-zoom input { flex: 1; min-width: 0; }
.frame-adjust-zoom output { min-width: 4em; text-align: right; }
.frame-adjust-actions { display: flex; justify-content: flex-end; gap: 8px; }
.frame-adjust-actions .btn { width: auto; min-width: 100px; white-space: nowrap; flex: 0 0 auto; }
.frame-library { margin-bottom: 16px; }
.frame-card { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; overflow: hidden; }
.frame-card__icon { display: block; height: 64px; }
.frame-card__icon svg path, .frame-card__icon svg rect, .frame-card__icon svg ellipse, .frame-card__icon svg polygon { fill: var(--accent); }

/* 레이어 목록 및 블록·섹션 카드 썸네일 */
.layers-panel { min-width: 0; }
.layers-list { display: flex; flex-direction: column; gap: 5px; }
.editor-layer {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 24px 24px 24px;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--border-subtle, var(--border));
  border-radius: var(--radius-sm);
  background: var(--bg-surface, var(--panel-bg));
  overflow: hidden;
}
.editor-layer.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--focus-editor-selection, color-mix(in srgb, var(--accent) 18%, transparent)); }
.editor-layer.is-hidden { opacity: .56; }
.editor-layer__drag,
.editor-layer__action,
.editor-layer__select {
  min-width: 0;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-secondary, var(--ink-soft));
  font: inherit;
  cursor: pointer;
}
.editor-layer__drag { padding: 0; color: var(--text-muted, var(--ink-faint)); font-size: 14px; cursor: grab; }
.editor-layer__drag:active { cursor: grabbing; }
.editor-layer__select {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 5px 0 2px;
  overflow: hidden;
  text-align: left;
}
.editor-layer__select:hover { color: var(--accent); }
.editor-layer__icon {
  display: inline-grid;
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 5px;
  background: var(--bg-subtle, var(--surface-muted));
  color: var(--text-secondary, var(--ink-soft));
  font-size: 12px;
  font-weight: 700;
}
.editor-layer__icon--composite {
  width: 56px;
  height: 32px;
  flex: 0 0 56px;
  overflow: hidden;
}
.editor-layer__icon--composite img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.editor-layer__name {
  overflow: hidden;
  color: var(--text-primary, var(--ink));
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-layer__action { padding: 0; font-size: 13px; }
.editor-layer__action:hover { color: var(--accent); background: var(--accent-soft); }
.editor-layer.is-locked .editor-layer__name::after { content: ''; }
.layers-list .sortable-ghost { opacity: .45; background: var(--accent-soft); }

.block-thumbnail__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}
.block-thumbnail__skeleton {
  display: none;
  position: absolute;
  inset: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-editor-skeleton-base, #ececf2) 25%, var(--bg-editor-skeleton-highlight, #f7f7fa) 37%, var(--bg-editor-skeleton-base, #ececf2) 63%);
  background-size: 400% 100%;
  animation: block-thumbnail-loading 1.2s ease-in-out infinite;
}
.block-grid-card__thumb.is-thumbnail-loading .block-thumbnail__fallback { opacity: 0; }
.block-grid-card__thumb.is-thumbnail-loading .block-thumbnail__skeleton { display: block; }
.block-grid-card__thumb.is-thumbnail-ready .block-thumbnail__fallback,
.block-grid-card__thumb.is-thumbnail-ready .block-thumbnail__skeleton,
.block-grid-card__thumb.is-thumbnail-fallback .block-thumbnail__skeleton { display: none; }
@keyframes block-thumbnail-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* 최근·문서·브랜드 공통 색상 팔레트 */
.color-palette { display: block; min-width: 0; max-width: 100%; margin: 6px 0; flex-basis: 100%; color: var(--text-primary, var(--ink)); }
.color-palette__toggle { cursor: pointer; font-size: 11px; }
.color-palette__body { min-width: 0; padding: 8px; border: 1px solid var(--border-default, var(--border)); border-radius: 6px; background: var(--bg-surface, var(--panel-bg)); }
.color-palette__section + .color-palette__section { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border-default, var(--border)); }
.color-palette__heading { font-size: 11px; line-height: 1.4; margin-bottom: 6px; overflow-wrap: anywhere; }
.color-palette__grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.color-palette__cell { display: block; position: relative; min-width: 0; }
.color-palette .color-palette__swatch { display: block; width: 100%; min-width: 0; height: 22px; padding: 0; border: 1px solid var(--border-default, var(--border)); border-radius: 4px; cursor: pointer; }
.color-palette .color-palette__remove { position: absolute; top: -4px; right: -3px; width: 14px; min-width: 0; height: 14px; padding: 0; line-height: 12px; border: 1px solid var(--border-default, var(--border)); border-radius: 50%; background: var(--bg-surface, var(--panel-bg)); color: var(--text-primary, var(--ink)); opacity: 0; cursor: pointer; }
.color-palette__cell:hover .color-palette__remove, .color-palette__cell:focus-within .color-palette__remove { opacity: 1; }
@media (hover: none) { .color-palette .color-palette__remove { opacity: 1; } }
.color-palette .color-palette__save { display: block; width: 100%; height: auto; margin-top: 8px; padding: 6px 4px; border: 1px solid var(--border-default, var(--border)); border-radius: 4px; background: var(--bg-surface, var(--panel-bg)); color: var(--text-primary, var(--ink)); font-size: 11px; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.color-palette__message { margin: 4px 0; font-size: 11px; line-height: 1.4; color: var(--text-muted, var(--ink-faint)); white-space: normal; overflow-wrap: anywhere; }
.color-palette button:disabled { opacity: 0.5; cursor: wait; }
.color-palette--compact { display: inline-block; flex-basis: auto; margin: 0; }
.color-palette--compact .color-palette__body { position: fixed; z-index: 1302; width: min(260px, calc(100vw - 16px)); max-height: min(420px, calc(100vh - 16px)); overflow-y: auto; box-shadow: var(--shadow-md); }

/* 09-10: 워터마크 설정·로고·미리보기 */
.admin-watermark-form {
  display: grid;
  max-width: 480px;
  gap: 7px;
  margin-top: 18px;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.admin-watermark-form > label:not(.checkbox-line) { margin-top: 8px; color: var(--text-secondary); font-size: 12px; font-weight: 700; }
.admin-watermark-form input[type="number"],
.admin-watermark-form select,
.admin-watermark-form input[type="file"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
}
.admin-watermark-form__toggle { margin: 0 0 8px; }
.admin-watermark-form__image-row { display: flex; align-items: center; gap: 12px; }
.admin-watermark-form__preview { width: 112px; height: 58px; flex: 0 0 auto; object-fit: contain; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-subtle); }
.admin-watermark-form__image-row input { min-width: 0; }
.admin-watermark-form .btn { width: 100%; margin-top: 12px; }
.admin-watermark-subtitle { margin: 30px 0 5px; color: var(--text-primary); font-size: 16px; }
.topbar__watermark-notice {
  max-width: 190px;
  overflow: hidden;
  color: var(--text-editor-watermark-notice);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__export-progress { color: var(--accent-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
.editor-watermark-preview {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
.editor-watermark-preview[hidden] { display: none; }
.editor-watermark-preview__image {
  position: absolute;
  display: block;
  max-width: none;
  user-select: none;
  pointer-events: none;
}
.brand-logo-library { margin-top: 18px; padding-top: 1px; border-top: 1px solid var(--border-default); }
.brand-logo-library .panel-subtitle { margin-bottom: 4px;  color: var(--text-primary); }
.brand-logo-upload { height: 62px; margin: 10px 0; font-size: 12px; }
.brand-logo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.brand-logo-empty { grid-column: 1 / -1; margin: 2px 0; }
.brand-logo-item { position: relative; min-width: 0; }
.brand-logo-item__insert {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0;
  background:
    linear-gradient(45deg, var(--bg-editor-transparent-checker) 25%, transparent 25%) 0 0 / 10px 10px,
    linear-gradient(-45deg, var(--bg-editor-transparent-checker) 25%, transparent 25%) 0 0 / 10px 10px,
    var(--panel-bg);
  cursor: pointer;
}
.brand-logo-item__insert:hover { border-color: var(--accent); }
.brand-logo-item__insert img { display: block; width: 100%; height: 66px; object-fit: contain; }
.brand-logo-item__delete {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: var(--text-on-dark);
  background: var(--overlay-editor-action);
  cursor: pointer;
  line-height: 1;
}
.brand-logo-item__delete:hover { background: var(--danger); }
.section-watermark {
  margin-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.section-watermark > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.section-watermark > summary::-webkit-details-marker { display: none; }
.section-watermark > summary::after { content: '⌄'; color: var(--text-secondary); transition: transform .15s ease; }
.section-watermark[open] > summary::after { transform: rotate(180deg); }
.section-watermark__content { padding-bottom: 4px; }
.section-watermark__toggle { margin-top: 0; }
.section-watermark__logo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 10px;
}
.section-watermark__logo-item { position: relative; min-width: 0; }
.section-watermark__logo {
  display: block;
  width: 100%;
  aspect-ratio: 1.45;
  padding: 5px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--panel-bg);
  cursor: pointer;
}
.section-watermark__logo.is-selected {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.section-watermark__logo.is-selected:focus-visible { outline: none; }
.section-watermark__logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.section-watermark__logo-delete {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 5;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--overlay-editor-watermark-action);
  color: var(--text-on-dark);
  font-size: 16px;
  line-height: 20px;
  cursor: pointer;
}
.section-watermark__logo-delete:hover { background: var(--danger); }
.section-watermark__empty { grid-column: 1 / -1; margin: 2px 0; }
.section-watermark__upload { min-height: 48px; margin: 0 0 8px; font-size: 12px; }
.section-watermark__notice {
  margin: 10px 0;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg-editor-watermark-notice);
  color: var(--text-editor-watermark-warning);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.section-watermark__server-preview { width: 100%; margin: 0 0 8px; font-size: 12px; }
.watermark-preview-modal__card { width: min(760px, 100%); display: flex; flex-direction: column; overscroll-behavior: contain; }
.watermark-preview-modal__progress { margin: 14px 0; color: var(--text-secondary); font-size: 12px; font-weight: 700; }
.watermark-preview-modal__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 0 0 auto; }
.watermark-preview-modal__controls .btn { width: auto; margin: 0; padding: 7px 10px; font-size: 12px; }
.watermark-preview-modal__controls [aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.watermark-preview-modal__controls output { min-width: 4.5em; text-align: center; color: var(--text-primary); font-variant-numeric: tabular-nums; font-size: 12px; }
.watermark-preview-modal__hint { margin: 8px 0 0; color: var(--text-secondary); font-size: 11px; line-height: 1.5; }
.watermark-preview-modal__viewport { position: relative; height: min(60vh, 640px); min-height: 120px; margin-top: 12px; overflow: auto; overscroll-behavior: contain; touch-action: none; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-subtle); cursor: grab; scrollbar-gutter: stable; }
.watermark-preview-modal__viewport:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.watermark-preview-modal__viewport.is-dragging { cursor: grabbing; user-select: none; }
.watermark-preview-modal__stage { position: relative; }
.watermark-preview-modal__image { position: absolute; display: block; max-width: none; user-select: none; pointer-events: none; }
html[data-theme="dark"] .watermark-preview-modal__viewport { border-color: var(--border-contrast-settings); }

/* 설정 UI에만 한정하며 워터마크/로고 이미지의 픽셀·투명도는 변경하지 않는다. */
.admin-section[data-section="watermark"] { background: var(--bg-watermark-settings-section); }
.admin-section[data-section="watermark"] > .dash-section-title,
#watermarkPreviewModalTitle { color: var(--text-primary); }
.admin-section[data-section="watermark"] > .panel-desc,
#watermarkPreviewModal .panel-desc { color: var(--text-secondary); }
.admin-watermark-form .checkbox-line { color: var(--text-primary); }
.properties-body .section-watermark__toggle { color: var(--text-secondary); }
.admin-watermark-form .checkbox-line input[type="checkbox"]:not(:checked),
.section-watermark .checkbox-line input[type="checkbox"]:not(:checked) { background: var(--border-default); }
.admin-watermark-form .checkbox-line input[type="checkbox"]::after,
.section-watermark .checkbox-line input[type="checkbox"]::after {
  background: var(--bg-watermark-toggle-knob);
  box-shadow: var(--shadow-toggle-knob);
}
.brand-logo-upload,
.properties-body .section-watermark__upload {
  background: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-secondary);
}
.brand-logo-upload:hover,
.properties-body .section-watermark__upload:hover { border-color: var(--accent); color: var(--accent); }

/* 대비 점검 범위: 라이트 값·캔버스 콘텐츠를 보존하고 다크 UI만 조정한다. */
html[data-theme="dark"] {
  --bg-accent-solid-on-white: #B94E0B;
  --border-contrast-settings: #858C99;
}
html[data-theme="dark"] .dashboard { background: var(--bg-page); }
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .image-item,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .help-card {
  background: var(--bg-surface);
  color: var(--text-primary);
}
html[data-theme="dark"] .dash-section-title,
html[data-theme="dark"] .admin-page-header__title { color: var(--text-primary); }
html[data-theme="dark"] .project-card__date,
html[data-theme="dark"] .image-item__meta,
html[data-theme="dark"] .stat-card__label,
html[data-theme="dark"] .stat-card__unit,
html[data-theme="dark"] .stat-card__sub,
html[data-theme="dark"] .plan-card .plan-card__label,
html[data-theme="dark"] .plan-card .plan-card__unit,
html[data-theme="dark"] .help-card p { color: var(--text-secondary); }

/* 흰 글자 전용 배경: 공용 accent와 어두운 글자의 CTA는 유지한다. */
html[data-theme="dark"] .dash-sidebar .app-language-toggle button.is-active,
html[data-theme="dark"] .dash-nav__item.is-active,
html[data-theme="dark"] .dash-user__avatar,
html[data-theme="dark"] .plan-card__badge,
html[data-theme="dark"] .quick-steps li:nth-child(even)::before,
html[data-theme="dark"] .admin-language-toggle__button.is-active,
html[data-theme="dark"] .topbar .app-language-toggle button.is-active,
html[data-theme="dark"] .editor-preview__devices button[aria-selected="true"],
html[data-theme="dark"] .tabs__item.is-active,
html[data-theme="dark"] .block-grid-card__add,
html[data-theme="dark"] .bp-pill { background: var(--bg-accent-solid-on-white); }
html[data-theme="dark"] .dash-sidebar .app-language-toggle { background: var(--bg-surface); }
html[data-theme="dark"] .dash-sidebar .app-language-toggle button:not(.is-active) { background: var(--bg-surface); }
html[data-theme="dark"] .auth-card input:not(:focus) { border-color: var(--border-contrast-settings); }

/* 밝은 썸네일 표시 바탕은 hover에도 유지한다. PNG·삽입 객체는 변경하지 않는다. */
html[data-theme="dark"] .block-grid-card:is([data-block="hero"], [data-block="features"], [data-block="divider"]) .block-grid-card__thumb,
html[data-theme="dark"] .block-grid-card__thumb.is-thumbnail-fallback {
  background: #fafafc;
}

/* 전역 border 토큰 대신 인증·워터마크 설정 경계에만 적용한다. */
html[data-theme="dark"] .admin-watermark-form,
html[data-theme="dark"] .admin-watermark-form input[type="number"],
html[data-theme="dark"] .admin-watermark-form input[type="file"],
html[data-theme="dark"] .admin-watermark-form select,
html[data-theme="dark"] .admin-watermark-form__preview,
html[data-theme="dark"] .section-watermark,
html[data-theme="dark"] .section-watermark__logo:not(.is-selected),
html[data-theme="dark"] .brand-logo-library,
html[data-theme="dark"] .brand-logo-item__insert:not(:hover),
html[data-theme="dark"] .watermark-preview-modal__image,
html[data-theme="dark"] .brand-logo-upload:not(:hover),
html[data-theme="dark"] .properties-body .section-watermark__upload:not(:hover),
html[data-theme="dark"] .properties-body .section-watermark select {
  border-color: var(--border-contrast-settings);
}
html[data-theme="dark"] .admin-watermark-form .checkbox-line input[type="checkbox"]:not(:checked),
html[data-theme="dark"] .section-watermark .checkbox-line input[type="checkbox"]:not(:checked) {
  background: var(--border-contrast-settings);
}
html[data-theme="dark"] .brand-logo-item__insert { --bg-editor-transparent-checker: #747D8C; }
/* 밝은 썸네일 위에서도 흰 아이콘 4.5:1을 유지한다(기존 .9 합성은 4.27:1). */
html[data-theme="dark"] .block-grid-card__add { opacity: 1; }

/* AI 크레딧 이력은 라이트/다크 공통 테마의 본문 색상을 사용한다. */
#creditLogTableBody { color: var(--text-primary); }

/* 오류·성공 live region은 빈 상태에도 DOM에 유지한다. */
.auth-error:empty, .auth-info:empty { margin: 0; padding: 0; border: 0; }

/* 상태 표준: 목록 데이터와 독립적으로 쓰는 카드/이미지 placeholder. */
.list-status { grid-column: 1 / -1; display: grid; justify-items: center; gap: 16px; padding: 40px 20px; text-align: center; color: var(--text-secondary); background: var(--bg-surface); border: 1px dashed var(--border-default); border-radius: var(--radius-md); }
.list-status p { margin: 0; line-height: 1.6; }
.list-loading { grid-column: 1 / -1; color: var(--text-secondary); }
.list-skeleton { padding: 16px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface); min-width: 0; }
.list-skeleton span { display: block; background: var(--bg-subtle); border-radius: var(--radius-sm); animation: marketplace-pulse 1.5s ease-in-out infinite; }
.list-skeleton__image { height: 140px; margin-bottom: 12px; }
.list-skeleton--image .list-skeleton__image { height: auto; aspect-ratio: 1; }
.list-skeleton__title { width: 70%; height: 20px; margin-bottom: 12px; }
.list-skeleton__line { width: 90%; height: 14px; }
@media (prefers-reduced-motion: reduce) { .list-skeleton span { animation: none; } }

.list-delete-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
#listDeleteModal .modal__card { color: var(--text-primary); }
#listDeleteDescription { overflow-wrap: anywhere; }

#myWorksGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }

/* 관리자 조회 상태: 표는 colspan 상태 행, 기존 의미 토큰 재사용. */
.admin-state { padding: 32px 20px; text-align: center; color: var(--text-secondary); background: var(--bg-surface); border-radius: var(--radius-md); }
.admin-state p { margin: 0 0 12px; line-height: 1.6; }
.admin-table [aria-busy="true"] .admin-state { background: var(--bg-subtle); }
.admin-section .refund-btn[aria-disabled="true"] { opacity: .65; cursor: not-allowed; }

#adminActionModal .modal__card { color: var(--text-primary); overflow-wrap: anywhere; }
.admin-action-buttons { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
.admin-inline-message { color: var(--text-primary); font-size: 13px; line-height: 1.5; max-width: 28em; }
.admin-table [aria-invalid="true"] { border-color: var(--status-danger); }

.admin-page { color: var(--text-primary); --ink: var(--text-primary); --ink-soft: var(--text-secondary); --ink-faint: var(--text-muted); }
.admin-page .search-input, .admin-page .plan-select, .admin-page .credit-adjust__input, .admin-page .credit-adjust__btn { background: var(--bg-control); color: var(--text-primary); border-color: var(--border-default); }
.admin-page :is(input, select, button, a):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.admin-page .table-card { overflow-x: auto; }
.admin-page .admin-watermark-form__image-row { flex-wrap: wrap; }
.admin-page .admin-watermark-form__image-row input { flex: 1 1 180px; max-width: 100%; }
.admin-page .admin-watermark-source-trigger { max-width: 100%; white-space: normal; }
.admin-page .admin-language-toggle, .admin-page .admin-language-toggle__button:not(.is-active) { background: var(--bg-control); color: var(--text-primary); border-color: var(--border-default); }

.editor-ui-status { grid-column: 1 / -1; padding: 12px; color: var(--text-primary); background: var(--bg-subtle); border: 1px solid var(--border-default); border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; }
.editor-ui-status p { margin: 0 0 8px; }
#imageReplaceModal .modal__card { color: var(--text-primary); }
#imageReplaceGrid .library-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.editor-ui-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }
.editor-project-status { position:fixed; top:70px; right:16px; z-index:90; width:min(360px, calc(100vw - 32px)); box-shadow:var(--shadow-md); }
#editorConfirmModal .modal__card { color:var(--text-primary); }
#app label.upload-drop:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }

#app .upload-drop, #app .chip { background:var(--bg-control); color:var(--text-secondary); border-color:var(--border-default); }
/* 편집 결과물이 아닌 UI 표면만 테마 토큰을 따른다. */
#editorConfirmModal { z-index: 1500; }
#app .ai-block,
#objectToolbar, #objectContextMenu, #imageToolbarMore, #shapeToolbarMore, #textToolbarMore {
  background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-default);
  --ink: var(--text-primary); --ink-soft: var(--text-secondary); --ink-faint: var(--text-muted);
}

/* 마이포인트 날짜 입력: 표시/전송 형식과 분리된 달력 표현 계층. */
.point-date-field { position: relative; min-width: 0; }
.point-date-field > label { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: 13px; }
.point-date-field > input { width: 100%; min-width: 0; height: 42px; padding: 8px 44px 8px 12px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); font: inherit; }
.point-date-trigger { position: absolute; right: 2px; top: 27px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); cursor: pointer; }
.point-date-picker { position: absolute; z-index: 30; top: 100%; left: 0; width: min(320px, calc(100vw - 48px)); margin-top: 6px; padding: 12px; border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); background: var(--bg-surface); color: var(--text-primary); }
.point-date-picker[hidden] { display: none; }
.point-date-picker__head { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 4px; margin-bottom: 12px; }
.point-date-picker__head :is(button, select) { min-width: 0; height: 36px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-primary); font: inherit; }
.point-date-picker__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.point-date-picker__grid > span { font-size: 12px; color: var(--text-secondary); padding: 4px 0; }
.point-date-picker__grid > button { min-width: 0; height: 34px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); font: inherit; cursor: pointer; }
.point-date-picker__grid > button[aria-current="date"] { border-color: var(--accent); }
.point-date-picker__grid > button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.point-date-picker button:hover:not(:disabled):not([aria-pressed="true"]), .point-date-trigger:hover { background: var(--bg-subtle); }
.point-date-field :is(input, button, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.point-date-field > input[aria-invalid="true"] { border-color: var(--status-danger); }
.point-date-picker__hint { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
@media (max-width: 640px) { .point-date-picker { width: min(300px, calc(100vw - 56px)); } }

/* 결제 입력의 표현만 통일한다. 처리 상태/상품 스냅샷은 payment 모듈 계약 유지. */
#purchaseModal .charge-amount { margin-top: 20px; }
#purchaseModal .charge-amount > label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
#purchaseModal :is(.charge-amount__input, .card-fields input) { width: 100%; min-width: 0; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); font: inherit; }
#purchaseModal .card-fields { margin-top: 16px; }
#purchaseModal .card-fields label { margin-top: 16px; margin-bottom: 8px; font-size: 13px; }
#purchaseModal .card-fields input::placeholder { color: var(--text-muted); opacity: 1; }
#purchaseModal .card-fields .align-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
#purchaseModal :is(input, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#purchaseModal :is(input, select):disabled { background: var(--bg-subtle); color: var(--text-muted); cursor: not-allowed; }
#purchaseModal .modal__card { max-height: calc(100dvh - 32px); overflow-y: auto; }
@media (max-width: 640px) { #purchaseModal .modal__card { width: calc(100% - 32px); padding: 20px; } }

/* 이력 유형 선택: 색뿐 아니라 테두리·굵기와 aria-selected로 구분. */
.point-history-controls { margin-bottom: 16px; }
.point-history-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.point-history-tab { min-height: 42px; padding: 8px 18px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-secondary); font: inherit; cursor: pointer; }
.point-history-tab[aria-selected="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: inset 0 -3px 0 currentColor; }
.point-history-tab:hover:not([aria-selected="true"]):not(:disabled) { background: var(--bg-subtle); color: var(--text-primary); border-color: var(--accent); }
.point-history-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.point-history-tab:disabled { opacity: .55; cursor: not-allowed; }
.point-history-filter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; align-items: end; gap: 12px; }
.point-history-filter__keyword { min-width: 0; color: var(--text-secondary); font-size: 13px; }
.point-history-filter__keyword > span { display: block; margin-bottom: 6px; }
.point-history-filter__keyword input { width: 100%; min-width: 0; height: 42px; padding: 8px 12px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); font: inherit; }
.point-history-filter__keyword input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.point-history-filter > .btn { min-height: 42px; }
@media (max-width: 1000px) { .point-history-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 640px) { .point-history-filter { grid-template-columns: minmax(0, 1fr); } }
/* 준비 안내와 결제 제목도 입력과 같은 테마 표면에서 읽히게 한다. */
.dash-section[data-section="points"] { color: var(--text-primary); }
.dash-section[data-section="points"] .panel-desc { color: var(--text-secondary); }
#purchaseModal .panel-title { color: var(--text-primary); }
#purchaseModal .panel-desc { color: var(--text-secondary); }
.points-total-card { display: grid; gap: 8px; margin: 16px 0 24px; }
.points-total-card__label { color: var(--text-secondary); font-size: 13px; }
.points-total-card__value { color: var(--text-primary); line-height: 1.6; }

/* 단일 포인트 잔액과 월 지급 설정: 기존 테마 의미 토큰 재사용. */
.unified-points-card { gap:24px; flex-wrap:wrap; }
.unified-points-card .panel-desc { color:var(--text-secondary); }
.unified-points-card__actions { display:flex; gap:16px; align-items:center; flex-wrap:wrap; }
.point-policy-card { padding:24px; margin:16px 0; border:1px solid var(--border-default); border-radius:var(--radius-md); background:var(--bg-surface); color:var(--text-primary); }
.point-policy-card p { white-space:pre-line; line-height:1.7; overflow-wrap:anywhere; }
.point-policy-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:24px 0; }
.point-policy-fields label { display:flex; flex-direction:column; gap:8px; }
.point-policy-fields input, .point-history-filter select { min-height:42px; width:100%; min-width:0; padding:8px 12px; border:1px solid var(--border-default); border-radius:var(--radius-sm); background:var(--bg-surface); color:var(--text-primary); }
.point-policy-fields input[aria-invalid="true"] { border-color:var(--status-danger); }
.point-policy-fields input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (max-width:600px) { .point-policy-fields { grid-template-columns:1fr; } .point-policy-card { padding:16px; } }

/* 카피 설정은 기존 포인트 정책 카드와 테마 토큰을 공유한다. */
#copyPolicyForm { display:grid; gap:16px; }
#copyPolicyProvider { min-height:42px; width:100%; max-width:360px; padding:8px 12px; border:1px solid var(--border-default); border-radius:var(--radius-sm); background:var(--bg-control); color:var(--text-primary); }
#copyPolicySave { justify-self:start; }

.marketplace-preview-empty { display:grid; place-items:center; min-height:180px; width:100%; padding:20px; box-sizing:border-box; margin-bottom:12px; text-align:center; color:var(--text-secondary); background:var(--bg-subtle); border:1px dashed var(--border-default); border-radius:var(--radius-md); }

/* 편집 캔버스의 논리 폭 직접 입력. */
.topbar__canvas-size #canvasWidthInput{width:76px;min-width:0;box-sizing:border-box;background:var(--bg-editor-topbar-control);color:var(--text-on-dark);border:1px solid var(--border-editor-topbar);border-radius:var(--radius-sm);padding:8px 6px;font:inherit}

/* 전체 다크 UI 점검에서 확인된 고정 흰 표면. 편집 콘텐츠에는 적용하지 않는다. */
html[data-theme="dark"] :is(.quick-steps li,.template-card,.settings-card,.upload-drop){background:var(--bg-surface);color:var(--text-primary)}
html[data-theme="dark"] #addSectionBtn{background:var(--bg-surface)}
html[data-theme="dark"] #addSectionBtn{color:var(--accent)}
html[data-theme="dark"] :is(#textToolbarFont,#textToolbarFontSize){background:var(--bg-control);color:var(--text-primary);border-color:var(--border-default)}
html[data-theme="dark"] .project-card__empty{color:var(--text-secondary)}

html[data-theme="dark"] :is(.section-block__duplicate,.section-block__delete){background:var(--bg-surface)}

.marketing-tabs{display:flex;gap:.5rem;border-bottom:1px solid #d9dce5;margin:1rem 0 1.25rem}.marketing-tabs [role=tab]{border:0;border-bottom:3px solid transparent;background:transparent;padding:.8rem 1rem;font:inherit;cursor:pointer;color:inherit}.marketing-tabs [role=tab][aria-selected=true]{border-color:#635bff;font-weight:700}.marketing-tabs [role=tab]:focus-visible{outline:3px solid #635bff;outline-offset:2px}

/* 언어 전환 국기 아이콘 및 펼침 메뉴(드롭다운) */
.lang-dropdown { position: relative; display: inline-flex; overflow: visible; }
.lang-dropdown .lang-dropdown__trigger { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; line-height: 1; }
.lang-dropdown .lang-dropdown__flag { display: block; width: 22px; height: 15px; object-fit: cover; border-radius: 2px; box-shadow: var(--shadow-xs); flex-shrink: 0; }
.lang-dropdown .lang-dropdown__chevron { font-size: 10px; line-height: 1; opacity: 0.8; transition: transform 0.15s ease; }
.lang-dropdown.is-open .lang-dropdown__chevron { transform: rotate(180deg); }
.lang-dropdown .lang-dropdown__menu { display: none; position: absolute; top: calc(100% + 4px); right: 0; z-index: 1200; min-width: 120px; padding: 4px; flex-direction: column; gap: 2px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-md); }
.lang-dropdown.is-open .lang-dropdown__menu { display: flex; }
.lang-dropdown .lang-dropdown__option { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--radius-xs, 4px); background: transparent; color: var(--text-primary); font: inherit; font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer; }
.lang-dropdown .lang-dropdown__option:hover:not(.is-active) { background: var(--bg-subtle); color: var(--text-primary); }
.dash-sidebar .lang-dropdown .lang-dropdown__menu, .topbar .lang-dropdown .lang-dropdown__menu { background: var(--bg-sidebar-soft); border-color: var(--border-sidebar); color: var(--text-sidebar); }
.dash-sidebar .lang-dropdown .lang-dropdown__option:not(.is-active), .topbar .lang-dropdown .lang-dropdown__option:not(.is-active) { background: transparent; color: var(--text-sidebar); }
.dash-sidebar .lang-dropdown .lang-dropdown__option:hover:not(.is-active), .topbar .lang-dropdown .lang-dropdown__option:hover:not(.is-active) { background: var(--bg-sidebar-hover); color: var(--text-on-dark); }
html[data-theme="dark"] .dash-sidebar .lang-dropdown .lang-dropdown__trigger { background: var(--bg-surface); color: var(--text-primary); }

/* 초기 부트스트랩 및 언어 준비 중 화면 점프·언어 깜빡임 방지 */
.dashboard { transition: opacity 0.14s ease-out; }
html:not([data-dashboard-ready="true"]) body:not(.admin-page) .dashboard[inert] { opacity: 0; }
html[lang="ko"]:not([data-i18n-ready="true"]) :is([data-i18n], [data-lang-dropdown]) { opacity: 0; }
:is([data-i18n], [data-lang-dropdown]) { transition: opacity 0.12s ease-out; }
.dash-section.is-active { animation: picre-section-fade 0.16s ease-out; }
@keyframes picre-section-fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .dashboard, :is([data-i18n], [data-lang-dropdown]), .dash-section.is-active { transition: none; animation: none; } }


/* Moart 한국어 전용: 언어 전환(일본어) UI 숨김 */
.lang-dropdown, [data-lang-dropdown], [data-legal-lang-box], .ps-s1-lang, .ps-re-lang-pill, [data-app-lang], [data-admin-lang], #admin-lang-toggle, .admin-lang-switch { display: none !important; }

/* ============================================================================
   Moart 전체 페이지 공용 우측 하단 푸터 카피라이트
   ============================================================================ */
.moart-global-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  margin-top: 28px;
  padding: 14px 4px 8px;
  border-top: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.22));
  color: var(--text-secondary, #64748b);
  font-size: 12px;
  line-height: 1.5;
  box-sizing: border-box;
}

.moart-global-footer--standalone {
  padding: 14px 24px 18px;
}

.moart-global-footer__inner {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  text-align: right;
}

.moart-global-footer__links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.moart-global-footer__links a {
  color: var(--text-secondary, #64748b);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.moart-global-footer__links a:hover {
  color: var(--accent, #6366f1);
  text-decoration: underline;
}

.moart-global-footer__sep,
.moart-global-footer__divider {
  opacity: 0.45;
  user-select: none;
}

.moart-global-footer__copy {
  font-weight: 500;
  letter-spacing: 0.01em;
}

.moart-global-footer__copy strong {
  color: var(--text-primary, #0f172a);
  font-weight: 700;
}

.moart-global-footer--editor {
  justify-content: center;
  width: 100%;
  max-width: 860px;
  margin: 40px auto 12px;
  padding: 14px 12px 6px;
  border-top: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.24));
  text-align: center;
}

.moart-global-footer--editor .moart-global-footer__inner {
  justify-content: center;
  text-align: center;
}

@media (max-width: 640px) {
  .moart-global-footer {
    padding: 12px 2px 6px;
    font-size: 11px;
  }
}
