@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-app: #202225;
  --bg-shell: #2b2d30;
  --bg-top: linear-gradient(180deg, #3a3d41 0%, #2f3236 100%);
  --bg-panel: linear-gradient(180deg, #32353a 0%, #2a2d31 100%);
  --bg-panel-2: #282b2f;
  --bg-panel-3: #24272b;
  --bg-canvas: #24272b;
  --bg-input: #1f2226;
  --bg-hover: rgba(255,255,255,0.05);
  --bg-active: rgba(61, 121, 196, 0.28);
  --border: #1c1e21;
  --border-strong: #121416;
  --border-soft: rgba(255,255,255,0.05);
  --text: #d8dadd;
  --text-dim: #b7bcc2;
  --text-faint: #8b929a;
  --accent: #3d79c4;
  --accent-2: #5f9ded;
  --success: #63b56d;
  --danger: #cb5c5c;
  --warning: #d2a24c;
  --shadow-lg: 0 18px 32px rgba(0,0,0,0.34);
  --shadow-md: 0 10px 18px rgba(0,0,0,0.28);
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 3px;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: 'IBM Plex Sans', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(180deg, #26292d 0%, #1f2125 100%);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #26292d; }
::-webkit-scrollbar-thumb {
  background: #4a5057;
  border: 2px solid #26292d;
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover { background: #59616a; }

input, select, textarea, button {
	font-family: inherit;
}


/* ── Status bar (replaces chip) ── */
.status-bar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 2px;
  border: 1px solid #1c1e20;
  background: linear-gradient(180deg, #3d4146 0%, #303338 100%);
  font-size: 10px;
}

.status-model {
  color: var(--text-faint);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: var(--success);
  box-shadow: 0 0 6px rgba(99,181,109,0.35);
  flex-shrink: 0;
}

/* ── Gen area model info ── */
.gen-model {
  margin-top: 14px;
  padding: 5px 8px;
  border: 1px solid #1e2124;
  border-radius: 2px;
  background: #25282d;
  font-size: 10px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 6px;
}

.gen-model-status {
  color: var(--success);
  font-size: 9px;
}

/* ── API security note ── */
.api-security-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 2px;
  background: rgba(255,255,255,.02);
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-faint);
}

.api-security-note svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Toolbar Dropdowns (Add / Export) ── */
.tool-dd {
  position: relative;
  display: inline-flex;
}

.dd-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 150px;
  padding: 5px;
  border: 1px solid #151719;
  border-radius: 3px;
  background: #2f3338;
  box-shadow: 0 10px 22px rgba(0,0,0,.38);
  z-index: 50;
}

.dd-menu.open {
  display: block;
}

.dd-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dd-section-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  padding: 5px 7px 3px;
}

.dd-label-first {
  padding-top: 2px;
}

.dd-item {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 7px;
  border-radius: 2px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .1s ease, color .1s ease;
  user-select: none;
  white-space: nowrap;
}

.dd-item:hover {
  background: rgba(61,121,196,0.2);
  color: var(--text);
}

.dd-item svg {
  flex-shrink: 0;
  opacity: .65;
}

.dd-item:hover svg {
  opacity: 1;
}

.dd-sep {
  height: 1px;
  margin: 4px 6px;
  background: rgba(255,255,255,.06);
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px;
  background: var(--bg-top);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.top-bar .logo {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #eef0f2;
  padding-right: 10px;
  margin-right: 2px;
  border-right: 1px solid #4a4d52;
}

.top-bar .sep {
  width: 1px;
  height: 16px;
  background: #484c52;
  margin: 0 2px;
}

.tool-btn {
  height: 22px;
  min-width: 22px;
  padding: 0 8px;
  border: 1px solid #1a1c1f;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #4a4e54 0%, #36393d 100%);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.icon-btn {
  gap: 6px;
}

.tb-ico,
.panel-ico,
.tab-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: currentColor;
}

.tb-ico {
  width: 12px;
  height: 12px;
  opacity: 0.9;
}

.panel-ico {
  width: 10px;
  height: 10px;
  margin-right: 6px;
  opacity: 0.85;
}

.tab-ico {
  width: 10px;
  height: 10px;
  margin-right: 5px;
  opacity: 0.85;
}

.tb-ico svg,
.panel-ico svg,
.tab-ico svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tool-btn:hover {
  background: linear-gradient(180deg, #565b62 0%, #3d4146 100%);
  color: #f2f4f6;
}

.tool-btn:active {
  background: linear-gradient(180deg, #31353a 0%, #454950 100%);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.35);
}

.tool-btn.primary {
  background: linear-gradient(180deg, #4b86cf 0%, #326bac 100%);
  border-color: #214f82;
  color: #fff;
}

.tool-btn.primary:hover {
  background: linear-gradient(180deg, #5a93db 0%, #3874ba 100%);
}

.tool-btn.danger {
  color: #ffd4d4;
  background: linear-gradient(180deg, #634141 0%, #4c3131 100%);
  border-color: #332020;
}

.tool-btn.danger:hover {
  background: linear-gradient(180deg, #704949 0%, #563838 100%);
}

.top-bar .spacer { flex: 1; }

.top-bar .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  height: 20px;
  border-radius: 2px;
  border: 1px solid #1c1e20;
  background: linear-gradient(180deg, #3d4146 0%, #303338 100%);
  color: var(--text-dim);
  font-size: 10px;
}

.top-bar .chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: var(--success);
  box-shadow: 0 0 6px rgba(99,181,109,0.35);
}

.main {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.left-panel,
.right-panel,
.bottom-panel {
  background: var(--bg-panel);
}

.left-panel {
  width: 300px;
  min-width: 230px;
  flex: 0 0 300px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.right-panel {
  width: 280px;
  min-width: 210px;
  flex: 0 0 280px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-title {
  height: 24px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  background: linear-gradient(180deg, #3a3d42 0%, #2f3237 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.resize-h {
  width: 5px;
  flex: 0 0 5px;
  cursor: col-resize;
  position: relative;
  z-index: 20;
  background: #1d1f22;
  border-left: 1px solid #101113;
  border-right: 1px solid #40444a;
  touch-action: none;
}

.resize-v {
  height: 5px;
  flex: 0 0 5px;
  cursor: row-resize;
  position: relative;
  z-index: 20;
  background: #1d1f22;
  border-top: 1px solid #40444a;
  border-bottom: 1px solid #101113;
  touch-action: none;
}

.resize-h::before,
.resize-v::before {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background .12s ease;
}

.resize-h:hover::before,
.resize-h.dragging::before,
.resize-v:hover::before,
.resize-v.dragging::before {
  background: rgba(61,121,196,0.24);
}

.center-panel {
  flex: 1;
  min-width: 420px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #2a2d31 0%, #23262a 100%);
  position: relative;
  overflow: hidden;
}

.gen-area {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.gen-area label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-faint);
}

.gen-area textarea,
.gen-area input,
.gen-area select,
.comp-row input,
.comp-row-2 input,
.modal-body input {
  width: 100%;
  border: 1px solid #17191b;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #202328 0%, #1b1e22 100%);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

.gen-area textarea:focus,
.gen-area input:focus,
.gen-area select:focus,
.comp-row input:focus,
.comp-row-2 input:focus,
.modal-body input:focus {
  border-color: #3d79c4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 0 0 1px rgba(61,121,196,0.25);
}

.gen-area textarea,
.gen-area input,
.gen-area select {
  padding: 7px 8px;
  margin-bottom: 14px;
  font-size: 12px;
}

/* ── Category / Style Custom Dropdowns ── */
.cs-dd {
  position: relative;
}

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #17191b;
  border-radius: 2px;
  background: linear-gradient(180deg, #202328 0%, #1b1e22 100%);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color .12s ease, background .12s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.cs-trigger:hover {
  background: linear-gradient(180deg, #24282d 0%, #1d2126 100%);
  border-color: rgba(255,255,255,0.1);
}

.cs-trigger svg {
  flex-shrink: 0;
  opacity: .5;
  transition: opacity .12s ease;
}

.cs-trigger:hover svg {
  opacity: .8;
}

.cs-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 3px;
  padding: 4px;
  border: 1px solid #151719;
  border-radius: 3px;
  background: #2f3338;
  box-shadow: 0 10px 22px rgba(0,0,0,.38);
  z-index: 40;
}

.cs-menu.open {
  display: block;
}

.cs-item {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 7px;
  border-radius: 2px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .1s ease, color .1s ease;
  user-select: none;
}

.cs-item:hover {
  background: rgba(61,121,196,0.2);
  color: var(--text);
}

.cs-item svg {
  flex-shrink: 0;
  opacity: .55;
}

.cs-item:hover svg {
  opacity: .85;
}

.cs-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}

.cs-sep {
  height: 1px;
  margin: 4px 6px;
  background: rgba(255,255,255,.06);
}

.gen-area textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.5;
}

.gen-area .row {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.gen-area .row > * { flex: 1; }

.gen-area .row select {
  margin-bottom: 0;
}

.btn-gen {
  width: 100%;
  height: 32px;
  margin-top: 4px;
  border: 1px solid #214f82;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #4b86cf 0%, #326bac 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  transition: filter .12s ease, background .12s ease;
}

.btn-gen:hover {
  filter: brightness(1.05);
}

.btn-gen:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.gen-tip {
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #1e2124;
  border-radius: 2px;
  background: #25282d;
  font-size: 10px;
  color: var(--text-faint);
  line-height: 1.5;
}

.canvas-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.canvas-wrap .grid,
.canvas-wrap .cross {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.canvas-wrap .grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 18px 18px;
}

.canvas-wrap .cross {
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 90px 90px;
}

.canvas-box {
  flex: 0 0 auto;
  position: relative;
  border: 1px solid #141618;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1d2024;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 18px 28px rgba(0,0,0,0.34);
}

/* ── Canvas Toolbar (top-right of canvas area) ── */
.canvas-toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #181b1d;
  border-radius: 3px;
  background: rgba(34,36,40,0.92);
  backdrop-filter: blur(4px);
  user-select: none;
}

.ct-btn {
  width: 26px;
  height: 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .1s ease, color .1s ease, border-color .1s ease;
  position: relative;
}

.ct-btn:hover {
  background: rgba(255,255,255,.06);
  color: var(--text);
}

.ct-btn.ct-active {
  color: #9bc2f0;
  background: rgba(61,121,196,0.16);
  border-color: rgba(61,121,196,0.25);
}

.ct-btn.ct-active:hover {
  background: rgba(61,121,196,0.24);
  color: #b8d6f8;
}

/* Align dropdown */
.ct-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  padding: 6px;
  border: 1px solid #151719;
  border-radius: 3px;
  background: #2f3338;
  box-shadow: 0 10px 22px rgba(0,0,0,.38);
  z-index: 40;
  min-width: 140px;
}

.ct-dropdown.open {
  display: block;
}

.ct-dropdown-title {
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
  padding: 2px 4px;
}

.ct-dropdown-row {
  display: flex;
  gap: 2px;
  margin-bottom: 2px;
}

.ct-dropdown-row:last-child {
  margin-bottom: 0;
}

.ct-dropdown-row button {
  flex: 1;
  height: 24px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--text-dim);
  font-size: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: background .1s ease, color .1s ease, border-color .1s ease;
}

.ct-dropdown-row button:hover {
  background: rgba(61,121,196,0.2);
  color: var(--text);
  border-color: rgba(61,121,196,0.25);
}

/* Grid visibility toggle */
.canvas-wrap.grid-hidden .grid,
.canvas-wrap.grid-hidden .cross {
  display: none;
}

#c { display: block; }

.canvas-status {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 2px;
  border: 1px solid #181b1d;
  background: rgba(34,36,40,0.92);
  font-size: 10px;
  color: var(--text-dim);
  pointer-events: none;
  white-space: nowrap;
}

.layer-area {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  position: relative;
}

.layer-area.layer-area-sorting { cursor: grabbing; }

.layer-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  margin: 0;
  padding: 3px 8px 3px 4px;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background .1s ease, border-left-color .1s ease;
  font-size: 11px;
}

.layer-item:hover {
  background: rgba(255,255,255,0.035);
}

.layer-item.active {
  background: linear-gradient(90deg, rgba(61,121,196,0.22), rgba(61,121,196,0.1));
  border-left-color: #4b8bdc;
}

.layer-item.layer-dragging {
  opacity: 0.85;
  background: rgba(61,121,196,0.15);
}

.layer-item.layer-swap-anim { transition: transform 0.16s ease; }

.collapse-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  font-size: 10px;
  color: rgba(255,255,255,.3);
  cursor: pointer;
  transition: color .1s;
}
.collapse-icon:hover {
  color: rgba(255,255,255,.5);
}

.layer-item.drop-before::before,
.layer-item.drop-after::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--accent-2);
}
.layer-item.drop-before::before { top: -3px; }
.layer-item.drop-after::after { bottom: -3px; }

/* Drop-to-parent highlight — shown when dragging over the middle of a layer */
.layer-item.drop-child {
  background: rgba(61,121,196,0.22);
  outline: 1px solid rgba(61,121,196,0.45);
  outline-offset: -1px;
  border-radius: 2px;
}

/* Child-arrow indicator in layer names */
.layer-child-arrow {
  color: rgba(255,255,255,0.25);
  font-size: 10px;
  margin-right: 2px;
}

/* Context menu sub-list for inline parent binding */
.ctx-sub-list {
  max-height: 180px;
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 4px;
  padding-top: 4px;
}
.ctx-sub-item {
  padding: 4px 10px 4px 20px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .1s;
}
.ctx-sub-item:hover {
  background: rgba(61,121,196,0.2);
  color: #fff;
}

.layer-item .thumb {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.3);
  font-size: 9px;
  font-weight: 700;
}

.layer-item .info {
  flex: 1;
  min-width: 0;
}

.layer-item .info .name {
  font-size: 11px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.layer-item .info .cat {
  display: none;
}

.layer-item .vis-btn {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.2);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  transition: color .1s;
}
.layer-item .vis-btn:hover {
  color: rgba(255,255,255,.5);
}
  border-radius: 2px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.layer-item .vis-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
  color: var(--text);
}

.layer-rename-input,
.drag-input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #3d79c4;
  border-radius: 2px;
  background: #1d2126;
  color: var(--text);
  font-size: 11px;
  outline: none;
}

.layer-export-modal {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer-export-list-wrap {
  border: 1px solid #17191b;
  border-radius: 2px;
  background: #262a2f;
  overflow: hidden;
}

.layer-export-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: linear-gradient(180deg, #373a3f 0%, #303338 100%);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
}

.layer-export-toolbar-check,
.export-layer-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.layer-export-toolbar input,
.export-layer-check input {
  accent-color: var(--accent);
}

.layer-export-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
}

.export-layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin: 0 0 3px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}

.export-layer-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.04);
}

.export-layer-thumb {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 1px solid #191b1d;
  background: linear-gradient(180deg, #24282d 0%, #1c1f23 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
}

.export-layer-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.export-layer-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.export-layer-cat {
  margin-top: 1px;
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.export-layer-vis {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
}

.export-layer-check {
  width: 18px;
  height: 18px;
  margin-left: auto;
}

.layer-export-tip {
  font-size: 10px;
  color: var(--text-faint);
}

.layer-empty,
.asset-empty,
.project-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 11px;
  gap: 6px;
}

.comp-area {
  max-height: 360px;
  border-top: 1px solid rgba(0,0,0,0.3);
  background: #282b30;
  overflow-y: auto;
  display: none;
  flex-shrink: 0;
}
.comp-area.show { display: block; }

.comp {
  border-bottom: 1px solid rgba(0,0,0,0.25);
}

.comp-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: #2e3136;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  user-select: none;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.comp-header:hover {
  background: #33373c;
}
.comp-header .tri {
  width: 12px;
  font-size: 10px;
  transition: transform .14s ease;
  color: rgba(255,255,255,.3);
}
.comp-header .tri.collapsed { transform: rotate(-90deg); }
.comp-header .label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}
.comp-header .label .panel-ico {
  opacity: .4;
}

.comp-body {
  padding: 6px 10px 8px;
}
.comp-body.hide { display: none; }

.comp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.comp-row label,
.comp-row-2 label {
  color: rgba(255,255,255,.35);
  font-size: 10px;
  font-weight: 400;
  min-width: 24px;
}

.comp-row-2 {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.comp-row-2 > div {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.drag-num {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.drag-num .lbl {
  min-width: 10px;
  padding-right: 3px;
  color: rgba(255,255,255,.3);
  font-size: 9px;
  font-weight: 600;
  cursor: ew-resize;
  user-select: none;
}
.drag-num .val {
  flex: 1;
  min-width: 0;
  min-height: 22px;
  padding: 3px 5px;
  border: 1px solid rgba(0,0,0,.25);
  border-radius: 2px;
  background: rgba(0,0,0,.2);
  color: var(--text);
  font-size: 11px;
  cursor: ew-resize;
  user-select: none;
  transition: border-color .1s, background .1s;
}
.drag-num .val:hover {
  border-color: rgba(61,121,196,0.35);
  background: rgba(0,0,0,.3);
}
.drag-num .val.dragging {
  border-color: rgba(61,121,196,0.55);
  background: rgba(0,0,0,.35);
}
.drag-num .val::after {
  content: '↔';
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8px;
  color: rgba(255,255,255,.1);
  pointer-events: none;
}

.drag-num .val:hover::after { color: var(--accent); }
}

.comp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 0;
}

.comp-actions button,
.modal-actions button,
.project-actions button {
  height: 24px;
  padding: 0 10px;
  border: 1px solid #17191b;
  border-radius: 2px;
  background: linear-gradient(180deg, #45494f 0%, #36393d 100%);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.comp-actions button:hover,
.modal-actions button:hover,
.project-actions button:hover {
  background: linear-gradient(180deg, #565b61 0%, #404449 100%);
  border-color: #101113;
  color: var(--text);
}

.comp-actions .del {
  color: #ffd2d2;
  border-color: #2b1a1a;
  background: linear-gradient(180deg, #694040 0%, #513131 100%);
}

.comp-actions .del:hover {
  background: linear-gradient(180deg, #7a4949 0%, #603939 100%);
}

.bottom-panel {
  height: 240px;
  min-height: 100px;
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, #2d3034 0%, #272a2e 100%);
  overflow: hidden;
}

.btabs {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 26px;
  padding: 0 6px;
  border-bottom: 1px solid var(--border);
  background: #31353a;
  flex-shrink: 0;
}

.btab {
  height: 20px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.btab:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.btab.active {
  background: linear-gradient(180deg, rgba(61,121,196,0.36), rgba(61,121,196,0.2));
  border-color: rgba(61,121,196,0.4);
  color: #f4f8fd;
}

.bcontent {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.bpane {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.bpane.active { display: block; }

#consoleLog {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

.asset-grid,
.project-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
}

.asset-item,
.project-card {
  position: relative;
  border: 1px solid #1a1c1f;
  border-radius: 2px;
  background: linear-gradient(180deg, #32363b 0%, #2a2d31 100%);
  transition: background .12s ease, border-color .12s ease;
}

.asset-item {
  width: 72px;
  padding: 5px;
  text-align: center;
  cursor: pointer;
}

.project-card {
  width: 96px;
  padding: 4px;
  text-align: center;
  cursor: pointer;
  overflow: visible;
}

.asset-item:hover,
.project-card:hover {
  border-color: #0f1113;
  background: linear-gradient(180deg, #3a3f45 0%, #31353a 100%);
}

.project-card.selected {
  border-color: rgba(61,121,196,0.48);
  background: linear-gradient(180deg, rgba(61,121,196,0.28), rgba(61,121,196,0.16));
}

.asset-item .thumb,
.project-card .pthumb {
  border: 1px solid #17191b;
  border-radius: 2px;
  background: linear-gradient(180deg, #262a2e 0%, #1f2226 100%);
  overflow: hidden;
}

.asset-item .thumb {
  width: 60px;
  height: 60px;
  margin: 0 auto 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.asset-item .thumb svg,
.asset-item .thumb img {
  width: 48px;
  height: 48px;
}

.asset-item .name,
.project-card .pname {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card .pthumb {
  width: 88px;
  height: 54px;
  margin: 0 auto 6px;
}

.project-menu-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: 1px solid #17191b;
  border-radius: 2px;
  background: rgba(34,36,40,0.92);
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: background .12s ease, color .12s ease, opacity .12s ease;
}

.project-card:hover .project-menu-btn,
.project-card.selected .project-menu-btn {
  opacity: 1;
}

.project-menu-btn:hover {
  background: #3a3f45;
  color: #f2f4f6;
}

.project-menu {
  position: absolute;
  top: 24px;
  right: 4px;
  min-width: 108px;
  padding: 4px;
  border: 1px solid #151719;
  border-radius: 2px;
  background: #2f3338;
  box-shadow: 0 10px 22px rgba(0,0,0,.38);
  display: none;
  z-index: 40;
}

.project-menu.open {
  display: block;
}

.project-menu button {
  width: 100%;
  height: 24px;
  padding: 0 8px;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.project-menu button:hover {
  background: rgba(61,121,196,0.26);
  color: #fff;
}

.project-menu button.danger {
  color: #ffd2d2;
}

.project-menu button.danger:hover {
  background: rgba(203,92,92,0.22);
  color: #fff;
}

#ctxMenu {
  position: fixed;
  z-index: 9999;
  display: none;
  min-width: 140px;
  background: #2f3338;
  border: 1px solid #151719;
  border-radius: 2px;
  padding: 4px;
  box-shadow: 0 10px 22px rgba(0,0,0,.38);
}

.ctx-item {
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-dim);
  border-radius: 2px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
  white-space: nowrap;
}

.ctx-item:hover {
  background: rgba(61,121,196,0.26);
  color: #fff;
}

.ctx-parent-option {
  font-size: 11px;
  color: var(--text-dim);
  transition: background .12s ease, color .12s ease;
}

.ctx-parent-option:hover {
  background: rgba(61,121,196,0.2);
  color: #fff;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
}

.settings-panel {
  width: 580px;
  height: 400px;
  background: #2d3136;
  border: 1px solid #141618;
  border-radius: 3px;
  box-shadow: 0 18px 30px rgba(0,0,0,.42);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 38px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #3b3f44 0%, #32363a 100%);
  flex-shrink: 0;
}

.settings-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
}

.settings-close {
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.settings-close:hover {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.1);
  color: var(--text);
}

.settings-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.settings-sidebar {
  width: 130px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 6px;
  background: #282b2f;
  border-right: 1px solid var(--border);
  gap: 2px;
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
  user-select: none;
}

.settings-tab:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
}

.settings-tab.active {
  background: linear-gradient(180deg, rgba(61,121,196,0.32), rgba(61,121,196,0.2));
  border-color: rgba(61,121,196,0.4);
  color: var(--text);
}

.settings-tab svg {
  flex-shrink: 0;
  opacity: .7;
}

.settings-tab.active svg {
  opacity: 1;
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}

.settings-pane {
  display: none;
}

.settings-pane.active {
  display: block;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.settings-placeholder {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.6;
  padding: 6px 0;
}

.settings-field {
  margin-bottom: 18px;
}

.settings-field-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.settings-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.settings-hint {
  font-size: 10px;
  color: var(--text-faint);
}

.settings-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.settings-number-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.settings-number-label {
  font-size: 10px;
  color: var(--text-faint);
  min-width: 12px;
}

.settings-input {
  width: 80px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid #17191b;
  border-radius: 2px;
  background: linear-gradient(180deg, #202328 0%, #1b1e22 100%);
  color: var(--text);
  font-size: 11px;
  outline: none;
  transition: border-color .12s ease;
}

.settings-input:focus {
  border-color: #3d79c4;
  box-shadow: 0 0 0 1px rgba(61,121,196,0.25);
}

.settings-input::-webkit-inner-spin-button {
  opacity: .5;
}

.settings-btn {
  height: 26px;
  padding: 0 12px;
  border: 1px solid #214f82;
  border-radius: 2px;
  background: linear-gradient(180deg, #4b86cf 0%, #326bac 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: filter .12s ease;
}

.settings-btn:hover {
  filter: brightness(1.08);
}

.settings-btn:active {
  filter: brightness(0.95);
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.settings-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

.settings-check-text {
  font-size: 10px;
  color: var(--text-faint);
}

.settings-select {
  width: 180px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid #17191b;
  border-radius: 2px;
  background: linear-gradient(180deg, #202328 0%, #1b1e22 100%);
  color: var(--text);
  font-size: 11px;
  outline: none;
  cursor: pointer;
  transition: border-color .12s ease;
}

.settings-select:focus {
  border-color: #3d79c4;
}

.settings-select option {
  background: #2e3236;
  color: #e0e4ec;
}

/* ── Profile Panel ── */
.profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
}

.feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
}

/* ── Sponsor / Donation Panel ── */
.sponsor-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
}

.sponsor-panel {
  width: 300px;
  background: #2d3136;
  border: 1px solid #141618;
  border-radius: 3px;
  box-shadow: 0 18px 30px rgba(0,0,0,.42);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sponsor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 38px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #3b3f44 0%, #32363a 100%);
  flex-shrink: 0;
}

.sponsor-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
}

.sponsor-body {
  flex: 1;
  padding: 24px 20px 20px;
  text-align: center;
}

.sponsor-intro {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 20px;
}

.sponsor-qr-wrap {
  width: 200px;
  height: 200px;
  margin: 0 auto 18px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sponsor-qr-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sponsor-footer {
  font-size: 10px;
  color: var(--text-faint);
  line-height: 1.5;
}

.profile-panel {
  width: 340px;
  max-height: 80vh;
  background: #2d3136;
  border: 1px solid #141618;
  border-radius: 3px;
  box-shadow: 0 18px 30px rgba(0,0,0,.42);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 38px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #3b3f44 0%, #32363a 100%);
  flex-shrink: 0;
}

.profile-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
}

.profile-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 20px;
}

.profile-avatar-area {
  text-align: center;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar svg {
  display: block;
}

.profile-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.profile-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(80,200,120,0.1);
  border: 1px solid rgba(80,200,120,0.15);
  font-size: 10px;
  color: var(--success);
}

.profile-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

/* ── Divider ── */
.profile-divider {
  height: 1px;
  margin: 14px 0;
  background: rgba(255,255,255,.06);
}

/* ── Info list ── */
.profile-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.profile-info-label {
  color: var(--text-faint);
  min-width: 36px;
  flex-shrink: 0;
}

.profile-info-value {
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-info-edit {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color .12s, background .12s;
}
.profile-info-edit:hover {
  color: var(--accent-2);
  background: rgba(61,121,196,0.12);
}

/* ── Action grid ── */
.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.profile-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 10px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 4px;
  background: rgba(255,255,255,.02);
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  font-family: inherit;
}
.profile-action-btn:hover {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.1);
  color: var(--text);
}
.profile-action-btn svg {
  opacity: .6;
  transition: opacity .12s;
}
.profile-action-btn:hover svg {
  opacity: .9;
}

/* ── Footer actions ── */
.profile-footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.profile-footer-btn {
  border: none;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
  padding: 2px 4px;
  font-family: inherit;
  transition: opacity .12s;
  opacity: .55;
}
.profile-footer-btn:hover {
  opacity: 1;
}

.profile-footer-sep {
  color: rgba(255,255,255,.12);
  font-size: 10px;
}

/* ── Contact ── */
.profile-contact {
  text-align: center;
  font-size: 8px;
  color: rgba(255,255,255,.2);
  margin-top: 12px;
  line-height: 1.5;
}
.profile-contact a {
  color: var(--text-faint);
  text-decoration: none;
}
.profile-contact a:hover {
  color: var(--accent-2);
}
.profile-contact-sep {
  margin: 0 5px;
  color: rgba(255,255,255,.1);
}

/* ── Version ── */
.profile-version {
  text-align: center;
  font-size: 7px;
  color: rgba(255,255,255,.1);
  margin-top: 6px;
  letter-spacing: .05em;
}

/* ── Primary button ── */
.profile-btn {
  display: block;
  width: 100%;
  height: 34px;
  line-height: 34px;
  text-align: center;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s;
}
.profile-btn-primary {
  border: 1px solid #214f82;
  background: linear-gradient(180deg, #4b86cf 0%, #326bac 100%);
  color: #fff;
}
.profile-btn-primary:hover {
  filter: brightness(1.06);
}
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px dashed rgba(255,255,255,.08);
  border-radius: 2px;
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.profile-name-input {
  width: 140px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  text-align: center;
}

.profile-name-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}

.profile-name-btn {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: background .1s ease;
}

.profile-name-btn:hover {
  background: rgba(255,255,255,.06);
}

.profile-name-btn.save:hover {
  background: rgba(61,121,196,0.2);
  border-color: var(--accent);
  color: var(--accent-2);
}


.profile-login-btn {
  display: block;
  width: 100%;
  height: 34px;
  line-height: 34px;
  text-align: center;
  border: 1px solid #214f82;
  border-radius: 2px;
  background: linear-gradient(180deg, #4b86cf 0%, #326bac 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: filter .12s ease;
}

.profile-login-btn:hover {
  filter: brightness(1.08);
  color: #fff;
}

.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  padding: 0 8px;
  border-radius: 2px;
  cursor: pointer;
  transition: background .1s ease;
}

.shortcut-item:hover {
  background: rgba(255,255,255,.04);
}

.shortcut-label {
  font-size: 11px;
  color: var(--text-dim);
}

.shortcut-keys {
  height: 22px;
  min-width: 60px;
  padding: 0 8px;
  border: 1px solid #17191b;
  border-radius: 2px;
  background: linear-gradient(180deg, #202328 0%, #1b1e22 100%);
  color: var(--text);
  font-size: 10px;
  font-family: 'JetBrains Mono', 'Cascadia Code', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
  user-select: none;
}

.shortcut-keys:hover {
  border-color: rgba(61,121,196,0.45);
  color: #fff;
}

.shortcut-keys.recording {
  border-color: #e8c34a;
  background: rgba(232,195,74,0.12);
  color: #e8c34a;
  animation: shortcut-pulse 1s ease-in-out infinite;
}

@keyframes shortcut-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,195,74,.2); }
  50% { box-shadow: 0 0 0 3px rgba(232,195,74,.06); }
}

.shortcut-keys.conflict {
  border-color: #cb5c5c;
  color: #cb5c5c;
}

.shortcut-keys.empty {
  color: var(--text-faint);
  font-family: inherit;
  font-size: 10px;
}

.shortcut-keys:active {
  border-color: rgba(61,121,196,0.6);
}

.shortcut-recording-hint {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10001;
  padding: 20px 32px;
  border: 1px solid rgba(232,195,74,.4);
  border-radius: 3px;
  background: rgba(40,43,48,0.97);
  text-align: center;
  pointer-events: none;
  box-shadow: 0 18px 32px rgba(0,0,0,.4);
}

.shortcut-recording-hint .hint-title {
  font-size: 14px;
  font-weight: 600;
  color: #e8c34a;
  margin-bottom: 6px;
}

.shortcut-recording-hint .hint-sub {
  font-size: 11px;
  color: var(--text-faint);
}

.shortcut-reset {
  width: 18px;
  height: 18px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
  opacity: .4;
}

.shortcut-item:hover .shortcut-reset {
  opacity: .8;
}

.custom-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.custom-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  border-radius: 2px;
  background: rgba(255,255,255,.02);
  font-size: 11px;
  color: var(--text-dim);
}

.custom-list-item .style-name {
  font-weight: 500;
  color: var(--text);
  min-width: 80px;
}

.custom-list-item .style-desc {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: var(--text-faint);
}

.custom-list-item.builtin {
  opacity: .5;
}

.custom-list-item .del-btn {
  width: 18px;
  height: 18px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background .12s ease, color .12s ease;
  flex-shrink: 0;
  opacity: .4;
}

.custom-list-item:hover .del-btn {
  opacity: .8;
}

.custom-list-item .del-btn:hover {
  background: rgba(203,92,92,0.18);
  color: var(--danger);
  opacity: 1;
}

.custom-add-form {
  margin-bottom: 8px;
}

.custom-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.custom-hint-input {
  width: 100%;
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid #17191b;
  border-radius: 2px;
  background: linear-gradient(180deg, #202328 0%, #1b1e22 100%);
  color: var(--text);
  font-size: 10px;
  font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  outline: none;
  resize: vertical;
  transition: border-color .12s ease;
  line-height: 1.4;
}

.custom-hint-input:focus {
  border-color: #3d79c4;
  box-shadow: 0 0 0 1px rgba(61,121,196,0.25);
}

.custom-prompts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-prompt-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.custom-prompt-label {
  width: 36px;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  line-height: 26px;
  text-transform: uppercase;
}

.custom-prompt-item .custom-hint-input {
  min-height: 36px;
}

.api-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.settings-sm-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid #17191b;
  border-radius: 2px;
  background: linear-gradient(180deg, #45494f 0%, #36393d 100%);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.settings-sm-btn:hover {
  background: linear-gradient(180deg, #565b61 0%, #404449 100%);
  color: var(--text);
}

.settings-btn-secondary {
  background: linear-gradient(180deg, #45494f 0%, #36393d 100%);
  border-color: #17191b;
  color: var(--text-dim);
}

.settings-btn-secondary:hover {
  background: linear-gradient(180deg, #565b61 0%, #404449 100%);
  color: var(--text);
}

.settings-btn-danger {
  background: linear-gradient(180deg, #634141 0%, #4c3131 100%);
  border-color: #332020;
  color: #ffd4d4;
}

.settings-btn-danger:hover {
  background: linear-gradient(180deg, #704949 0%, #563838 100%);
}

.api-test-ok {
  color: var(--success);
  padding: 6px 8px;
  border: 1px solid rgba(99,181,109,.25);
  border-radius: 2px;
  background: rgba(99,181,109,.06);
}

.ct-sep {
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,.08);
  flex-shrink: 0;
}

.ct-zoom {
  font-size: 10px;
  font-family: 'JetBrains Mono', 'Cascadia Code', monospace;
  color: var(--text-faint);
  padding: 0 4px;
  cursor: pointer;
  user-select: none;
  transition: color .1s ease;
  min-width: 32px;
  text-align: center;
}

.ct-zoom:hover {
  color: var(--text);
}

#ctPan.ct-active {
  color: #9bc2f0;
  background: rgba(61,121,196,0.16);
  border-color: rgba(61,121,196,0.25);
}

.api-test-err {
  color: var(--danger);
  padding: 6px 8px;
  border: 1px solid rgba(203,92,92,.25);
  border-radius: 2px;
  background: rgba(203,92,92,.06);
}

.custom-section-spacer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.04);
}

.shortcut-reset:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
  color: var(--text);
  opacity: 1;
}

.project-card .pthumb canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.asset-item.asset-png .thumb::after {
  content: 'PNG';
  position: absolute;
  bottom: 2px;
  right: 2px;
  padding: 0 3px;
  font-size: 8px;
  line-height: 13px;
  border-radius: 1px;
  background: rgba(0,0,0,.6);
  color: rgba(255,255,255,.7);
  pointer-events: none;
}

.asset-item .asset-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border: 1px solid #17191b;
  border-radius: 2px;
  background: rgba(31,34,38,0.92);
  color: var(--text-faint);
  font-size: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.asset-item:hover .asset-del { display: flex; }
.asset-item .asset-del:hover { background: rgba(203,92,92,0.22); color: #fff; }

.current-project-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.current-project-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.current-project-stats {
  font-size: 10px;
  color: var(--text-faint);
}

.project-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--border);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,12,14,0.62);
  backdrop-filter: blur(3px);
}

.modal-box {
  min-width: 340px;
  max-width: 440px;
  padding: 16px 18px;
  border: 1px solid #141618;
  border-radius: 2px;
  background: linear-gradient(180deg, #36393d 0%, #2d3034 100%);
  box-shadow: var(--shadow-lg);
}

.modal-title {
  margin-bottom: 10px;
  color: #f7fafc;
  font-size: 14px;
  font-weight: 600;
}

.modal-body {
  margin-bottom: 14px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
}

.modal-body input {
  margin-top: 8px;
  padding: 8px;
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.modal-actions button.modal-primary,
.project-actions .modal-primary {
  background: linear-gradient(180deg, #4b86cf 0%, #326bac 100%);
  border-color: #214f82;
  color: #fff;
}

.modal-actions button.modal-danger,
.project-actions .modal-danger {
  color: #ffd2d2;
  border-color: #2b1a1a;
  background: linear-gradient(180deg, #694040 0%, #513131 100%);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 7px 12px;
  border: 1px solid #17191b;
  border-radius: 2px;
  background: rgba(40,43,48,0.96);
  color: var(--text);
  font-size: 11px;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  z-index: 10001;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-1px);
}

.toast.err {
  border-color: rgba(203,92,92,0.38);
  color: #ffe2e2;
}

@media (max-width: 1100px) {
  .left-panel { min-width: 200px; flex-basis: 240px; }
  .right-panel { min-width: 190px; flex-basis: 240px; }
  .canvas-wrap { padding: 12px; }
}

@media (max-width: 860px) {
  .top-bar {
    flex-wrap: wrap;
    height: auto;
    padding: 6px;
  }

  .main {
    flex-direction: column;
  }

  .left-panel,
  .right-panel {
    width: 100%;
    min-width: 0;
    flex: 0 0 220px;
    border-left: none;
    border-right: none;
  }

  .resize-h {
    width: 100%;
    height: 5px;
    flex: 0 0 5px;
    cursor: row-resize;
  }

  .canvas-box {
    width: min(100%, 800px);
    height: auto;
    aspect-ratio: 16 / 10;
  }
}
