/* Pretendard Variable 폰트 로드 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.css');
@import url('https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=Do+Hyeon&family=Jua&family=Nanum+Pen+Script&display=swap');

/* CSS Variables for Theme - 유랑샵 디자인 시스템 기반 */
:root {
  /* 폰트 시스템 */
  --font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Light theme (default - 유랑샵 기본값) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --border-light: #e9ecef;
  --accent-color: #007bff;
  --accent-hover: #0056b3;
  --success-color: #28a745;
  --warning-color: #fd7e14;
  --danger-color: #dc3545;
  --shadow-color: rgba(0, 0, 0, 0.1);

  /* Layout helpers */
  --side-panel-width: 200px;
  --right-panel-width: 320px;
  --tools-panel-width: var(--side-panel-width);
}

/* Dark theme */
[data-theme="dark"] {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #888888;
  --border-color: #333333;
  --border-light: #444444;
  --accent-color: #4a9eff;
  --accent-hover: #3a8eef;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --danger-color: #f44336;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-normal);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  position: relative;
}

html {
  width: 100%;
  overflow-x: hidden;
}

/* Hide scrollbar on mobile */
@media (max-width: 992px) {
  html, body {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}

/* Header */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 60px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
  transition: color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.theme-toggle i {
  font-size: 16px;
}

.logo-sub {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.order-guide-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.order-guide-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.order-guide-btn i {
  font-size: 14px;
}

/* Order Guide Modal */
.order-guide-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.order-guide-modal.active {
  display: flex;
}

.order-guide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
}

.order-guide-content {
  position: relative;
  background: var(--bg-primary, #fff);
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.order-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color, #e5e5e5);
  background: var(--bg-secondary, #f8f9fa);
}

.order-guide-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #333);
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-guide-header h3 i {
  color: var(--primary-color, #4a9eff);
}

.order-guide-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted, #999);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.order-guide-close:hover {
  color: var(--text-primary, #333);
}

.order-guide-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

.guide-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color, #e5e5e5);
}

.guide-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.guide-section h4 {
  margin: 0 0 10px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #333);
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-section h4 i {
  color: var(--primary-color, #4a9eff);
  font-size: 16px;
}

.guide-section p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary, #666);
  line-height: 1.6;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.header-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

/* Hide header label on mobile */
@media (max-width: 768px) {
  .header-label {
    display: none;
  }

  .header-right {
    gap: 8px;
  }
}

/* Main Layout */
.main-content {
  display: grid;
  grid-template-columns: var(--side-panel-width) 1fr var(--right-panel-width);
  gap: 0;
  margin-top: 60px;
  height: calc(100vh - 60px);
}

/* Side Panel (Left) */
.side-panel {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 24px 20px;
  overflow-y: auto;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  box-shadow: 1px 0 3px var(--shadow-color);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.side-link:hover {
  color: var(--text-primary);
}

/* Tools Panel (Right) - 유랑샵 스타일 */
.tools-panel {
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  padding: 12px;
  overflow-y: auto;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  box-shadow: -1px 0 3px var(--shadow-color);
}

.layers-panel {
  display: none;
}

.mobile-panel-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 2;
}

.mobile-panel-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
}

.tool-section {
  margin-bottom: 8px;
  padding: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 1px 2px var(--shadow-color);
}

.tool-section:last-child {
  margin-bottom: 0;
}

.tool-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s ease;
}

.tool-title i {
  color: var(--accent-color);
  transition: color 0.3s ease;
  font-size: 12px;
}

/* Carrier Size Selection */
.carrier-sizes {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

/* Model Buttons */
.carrier-models {
  margin-bottom: 10px;
}

.carrier-models h4 {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.model-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.model-btn {
  padding: 6px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
}

.model-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.model-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

/* Size Buttons */
.size-btn {
  flex: 1;
  padding: 6px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.size-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.size-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

/* Color Palette */
.carrier-colors h4 {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.color-palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.color-option .color-btn {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.color-option:hover .color-btn {
  transform: scale(1.1);
}

.color-option.active .color-btn {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-color)33;
}

.color-option .color-name {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
}

.color-option.active .color-name {
  color: var(--accent-color);
  font-weight: 500;
}

/* Legacy color-btn styles for backwards compatibility */
.color-btn {
  width: 24px;
  height: 24px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.active {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-color)33;
}

.color-btn[data-color="#ffffff"] {
  border: 1px solid var(--border-light);
}

/* Text Controls */
.text-controls {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.text-input {
  flex: 1;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.add-btn {
  padding: 10px 16px;
  background: var(--accent-color);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.add-btn:hover {
  background: var(--accent-hover);
}

/* Text Options */
.text-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.font-select {
  padding: 6px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.font-size-control,
.font-color-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.font-size-control label,
.font-color-control label {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 32px;
}

.font-size-control input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
}

.font-size-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
}

#fontSizeValue {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
}

.font-color-control input[type="color"] {
  width: 40px;
  height: 32px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}

.font-style-buttons {
  display: flex;
  gap: 8px;
}

.style-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.2s ease;
}

.style-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.style-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

/* Upload Area */
.upload-area {
  border: 2px dashed #444;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 10px;
}

.upload-area.blocked {
  cursor: not-allowed;
  opacity: 0.55;
}

.upload-area:hover {
  border-color: #4a9eff;
  background: rgba(74, 158, 255, 0.05);
}

.upload-area i {
  font-size: 20px;
  color: #4a9eff;
  margin-bottom: 4px;
}

.upload-area p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Sticker Gallery */
.sticker-gallery h4 {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.sticker-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sticker-actions .design-btn {
  margin-bottom: 0;
}

/* Transform Controls */
.transform-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.transform-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transform-row label {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 35px;
}

.transform-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
}

.transform-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
}

.transform-row input[type="number"] {
  width: 50px;
  padding: 6px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-family);
  text-align: center;
}

.transform-row span {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 12px;
}

.transform-buttons {
  display: flex;
  gap: 6px;
}

.transform-btn {
  flex: 1;
  padding: 8px 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.transform-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-color);
  color: var(--text-primary);
}

.transform-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.pattern-controls {
  padding-top: 12px;
  border-top: 1px solid #333;
}

.pattern-controls > label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pattern-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pattern-input {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pattern-input span {
  font-size: 11px;
  color: var(--text-muted);
}

.pattern-input input {
  width: 40px;
  padding: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  text-align: center;
}

.pattern-btn {
  padding: 6px 12px;
  background: var(--accent-color);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s;
}

.pattern-btn:hover {
  background: var(--accent-hover);
}

/* Layer Controls */
.layer-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.layer-btn {
  flex: 1;
  padding: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.layer-btn:hover {
  border-color: var(--border-color);
  color: var(--text-primary);
}

.layer-btn.delete:hover {
  background: var(--danger-color);
  border-color: var(--danger-color);
  color: #fff;
}

.layers-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layer-item {
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.layer-item:hover {
  border-color: var(--border-color);
}

.layer-item.active {
  border-color: var(--accent-color);
  color: var(--text-primary);
}

.layer-item.locked {
  opacity: 0.6;
}

.layer-item.hidden {
  opacity: 0.4;
}

.layer-item .layer-icon {
  font-size: 12px;
  width: 16px;
  text-align: center;
}

.layer-item .layer-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-item .layer-actions {
  display: flex;
  gap: 4px;
}

.layer-item .layer-action-btn {
  width: 22px;
  height: 22px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.2s;
}

.layer-item .layer-action-btn:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.layer-item .layer-action-btn.active {
  color: var(--accent-color);
}

.layer-item .layer-action-btn.hidden-btn.active {
  color: var(--danger-color);
}

/* Canvas Section (Center) */
.canvas-section {
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: visible;
  transition: background-color 0.3s ease;
}

.canvas-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 20px;
  background: var(--bg-secondary);
  transition: background-color 0.3s ease;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 200;
}

/* Transform Toolbar */
.transform-toolbar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.transform-toolbar.visible {
  display: flex;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-btn {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn:hover {
  background: var(--border-light);
  color: var(--text-primary);
  border-color: var(--accent-color);
}

.toolbar-btn-danger:hover {
  background: var(--danger-color);
  border-color: var(--danger-color);
  color: #fff;
}

.toolbar-label {
  font-size: 12px;
  color: var(--text-muted);
}

.toolbar-input {
  width: 55px;
  padding: 6px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  text-align: center;
}

.toolbar-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.toolbar-unit {
  font-size: 11px;
  color: var(--text-muted);
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-light);
  margin: 0 4px;
}

/* Pattern Modal */
.pattern-modal {
  display: none;
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.pattern-modal.visible {
  display: block;
}

.pattern-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.pattern-modal-content h4 {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-align: center;
}

.pattern-modal-inputs {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.pattern-modal-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pattern-modal-input label {
  font-size: 11px;
  color: var(--text-muted);
}

.pattern-modal-input input {
  width: 60px;
  padding: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  text-align: center;
}

.pattern-modal-actions {
  display: flex;
  gap: 8px;
}

.pattern-modal-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.pattern-modal-btn.cancel {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.pattern-modal-btn.cancel:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.pattern-modal-btn.apply {
  background: var(--accent-color);
  color: #fff;
}

.pattern-modal-btn.apply:hover {
  background: var(--accent-hover);
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zoom-btn {
  width: 32px;
  height: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  /* Touch support for mobile */
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  position: relative;
  z-index: 10;
}

.zoom-btn:hover {
  border-color: var(--accent-color);
  color: var(--text-primary);
}

.zoom-btn-reset {
  min-width: 40px;
  width: auto;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: rgba(74, 158, 255, 0.12);
}

#zoomLevel {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 50px;
  text-align: center;
}

.toolbar-separator {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 8px;
}

#toggleRuler.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

/* Ruler visibility */
.ruler-hidden .ruler {
  display: none !important;
}

/* Canvas Wrapper */
.canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow: visible;
  position: relative;
  background: var(--bg-primary);
  transition: background-color 0.3s ease;
  --canvas-offset: max(0px, calc(var(--right-panel-width) - var(--side-panel-width)));
}

/* Mobile layout overrides */
@media (max-width: 992px) {
  .main-content {
    display: block;
    width: 100%;
    max-width: 100vw;
    overflow: visible; /* Allow handles to show */
  }

  .canvas-section {
    width: 100%;
    max-width: 100vw;
    overflow: visible; /* Allow handles to show */
  }
}

@media (max-width: 992px) {
  .canvas-wrapper {
    overflow: visible !important; /* Allow handles to show outside */
    padding: 20px 0; /* Reduce padding on mobile */
  }
}

.canvas-wrapper::before {
  content: '';
  flex: 0 0 var(--canvas-offset);
}

/* Mobile toggle button - hidden on desktop */
.mobile-toggle-btn {
  display: none;
}

/* Floating Edit Bar (always visible) */
.floating-editbar {
  position: fixed;
  top: 76px;
  left: calc(var(--tools-panel-width) + 12px);
  z-index: 1000;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  padding: 6px 10px;
  gap: 6px;
  user-select: none;
}

/* Desktop: hide mobile toggle, show menu inline */
.floating-editbar .mobile-toggle-btn {
  display: none;
}

.floating-editbar .eb-menu-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.floating-editbar .drag-handle {
  cursor: grab;
  color: var(--text-muted);
  padding: 4px 6px;
  margin-right: 4px;
}

.floating-editbar .drag-handle:active {
  cursor: grabbing;
}

.floating-editbar.dragging {
  opacity: 0.9;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}

.eb-section {
  display: flex;
  align-items: center;
  gap: 4px;
}

.eb-divider {
  width: 1px;
  height: 24px;
  background: var(--border-light);
  margin: 0 4px;
}

.eb-btn {
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 13px;
}

.eb-btn:hover {
  background: var(--accent-color);
  color: #fff;
}

.eb-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.eb-btn.disabled:hover {
  background: transparent;
  color: var(--text-secondary);
}

.eb-sub-icon {
  font-size: 8px;
  position: absolute;
  bottom: 2px;
  right: 2px;
}

.eb-align .eb-btn {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

/* Floating Transform Toolbar */
.floating-transform {
  position: fixed;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  display: none;
  user-select: none;
}

.floating-transform.visible {
  display: block;
}

.floating-transform.dragging {
  opacity: 0.9;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}

.floating-transform .floating-header {
  padding: 8px 14px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  border-radius: 10px 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  cursor: grab;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.floating-transform .floating-header:active {
  cursor: grabbing;
}

.floating-transform .floating-header i {
  color: var(--accent-color);
  margin-right: 6px;
}

.floating-transform .floating-header .drag-handle {
  color: var(--text-muted);
  margin-right: 0;
  margin-left: 10px;
}

.floating-transform .floating-content {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 10px;
}

.ft-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ft-group label {
  font-size: 11px;
  color: var(--text-muted);
}

.ft-group input {
  width: 50px;
  padding: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  text-align: center;
}

.ft-group input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.ft-group span {
  font-size: 11px;
  color: var(--text-muted);
}

.ft-btn {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ft-btn:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.ft-btn-danger:hover {
  background: var(--danger-color);
  border-color: var(--danger-color);
}

.ft-divider {
  width: 1px;
  height: 24px;
  background: var(--border-light);
}

/* Pattern Popup */
.pattern-popup {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 101;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  padding: 16px;
  display: none;
  min-width: 280px;
  user-select: none;
}

.pattern-popup.visible {
  display: block;
}

.pattern-popup.dragging {
  opacity: 0.9;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}

.pattern-popup-header {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #333;
  cursor: grab;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.pattern-popup-header:active {
  cursor: grabbing;
}

.pattern-popup-header .drag-handle {
  color: #666;
  font-size: 12px;
}

.pattern-popup-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.pattern-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pattern-section-title {
  font-size: 12px;
  color: #888;
  font-weight: 500;
}

.pattern-row-group {
  display: flex;
  gap: 12px;
}

.pattern-popup-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pattern-popup-row label {
  font-size: 12px;
  color: #aaa;
  width: 20px;
}

.pattern-popup-row input {
  width: 60px;
  padding: 8px;
  background: #333;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.pattern-popup-row input:focus {
  border-color: #4a9eff;
  outline: none;
}

.pattern-popup-row .unit {
  font-size: 11px;
  color: #666;
}

.pattern-type-group {
  display: flex;
  gap: 8px;
}

.pattern-type-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  background: #333;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.pattern-type-option:hover {
  background: #3a3a3a;
}

.pattern-type-option input[type="radio"] {
  display: none;
}

.pattern-type-option input[type="radio"]:checked + .pattern-type-icon {
  color: #4a9eff;
}

.pattern-type-option:has(input[type="radio"]:checked) {
  border-color: #4a9eff;
  background: #2a3a4a;
}

.pattern-type-icon {
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pattern-type-icon svg {
  width: 28px;
  height: 28px;
}

.pattern-type-name {
  font-size: 10px;
  color: #888;
  text-align: center;
}

.pattern-type-option:has(input[type="radio"]:checked) .pattern-type-name {
  color: #4a9eff;
}

.pattern-popup-actions {
  display: flex;
  gap: 8px;
}

.pattern-popup-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  background: #333;
  color: #888;
}

.pattern-popup-actions button:hover {
  background: #444;
  color: #fff;
}

.pattern-popup-actions button.primary {
  background: #4a9eff;
  color: #fff;
}

.pattern-popup-actions button.primary:hover {
  background: #3a8eef;
}

/* Floating Layer Panel */
.floating-layers {
  position: fixed;
  bottom: 80px;
  left: calc(var(--tools-panel-width) + 12px);
  z-index: 1000;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  width: 220px;
  max-height: 300px;
  user-select: none;
}

.floating-layers.dragging {
  opacity: 0.9;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}

.floating-layers .floating-header {
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  border-radius: 10px 10px 0 0;
  font-size: 12px;
  color: #888;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
}

.floating-layers .floating-header:active {
  cursor: grabbing;
}

.floating-layers .floating-header i {
  color: #4a9eff;
  margin-right: 6px;
}

.floating-toggle {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}

.floating-toggle:hover {
  color: #fff;
}

.floating-layers .floating-content {
  padding: 10px;
  overflow-y: auto;
  max-height: 240px;
}

.floating-layers.collapsed .floating-content {
  display: none;
}

.floating-layers.collapsed .floating-toggle i {
  transform: rotate(180deg);
}

.fl-controls {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
}

.fl-btn {
  flex: 1;
  padding: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.fl-btn:hover {
  background: var(--border-light);
  color: var(--text-primary);
  border-color: var(--accent-color);
}

.fl-btn-danger:hover {
  background: var(--danger-color);
  border-color: var(--danger-color);
}

.fl-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.carrier-container {
  position: relative;
  width: 750px;
  height: 950px;
  transform-origin: center center;
  isolation: isolate;
  overflow: visible !important;
  /* CSS transform 줌 시 렌더링 품질 개선 */
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
}

.carrier-svg {
  width: 100%;
  height: 100%;
}

.carrier-body {
  transition: fill 0.3s;
}

/* Carrier Image Styles */
.carrier-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
  z-index: 0;
  pointer-events: none;
}

.carrier-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.carrier-image.loading {
  opacity: 0.5;
}

/* 모델별 캐리어 이미지 위치 조정 - 데스크탑 */
.model-edon .carrier-image {
  margin-top: -60%;
  transform: scale(1.2);
}
@media (max-width: 992px) {
  .model-edon .carrier-image {
    margin-top: -40%;
    transform: scale(1.8);
  }
}

.model-mellow .carrier-image {
  margin-top: -30%;
  transform: scale(1.3);
}
@media (max-width: 992px) {
  .model-mellow .carrier-image {
    margin-top: -10%;
    transform: scale(2.0);
  }
}

.model-stella .carrier-image {
  margin-top: -38%;
  transform: scale(1.001);
}
@media (max-width: 992px) {
  .model-stella .carrier-image {
    margin-top: -10%;
    transform: scale(1.5);
  }
}

.model-readybag .carrier-image {
  margin-top: 0px;
  transform: scale(2.0);
}
@media (max-width: 992px) {
  .model-readybag .carrier-image {
    margin-top: 10%;
    margin-left:9% !important;
    transform: scale(1.5);
  }
}

.model-raven .carrier-image {
  margin-top: -20%;
  transform: scale(1.3);
}
@media (max-width: 992px) {
  .model-raven .carrier-image {
    margin-top: 5%;
    transform: scale(1.8);
  }
}

.design-area-overlay {
  position: absolute;
  border: 2px dashed rgba(74, 158, 255, 0.6);
  border-radius: 0;
  pointer-events: none;
  background: rgba(74, 158, 255, 0.05);
  z-index: 200; /* Ensure visibility above canvas */
}

/* Carrier Model Select */
.carrier-models {
  margin-bottom: 16px;
}

.carrier-models h4 {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.model-select-wrapper {
  position: relative;
}

.model-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.model-select:hover {
  border-color: var(--accent-color);
}

.model-select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

.model-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px;
}

.model-select option:disabled {
  color: var(--text-muted);
}

/* Carrier Sizes */
.carrier-sizes h4 {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.size-buttons {
  display: flex;
  gap: 8px;
}

/* Color Palette with Images */
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.color-btn:hover {
  transform: scale(1.1);
  border-color: var(--accent-color);
}

.color-btn.active {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-color);
}

.color-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.color-btn .color-name {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.color-btn:hover .color-name {
  opacity: 1;
}

#designCanvas {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: inherit;
  z-index: 10;
}

/* Blur overlay canvas - positioned INSIDE canvas-container between lower-canvas and upper-canvas
   JS moves this element inside .canvas-container and sets z-index: 150 inline */
#blurOverlayCanvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 150 !important; /* Between lower-canvas(1) and upper-canvas(200) */
  pointer-events: none;
  /* iOS Safari에서 CSS filter 렌더링을 위한 하드웨어 가속 */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Fabric.js creates a wrapper div and upper canvas for interactions */
.canvas-container {
  /* Fabric sets `position: relative` inline; override so it overlays the SVG design area */
  position: absolute !important;
  /* Top/left adjusted for padding - Fabric.js sets width/height inline */
  top: 20px;
  left: 10px;
  /* Remove fixed size - let Fabric.js control the size */
  /* width and height are set inline by Fabric.js */
  z-index: 100 !important;
  /* Remove border-radius to prevent clipping */
  overflow: visible !important; /* Allow controls to show outside canvas */
}

/* Clip the lower canvas to design area - controls still visible */
.canvas-container .lower-canvas {
  /* clip-path will be set dynamically via JS */
}

.upper-canvas {
  z-index: 200 !important; /* 핸들바가 blurOverlay(150) 위에 표시 */
  position: absolute !important;
  overflow: visible !important;
  clip-path: none !important; /* 절대 클리핑되지 않음 */
}

.canvas-container .lower-canvas,
.canvas-container .upper-canvas {
  /* Fabric also sets inline positioning; keep them pinned to the wrapper */
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible !important;
  /* 텍스트 및 이미지 렌더링 품질 최적화 */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}


/* Canvas Notice - top left of canvas wrapper */
.canvas-notice {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 500;
  background: rgba(var(--bg-secondary-rgb, 248, 249, 250), 0.95);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  max-width: 280px;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.canvas-notice p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
}

.canvas-notice p:not(:last-child) {
  margin-bottom: 4px;
}

.canvas-notice i {
  font-size: 10px;
  flex-shrink: 0;
}

.canvas-notice i.fa-info-circle {
  color: var(--accent-color);
}

.canvas-notice i.fa-exclamation-circle {
  color: var(--warning-color);
}

/* Hide notice on mobile */
@media (max-width: 992px) {
  .canvas-notice {
    display: none;
  }
}

/* Mobile Zoom Reset Button - top right of canvas */
.mobile-zoom-reset {
  display: none; /* Hidden by default, shown via JS */
  position: fixed;
  top: 70px;
  right: 12px;
  z-index: 10001;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-zoom-reset:active {
  transform: scale(0.95);
}

.mobile-zoom-reset.visible {
  display: flex !important;
}

/* Only show on mobile */
@media (min-width: 993px) {
  .mobile-zoom-reset {
    display: none !important;
  }
}

/* Legacy canvas-info (kept for compatibility) */
.canvas-info {
  display: none;
  padding: 12px 24px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  text-align: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.canvas-info p {
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.canvas-info i {
  margin-right: 6px;
}

/* Tools Panel (Right) extras */
.tools-panel .tool-section-right {
  margin-top: 0;
}

.quick-actions-section {
  margin-top: 8px;
}

.quick-actions-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.quick-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-color);
}

.quick-btn.primary {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--accent-color) 0%, #6c5ce7 100%);
  border-color: transparent;
  color: #fff;
}

.quick-btn.primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #333;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

.sticker-categories {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.category-btn {
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.category-btn:hover {
  border-color: var(--border-color);
  color: var(--text-primary);
}

.category-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.sticker-grid .sticker-item {
  aspect-ratio: 1;
  font-size: 32px;
}

.sticker-grid .sticker-item.sticker-image {
  background: transparent;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticker-grid .sticker-item.sticker-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Sticker category buttons */
.sticker-category-btn {
  padding: 8px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sticker-category-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.sticker-category-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

/* Design Button */
.design-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #4a9eff 0%, #6c5ce7 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 6px;
}

.design-btn.secondary {
  background: linear-gradient(135deg, #5a8bff 0%, #7b6ef6 100%);
}

.design-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
}

.design-btn i:first-child {
  font-size: 20px;
}

.design-btn span {
  flex: 1;
  text-align: left;
}

.design-btn i:last-child {
  opacity: 0.7;
}

/* New Sticker Modal */
.sticker-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.sticker-modal.active {
  display: flex;
}

.sticker-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  width: 90%;
  max-width: 800px;
  height: 80vh;
  max-height: 600px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.sticker-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.sticker-modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sticker-modal-header h3 i {
  color: var(--accent-color);
}

.sticker-modal-close {
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticker-modal-close:hover {
  background: var(--danger-color);
  color: #fff;
}

.sticker-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sticker-sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg-tertiary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.sticker-sidebar-title {
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Breadcrumb navigation */
.sticker-breadcrumb {
  padding: 8px 12px;
  border-bottom: 1px solid #333;
  display: none;
}

.sticker-breadcrumb.visible {
  display: block;
}

.sticker-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s;
}

.sticker-breadcrumb-item:hover {
  color: #4a9eff;
}

.sticker-breadcrumb-item:not(:last-child)::after {
  content: '>';
  margin: 0 6px;
  color: #555;
}

/* Category tree */
.sticker-category-tree {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Folder item with hierarchy support */
.sticker-folder-item {
  margin-bottom: 2px;
}

.sticker-folder-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.2s;
  position: relative;
  min-height: 36px; /* 터치 영역 */
  box-sizing: border-box;
}

.sticker-folder-header:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sticker-folder-header.selected {
  background: var(--accent-color);
  color: #fff;
}

.sticker-folder-header.selected .sticker-folder-count {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.sticker-folder-header.has-children {
  padding-left: 6px;
}

/* Folder toggle button */
.sticker-folder-toggle {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  font-size: 10px;
}

.sticker-folder-toggle.expanded {
  transform: rotate(90deg);
}

.sticker-folder-toggle.empty {
  width: 8px;
  opacity: 0;
  pointer-events: none;
}

/* Folder icon/image */
.sticker-folder-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.sticker-folder-image {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Folder name and count */
.sticker-folder-name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sticker-folder-count {
  font-size: 10px;
  opacity: 0.8;
  background: var(--bg-secondary);
  padding: 2px 5px;
  border-radius: 8px;
  min-width: 14px;
  text-align: center;
  flex-shrink: 0;
}

/* Folder children */
.sticker-folder-children {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 12px;
}

.sticker-folder-children.expanded {
  max-height: 1000px;
}

/* Legacy category item for backward compatibility */
.sticker-category-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}

.sticker-category-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sticker-category-item.active {
  background: var(--accent-color);
  color: #fff;
}

.sticker-category-item .cat-icon {
  font-size: 18px;
}

.sticker-category-item .cat-count {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.7;
}

.sticker-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sticker-main-header {
  padding: 14px 20px;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sticker-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sticker-back-btn {
  width: 32px;
  height: 32px;
  background: #333;
  border: none;
  border-radius: 6px;
  color: #aaa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sticker-back-btn:hover {
  background: #4a9eff;
  color: #fff;
}

.sticker-category-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.sticker-count {
  font-size: 13px;
  color: #666;
}

.sticker-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(5, 80px);
  grid-auto-rows: 80px;
  gap: 12px;
  align-content: start;
  justify-content: start;
  width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.sticker-grid-container .sticker-item {
  width: 80px;
  height: 80px;
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 36px;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
}

.sticker-grid-container .sticker-item:hover {
  border-color: var(--accent-color);
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
}

.sticker-grid-container .sticker-item.sticker-image {
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticker-grid-container .sticker-item.sticker-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.sticker-grid-container .sticker-item::after {
  content: '+';
  position: absolute;
  top: 4px;
  right: 6px;
  width: 20px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s;
  pointer-events: none;
}

.sticker-grid-container .sticker-item:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* Incompatible sticker styles */
.sticker-item.sticker-incompatible {
  opacity: 0.4;
  filter: grayscale(80%);
  cursor: not-allowed;
  position: relative;
}

.sticker-item.sticker-incompatible:hover {
  transform: none;
  border-color: #ef4444;
}

.sticker-item.sticker-incompatible::after {
  content: '' !important;
  background: none !important;
}

.incompatible-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  pointer-events: none;
}

.incompatible-overlay i {
  color: #ef4444;
  font-size: 24px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Incompatible sticker tooltip */
.sticker-item.sticker-incompatible[title]:hover::before {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  white-space: nowrap;
  border-radius: 4px;
  z-index: 100;
  margin-bottom: 4px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Hide scrollbar on mobile - must come after global scrollbar styles */
@media (max-width: 992px) {
  html, body, * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  ::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
}

/* Responsive - 유랑샵 브레이크포인트 */
@media (max-width: 1200px) {
  .main-content {
    grid-template-columns: 180px 1fr 280px;
  }

  :root {
    --side-panel-width: 180px;
    --right-panel-width: 280px;
    --tools-panel-width: var(--side-panel-width);
  }
}

/* Tablet & Mobile - 유랑샵 스타일 */
@media (max-width: 992px) {
  body {
    font-size: 14px;
    line-height: 1.5;
  }

  .main-content {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: calc(100vh - 60px);
    padding-bottom: 70px;
  }

  /* Header mobile */
  .header-container {
    padding: 0 12px;
    max-width: 100vw;
    box-sizing: border-box;
    gap: 8px;
  }

  .header-right {
    gap: 8px;
    flex-shrink: 1;
    min-width: 0;
  }

  .logo {
    flex-shrink: 1;
    min-width: 0;
  }

  .nav {
    display: none;
  }

  .side-panel {
    display: none;
  }

  .mobile-menu-btn {
    display: none !important;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
  }

  /* Tools Panel - Right drawer style */
  .tools-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(360px, 92vw);
    max-width: 92vw;
    height: 100vh;
    max-height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    border-top: none;
    border-radius: 12px 0 0 12px;
    z-index: 1100;
    overflow-y: auto;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -2px 0 10px var(--shadow-color);
  }

  .layers-panel {
    display: block;
  }

  .tools-panel .tool-section,
  .tools-panel .quick-actions-section {
    scroll-margin-top: 72px;
  }

  .tools-panel.active {
    display: block;
    transform: translateX(0);
  }

  .tools-panel::before {
    display: none;
  }

  /* Preview Panel - Bottom Sheet */
  /* Canvas Section */
  .canvas-section {
    height: 100%;
    overflow: visible !important;
  }

  .canvas-toolbar {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    padding: 8px 12px;
    flex-wrap: wrap;
    overflow-x: hidden;
    overflow-y: visible;
    min-height: 44px;
    max-width: 100vw;
    box-sizing: border-box;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 9999 !important;
    /* Ensure touch/click works on toolbar buttons */
    pointer-events: auto !important;
    touch-action: auto !important;
  }

  .canvas-toolbar .zoom-controls {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    position: relative;
    z-index: 10;
  }

  .canvas-toolbar .zoom-btn {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(74, 158, 255, 0.3);
    cursor: pointer;
  }

  .canvas-wrapper {
    padding: 12px 8px 24px;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    --canvas-offset: 0px;
    overflow: visible !important;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    /* Don't block toolbar buttons */
    pointer-events: none;
  }

  .canvas-wrapper > * {
    pointer-events: auto;
  }

  .canvas-wrapper::before {
    display: none;
  }

  .carrier-container {
    transform-origin: center center;
    overflow: visible !important;
    margin-top: 15px; /* 캐리어를 약간 아래로 이동 */
  }

  /* 모바일에서 캔버스가 캐리어 이미지 위에 표시되도록 */
  .canvas-container {
    z-index: 100 !important;
  }

  .carrier-image-wrapper {
    z-index: 1 !important;
  }

  .carrier-svg {
    width: 100%;
    height: 100%;
  }

  /* Canvas position/size is calculated dynamically by JavaScript */

  /* Floating editbar mobile - aligned with canvas-toolbar zoom buttons */
  .floating-editbar {
    position: fixed;
    top: 64px;
    left: 8px;
    right: auto;
    transform: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    gap: 0;
    width: auto;
    max-width: 200px;
    overflow: visible;
    box-sizing: border-box;
    background: transparent;
    border: none;
    box-shadow: none;
    z-index: 10000;
    margin-top: -3px !important;
    pointer-events: none;
  }

  .floating-editbar .mobile-toggle-btn,
  .floating-editbar .eb-menu-container {
    pointer-events: auto;
  }

  /* Hide dividers on mobile toolbar */
  .floating-editbar .eb-divider {
    display: none !important;
  }

  /* Toggle button always visible at top - aligned with zoom buttons */
  .floating-editbar .mobile-toggle-btn {
    order: -1;
    width: auto;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: none;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* Menu container that expands below header */
  .floating-editbar .eb-menu-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: calc(100vw - 32px);
    overflow-x: auto;
    margin-top: 8px;
    margin-left: 4px;
    scrollbar-width: none;
  }

  .floating-editbar .eb-menu-container::-webkit-scrollbar {
    display: none;
  }

  /* Hide menu when collapsed */
  .floating-editbar.collapsed .eb-menu-container {
    display: none;
  }

  .floating-editbar.collapsed .mobile-toggle-btn .toggle-icon {
    transform: rotate(180deg);
  }

  .floating-editbar .eb-section {
    flex: 0 0 auto;
    min-width: 0;
    flex-wrap: nowrap;
    display: flex;
    align-items: center;
    gap: 2px;
  }

  .floating-editbar .drag-handle {
    display: none;
  }

  .eb-section {
    gap: 2px;
  }

  .eb-btn {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }

  .eb-align {
    display: none;
  }

  .eb-divider {
    height: 20px;
  }

  /* Mobile toggle button styles */
  .mobile-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    background: var(--accent-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .floating-editbar .mobile-toggle-btn,
  .floating-transform .mobile-toggle-btn {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 10px;
  }

  .floating-transform:not(.collapsed) .mobile-toggle-btn {
    margin: 8px 8px 0;
  }

  .floating-transform:not(.collapsed) .floating-header {
    display: none;
  }

  .mobile-toggle-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
  }

  .mobile-toggle-btn .toggle-icon {
    transition: transform 0.3s ease;
  }

  /* Toggle label - always visible */
  .mobile-toggle-btn .toggle-label {
    display: inline;
    font-size: 13px;
    font-weight: 500;
  }

  /* Collapsed state for floating-editbar - hide menu container */
  .floating-editbar.collapsed .eb-menu-container {
    display: none !important;
  }

  .floating-editbar.collapsed .mobile-toggle-btn .toggle-icon {
    transform: rotate(180deg);
  }

  /* Collapsed state for floating-transform */
  .floating-transform.collapsed .floating-header,
  .floating-transform.collapsed .floating-content {
    display: none !important;
  }

  .floating-transform.collapsed {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    left: auto !important;
    right: 8px;
    bottom: 50px !important; /* 접혔을 때 y값 - 이 값 수정하세요 */
    width: auto;
    max-width: none;
    transform: none;
  }

  .floating-transform.collapsed .mobile-toggle-btn {
    width: auto;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    color: var(--text-primary);
  }

  .floating-transform.collapsed .mobile-toggle-btn .toggle-label {
    display: inline;
  }

  .floating-transform.collapsed .mobile-toggle-btn .toggle-icon {
    transform: rotate(180deg);
  }

  /* Floating transform mobile - positioned directly above canvas-info */
  .floating-transform {
    position: fixed;
    top: auto;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important; /* 펼쳐졌을 때 - 이 값 수정 */
    left: 8px;
    right: 8px;
    transform: none;
    max-width: calc(100vw - 16px);
    width: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    margin-bottom: 0;
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .floating-transform::-webkit-scrollbar {
    display: none;
  }

  .floating-transform .floating-content {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px 10px;
    width: 100%;
    min-width: 0;
    justify-content: center;
    align-items: center;
  }

  .ft-group {
    gap: 3px;
    flex-shrink: 0;
  }

  .ft-group input {
    width: 40px;
    padding: 4px;
    font-size: 12px;
  }

  .ft-group label {
    font-size: 11px;
  }

  .ft-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .ft-divider {
    height: 20px;
    margin: 0 2px;
  }

  /* Floating layers - hide on mobile by default */
  .floating-layers {
    display: none;
  }

  /* Canvas info */
  .canvas-info {
    padding: 6px 12px;
    font-size: 11px;
  }

  .canvas-info p {
    line-height: 1.35;
  }

  .canvas-info {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    z-index: 250;
    border-radius: 0;
  }

  /* Mobile Bottom Tab Bar */
  .mobile-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    padding: 8px 0;
    padding-bottom: env(safe-area-inset-bottom, 8px);
  }

  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
  }

  .mobile-tab i {
    font-size: 20px;
  }

  .mobile-tab:hover,
  .mobile-tab.active {
    color: var(--accent-color);
  }

  /* Pattern popup mobile */
  .pattern-popup {
    left: 16px;
    right: 16px;
    transform: none;
    min-width: auto;
  }

  .pattern-type-group {
    flex-direction: column;
  }

  /* Overlay for bottom sheets */
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
  }

  .mobile-overlay.active {
    display: block;
  }
}

/* Small mobile */
@media (max-width: 576px) {
  .header-container {
    padding: 0 8px;
    gap: 6px;
  }

  .logo-text {
    font-size: 18px;
    letter-spacing: 1px;
  }

  .logo-sub {
    display: none;
  }

  .order-guide-btn {
    padding: 6px 8px;
    font-size: 12px;
    margin-left: 0;
  }

  .order-guide-btn span {
    display: none;
  }

  .canvas-wrapper {
    padding: 8px 6px 20px;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    --canvas-offset: 0px;
    overflow: visible !important;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .carrier-container {
    transform-origin: center center;
    overflow: visible !important;
  }

  /* Canvas position/size is calculated dynamically by JavaScript */

  .view-btn {
    padding: 10px 14px;
    font-size: 12px;
  }

  .zoom-controls {
    gap: 8px;
  }

  .zoom-btn {
    width: 36px;
    height: 36px;
  }

  .zoom-btn.zoom-btn-reset {
    min-width: 44px;
    height: 36px;
    font-size: 10px;
    padding: 0 7px;
  }

  #zoomLevel {
    font-size: 12px;
    min-width: 40px;
  }

  .header-right {
    gap: 6px;
  }

  .theme-toggle {
    padding: 6px 8px;
    font-size: 12px;
  }

  .theme-toggle span {
    display: none;
  }

  .mobile-menu-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  /* Tools panel mobile adjustments */
  .tools-panel {
    top: 0;
    height: 100vh;
    max-height: 100vh;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .tool-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
  }

  .carrier-sizes {
    gap: 6px;
  }

  .size-btn {
    padding: 8px;
    font-size: 12px;
  }

  .color-palette {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .text-controls {
    flex-direction: column;
    gap: 8px;
  }

  .text-input {
    width: 100%;
    font-size: 16px; /* Prevent auto-zoom on iOS Safari */
  }

  .add-btn {
    width: 100%;
  }

  .upload-area {
    padding: 16px;
  }

  .upload-area i {
    font-size: 24px;
  }

  .upload-area p {
    font-size: 12px;
  }

  /* Preview panel mobile */
  .preview-3d {
    height: 150px;
  }

  .preview-carrier {
    width: 90px;
    height: 120px;
  }

  .order-details {
    padding: 12px;
  }

  .order-row {
    font-size: 12px;
    padding: 6px 0;
  }

  .action-btn {
    padding: 12px 16px;
    font-size: 13px;
  }

  .tips-section {
    padding: 12px;
  }

  .tips-section h4 {
    font-size: 12px;
  }

  .tips-list li {
    font-size: 11px;
  }

  /* Floating editbar even smaller */
  .floating-editbar {
    padding: 6px;
  }

  .eb-btn {
    width: 34px;
    height: 34px;
    font-size: 11px;
  }

  .eb-divider {
    margin: 0 2px;
  }

  /* Mobile tab adjustments */
  .mobile-tab {
    font-size: 10px;
  }

  .mobile-tab i {
    font-size: 18px;
  }
}

/* Sticker modal mobile */
@media (max-width: 768px) {
  .sticker-modal {
    align-items: flex-end;
    background: transparent; /* Remove blind effect on mobile */
  }

  .sticker-modal-content {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 70vh; /* 화면 높이의 70%로 확대 */
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
  }

  .sticker-modal-header {
    flex-shrink: 0;
  }

  .sticker-modal-body {
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .sticker-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #333;
    max-height: 180px; /* 카테고리 항목이 잘 보이도록 높이 확대 */
    flex-shrink: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .sticker-sidebar-title {
    display: none;
  }

  .sticker-category-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px 12px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }

  .sticker-category-item {
    flex-shrink: 0;
    padding: 8px 14px;
    margin: 0;
    border-radius: 20px;
    background: #2a2a2a;
    font-size: 13px;
  }

  .sticker-category-item .cat-count {
    display: none;
  }

  /* 모바일에서 카테고리 선택 전: 스티커 영역 숨김 */
  .sticker-main {
    display: none;
  }

  .sticker-main-header {
    display: none;
  }

  /* 모바일에서 카테고리 선택 후 스티커 보기 모드 */
  .sticker-modal-body.show-stickers .sticker-sidebar {
    display: none;
  }

  .sticker-modal-body.show-stickers .sticker-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .sticker-modal-body.show-stickers .sticker-main-header {
    display: flex;
    padding: 12px 16px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    align-items: center;
    justify-content: space-between;
  }

  .sticker-modal-body.show-stickers .sticker-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .sticker-modal-body.show-stickers .sticker-back-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: #333;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
  }

  .sticker-modal-body.show-stickers .sticker-back-btn:active {
    background: #444;
  }

  .sticker-modal-body.show-stickers .sticker-category-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
  }

  .sticker-modal-body.show-stickers .sticker-count {
    font-size: 13px;
    color: #888;
  }

  .sticker-grid-container {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    padding: 12px 16px;
    gap: 12px;
    overflow-y: auto;
    flex: none;
    /* 2.5줄 높이: (72px * 2.5) + (gap 12px * 1.5) + padding 24px = 222px */
    height: 222px;
    justify-items: center;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .sticker-grid-container .sticker-item {
    width: 72px;
    height: 72px;
    font-size: 30px;
  }
}

@media (max-width: 480px) {
  .sticker-grid-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 12px;
    /* 2.5줄 높이: (68px * 2.5) + (gap 10px * 1.5) + padding 24px = 209px */
    height: 209px;
  }

  .sticker-grid-container .sticker-item {
    width: 68px;
    height: 68px;
    font-size: 28px;
  }

  .sticker-modal-header {
    padding: 14px 16px;
  }

  .sticker-modal-header h3 {
    font-size: 16px;
  }

  .sticker-category-item {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Hide mobile elements on desktop */
@media (min-width: 993px) {
  .mobile-tabbar,
  .mobile-menu-btn,
  .mobile-overlay {
    display: none !important;
  }
}

/* ============================================
   Tag Conflict Warning
   ============================================ */

.tag-conflict-warning {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 400px;
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  animation: slideInRight 0.3s ease;
}

.conflict-warning-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.conflict-warning-content i {
  color: #f59e0b;
  font-size: 20px;
  margin-top: 2px;
}

.conflict-message {
  flex: 1;
}

.conflict-message strong {
  color: #92400e;
  font-size: 16px;
  display: block;
  margin-bottom: 8px;
}

.conflict-message p {
  color: #92400e;
  margin: 4px 0;
  font-size: 14px;
}

.conflict-message ul {
  margin: 8px 0 0 16px;
  padding: 0;
}

.conflict-message li {
  color: #92400e;
  font-size: 13px;
  margin: 2px 0;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   Mobile Slide Menu (Hamburger)
   ============================================ */

/* Hide hamburger button on desktop */
.mobile-menu-btn {
  display: none;
}

/* Mobile styles */
@media (max-width: 768px) {
  /* Hide hamburger button */
  .mobile-menu-btn {
    display: none !important;
  }

  /* Hide bottom tab bar */
  .mobile-tabbar {
    display: none !important;
  }

  .mobile-overlay {
    display: none;
  }

  .mobile-overlay.active {
    display: block;
  }

  .tools-panel {
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-panel-header {
    display: flex;
  }

  .canvas-info {
    bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* Slide menu overlay */
.mobile-slide-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
}

.mobile-slide-overlay.active {
  display: block;
}

/* Slide menu panel */
.mobile-slide-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background: var(--bg-secondary);
  z-index: 2000;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
  visibility: hidden;
}

.mobile-slide-menu.active {
  right: 0;
  visibility: visible;
}

.mobile-slide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.mobile-slide-header span {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-slide-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
}

.mobile-slide-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.mobile-slide-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.mobile-slide-item:hover,
.mobile-slide-item:active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.mobile-slide-item i {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

/* Hide slide menu on desktop */
@media (min-width: 769px) {
  .mobile-slide-menu,
  .mobile-slide-overlay {
    display: none !important;
  }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  pointer-events: auto;
  max-width: 90vw;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast i {
  font-size: 16px;
}

.toast span {
  font-size: 14px;
  color: var(--text-primary);
}

.toast-warning {
  border-color: #f59e0b;
  background: linear-gradient(135deg, var(--bg-secondary), rgba(245, 158, 11, 0.1));
}

.toast-warning i {
  color: #f59e0b;
}

.toast-error {
  border-color: #ef4444;
  background: linear-gradient(135deg, var(--bg-secondary), rgba(239, 68, 68, 0.1));
}

.toast-error i {
  color: #ef4444;
}

.toast-info {
  border-color: var(--accent-color);
  background: linear-gradient(135deg, var(--bg-secondary), rgba(74, 158, 255, 0.1));
}

.toast-info i {
  color: var(--accent-color);
}

.toast-clipboard {
  border-color: #111;
  background: #111;
}

.toast-clipboard i,
.toast-clipboard span {
  color: #fff;
}

@media (max-width: 768px) {
  .toast-container {
    top: 70px;
    left: 10px;
    right: 10px;
    transform: none;
  }

  .toast {
    width: 100%;
  }
}

/* ============================================
   Alert Modal (확인 버튼 있는 알림)
   ============================================ */
.alert-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.alert-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.alert-modal {
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.alert-modal-overlay.show .alert-modal {
  transform: scale(1) translateY(0);
}

.alert-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: #FEE500;
  color: #3C1E1E;
  font-weight: 600;
  font-size: 16px;
}

.alert-modal-header i {
  font-size: 20px;
}

.alert-modal-body {
  padding: 24px 20px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

.alert-modal-footer {
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border-color);
}

.alert-modal-btn {
  background: #FEE500;
  color: #3C1E1E;
  border: none;
  padding: 12px 48px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.alert-modal-btn:hover {
  background: #FAD800;
}

.alert-modal-btn:active {
  transform: scale(0.98);
}

@media (max-width: 480px) {
  .alert-modal {
    max-width: 320px;
  }

  .alert-modal-header {
    padding: 14px 16px;
    font-size: 15px;
  }

  .alert-modal-body {
    padding: 20px 16px;
    font-size: 13px;
  }

  .alert-modal-footer {
    padding: 14px 16px;
  }

  .alert-modal-btn {
    padding: 10px 40px;
    font-size: 14px;
  }
}

/* ============================================
   Mobile Bottom Sheet Menu System
   ============================================ */

/* Hide legacy mobile tabbar on mobile */
@media (max-width: 992px) {
  .mobile-tabbar {
    display: none !important;
  }
}

/* Mobile Bottom Bar */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  z-index: 2000; /* Increased to ensure visibility */
  padding: 6px 10px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

@media (max-width: 992px) {
  .mobile-bottom-bar {
    display: flex;
  }
}

.mobile-menu-buttons {
  display: flex;
  gap: 3px;
  flex: 1;
}

.mobile-menu-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 9px;
  cursor: pointer;
  padding: 5px 3px;
  transition: all 0.2s ease;
}

.mobile-menu-item i {
  font-size: 14px;
}

.mobile-menu-item span {
  font-weight: 500;
  white-space: nowrap;
}

.mobile-menu-item:hover,
.mobile-menu-item.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.mobile-order-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--accent-color);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 14px;
  height: 38px;
  transition: all 0.2s ease;
}

.mobile-order-btn:hover {
  background: var(--accent-hover);
}

.mobile-order-btn i {
  font-size: 12px;
}

/* Mobile Sheet Overlay - hidden, no dark background */
.mobile-sheet-overlay {
  display: none !important;
}

/* Mobile Bottom Sheet */
.mobile-bottom-sheet {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 50px; /* Position above the bottom bar */
  bottom: calc(50px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-primary);
  border-radius: 20px 20px 0 0;
  z-index: 1200;
  transform: translateY(calc(100% + 50px));
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 45vh; /* Increased from 30vh */
  overflow: hidden;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  visibility: hidden;
}

@media (max-width: 992px) {
  .mobile-bottom-sheet {
    display: block;
  }
}

.mobile-bottom-sheet.active {
  transform: translateY(0);
  visibility: visible;
}

/* Specific override for color picker sheet */
.mobile-bottom-sheet.color-picker-sheet {
  max-height: 75vh !important;
}

/* Text editing mode - compact sheet that doesn't block text */
.mobile-bottom-sheet.editing-mode {
  max-height: 28vh !important;
}

.mobile-bottom-sheet.editing-mode .sheet-title span {
  font-size: 14px;
}

/* Hide text input section when in editing mode */
.mobile-bottom-sheet.editing-mode .text-add-section {
  display: none !important;
}

/* Hide font and size sections in editing mode (only show color and style) */
.mobile-bottom-sheet.editing-mode .font-section,
.mobile-bottom-sheet.editing-mode .size-section {
  display: none !important;
}

/* Make sheet content scrollable in editing mode */
.mobile-bottom-sheet.editing-mode .sheet-content {
  max-height: calc(28vh - 50px);
  overflow-y: auto;
  padding-bottom: 8px;
}

/* Compact sections in editing mode */
.mobile-bottom-sheet.editing-mode .sheet-section {
  padding: 8px 16px;
}

.mobile-bottom-sheet.editing-mode .sheet-section h4 {
  margin-bottom: 6px;
  font-size: 12px;
}

/* Hide spectrum and slider tabs on mobile color picker */
.color-picker-sheet .color-tab[data-tab="spectrum"],
.color-picker-sheet .color-tab[data-tab="slider"] {
  display: none !important;
}

.color-picker-sheet #tabSpectrum,
.color-picker-sheet #tabSlider {
  display: none !important;
}

.sheet-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border-color);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  margin: 0 auto 12px;
}

.sheet-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-title span {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.sheet-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.sheet-close:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.sheet-content {
  padding: 12px 16px;
  overflow-y: auto;
  max-height: calc(45vh - 60px); /* Increased to match sheet height */
  overscroll-behavior: contain;
}

.sheet-section {
  margin-bottom: 16px;
}

.sheet-section:last-child {
  margin-bottom: 0;
}

.sheet-section h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Text sheet specific - horizontal layout for all sections */
#sheetText .sheet-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px !important;
}

#sheetText .sheet-section:last-child {
  margin-bottom: 0;
}

#sheetText .sheet-content {
  padding-bottom: 4px;
}

#sheetText .sheet-section h4 {
  margin-bottom: 0;
  white-space: nowrap;
  min-width: 45px;
  flex-shrink: 0;
}

#sheetText .sheet-section .section-content {
  flex: 1;
  min-width: 0;
}

/* Size/Color sheet specific - horizontal layout */
#sheetSizeColor .sheet-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

#sheetSizeColor .sheet-section:last-child {
  margin-bottom: 0;
}

#sheetSizeColor .sheet-content {
  padding-bottom: 4px;
}

#sheetSizeColor .sheet-section h4 {
  margin-bottom: 0;
  white-space: nowrap;
  min-width: 45px;
  flex-shrink: 0;
}

#sheetSizeColor .sheet-model-buttons,
#sheetSizeColor .sheet-size-buttons,
#sheetSizeColor .sheet-color-palette {
  flex: 1;
  min-width: 0;
}

#sheetSizeColor .sheet-size-buttons .size-btn {
  white-space: nowrap;
  padding: 8px 10px;
  font-size: 11px;
}

#sheetSizeColor .sheet-model-buttons .model-btn {
  white-space: nowrap;
  padding: 8px 10px;
  font-size: 11px;
}

/* Sheet specific styles */
.sheet-model-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sheet-size-buttons {
  display: flex;
  gap: 8px;
}

.sheet-size-buttons .size-btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
}

.sheet-color-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.sheet-content .text-controls {
  display: flex;
  flex-direction: row !important;
  gap: 8px;
  align-items: stretch;
}

.sheet-content .text-input {
  flex: 1;
  min-width: 0;
  font-size: 16px; /* iOS 자동 줌 방지 - 16px 미만이면 탭 시 줌됨 */
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sheet-content .text-input::placeholder {
  font-size: 16px;
}

.sheet-content .add-btn {
  width: auto !important;
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 11px;
  white-space: nowrap;
}

.sheet-content .font-select {
  width: 100%;
  padding: 8px 10px;
  font-size: 11px;
}

.sheet-content .font-size-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sheet-content .font-size-control input[type="range"] {
  flex: 1;
}

.sheet-content .font-style-buttons {
  display: flex;
  gap: 6px;
}

.sheet-content .font-style-buttons .style-btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 11px;
  height: auto;
  min-height: unset;
}

.sheet-content .upload-area {
  border-radius: 12px;
}

.sheet-content .sticker-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-content .sticker-actions .design-btn {
  width: 100%;
  padding: 14px 16px;
  justify-content: flex-start;
}

.sheet-content .design-btn {
  padding: 12px 16px;
}

/* Sticker bottom sheet specific styles */
#sheetSticker .sheet-section {
  display: block;
  margin-bottom: 4px !important;
}

#sheetSticker .sheet-section h4 {
  margin-bottom: 4px;
}

#sheetSticker .upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

#sheetSticker .upload-area:hover {
  border-color: var(--accent-color);
  background: var(--bg-tertiary);
}

#sheetSticker .upload-area i {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

#sheetSticker .upload-area p {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0;
}

#sheetSticker .sticker-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#sheetSticker .sticker-actions .design-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
}

#sheetSticker .sticker-actions .design-btn i:first-child {
  font-size: 14px;
}

#sheetSticker .sticker-actions .design-btn span {
  flex: 1;
  text-align: left;
  font-size: 11px;
}

#sheetSticker .sticker-actions .design-btn i.fa-chevron-right {
  opacity: 0.6;
  font-size: 12px;
}

/* Font color grid for mobile */
.font-color-grid {
  display: flex;
  flex-wrap: nowrap; /* Prevent wrapping */
  overflow-x: auto; /* Enable horizontal scroll */
  gap: 10px;
  flex: 1;
  padding: 6px; /* Space for shadows */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  mask-image: linear-gradient(to right, black 90%, transparent 100%); /* Fade out effect */
}

.font-color-grid::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.color-grid-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy pop */
  flex-shrink: 0;
  position: relative;
}

.color-grid-btn:hover {
  transform: scale(1.15);
}

.color-grid-btn.active {
  border-color: transparent;
  transform: scale(1.1);
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent-color);
  z-index: 1;
}

.color-grid-btn.active::after {
  content: '\f00c'; /* FontAwesome check */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff; /* Default check color */
  font-size: 12px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Adjust check color for light backgrounds */
.color-grid-btn[data-color="#ffffff"].active::after,
.color-grid-btn[data-color="#ffff00"].active::after,
.color-grid-btn[data-color="#ffffcc"].active::after,
.color-grid-btn[data-color="#e0e0e0"].active::after {
  color: #333;
  text-shadow: none;
}

.color-grid-btn[data-color="#ffffff"] {
  border: 1px solid var(--border-color);
}

/* Color picker row */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-custom-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.color-custom-btn:hover {
  background: var(--bg-tertiary);
}

/* Color Picker Sheet */

.color-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 12px;
}

.color-result-preview {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
}

.color-hex-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: monospace;
  font-size: 14px;
  text-transform: uppercase;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.color-apply-btn {
  padding: 10px 20px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.color-apply-btn:hover {
  background: var(--accent-hover);
}

/* Color Apply Bar (fixed at bottom) */
.color-apply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  margin: 16px -16px -16px;
  position: sticky;
  bottom: 0;
}

.color-apply-bar .color-result-preview {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
}

.color-apply-bar .color-hex-input {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-family: monospace;
  font-size: 14px;
  text-transform: uppercase;
  background: var(--bg-secondary);
}

.color-apply-bar .color-apply-btn {
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
}

/* Color Sheet Header */
.color-sheet-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.color-sheet-title span {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
}

.color-eyedropper-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.color-eyedropper-btn:hover {
  background: var(--bg-tertiary);
}

/* Color Tabs */
.color-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: 10px;
}

.color-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.color-tab:hover {
  color: var(--text-primary);
}

.color-tab.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tab Contents */
.color-tab-content {
  display: none;
}

.color-tab-content.active {
  display: block;
}

/* Color Grid Wrapper */
.color-grid-wrapper {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Full Color Grid (9x9) */
.color-full-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
}

.cgrid-btn {
  aspect-ratio: 1;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.cgrid-btn:hover {
  transform: scale(1.15);
  z-index: 1;
}

.cgrid-btn.active {
  box-shadow: 0 0 0 2px var(--accent-color);
}

.cgrid-btn.active::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: bold;
  color: var(--text-primary);
}

.cgrid-btn[data-color="#ffffff"] {
  border: 1px solid #e0e0e0;
}

.cgrid-btn[data-color="#000000"].active::after,
.cgrid-btn[data-color="#202020"].active::after,
.cgrid-btn[data-color="#404040"].active::after {
  color: #ffffff;
}

/* Saved Colors Section */
.color-saved-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
}

.color-saved-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.color-saved-grid .saved-color-btn {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  background: #ffffff;
  transition: transform 0.15s;
}

.color-saved-grid .saved-color-btn:hover {
  transform: scale(1.05);
}

.color-saved-section .add-color-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.color-saved-section .add-color-btn:hover {
  background: var(--bg-secondary);
}

/* Spectrum Canvas */
#tabSpectrum {
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

#tabSpectrum.active {
  display: flex !important;
}

#colorSpectrumCanvas {
  width: 100%;
  height: 150px;
  border-radius: 6px;
  cursor: crosshair;
  border: 1px solid var(--border-color);
  display: block;
}

#colorHueBar {
  width: 100%;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  display: block;
}

/* RGB Sliders */
#tabSlider {
  padding: 8px 0;
}

#tabSlider.active {
  display: block !important;
}

.color-slider-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.color-slider-group label {
  width: 24px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}

.color-slider-group label[for="sliderR"],
.color-slider-group label:first-child {
  color: #e53935;
}

.color-slider-group:nth-child(2) label {
  color: #43a047;
}

.color-slider-group:nth-child(3) label {
  color: #1e88e5;
}

.color-slider-group input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 12px;
  border-radius: 6px;
  outline: none;
}

#sliderR {
  background: linear-gradient(to right, #000, #ff0000);
}

#sliderG {
  background: linear-gradient(to right, #000, #00ff00);
}

#sliderB {
  background: linear-gradient(to right, #000, #0000ff);
}

.color-slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 3px solid #333;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.color-slider-group input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 3px solid #333;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.color-slider-group span {
  width: 40px;
  text-align: center;
  font-family: monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: 4px;
}

/* Color picker sheet scroll fix */
.color-picker-sheet .sheet-content {
  max-height: 75vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: 100px; /* Increased to ensure bottom visibility */
}

#tabGrid {
  padding-bottom: 60px;
}

#tabSpectrum {
  padding-bottom: 60px;
  flex-direction: column;
  align-items: center;
  gap: 20px; /* Add gap for scrolling space */
}

/* Add margin to canvas to allow touch scrolling on sides */
#colorSpectrumCanvas {
  margin: 10px 0;
  touch-action: none; /* Prevent scroll when touching canvas */
}

#colorHueBar {
  touch-action: none;
}

#tabSlider {
  padding-bottom: 60px;
  padding-top: 10px;
}

/* Canvas wrapper adjustment when sheet is open */
@media (max-width: 768px) {
  /* Add transition to carrier container by default */
  .carrier-container {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .canvas-section.sheet-open {
    padding-bottom: 0;
  }

  .canvas-section.sheet-open .canvas-wrapper {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative !important;
  }

  .canvas-section.sheet-open .carrier-container {
    /* Position/transform controlled by JavaScript for zoom support */
    z-index: 1;
    transition: transform 0.2s ease;
  }

  /* Ensure toolbar stays above when sheet is open */
  .canvas-section.sheet-open .canvas-toolbar {
    z-index: 9999 !important;
    pointer-events: auto !important;
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .canvas-section.sheet-open .canvas-toolbar .zoom-btn,
  .canvas-section.sheet-open .canvas-toolbar .zoom-controls {
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
  }

  /* Ensure floating-editbar stays visible when sheet is open - above canvas-toolbar */
  .canvas-section.sheet-open .floating-editbar {
    z-index: 10000 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Adjust canvas info when sheet open */
  .canvas-section.sheet-open .canvas-info {
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  /* Hide some buttons on mobile toolbar */
  .floating-editbar .eb-align,
  .floating-editbar #ebGroup,
  .floating-editbar #ebUngroup,
  .floating-editbar #ebFlipH,
  .floating-editbar #ebFlipV,
  .floating-editbar #ebPattern {
    display: none !important;
  }

  .floating-editbar .eb-section:has(#ebGroup),
  .floating-editbar .eb-section:has(#ebFlipH),
  .floating-editbar .eb-section:has(#ebPattern) {
    display: none !important;
  }

  /* Bottom bar stays in place - sheet appears above it */
  .mobile-bottom-bar {
    z-index: 1000;
  }
}

/* =====================================================
   Ruler / Size Indicator Styles
   ===================================================== */

.ruler {
  position: absolute;
  z-index: 5;
}

.ruler-track,
.ruler-ticks,
.ruler::before,
.ruler::after {
  display: none !important;
}

.ruler-top {
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ruler-top::before {
  content: '';
  display: block !important;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(74, 158, 255, 0.5);
}

.ruler-top::after {
  content: '';
  display: block !important;
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 8px;
  transform: translateY(-50%);
  border-left: 1px solid rgba(74, 158, 255, 0.6);
  border-right: 1px solid rgba(74, 158, 255, 0.6);
  background: transparent;
}

.ruler-top .ruler-label {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary, #666);
  background: var(--bg-primary, #fff);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  border: 1px solid rgba(74, 158, 255, 0.3);
}

.ruler-left {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ruler-left::before {
  content: '';
  display: block !important;
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(74, 158, 255, 0.5);
}

.ruler-left::after {
  content: '';
  display: block !important;
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: 8px;
  transform: translateX(-50%);
  border-top: 1px solid rgba(74, 158, 255, 0.6);
  border-bottom: 1px solid rgba(74, 158, 255, 0.6);
  background: transparent;
}

.ruler-left .ruler-label {
  position: relative;
  z-index: 1;
  transform: rotate(-90deg);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary, #666);
  background: var(--bg-primary, #fff);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  border: 1px solid rgba(74, 158, 255, 0.3);
}

@media (max-width: 992px) {
  .ruler-top .ruler-label,
  .ruler-left .ruler-label {
    font-size: 10px;
    padding: 1px 6px;
  }
}

/* =====================================================
   Carrier Size Ruler Styles (Overall Carrier Dimensions)
   ===================================================== */

.carrier-ruler {
  position: absolute;
  z-index: 10;
  pointer-events: none;
}

.carrier-ruler-line {
  display: none;
}

.carrier-ruler-top {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
}

.carrier-ruler-top::before {
  content: '';
  display: block;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(76, 175, 80, 0.35);
}

.carrier-ruler-top::after {
  content: '';
  display: block;
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 8px;
  transform: translateY(-50%);
  border-left: 1px solid rgba(76, 175, 80, 0.4);
  border-right: 1px solid rgba(76, 175, 80, 0.4);
  background: transparent;
}

.carrier-ruler-top .carrier-ruler-label {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary, #666);
  background: var(--bg-primary, #fff);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.carrier-ruler-left {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
}

.carrier-ruler-left::before {
  content: '';
  display: block;
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(76, 175, 80, 0.35);
}

.carrier-ruler-left::after {
  content: '';
  display: block;
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: 8px;
  transform: translateX(-50%);
  border-top: 1px solid rgba(76, 175, 80, 0.4);
  border-bottom: 1px solid rgba(76, 175, 80, 0.4);
  background: transparent;
}

.carrier-ruler-left .carrier-ruler-label {
  position: relative;
  z-index: 1;
  transform: rotate(-90deg);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary, #666);
  background: var(--bg-primary, #fff);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

/* Hide carrier rulers when ruler is hidden */
.ruler-hidden .carrier-ruler {
  display: none !important;
}

@media (max-width: 992px) {
  .carrier-ruler-top .carrier-ruler-label,
  .carrier-ruler-left .carrier-ruler-label {
    font-size: 9px;
    padding: 1px 5px;
  }
}

/* Make grid buttons square with rounded corners */
.cgrid-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cgrid-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 1;
}

/* Specific border for white/light colors */
.cgrid-btn[data-color="#ffffff"],
.cgrid-btn[data-color="#e0e0e0"],
.cgrid-btn[data-color="#ffffcc"] {
  border: 1px solid var(--border-color);
}

/* Saved color item specific styles (can reuse cgrid-btn) */
.saved-color-item {
  position: relative;
}

.saved-color-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--danger-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
  z-index: 2;
}

.saved-color-item:hover .saved-color-remove {
  opacity: 1;
}
