:root {
  /* Gdoop Droh Dark Theme Colors */
  --bg-base: #1c1c1e;
  --bg-surface: #0c0c0c;
  --bg-surface-hover: #141414;
  --bg-surface-active: #3a3a3c;

  --border-light: #131313;
  --border-focus: #007aff;

  --text-primary: #ffffff;
  --text-secondary: #8e8e93;
  --text-muted: #636366;

  --accent: #0a84ff; /* Apple-ish blue often used in neat dark themes */
  --accent-hover: #006ee6;

  --danger: #ff453a;
  --danger-hover: #ff2a1f;

  --canvas-bg: #292929;
  --canvas-dot: rgba(255, 255, 255, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  font-size: 13px;
  user-select: none;
}
.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Top Navigation */
.topbar {
  height: 32px;
  background-color: var(--bg-surface);
  display: flex;
  align-items: stretch;
  padding-left: 12px;
  z-index: 20;
  overflow: visible;
}

.logo {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  padding: 0;
  flex-shrink: 0;
}
.home-logo {
  width: 120px;
}
.logo img {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 4px;
}

.workspace-tabs {
  display: flex;
  height: 100%;
  align-items: flex-end;
  margin-left: 4px;
  flex: 1;
  min-width: 0;
  gap: 2px;
  overflow-x: auto;
  overflow-y: visible;
}

.workspace-tabs::-webkit-scrollbar,
.sidebar-left::-webkit-scrollbar,
.tools-group::-webkit-scrollbar,
.sidebar-right::-webkit-scrollbar,
.layers-list::-webkit-scrollbar,
.props-section::-webkit-scrollbar,
.export-section::-webkit-scrollbar {
  display: none;
}

.workspace-tabs,
.sidebar-left,
.tools-group,
.sidebar-right,
.layers-list,
.props-section,
.export-section {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

.topbar-actions {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 12px;
  margin-left: auto;
  padding: 0 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 30;
}

.zoom-dropdown {
  background-color: var(--bg-base);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  margin-bottom: 3px;
}

.zoom-dropdown:focus {
  border-color: var(--border-focus);
}

.btn-pro {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  border: none;
  border-radius: 0;
  padding: 0 16px;
  height: 30px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition:
    opacity 0.2s,
    transform 0.1s;
}

.btn-pro:hover {
  opacity: 0.9;
}

.btn-pro:active {
  transform: scale(0.96);
}

.workspace-tab {
  height: 32px;
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: grab;
  user-select: none;
  min-width: 100px;
  max-width: 200px;
  position: relative;
  transition:
    background-color 0.2s,
    color 0.2s;
  box-sizing: border-box;
  align-self: flex-end;
}

.workspace-tab:active {
  cursor: grabbing;
}

.workspace-tab:not(.active):hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

.workspace-tab.active {
  background-color: var(--canvas-bg);
  color: var(--text-primary);
}

/* Ensure the active tab borders cover the topbar bottom border to connect visibly to the canvas */
.workspace-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--canvas-bg);
}

.btn-new-workspace-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 0.5rem;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s,
    color 0.2s;
  margin-left: 4px;
  align-self: flex-end;
}

.btn-new-workspace-tab:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

.tab-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-close-btn {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0;
  padding: 2px 4px;
  border-radius: 3px;
  transition:
    opacity 0.15s,
    color 0.15s,
    background 0.15s;
  flex-shrink: 0;
  cursor: pointer;
}

.workspace-tab:hover .tab-close-btn {
  opacity: 1;
}

.tab-close-btn:hover {
  color: #ff453a;
  background: rgba(255, 69, 58, 0.12);
  opacity: 1;
}

.tab-rename-input {
  flex: 1;
  width: 100%;
  background: var(--bg-surface-active);
  color: var(--text-primary);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 13px;
  outline: none;
}

.tab-more-btn {
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-more-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.tab-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 4px;
  z-index: 1000;
  display: none;
  flex-direction: column;
  min-width: 120px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.tab-menu.show {
  display: flex;
}

.tab-menu-item {
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-menu-item:hover {
  background-color: var(--bg-surface-hover);
}

.tab-menu-item.danger:hover {
  background-color: rgba(255, 69, 58, 0.1);
  color: var(--danger);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.logo i {
  color: var(--text-primary);
  font-size: 16px;
}

.actions {
  display: flex;
  gap: 8px;
}

.hidden-input {
  display: none;
}

.btn {
  border: none;
  background: transparent;
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  font-size: 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover {
  background-color: var(--bg-surface-hover);
}

.btn-icon-text {
  border: 1px solid var(--border-light);
}

.btn-danger {
  background-color: rgba(255, 69, 58, 0.1);
  color: var(--danger);
}

.btn-danger:hover {
  background-color: rgba(255, 69, 58, 0.2);
}

.w-100 {
  width: 100%;
}

/* Main Layout */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Home Screen Overlay */
.home-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 4rem;
  z-index: 50;
  text-align: center;
}

.home-screen.hidden {
  display: none;
}

.home-screen h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.home-screen p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 40px;
}

/* Home Tabs */
.home-tabs-container {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
}

.home-tabs-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.home-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
}

.home-tab-btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

.home-tab-btn.active {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
}

.home-tab-content {
  display: none;
  width: 100%;
}

.home-tab-content.active {
  display: block;
}
.home-screen footer p {
  font-size: 0.8rem;
}
.home-screen footer a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-right: 0.3rem;
}
/* Recent Workspaces Grid */
.recent-workspaces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
}

.recent-card {
  background-color: var(--bg-surface-hover);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
}

.recent-card:hover {
  border-color: var(--accent);
  background-color: var(--bg-surface-active);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.recent-card .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  word-wrap: break-word;
}

.recent-card .meta {
  font-size: 12px;
  color: var(--text-muted);
}
/* Left Sidebar - Tools */
.sidebar-left {
  width: 40px;
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
  z-index: 10;
  justify-content: space-between;
}

.tools-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.sidebar-bottom-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding-bottom: 12px;
}

.tool-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-size: 14px;
}

.tool-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
}

.tool-btn.active {
  color: var(--accent);
  background-color: rgba(10, 132, 255, 0.15);
}

.divider {
  height: 1px;
  background-color: var(--border-light);
  width: 24px;
  margin: 4px 0;
}

/* Center Canvas Area */
.canvas-area {
  flex: 1;
  background-color: var(--canvas-bg);
  position: relative;
  overflow: auto;
}

canvas {
  background: transparent;
  position: absolute;
  top: 0;
  left: 0;
  cursor: crosshair;
}

body.is-panning canvas {
  cursor: grab !important;
}

body.is-panning.is-dragging-pan canvas {
  cursor: grabbing !important;
}

/* Right Sidebar - Layers & Properties */
.sidebar-right {
  width: 260px;
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}
.sidebar-right input {
  background: transparent !important;
  border: none !important;
}
.panel-section {
  display: flex;
  flex-direction: column;
}

.layers-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.props-section,
.export-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.horizontal-divider {
  height: 1px;
  background-color: var(--border-light);
  width: 100%;
}

.section-header {
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-base);
}

.section-header h3 {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Sidebar Tabs */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-surface);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.tab-content.active {
  display: flex;
}

/* Layers List */
.layers-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.layer-item {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background-color 0.1s;
}

.layer-item:hover {
  background-color: var(--bg-surface-hover);
}

.layer-item.selected {
  background-color: rgba(10, 132, 255, 0.15);
  color: var(--accent);
  border-radius: 4px;
}

.layer-item[draggable="true"] {
  cursor: grab;
}

.layer-item[draggable="true"]:active {
  cursor: grabbing;
}

.layer-icon {
  color: var(--text-secondary);
  font-size: 12px;
  width: 16px;
  text-align: center;
}

.layer-item.selected .layer-icon {
  color: var(--accent);
}

.layer-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

/* Layer action buttons (eye + lock) */
.layer-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.layer-item:hover .layer-actions {
  opacity: 1;
}

/* Always show actions when state is active (hidden or locked) */
.layer-item.layer-hidden .layer-actions,
.layer-item.layer-locked .layer-actions {
  opacity: 1;
}

.layer-action-btn {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  padding: 0;
  transition:
    color 0.15s,
    background 0.15s;
}

.layer-action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

/* Hidden layer: dimmed name + eye-slash icon highlighted */
.layer-item.layer-hidden {
  opacity: 0.45;
}

.layer-item.layer-hidden .layer-visibility-btn {
  color: var(--text-muted);
  opacity: 1;
}

/* Locked layer: lock icon highlighted */
.layer-item .layer-lock-btn.active,
.layer-item.layer-locked .layer-lock-btn {
  color: var(--accent);
}

.layer-rename-input {
  flex: 1;
  background: var(--bg-base);
  color: var(--text-primary);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 13px;
  outline: none;
  width: 100%;
}

/* Properties Content */
.props-content {
  padding: 16px;
}

.empty-state {
  color: var(--text-secondary);
  text-align: center;
  padding: 40px 0;
  font-style: italic;
}

.hidden {
  display: none !important;
}

.type-indicator {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

#prop-type-badge {
  background-color: var(--bg-surface-hover);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prop-group {
  margin-bottom: 16px;
}

.prop-group.row {
  display: flex;
  gap: 12px;
}
.prop-group .row {
  display: flex;
}
.prop-group .row .prop-field {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.prop-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: transparent !important;
  border: none !important;
}
#prop-opacity {
  margin-left: 1.5rem;
  width: 100%;
}

.prop-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 11px;
  outline: none;
  font-weight: 500;
  text-align: right;
}

.prop-field input[type="text"],
.prop-field input[type="number"] {
  width: 100%;
  border: none;
  color: var(--text-primary);
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 11px;
  text-align: right;
}

.prop-field input:focus {
  border-color: var(--border-focus);
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-unit input {
  padding-right: 18px !important;
}

.input-unit {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
}

.text-area-input {
  width: 100%;
  background-color: transparent;
  border: none;
  color: var(--text-primary);
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 11px;
  min-height: 40px;
  resize: vertical;
  text-align: left !important;
}

.prop-group label,
.prop-field label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.prop-group.row .prop-field {
  flex-direction: row;
  align-items: center;
  background-color: transparent;
  border: none;
  border-radius: 4px;
  padding: 0 8px;
  transition: border-color 0.2s;
}

.prop-group.row .prop-field label {
  width: 12px;
  color: var(--text-muted);
}

.prop-group.row .prop-field:focus-within {
  border-color: var(--border-focus);
}

input[type="number"],
input[type="text"],
textarea,
select {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 6px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

select {
  cursor: pointer;
}

select option {
  background-color: var(--bg-surface);
}

textarea {
  background-color: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  resize: vertical;
  padding: 8px;
}

textarea:focus {
  border-color: var(--border-focus);
}

input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: var(--border-light);
  outline: none;
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  -moz-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
}

.custom-prop.frame-prop {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  margin-top: 4px;
  position: relative;
}

.color-picker-wrapper:focus-within {
  border-color: var(--border-focus);
}

.color-preview {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: #000;
  cursor: pointer;
}

input[type="color"] {
  display: none;
}

/* Custom Color Picker Popover */
#custom-color-picker {
  position: fixed;
  top: 100px; /* Overwritten by JS based on trigger position */
  left: 200px;
  width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  user-select: none;
}

#custom-color-picker.hidden {
  display: none;
}

.cp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
}

.cp-tabs {
  display: flex;
  gap: 8px;
}

.cp-tab {
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.5;
  transition:
    opacity 0.2s,
    background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cp-tab:hover {
  background: var(--bg-surface-hover);
  opacity: 0.8;
}

.cp-tab.active {
  background: var(--bg-surface-active);
  opacity: 1;
}

.cp-close {
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
}
.cp-close:hover {
  color: #fff;
}

#cp-gradient-area {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
}

.cp-gradient-track-wrap {
  position: relative;
  height: 12px;
  border-radius: 6px;
  background: var(--bg-surface-active);
}

#cp-gradient-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#cp-gradient-stops {
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  bottom: -2px;
  pointer-events: none; /* Let container handle clicks, stops re-enable */
}

.cp-grad-stop {
  position: absolute;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  transform: translateX(-8px);
  cursor: grab;
  pointer-events: auto;
}
.cp-grad-stop:active {
  cursor: grabbing;
}
.cp-grad-stop.active-stop {
  border-color: var(--accent);
  z-index: 2;
}

.cp-saturation-area {
  position: relative;
  width: 100%;
  height: 150px;
  cursor: crosshair;
  background: red; /* Base Hue color */
}

.cp-sat-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: red; /* Overwritten by JS Hue */
}

.cp-sat-white {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}

.cp-sat-black {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, #000, rgba(0, 0, 0, 0));
}

.cp-sat-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  transform: translate(-6px, -6px);
  pointer-events: none;
}

.cp-controls-area {
  padding: 12px;
}

.cp-sliders {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cp-slider-track {
  position: relative;
  height: 12px;
  border-radius: 6px;
  cursor: pointer;
}

.cp-hue-track {
  background: linear-gradient(
    to right,
    #f00 0%,
    #ff0 17%,
    #0f0 33%,
    #0ff 50%,
    #00f 67%,
    #f0f 83%,
    #f00 100%
  );
}

.cp-alpha-track {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8"><rect width="4" height="4" fill="%23ccc"/><rect x="4" y="4" width="4" height="4" fill="%23ccc"/><rect x="4" width="4" height="4" fill="%23fff"/><rect y="4" width="4" height="4" fill="%23fff"/></svg>');
}

.cp-alpha-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 6px;
  background: linear-gradient(
    to right,
    rgba(255, 0, 0, 0),
    rgba(255, 0, 0, 1)
  ); /* overriden by JS */
}

.cp-slider-thumb {
  position: absolute;
  top: -2px;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transform: translateX(-8px);
  pointer-events: none;
}

.cp-inputs {
  display: flex;
  border-top: 1px solid var(--border-light);
  background: var(--bg-base);
  border-radius: 0 0 6px 6px;
}

.cp-input-group {
  display: flex;
  align-items: center;
  padding: 8px 12px;
}

.cp-input-group.hex-group {
  flex: 3;
  position: relative;
  border-right: 1px solid var(--border-light);
}
.cp-input-group.alpha-group {
  flex: 1;
}
.cp-input-group.angle-group {
  flex: 1;
  border-left: 1px solid var(--border-light);
}

.cp-eyedropper {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.cp-eyedropper:hover {
  color: var(--primary);
}

.cp-input-group input {
  width: 100%;
  background: transparent;
  color: var(--text-primary);
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  text-align: right; /* Injected property */
}
.cp-input-group.hex-group input {
  padding: 4px 26px 4px 6px;
  text-align: left;
}
.cp-input-group label {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 8px;
}

.color-hex-input {
  flex: 1;
  text-transform: uppercase;
  font-family: monospace;
  padding: 2px !important;
}

.separator-line {
  height: 1px;
  background-color: var(--border-light);
  margin: 16px 0;
}

.export-section {
  padding: 16px;
}

.export-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #333;
  color: white;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  background-color: #007aff;
}
.toast.error {
  background-color: var(--danger);
}

/* ─── Text Alignment Button Groups ─── */
.text-align-btn,
.text-valign-btn {
  flex: 1;
  height: 26px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
  padding: 0;
  min-width: 0;
}

.text-align-btn:hover,
.text-valign-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.text-align-btn.active,
.text-valign-btn.active {
  background: rgba(10, 132, 255, 0.15);
  border-color: rgba(10, 132, 255, 0.4);
  color: var(--accent);
}

.text-align-divider {
  width: 1px;
  height: 22px;
  background: var(--border-light);
  align-self: center;
  flex: 0 0 1px;
  margin: 0 2px;
}

/* Prop field within .prop-group (non-row) should have panel border */
.prop-group .prop-field:not(.prop-group.row .prop-field) {
  background-color: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  flex-direction: row;
  align-items: center;
  padding: 0 8px;
  transition: border-color 0.2s;
}

.prop-group .prop-field:not(.prop-group.row .prop-field):focus-within {
  border-color: var(--border-focus);
}

.prop-group .prop-field:not(.prop-group.row .prop-field) label {
  color: var(--text-muted);
  width: 14px;
  flex-shrink: 0;
}

.prop-group .prop-field:not(.prop-group.row .prop-field) input {
  padding: 5px 4px;
}

/* ─── Custom Smooth Scrollbars ─── */

/* Global thin scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Webkit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Layers list scrollbar */
.layers-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}
.layers-list::-webkit-scrollbar-thumb:hover {
  background: rgba(10, 132, 255, 0.45);
}

/* Properties panel scrollbar */
.props-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}
.props-section::-webkit-scrollbar-thumb:hover {
  background: rgba(10, 132, 255, 0.45);
}

/* Workspace tabs horizontal scrollbar — keep invisible */
.workspace-tabs::-webkit-scrollbar {
  height: 0;
}

/* Custom Context Menu */
.context-menu {
  position: absolute;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  min-width: 200px;
  z-index: 9999;
  padding: 4px;
}

.context-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.context-menu li {
  padding: 8px 12px;
  margin: 2px 0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
  font-size: 13px;
  transition: background 0.1s;
}

.context-menu li span i {
  width: 16px;
  margin-right: 6px;
  color: var(--text-secondary);
  text-align: center;
}

.context-menu li:hover {
  background: var(--bg-surface-hover);
}

.context-menu li.danger:hover {
  background: rgba(255, 69, 58, 0.2);
  color: #ff453a;
}

.context-menu li.danger:hover span i {
  color: #ff453a;
}

.context-menu .shortcut {
  color: var(--text-muted);
  font-size: 11px;
}

.context-menu .separator {
  height: 1px;
  background: var(--border-light);
  margin: 4px 8px;
}

/* ── Path Edit Toolbar ─────────────────────────────────────── */
.path-edit-toolbar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1c1c1e;
  border: 1px solid #2c2c2e;
  border-radius: 12px;
  padding: 7px 14px;
  z-index: 300;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
  pointer-events: all;
  user-select: none;
  white-space: nowrap;
}

.path-edit-toolbar.hidden {
  display: none;
}

.pe-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding-right: 4px;
}

.pe-divider {
  width: 1px;
  height: 20px;
  background: #2c2c2e;
  margin: 0 4px;
}

.pe-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  transition:
    background 0.15s,
    color 0.15s;
}

.pe-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}

.pe-btn.active {
  background: rgba(10, 132, 255, 0.18);
  color: var(--accent);
}

.pe-finish-btn {
  background: var(--accent);
  color: #ffffff !important;
  font-weight: 600;
  padding: 5px 14px;
}

.pe-finish-btn:hover {
  background: var(--accent-hover) !important;
  color: #fff !important;
}

.pe-modes {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.pe-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.pe-mode-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.pe-mode-btn.active {
  background: #3a3a3c;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.text-editor-textarea {
  position: fixed;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  resize: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  z-index: 1000;
  line-height: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  text-align: inherit;
}

/* Custom Context Menu */
.context-menu {
  position: fixed;
  z-index: 9999;
  background-color: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  min-width: 180px;
  padding: 6px;
  user-select: none;
  backdrop-filter: blur(10px);
}

.context-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.context-menu li {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: background-color 0.15s ease;
}

.context-menu li i {
  margin-right: 8px;
  width: 14px;
  text-align: center;
  color: var(--text-secondary);
}

.context-menu li .shortcut {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 12px;
}

.context-menu li:hover {
  background-color: var(--bg-surface-active);
}

.context-menu li.danger {
  color: #ff453a;
}

.context-menu li.danger:hover {
  background-color: rgba(255, 69, 58, 0.15);
}

.context-menu .separator {
  height: 1px;
  background-color: var(--border-light);
  margin: 4px 0;
}

/* Multi-select Layout Panel */
.prop-label-sm {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.layout-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.layout-btn {
  width: 30px;
  height: 30px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.layout-btn:hover {
  background: var(--bg-surface-active);
  border-color: #0a84ff;
  color: #0a84ff;
}

.layout-btn:active {
  background: rgba(10, 132, 255, 0.18);
}

/* Image Properties Adjustments */
.image-adjust-row {
  display: grid;
  grid-template-columns: 70px 1fr 40px;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.image-adjust-row label {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.adjust-num {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 11px;
  text-align: right;
  width: 100%;
}

/* ── Zoom Sidebar Popover ─────────────────────────────── */
.zoom-sidebar-wrap {
  position: relative;
}

.zoom-popover {
  position: absolute;
  left: calc(100% + 10px);
  bottom: 0;
  width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 14px 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zoom-popover.hidden {
  display: none;
}

.zoom-popover-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#zoom-popover-pct {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.zoom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: var(--border-light);
  outline: none;
  cursor: pointer;
}

.zoom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-base);
  box-shadow: 0 0 0 2px var(--accent);
  transition: transform 0.1s;
}

.zoom-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.zoom-popover-presets {
  display: flex;
  gap: 4px;
}

.zoom-popover-presets button {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 10px;
  padding: 4px 2px;
  cursor: pointer;
  transition: all 0.15s;
}

.zoom-popover-presets button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Mobile View Blocker Styles */
.mobile-blocker {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(12, 12, 12, 0.95);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.mobile-blocker-content {
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  animation: mobileBlockerFadeIn 0.5s ease-out;
}

@keyframes mobileBlockerFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-icon-wrapper > .fa-desktop {
  font-size: 80px;
  color: var(--accent);
  filter: drop-shadow(0 0 20px rgba(10, 132, 255, 0.3));
}

.mobile-cross {
  position: absolute;
  bottom: -10px;
  right: -10px;
  background: var(--bg-surface);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.mobile-cross > .fa-mobile-screen-button {
  font-size: 24px;
  color: var(--text-muted);
}

.cross-line {
  position: absolute;
  width: 32px;
  height: 3px;
  background-color: var(--danger);
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 69, 58, 0.5);
}

.mobile-blocker h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, #aaa 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mobile-blocker p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.mobile-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-radius: 100px;
}

.mobile-footer img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.mobile-footer span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* Media Query to show blocker on mobile/small screens */
@media (max-width: 850px) {
  .mobile-blocker {
    display: flex;
  }
}
