/* =========================================================
   Studio V2 Layout & Styles
   Matching exact proportions: Col 1: 52.5%, Col 2: 21.5%, Col 3: 26.0%
   Clean Pure White Theme with Category Sidebar, 4-Col/3-Col Grid,
   Middle Custom Controls (Purple Box), and Right Preview & Actions
   ========================================================= */

/* Body & Global Reset for V2 */
body.v2-page {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  background: #f8fafc;
  color: #0f172a;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Clean White / Light Theme Scrollbars */
body.v2-page * {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}
body.v2-page *::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
body.v2-page *::-webkit-scrollbar-track {
  background: #f8fafc;
}
body.v2-page *::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
body.v2-page *::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 3-Column Studio Grid Layout */
body.v2-page .v2-studio-layout {
  display: grid;
  grid-template-columns: 46% 28% 26%;
  height: calc(100vh - 64px);
  min-height: calc(100vh - 64px);
  width: 100vw;
  overflow: hidden;
  background: #f8fafc;
  box-sizing: border-box;
}

/* =========================================================
   COLUMN 1: STORE-STYLE ASSET LIBRARY (52.5% Width)
   ========================================================= */
.v2-col-library {
  width: 100%;
  height: 100%;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 10;
}

/* Library Header */
.v2-lib-header {
  padding: 10px 14px 8px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* Top 3 Tab Switcher */
.v2-lib-top-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.v2-lib-tab-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.v2-lib-tab-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.v2-lib-tab-btn.active {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #6d28d9;
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.2);
}

.v2-lib-tab-btn .badge {
  font-size: 9px;
  font-weight: 800;
  background: #8b5cf6;
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 10px;
}

.v2-lib-tab-btn.active .badge {
  background: #6d28d9;
}

/* Search Bar */
.v2-lib-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v2-lib-search-bar input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.v2-lib-search-bar input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
  background: #ffffff;
}

.v2-lib-badge {
  font-size: 11px;
  font-weight: 700;
  color: #6d28d9;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Library Body: Left Sidebar + Right Grid */
.v2-lib-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Left Subcategory Sidebar */
.v2-lib-cat-sidebar {
  width: 145px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  padding: 6px 4px;
}

.v2-cat-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  margin-bottom: 2px;
  transition: all 0.12s;
  box-sizing: border-box;
  text-align: left;
}

.v2-cat-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.v2-cat-item.active {
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 800;
  border-left: 2.5px solid #8b5cf6;
}

.v2-cat-item .v2-cat-label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.v2-cat-item .v2-cat-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-cat-item .v2-cat-cost {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--brand-muted, #687288);
  white-space: nowrap;
}

.v2-cat-item .v2-cat-count {
  flex: 0 0 auto;
  margin-left: 5px;
  font-size: 9px;
  font-weight: 700;
  color: #8b5cf6;
  background: #f5f3ff;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Right Cards Grid Wrap */
.v2-lib-grid-wrap {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px;
}

.v2-asset-grid {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.v2-asset-grid.grid-ornaments {
  grid-template-columns: repeat(4, 1fr);
}

/* Keep the full catalog searchable, but defer offscreen card layout/painting.
   108px is the card content height (80px thumbnail + 28px caption). */
.v2-asset-grid.grid-ornaments > .v2-asset-card {
  content-visibility: auto;
  contain-intrinsic-block-size: auto 108px;
}

.v2-asset-grid.grid-frames {
  grid-template-columns: repeat(3, 1fr); /* 3 columns for frames */
}

/* Clean Cards */
.v2-asset-card {
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  position: relative;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.v2-asset-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* The full-row builder and the image tiles share one add icon, with different
   sizes and clear labels. Custom actions do not use catalog virtualization. */
.v2-asset-grid.grid-custom {grid-template-columns:repeat(4,minmax(0,1fr));}
.grid-custom > .v2-custom-upload-card {grid-column:span 2;}
.grid-custom > .v2-custom-upload-card .v2-card-title {white-space:normal;overflow:visible;line-height:1.5;}
.v2-custom-plan-label {font-size:10px;font-weight:600;}
.v2-creator-offer {margin-bottom:14px;padding:16px;border:1px solid #ddd6fe;border-radius:14px;background:#faf8ff;color:#334155;font-size:13px;line-height:1.7;}
.v2-creator-offer-title {font-size:17px;color:#6d28d9;}
.v2-asset-grid.grid-custom > .v2-custom-builder-card {
  grid-column:1/-1;display:grid;grid-template-columns:84px minmax(0,1fr) 22px;
  gap:18px;width:100%;min-height:136px;padding:20px;text-align:left;
  font:inherit;color:#475569;cursor:pointer;box-shadow:none;
  border-color:var(--brand-line,#d9d0e3);background:var(--brand-panel,#faf8ff);
}
.v2-custom-builder-card .v2-custom-builder-thumb {width:84px;height:84px;margin:0;border:1px dashed var(--brand-focus,#a88bbb);background:#faf5ff;}
.grid-custom .upload-icon {font-size:26px;line-height:1.2;}
.v2-custom-builder-copy {display:flex;flex-direction:column;gap:6px;min-width:0;}
.v2-custom-builder-card .v2-card-title {font-size:18px;line-height:1.4;white-space:normal;overflow:visible;color:var(--brand-accent-text,#684582);}
.v2-custom-builder-card small {font-size:12px;line-height:1.6;color:#64748b;}
.v2-custom-builder-card .v2-custom-builder-access {font-size:11px;}
.v2-custom-builder-arrow {font-size:22px;color:var(--brand-accent-text,#684582);}
.v2-custom-builder-card:hover {border-color:var(--brand-focus,#a88bbb);background:var(--brand-accent,#f1e8f9);}
.v2-custom-builder-card:focus-visible,.v2-custom-upload-card:focus-within {outline:3px solid var(--brand-focus,#a88bbb);outline-offset:2px;}
body.v2-page.theme-dark-obsidian .v2-creator-offer {background:#111827;color:#cbd5e1;border-color:#374151;}
body.v2-page.theme-dark-obsidian .v2-creator-offer-title {color:#d8c5ec;}
body.v2-page.theme-dark-obsidian .v2-creator-offer a:not([style]) {color:#d8c5ec;}
body.v2-page.theme-dark-obsidian .grid-custom > .v2-custom-builder-card {background:#111827;border-color:#374151;color:#cbd5e1;}
body.v2-page.theme-dark-obsidian .v2-custom-builder-card .v2-custom-builder-thumb {background:#17152a;border-color:#6d5a9d;}
body.v2-page.theme-dark-obsidian .v2-custom-builder-card :is(.v2-card-title,.v2-custom-builder-arrow) {color:#e4d8f2;}
body.v2-page.theme-dark-obsidian .v2-custom-builder-card small {color:#b5c0d1;}
body.v2-page.theme-dark-obsidian .grid-custom > .v2-custom-upload-card .v2-card-title {color:#b5c0d1!important;}
body.v2-page.theme-dark-obsidian .grid-custom .upload-text {color:#d8c5ec!important;}
@media(max-width:500px){
  body.v2-page .v2-library-custom .v2-lib-tab-btn {flex-direction:column;gap:3px;padding:7px 3px;font-size:11px;word-break:keep-all;}
  .v2-library-custom .v2-custom-plan-label {white-space:nowrap;}
  .v2-library-custom .v2-lib-body {flex-direction:column;}
  body.v2-page .v2-library-custom .v2-lib-cat-sidebar {width:auto;border-right:0;border-bottom:1px solid #e2e8f0;overflow:visible;}
  .v2-library-custom .v2-cat-item {max-width:100%;}
  .v2-asset-grid.grid-custom > .v2-custom-builder-card {grid-template-columns:48px minmax(0,1fr);gap:12px;padding:16px;min-height:136px;}
  .v2-custom-builder-card .v2-custom-builder-thumb {width:48px;height:56px;}
  .v2-custom-builder-card .v2-card-title {font-size:16px;}
  .v2-custom-builder-arrow {display:none;}
  .v2-creator-offer {padding:16px;}
}

.v2-asset-card.is-selected {
  border-color: #8b5cf6 !important;
  background: #fbfaff !important;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25), 0 4px 10px rgba(139, 92, 246, 0.15) !important;
}

.v2-card-thumb {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.v2-card-thumb img {
  max-width: 86%;
  max-height: 86%;
  object-fit: contain;
  filter: none !important;
}

.v2-card-thumb.frame-thumb {
  height: 68px;
  background: #f8fafc;
}

.v2-card-thumb.frame-thumb img {
  max-width: 92%;
  max-height: 92%;
}

/* Picker-only silhouettes: keep the shared/actual chat renderers unchanged. */
.v2-asset-grid.grid-frames .v2-card-thumb.frame-thumb > .frame-mini {
  flex: 0 0 auto;
  width: 86%;
  height: 30px;
  margin: 0;
}

/* Reuse the real native drawing for illustrated/native frame cards. These
   overrides only isolate its artboard from the editor's canvas layout. */
.v2-card-thumb > .v2-native-frame-thumbnail {
  display: block;
  width: 92%;
  height: 92%;
  overflow: visible;
  pointer-events: none;
}

body.v2-page .v2-native-frame-thumbnail .v2-native-frame-art.chat-wrap {
  position: relative !important;
  display: block !important;
  width: 382px !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  pointer-events: none;
}

body.v2-page .v2-native-frame-thumbnail .v2-native-frame-art.chat-wrap > .message {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.v2-page .v2-native-frame-thumbnail .message-content {
  /* Blank multi-line space keeps the real frame readable at picker size. */
  min-height: 70px;
}

.v2-card-thumb.theme-thumb {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
  overflow: hidden;
  background: #f8fafc;
}

.v2-mini-theme-preview {
  /* Compensate for the uniform scale, rather than halving the card width. */
  width: calc(88% / 0.6);
  min-width: 0;
  flex: 0 0 auto;
  transform: scale(0.6);
  transform-origin: center center;
  pointer-events: none;
  user-select: none;
  display: flex;
  justify-content: center;
}

.v2-mini-theme-preview .message {
  width: 100% !important;
  min-width: 0 !important;
  padding: var(--padding) !important;
  margin: 0 !important;
  animation: none !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06) !important;
  box-sizing: border-box !important;
}

.v2-mini-theme-preview .message-content {
  min-height: 18.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

/* Only tall main-theme ornaments need a little extra headroom. */
.v2-card-thumb.frame-thumb.v2-main-theme-thumb .v2-mini-ornament {
  max-height: 38px;
  object-fit: contain;
}

.v2-main-theme-thumb .v2-mini-theme-preview {
  transform: translateY(6px) scale(0.6);
}

.v2-asset-grid.grid-frames .showcase-catalog-thumbnail .message-content,
.v2-asset-grid.grid-frames .showcase-catalog-thumbnail .nickname-tag {
  visibility: hidden !important;
}

.v2-equipped-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #7c3aed;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.v2-kind-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #6366f1;
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.25);
  pointer-events: none;
}

.v2-btn-card-add {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.4);
  transition: transform 0.1s, background 0.1s;
}

.v2-btn-card-add:hover {
  background: #059669;
  transform: scale(1.1);
}

/* Custom Upload Card & Delete Button */
.v2-custom-upload-card {
  position: relative;
  border: 2px dashed #c4b5fd !important;
  background: #fdfcff !important;
  cursor: pointer;
}
.v2-custom-file-input {position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;z-index:1;}

.v2-custom-upload-card:hover {
  border-color: #8b5cf6 !important;
  background: #f5f3ff !important;
  transform: translateY(-2px);
}

.v2-card-thumb.upload-thumb {
  background: #faf5ff;
  border-color: #ede9fe;
  flex-direction: column;
}

.v2-card-del-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.4);
  transition: transform 0.1s, background 0.1s;
  z-index: 5;
}

.v2-card-del-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.v2-separated-badge {
  display: inline-block;
  margin-left: 3px;
  padding: 1px 4px;
  border: 1px solid #34d399;
  border-radius: 4px;
  background: #ecfdf5;
  color: #059669;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.2px;
  vertical-align: 1px;
  white-space: nowrap;
}
.v2-card-title {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keep favorites beside the caption, clear of image art and thumbnail badges. */
.v2-card-caption {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: 24px;
  margin-top: 4px;
}

.v2-card-caption > .v2-card-title {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.v2-card-favorite {
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--brand-line, #e7e2ee);
  border-radius: 6px;
  background: var(--brand-panel, #faf9fd);
  color: var(--brand-accent-text, #684b8a);
  font-family: inherit;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.v2-card-favorite:hover {
  background: var(--brand-accent, #eee7fa);
  border-color: var(--brand-focus, #8b6bad);
}

.v2-card-favorite.is-favorite {
  background: var(--brand-main, #e7dcfa);
  color: var(--brand-main-text, #533774);
  border-color: var(--brand-focus, #8b6bad);
}

.v2-lib-empty {
  grid-column: 1 / -1;
  box-sizing: border-box;
  width: 100%;
  padding: 28px 16px;
  border: 1px dashed var(--brand-line, #e7e2ee);
  border-radius: 10px;
  background: var(--brand-panel, #faf9fd);
  text-align: center;
}

.v2-lib-empty-title {
  margin: 0;
  color: var(--brand-main-text, #533774);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.v2-lib-empty-description {
  margin: 6px 0 0;
  color: var(--brand-muted, #687288);
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.v2-lib-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin: 12px 0 0;
  padding: 6px 12px;
  border: 1px solid var(--brand-line, #e7e2ee);
  border-radius: 6px;
  background: var(--brand-accent, #eee7fa);
  color: var(--brand-accent-text, #684b8a);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}

.v2-lib-search-clear:hover {
  background: var(--brand-main, #e7dcfa);
  color: var(--brand-main-text, #533774);
}

/* =========================================================
   COLUMN 2: CUSTOM CONTROLS (21.5% Width - PURPLE BOX)
   ========================================================= */
.v2-controls {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 15;
}

.v2-custom-header {
  padding: 10px 12px 8px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.v2-custom-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.v2-custom-title-row h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.v2-custom-sub {
  font-size: 10px;
  font-weight: 700;
  color: #8b5cf6;
}

/* Custom 5 Tabs */
.v2-custom-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}

.v2-tab-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 2px;
  cursor: pointer;
  transition: all 0.12s;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
  min-height: 36px;
}

.v2-tab-btn:hover {
  color: #0f172a;
}

.v2-tab-btn.active {
  background: #ffffff;
  color: #6d28d9;
  font-weight: 800;
  border: 1px solid #8b5cf6;
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.2);
}

.v2-custom-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px;
}

/* Custom-tool visual order */
.v2-chat-style-picker { order: -10; --chat-style-surface:#fff; }
body.theme-dark-obsidian .v2-chat-style-picker { --chat-style-surface:#101624; }
.v2-chat-style-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
body.v2-page .v2-chat-style-card {
  display:flex; flex-direction:column; align-items:flex-start; gap:6px;
  min-width:0; padding:10px; border:1px solid var(--brand-line,#e7e2ee);
  border-radius:9px; background:var(--chat-style-surface); color:inherit;
  font:inherit; text-align:start; cursor:pointer;
}
body.v2-page .v2-chat-style-card:hover:not(:disabled),
body.v2-page .v2-chat-style-card.is-selected { border-color:var(--brand-focus,#8b6bad); background:var(--brand-accent,#eee7fa); }
body.v2-page .v2-chat-style-card:focus-visible { outline:2px solid var(--brand-focus,#8b6bad); outline-offset:2px; }
body.v2-page .v2-chat-style-card:disabled { opacity:.55; cursor:default; }
.v2-chat-style-name { font-size:12px; font-weight:800; line-height:1.4; overflow-wrap:anywhere; }
.v2-chat-style-detail { font-size:10px; line-height:1.6; opacity:.8; overflow-wrap:anywhere; }
.v2-chat-style-selected { color:var(--brand-accent-text,#684b8a); font-size:10px; font-weight:800; }
.v2-chat-style-selected[hidden],.v2-chat-style-note[hidden] { display:none; }
.v2-chat-style-note { margin:9px 0 0; font-size:10px; line-height:1.65; opacity:.8; }
.v2-chat-style-demo { display:flex; flex-direction:column; justify-content:center; gap:6px; width:100%; height:76px; padding:6px; border-radius:6px; background:var(--brand-panel,#faf9fd); box-sizing:border-box; }
.v2-chat-style-demo i { display:block; position:relative; width:100%; height:16px; border:1px solid var(--brand-focus,#8b6bad); background:var(--chat-style-surface); box-sizing:border-box; }
.v2-chat-style-demo i::after { content:''; position:absolute; top:50%; left:10%; width:45%; height:2px; background:currentColor; opacity:.35; }
.v2-chat-style-demo.compact { gap:4px; }
.v2-chat-style-demo.compact i { width:75%; height:14px; border-radius:6px; }
.v2-chat-style-demo.compact i:nth-child(2) { width:55%; }
.v2-chat-style-demo.compact i:nth-child(3) { width:90%; }
.v2-order-rainbow { order: 10; }
.v2-order-frame-tone { order: 15; }
.v2-order-bubble-bg { order: 20; }
.v2-order-bubble-pattern { order: 30; }
.v2-order-bubble-border { order: 40; }
.v2-order-bubble-padding { order: 50; }
.v2-order-bubble-fine { order: 60; }

.v2-order-ornament-slots { order: 10; }
.v2-order-ornament-color,
.v2-order-ornament-empty { order: 20; }
.v2-order-ornament-size { order: 30; }
.v2-order-ornament-animation { order: 40; }
.v2-order-ornament-flip { order: 50; }
.v2-order-ornament-cutout { order: 60; }
.v2-order-ornament-quick-cut { order: 70; }

.v2-order-text-color { order: 10; }
.v2-order-text-stroke { order: 20; }
.v2-order-text-shadow { order: 30; }
.v2-order-text-font { order: 40; }

.v2-order-nickname-position { order: 10; }
.v2-order-nickname-design { order: 20; }
.v2-order-nickname-display { order: 30; }
.v2-order-nickname-location { order: 40; }
.v2-order-nickname-frame-slot { order: 50; }

.v2-order-preset-mood { order: 10; }
.v2-order-preset-motion { order: 20; }

.v2-color-mode-pills .v2-pill {
  flex: 1 1 0;
}

/* Control Groups */
.v2-ctrl-group {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.v2-ctrl-title {
  font-size: 11px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}

.v2-ctrl-title-with-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.v2-help-button {
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid var(--brand-line, #ded4ec);
  border-radius: 50%;
  background: var(--brand-panel, #f7f3fb);
  color: var(--brand-accent-text, #604876);
  font: 700 13px/1 system-ui;
  cursor: pointer;
}
.v2-help-button:hover { background: var(--brand-accent, #e0d1f3); }
.v2-title-help-actions { display:inline-flex; align-items:center; gap:6px; flex-shrink:0; }
.v2-title-help-actions > [data-frame-resize-notice]:not([hidden]) { display:inline-flex; }
.v2-help-button.v2-help-warning { flex-basis:20px; width:20px; height:20px; border-color:#efb9b9; background:#fff5f5; color:#bf3030; }
.v2-help-button.v2-help-warning:hover { background:#ffe8e8; }
body.theme-dark-obsidian .v2-help-button.v2-help-warning { border-color:#85535b; background:#34262d; color:#ffb4b4; }
body.theme-dark-obsidian .v2-help-button.v2-help-warning:hover { background:#493039; }
.v2-ctrl-title-with-help > span { min-width:0; }
.v2-mode-actions { display:inline-flex; align-items:center; flex-shrink:0; gap:7px; }
.v2-control-label { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; font-weight:600; color:#475569; }
.v2-condition-note { margin:6px 0; font-size:11px; line-height:1.55; color:#8a5262; }
.v2-condition-note .v2-help-button { width:20px; height:20px; vertical-align:middle; margin-left:5px; }
.v2-help-popup { position:fixed; z-index:2147483646; box-sizing:border-box; padding:16px; overflow:auto; overscroll-behavior:contain; border:1px solid #d8c9e6; border-radius:14px; background:#fff; color:#334155; box-shadow:0 10px 36px #3023442b; font:12px/1.65 system-ui,sans-serif; }
.v2-help-popup-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:8px; }
.v2-help-popup-heading strong { min-width:0; font-size:13px; color:#5f4678; }
.v2-help-popup-heading button { flex:0 0 24px; width:24px; height:24px; padding:0; border:0; border-radius:6px; background:#f2edf8; color:#685777; font:20px/1 system-ui; cursor:pointer; }
.v2-help-popup p { margin:8px 0 0; font-size:12px; line-height:1.65; }
body.theme-dark-obsidian .v2-help-popup { background:#232235; color:#ddd9e8; border-color:#5c4b6f; box-shadow:0 10px 36px #05040b70; }
body.theme-dark-obsidian .v2-help-popup-heading strong { color:#dfc8f1; }
body.theme-dark-obsidian .v2-help-popup-heading button { background:#3d304b; color:#e8daef; }
body.theme-dark-obsidian .v2-control-label { color:#bcc6d9; }
body.theme-dark-obsidian .v2-condition-note { color:#d9a7b8; }
.v2-mode-control { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 7px 0; }
.v2-mode-control > span { font-size: 11px; font-weight: 600; color: #475569; }
.v2-preset-switch { display: inline-flex; flex-shrink: 0; gap: 2px; padding: 3px; border: 1px solid var(--brand-line, #ded4ec); border-radius: 9px; background: var(--brand-panel, #f7f3fb); }
.v2-preset-switch button { min-width: 43px; min-height: 28px; border: 0; border-radius: 6px; background: transparent; color: #778195; font: 700 11px/1 system-ui; cursor: pointer; }
.v2-preset-switch button[aria-pressed="true"] { background: var(--brand-accent, #e0d1f3); color: var(--brand-accent-text, #604876); box-shadow: 0 1px 3px #43315412; }
body.theme-dark-obsidian :is(.v2-help-button,.v2-preset-switch){background:#252236;border-color:#4d405f;color:#ddcfee}
body.theme-dark-obsidian .v2-mode-control>span{color:#bcc6d9}
.v2-cutout-demo{box-sizing:border-box;margin:12px 0;border:1px solid #dfd3e9;border-radius:11px;background:#faf8fd;overflow:hidden;color:#51445f;font:12px/1.55 system-ui,sans-serif}
.v2-cutout-demo [hidden]{display:none!important}
.v2-cutout-tabs{display:flex;gap:5px;padding:8px;border-bottom:1px solid #e6deed}
.v2-cutout-demo button{font:600 11px/1.4 system-ui,sans-serif;border:1px solid #d9cce5;border-radius:7px;padding:6px 8px;color:#665074;background:#fff;cursor:pointer}
.v2-cutout-tabs button{flex:1;min-width:0}
.v2-cutout-tabs button[aria-pressed=true]{background:#e9ddf5;border-color:#ac8dc4;color:#57366f}
.v2-cutout-demo button:disabled{opacity:.45;cursor:wait}
.v2-cutout-demo button:focus-visible{outline:2px solid #a37fbd;outline-offset:2px}
.v2-cutout-demo .v2-cutout-phase{box-sizing:border-box;min-height:34px;margin:0;padding:7px 10px 0;font-size:11px;line-height:17px;color:#776185}
.v2-cutout-stage{height:154px;display:flex;align-items:center;justify-content:center;padding:6px;box-sizing:border-box;background:repeating-conic-gradient(#efebf4 0 25%,#fff 0 50%) 50%/14px 14px}
.v2-cutout-canvas-box{position:relative;width:100%;margin:auto}
.v2-cutout-canvas-box canvas{display:block;width:100%;height:auto}
.v2-cutout-brush{position:absolute;box-sizing:border-box;border:1.5px dashed #8b5dba;border-radius:50%;background:#a986d028;transform:translate(-50%,-50%);pointer-events:none}
.v2-cutout-controls{display:grid;grid-template-columns:1fr 1fr auto;gap:6px;padding:9px}
.v2-cutout-controls [data-cutout-replay]{grid-column:3;grid-row:1}
.v2-cutout-controls .v2-cutout-apply{grid-column:1/-1;position:relative;font-weight:700;background:#ede3f7}
.v2-cutout-demo[data-phase=applying] .v2-cutout-apply{border-color:#8f62b1;background:#d4bce8;color:#50305f;box-shadow:0 0 0 2px #ba98d344}
.v2-cutout-click{display:none;position:absolute;right:10px;top:50%;transform:translateY(-45%);font-size:20px}
.v2-cutout-demo[data-phase=applying] .v2-cutout-click{display:block}
.v2-cutout-demo[data-phase=applied] .v2-cutout-apply{animation:v2-cutout-apply-click .25s ease-out}
@keyframes v2-cutout-apply-click{0%,100%{transform:scale(1)}40%{transform:scale(.96);background:#d4bce8}}
.v2-cutout-sample{padding:5px 14px 12px;border-top:1px solid #e6deed}
.v2-cutout-sample-title{display:block;font-size:11px;font-weight:600;color:#80658f}
.v2-cutout-sample-chat{box-sizing:border-box;position:relative;isolation:isolate;width:230px;max-width:100%;margin:56px auto 0;padding:10px 12px;border:1.5px solid #bb9bd5;border-radius:12px;background:#fff;color:#4b4654;font-size:11px;line-height:1.5;overflow:visible}
.v2-cutout-sample-chat+.v2-cutout-sample-chat{margin-top:52px}
.v2-cutout-sample-name{font-weight:800;color:#9273ad}
.v2-cutout-sample-art{position:absolute;z-index:2;object-fit:contain;max-width:none;pointer-events:none}
.v2-cutout-demo .v2-cutout-note{margin:0;padding:8px 10px;border-top:1px solid #e6deed;font-size:10px;line-height:1.6;color:#85718e}
body.theme-dark-obsidian .v2-cutout-demo{background:#272336;color:#e4d7ee;border-color:#554362}
body.theme-dark-obsidian :is(.v2-cutout-tabs,.v2-cutout-sample,.v2-cutout-note){border-color:#4d3f5b}
body.theme-dark-obsidian .v2-cutout-demo button{background:#352a42;color:#e9daf3;border-color:#685176}
body.theme-dark-obsidian .v2-cutout-tabs button[aria-pressed=true]{background:#5a3e70;border-color:#a987c0}
body.theme-dark-obsidian .v2-cutout-demo :is(.v2-cutout-phase,.v2-cutout-note,.v2-cutout-sample-title){color:#c8b4d8}
body.theme-dark-obsidian .v2-cutout-stage{background:repeating-conic-gradient(#2e293c 0 25%,#221f2e 0 50%) 50%/14px 14px}
body.theme-dark-obsidian .v2-cutout-sample-chat{background:#211f2c;border-color:#9e7fb6;color:#e8e1ed}
body.theme-dark-obsidian .v2-cutout-sample-name{color:#d2b8e7}
body.theme-dark-obsidian .v2-cutout-demo[data-phase=applying] .v2-cutout-apply{background:#705080;border-color:#c3a4dd}
@media(prefers-reduced-motion:reduce){.v2-cutout-demo .v2-cutout-brush,.v2-cutout-demo .v2-cutout-click{display:none!important}.v2-cutout-demo .v2-cutout-apply{animation:none!important}}

.v2-ctrl-row {
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.v2-ctrl-row[hidden] {
  display: none;
}

body.v2-page [data-frame-control-hidden] {
  display: none !important;
}

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

.v2-ctrl-row label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

.v2-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.v2-slider-header label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

.v2-slider-header b {
  cursor: text;
  font-size: 10px;
  font-weight: 700;
  color: #6d28d9;
}

.v2-ctrl-row input[type="range"] {
  width: 100%;
  accent-color: #8b5cf6;
  cursor: pointer;
  margin: 2px 0;
}

.v2-color-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.v2-color-row input[type="color"] {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  padding: 0;
  cursor: pointer;
  background: none;
}

.v2-hex-input {
  width: 70px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11px;
  font-family: monospace;
  text-align: center;
  color: #0f172a;
}

.v2-btn-mini {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
}

.v2-btn-mini:hover {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #6d28d9;
}

.v2-pills-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 4px;
}

.v2-order-bubble-layout .v2-check-row { display:flex;align-items:center;gap:6px;font-size:12px; }
.v2-order-bubble-layout .v2-hint { margin:10px 0 0;font-size:12px;line-height:1.6;color:#64748b; }
body.v2-page.theme-dark-obsidian .v2-order-bubble-layout .v2-hint { color:#94a3b8; }

/* Clean White Form Controls (Select Dropdowns & Checkboxes) */
body.v2-page select,
body.v2-page .v2-select {
  width: 100%;
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
  font-size: 11.5px !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  outline: none !important;
  cursor: pointer !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  appearance: auto !important;
}

body.v2-page select:focus,
body.v2-page .v2-select:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2) !important;
}

body.v2-page select option,
body.v2-page .v2-select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
  padding: 6px 8px !important;
}

body.v2-page input[type="checkbox"] {
  accent-color: #8b5cf6;
  cursor: pointer;
}

.v2-pill {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 4px 2px;
  font-size: 9px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.v2-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.v2-pill.active {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #6d28d9;
}

.v2-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

/* Decoration Slots in Inspector */
.v2-deco-slots-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 8px;
}

.v2-deco-slots-heading .v2-ctrl-title {
  margin-bottom: 0;
}

.v2-deco-gap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.v2-deco-gap-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #8b5cf6;
  cursor: pointer;
}

.v2-deco-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.v2-deco-slot-wrapper {
  position: relative;
  width: 100%;
}

.v2-deco-slot-btn {
  width: 100%;
  min-height: 60px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 4px 4px 4px;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.v2-deco-slot-wrapper.active .v2-deco-slot-btn,
.v2-deco-slot-btn.active {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #6d28d9;
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.2);
}

.v2-deco-slot-wrapper.empty .v2-deco-slot-btn,
.v2-deco-slot-btn.empty {
  opacity: 0.6;
}

.v2-slot-icon-area {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22px;
}

.v2-deco-slot-wrapper.needs-relink .v2-deco-slot-btn{border-style:dashed}
.v2-deco-slot-wrapper.needs-relink .v2-slot-icon-area{height:26px}
.v2-slot-relink-plus{display:grid;place-items:center;width:25px;height:25px;border:1px dashed currentColor;border-radius:7px;font-size:23px;font-weight:500;line-height:1;pointer-events:none}

.v2-slot-thumb {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.v2-slot-emoji {
  font-size: 15px;
  line-height: 20px;
  display: block;
}

.v2-slot-num {
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.1;
}

.v2-deco-slot-btn small {
  font-size: 8px;
  color: #64748b;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}

/* X button on the top right of each equipped decoration slot */
.v2-deco-slot-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #f87171;
  color: #ef4444;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 5;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.25);
  transition: all 0.15s ease;
}

.v2-deco-slot-remove:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
  transform: scale(1.15);
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
}

.v2-deco-slot-remove:active {
  transform: scale(0.95);
}

/* Per-slot position lock, kept opposite the remove button for quick access. */
.v2-deco-slot-lock,
.v2-deco-slot-reset {
  position: absolute;
  bottom: 4px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #d8deea;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: #667085;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.v2-deco-slot-lock {
  right: 4px;
}

.v2-deco-slot-reset {
  right: 28px;
}

.v2-deco-slot-lock:hover,
.v2-deco-slot-reset:hover {
  transform: translateY(-1px);
  border-color: #8b5cf6;
  color: #6d28d9;
}

.v2-deco-slot-lock.is-locked {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #ffffff;
}

.v2-deco-slot-lock:active,
.v2-deco-slot-reset:active {
  transform: scale(0.92);
}

.v2-deco-slot-wrapper.locked .v2-deco-slot-btn {
  border-color: #a78bfa;
  background: #faf7ff;
}

.v2-ctrl-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.v2-btn-cutout {
  background: #ede9fe;
  border: 1px solid #8b5cf6;
  color: #6d28d9;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
}

.v2-btn-cutout:hover {
  background: #ddd6fe;
}

/* Mirror Clone Button */
.v2-btn-mirror {
  width: 100%;
  margin: 4px 0 2px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #6d28d9;
  cursor: pointer;
  transition: all 0.12s;
}

.v2-btn-mirror:hover {
  background: #ede9fe;
  border-color: #8b5cf6;
}

/* Part buttons for quick cuts */
.v2-part-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 6px;
}

.v2-part-grid .part-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 5px 2px;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  text-align: center;
  transition: all 0.1s;
}

.v2-part-grid .part-btn:hover {
  background: #ede9fe;
  color: #6d28d9;
}

.v2-part-grid .part-btn.selected {
  background: #7c3aed;
  border-color: #6d28d9;
  color: #ffffff;
}

/* Crop Details */
.v2-crop-details {
  margin-top: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 8px;
}

.v2-crop-details summary {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.v2-crop-details summary::-webkit-details-marker {
  display: none;
}

.v2-btn-danger {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.v2-btn-danger:hover {
  background: #fee2e2;
}

.v2-empty-notice {
  padding: 24px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.5;
}

/* Preset Cards */
.v2-presets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.v2-preset-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.v2-preset-card:hover {
  background: #f1f5f9;
}

.v2-preset-card.selected {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #6d28d9;
}

/* =========================================================
   COLUMN 3: LIVE PREVIEW & ACTIONS (26.0% Width)
   ========================================================= */
body.v2-page .workspace.v2-workspace {
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Header & Live Preview Toolbar (Compact 1-row) */
.v2-preview-header {
  padding: 4px 0 6px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.v2-preview-tools-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.v2-tool-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.v2-tool-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Toolbar Controls Single Row: 2초 롤링 + 가로 닉네임 + 채팅 위쪽 + 투명 + 테스트 */
.v2-preview-tools-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-top: 0;
  flex-wrap: nowrap;
}

.v2-rolling-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  white-space: nowrap;
}

.v2-rolling-toggle-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.v2-rolling-toggle-btn.active {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.25);
}

.v2-rolling-toggle-btn .check-box {
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
}

/* Nickname Toggle Group */
.v2-nick-toggle-group {
  display: flex;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
  white-space: nowrap;
}

.v2-nick-btn {
  background: transparent;
  border: none;
  color: #64748b;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.v2-nick-btn:hover {
  color: #0f172a;
}

.v2-nick-btn.active {
  background: #ffffff;
  color: #6d28d9;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Stage & Preview Area - Checkerboard transparency grid */
body.v2-page .stage {
  flex: 1;
  min-height: 360px;
  max-height: 495px;
  background-color: #f8fafc;
  background-image: 
    linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
    linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin: 6px 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

body.v2-page .stage.opaque-preview {
  background-image: none !important;
  background-color: #0f172a !important;
}

body.v2-page .stage {
  padding: 42px 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

body.v2-page .stage .preview {
  width: 100%;
  max-width: 100%;
  transform-origin: center center;
  zoom: 0.68; /* Scaled down comfortably for editing screen; OBS export remains 100% standard scale */
  display: flex;
  align-items: center;
  justify-content: center;
}

.v2-icon-tool {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d9e1ec;
  border-radius: 9px;
  background: #ffffff;
  color: #64748b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.v2-icon-tool svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v2-icon-tool .v2-icon-fill {
  fill: currentColor;
  stroke: none;
  opacity: 0.18;
}

.v2-icon-tool:hover {
  transform: translateY(-1px);
  color: #6d4aff;
  border-color: #b9a9ff;
  background: #f7f5ff;
  box-shadow: 0 4px 10px rgba(109, 74, 255, 0.16);
}

.v2-icon-tool:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(109, 74, 255, 0.12);
}

.v2-icon-tool.is-active {
  color: #6d4aff;
  border-color: #c4b5fd;
  background: #f2efff;
}

.v2-icon-tool.is-reset:hover {
  color: #e05270;
  border-color: #f2a7b7;
  background: #fff4f6;
}

.v2-preview-zoom {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  margin-left: auto;
}

.v2-preview-zoom select {
  width: auto !important;
  min-width: 64px;
  padding: 4px 6px !important;
  font-size: 11px !important;
}

.v2-view-center {
  width: auto;
  min-width: 0;
  padding: 5px 8px;
  white-space: nowrap;
  font-size: 11px;
}

.v2-rainbow-list { display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.v2-rainbow-row { display:flex; align-items:center; gap:6px; min-width:0; }
.v2-rainbow-row > b { width:16px; color:#64748b; font-size:11px; text-align:center; }
.v2-rainbow-row input[type="color"] { width:28px; height:24px; padding:0; border:0; background:transparent; cursor:pointer; }
.v2-rainbow-row code { flex:1; min-width:0; color:#475569; font:10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.v2-rainbow-row .v2-btn-mini { min-width:24px; padding:3px 5px; }

body.admin-page :is(.v2-frame-card, .v2-theme-card)[draggable="true"] {
  cursor: grab;
}

body.admin-page :is(.v2-frame-card, .v2-theme-card).frame-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

body.admin-page :is(.v2-frame-card, .v2-theme-card).frame-drag-over {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22) !important;
}

/* Remove card shadow & safe area label that created artificial boundary confusion */
body.v2-page .chat-wrap {
  box-shadow: none !important;
  /* The regular editor reserves a tall canvas.  In V2 that placed actual chats
     at the canvas top, so let the frame group use its content height instead. */
  min-height: 0 !important;
  padding: 8px 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

body.v2-page .chat-wrap .chat-list {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

body.v2-page .chat-wrap .message {
  width: min(calc(100% - 16px), var(--width)) !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body.v2-page .safe-area {
  display: none !important;
}

.chat-wrap.has-text-stroke .message-content span,
.chat-wrap.has-text-stroke .message-content strong,
.chat-wrap.has-text-stroke .nickname-text {
  -webkit-text-stroke: var(--text-stroke-width, 1.5px) var(--text-stroke-color, #000000);
  paint-order: stroke fill;
}

/* Layer order controller */
.v2-layer-box {
  margin: 6px 0 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.v2-layer-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.v2-layer-title {
  font-size: 11px;
  font-weight: 800;
  color: #b91c1c;
}

.v2-layer-hint {
  font-size: 9px;
  color: #64748b;
}

.v2-layer-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v2-layer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 3px 6px;
  gap: 4px;
}

.v2-layer-row.is-empty {
  opacity: 0.45;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.v2-layer-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #1e293b;
  min-width: 58px;
  white-space: nowrap;
}

.v2-layer-name .v2-deco-mini {
  font-size: 9px;
  color: #64748b;
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-num-boxes {
  display: flex;
  align-items: center;
  gap: 2px;
}

.v2-num-box {
  width: 17px;
  height: 17px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  color: #475569;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.1s;
}

.v2-num-box:hover:not(:disabled) {
  border-color: #dc2626;
  color: #dc2626;
  background: #fff1f2;
}

.v2-num-box.active {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
  font-weight: 900;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.35);
}

.v2-num-box:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #e2e8f0;
  background: #f1f5f9;
}

/* Matching two-button rows for design files and Style Shop. */
.v2-styleshop-bar,
.v2-design-backup-bar {
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  background: var(--brand-panel, #ffffff);
  border: 1px solid var(--brand-line, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  flex-shrink: 0;
}

/* Size rules are shared; each button keeps its existing color treatment. */
:is(.v2-styleshop-bar, .v2-design-backup-bar) > :is(.v2-btn-styleshop-import,
  .v2-btn-styleshop-publish, .v2-btn-design-save, .v2-btn-design-load) {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  min-height: 30px;
  margin: 0;
  padding: 6px 4px;
  border-width: 1px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.v2-design-backup-bar :is(.v2-btn-design-save, .v2-btn-design-load) {
  background: var(--brand-accent, #eee7fa);
  color: var(--brand-accent-text, #684b8a);
  border-color: var(--brand-line, #e7e2ee);
}
.v2-design-backup-note {
  flex-shrink: 0;
  margin: 0 7px 8px;
  color: var(--brand-muted, #687288);
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.v2-btn-styleshop {
  background: #0284c7;
  border: 1px solid #0369a1;
  color: #ffffff;
  padding: 6px 4px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
  white-space: nowrap;
}

.v2-btn-styleshop:hover {
  background: #0369a1;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

/* =========================================================
   CYAN & YELLOW BOX: SAVE & OBS CSS BAR
   ========================================================= */
.v2-complete-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.v2-btn-temp-save {
  background: #ecfeff;
  border: 1.5px solid #06b6d4; /* Cyan button */
  color: #0e7490;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}

.v2-btn-temp-save:hover {
  background: #cffafe;
  color: #155e75;
}

.v2-btn-complete-obs {
  flex: 1;
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%); /* Yellow button */
  border: 1.5px solid #ca8a04;
  color: #422006;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.35);
  transition: all 0.12s;
}

.v2-btn-complete-obs:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.5);
  background: linear-gradient(135deg, #fde047 0%, #facc15 100%);
}

/* =========================================================
   COMPLETE DARK MODE — editor chrome only. Chat designs keep
   their selected colors inside the preview.
   ========================================================= */
body.v2-page.theme-dark-obsidian{
  background:#0b0f18;color:#e8edf7;color-scheme:dark
}
body.v2-page.theme-dark-obsidian *,
body.v2-page.theme-dark-obsidian{
  scrollbar-color:#53627a #111827
}
body.v2-page.theme-dark-obsidian *::-webkit-scrollbar-track{background:#111827}
body.v2-page.theme-dark-obsidian *::-webkit-scrollbar-thumb{background:#53627a;border-color:#111827}
body.v2-page.theme-dark-obsidian .v2-studio-layout,
body.v2-page.theme-dark-obsidian .v2-col-library,
body.v2-page.theme-dark-obsidian .v2-lib-grid-wrap,
body.v2-page.theme-dark-obsidian .v2-controls,
body.v2-page.theme-dark-obsidian .workspace.v2-workspace{background:#0b0f18;border-color:#28344a}
body.v2-page.theme-dark-obsidian .v2-lib-header,
body.v2-page.theme-dark-obsidian .v2-lib-cat-sidebar,
body.v2-page.theme-dark-obsidian .v2-custom-header,
body.v2-page.theme-dark-obsidian .v2-custom-body,
body.v2-page.theme-dark-obsidian .v2-preview-header{background:#111827;border-color:#28344a}
body.v2-page.theme-dark-obsidian .v2-lib-top-tabs,
body.v2-page.theme-dark-obsidian .v2-custom-tabs,
body.v2-page.theme-dark-obsidian .v2-nick-toggle-group{background:#0d1320;border-color:#34435b}
body.v2-page.theme-dark-obsidian .v2-lib-tab-btn,
body.v2-page.theme-dark-obsidian .v2-asset-card,
body.v2-page.theme-dark-obsidian .v2-ctrl-group,
body.v2-page.theme-dark-obsidian .v2-deco-slot-btn,
body.v2-page.theme-dark-obsidian .v2-part-grid .part-btn,
body.v2-page.theme-dark-obsidian .v2-crop-details,
body.v2-page.theme-dark-obsidian .v2-preset-card,
body.v2-page.theme-dark-obsidian .v2-tool-btn,
body.v2-page.theme-dark-obsidian .v2-rolling-toggle-btn,
body.v2-page.theme-dark-obsidian .v2-layer-box,
body.v2-page.theme-dark-obsidian .v2-styleshop-bar,
body.v2-page.theme-dark-obsidian .v2-design-backup-bar,
body.v2-page.theme-dark-obsidian .v2-btn-mini,
body.v2-page.theme-dark-obsidian .v2-pill,
body.v2-page.theme-dark-obsidian .v2-btn-mirror,
body.v2-page.theme-dark-obsidian .v2-icon-tool,
body.v2-page.theme-dark-obsidian .v2-num-box{
  background:#172033;border-color:#34435b;color:#cbd5e1;box-shadow:none
}
body.v2-page.theme-dark-obsidian .v2-asset-card:hover,
body.v2-page.theme-dark-obsidian .v2-lib-tab-btn:hover,
body.v2-page.theme-dark-obsidian .v2-cat-item:hover,
body.v2-page.theme-dark-obsidian .v2-btn-mini:hover,
body.v2-page.theme-dark-obsidian .v2-tool-btn:hover,
body.v2-page.theme-dark-obsidian .v2-rolling-toggle-btn:hover,
body.v2-page.theme-dark-obsidian .v2-pill:hover{background:#202b40;color:#f1f5f9;border-color:#53627a}
body.v2-page.theme-dark-obsidian .v2-asset-card.is-selected,
body.v2-page.theme-dark-obsidian .v2-lib-tab-btn.active,
body.v2-page.theme-dark-obsidian .v2-cat-item.active,
body.v2-page.theme-dark-obsidian .v2-tab-btn.active,
body.v2-page.theme-dark-obsidian .v2-pill.active,
body.v2-page.theme-dark-obsidian .v2-preset-card.selected,
body.v2-page.theme-dark-obsidian .v2-deco-slot-btn.active,
body.v2-page.theme-dark-obsidian .v2-deco-slot-wrapper.active .v2-deco-slot-btn{
  background:#282240!important;border-color:#8b5cf6!important;color:#c4b5fd!important
}
body.v2-page.theme-dark-obsidian .v2-card-thumb,
body.v2-page.theme-dark-obsidian .v2-card-thumb.frame-thumb,
body.v2-page.theme-dark-obsidian .v2-card-thumb.theme-thumb{background:#0d1320;border-color:#28344a}
body.v2-page.theme-dark-obsidian .v2-custom-upload-card{background:#17152a!important;border-color:#6d5a9d!important}
body.v2-page.theme-dark-obsidian .v2-card-thumb.upload-thumb{background:#141225;border-color:#403463}
body.v2-page.theme-dark-obsidian .v2-tab-btn,
body.v2-page.theme-dark-obsidian .v2-cat-item,
body.v2-page.theme-dark-obsidian .v2-ctrl-row label,
body.v2-page.theme-dark-obsidian .v2-slider-header label,
body.v2-page.theme-dark-obsidian .v2-toggle-label,
body.v2-page.theme-dark-obsidian .v2-layer-hint,
body.v2-page.theme-dark-obsidian .v2-preview-zoom,
body.v2-page.theme-dark-obsidian .v2-rainbow-row code{color:#9aa7bd}
body.v2-page.theme-dark-obsidian .v2-card-title,
body.v2-page.theme-dark-obsidian .v2-custom-title-row h2,
body.v2-page.theme-dark-obsidian .v2-ctrl-title,
body.v2-page.theme-dark-obsidian .v2-layer-name{color:#e8edf7}
body.v2-page.theme-dark-obsidian .v2-ctrl-title{border-color:#28344a}
body.v2-page.theme-dark-obsidian .v2-lib-search-bar input,
body.v2-page.theme-dark-obsidian .v2-hex-input,
body.v2-page.theme-dark-obsidian select,
body.v2-page.theme-dark-obsidian .v2-select{
  background-color:#0d1320!important;color:#e8edf7!important;border-color:#3a4961!important
}
body.v2-page.theme-dark-obsidian .v2-lib-search-bar input:focus{background:#111827}
body.v2-page.theme-dark-obsidian input::placeholder{color:#748198}
body.v2-page.theme-dark-obsidian select option,
body.v2-page.theme-dark-obsidian .v2-select option{background:#111827!important;color:#e8edf7!important}
body.v2-page.theme-dark-obsidian .v2-deco-slot-lock,
body.v2-page.theme-dark-obsidian .v2-deco-slot-reset,
body.v2-page.theme-dark-obsidian .v2-deco-slot-remove{background:#172033;border-color:#46566f;color:#aebbd0}
body.v2-page.theme-dark-obsidian .v2-layer-row{background:#291a25;border-color:#633044}
body.v2-page.theme-dark-obsidian .v2-layer-row.is-empty{background:#111827;border-color:#28344a}
body.v2-page.theme-dark-obsidian .v2-num-box:disabled{background:#101622;border-color:#202b3c;color:#5f6c80}
body.v2-page.theme-dark-obsidian .v2-rolling-toggle-btn.active{background:#102a25;border-color:#10b981;color:#6ee7b7}
body.v2-page.theme-dark-obsidian .v2-nick-btn.active{background:#282240;color:#c4b5fd}
body.v2-page.theme-dark-obsidian .v2-btn-temp-save{background:#10242a;color:#67e8f9;border-color:#0891b2}
body.v2-page.theme-dark-obsidian .stage{
  background-color:#0a0e17!important;
  background-image:linear-gradient(45deg,#121a29 25%,transparent 25%),linear-gradient(-45deg,#121a29 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#121a29 75%),linear-gradient(-45deg,transparent 75%,#121a29 75%)!important;
  border-color:#28344a
}

/* Broadcast fitting and media controls belong only to the local editor UI. */
.v2-broadcast-preview-link{display:inline-flex;align-items:center;white-space:nowrap;padding:8px 12px;border:1px solid #d7c9ed;border-radius:9px;background:#f2ebfb;color:#664582;font-size:12px;font-weight:700;text-decoration:none}
.v2-custom-body [data-chat-media-controls]{order:45}
.v2-preview-tools-row{flex-wrap:wrap}
/* Plan limits preserve existing saved slots while limiting their active view. */
.v2-deco-slot-wrapper.plan-limited .v2-deco-slot-btn{border-style:dashed;opacity:.65}
.v2-deco-slot-btn:disabled{cursor:default}
.v2-plan-note{margin:10px 0 0;font-size:12px;line-height:1.6;color:#64748b}
.v2-plan-note a{color:#76518f}
body.v2-page .v2-plan-add-slot{width:100%;margin-top:10px;padding:9px 10px;font-size:12px;font-weight:700;color:#68477e;background:#f4edf9;border:1px solid #cdb7dd;border-radius:9px;cursor:pointer}
body.v2-page .v2-plan-add-slot:hover{background:#eadcf5;border-color:#ae8ac8}
body.v2-page.theme-dark-obsidian .v2-plan-add-slot{color:#e3c9f3;background:#30263e;border-color:#6f527f}
.v2-plan-notice{margin:10px 0 0;padding:10px 12px;border-radius:9px;background:#f5effa;color:#684d7d;font-size:12px;line-height:1.65}
body.theme-dark-obsidian .v2-plan-note{color:#b5c0d1}
body.theme-dark-obsidian .v2-plan-note a{color:#d6bceb}
body.theme-dark-obsidian .v2-plan-notice{background:#292337;color:#d4c1e2}

/* Keep the desktop layout intact; narrow windows use readable full-width
   sections instead of squeezing three columns into single-character lines. */
body.v2-page{min-width:0}
body.v2-page .v2-studio-layout>*{min-width:0}
@media(max-width:900px){
  body.v2-page{height:auto;min-height:100vh;overflow-x:hidden;overflow-y:auto}
  body.v2-page #app{min-width:0;width:100%}
  body.v2-page .v2-studio-layout{display:flex;flex-direction:column;width:100%;height:auto;min-height:0;overflow:visible}
  body.v2-page .v2-col-library{height:560px;max-height:75vh;min-height:350px;border-right:0;border-bottom:1px solid #e2e8f0}
  body.v2-page .v2-controls{height:auto;max-height:none;overflow:visible;border-right:0;border-bottom:1px solid #e2e8f0}
  body.v2-page .v2-custom-body{flex:none;max-height:65vh;min-height:220px;overflow-y:auto}
  body.v2-page .workspace.v2-workspace{height:auto;overflow:visible;padding:12px}
  body.v2-page .stage{flex:none;height:420px;max-height:70vh;min-height:300px;padding:30px 16px}
  body.v2-page .v2-lib-cat-sidebar{width:120px}
  body.v2-page .v2-lib-grid-wrap{min-width:0}
  body.v2-page .v2-asset-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.v2-page .v2-lib-search-bar{flex-wrap:wrap}
  body.v2-page .v2-lib-search-bar input{min-width:0;flex:1}
  body.v2-page .v2-lib-tab-btn{min-width:0;white-space:normal;line-height:1.4}
  body.v2-page .v2-preview-tools-row{gap:6px}
}
