/* c:\Users\Administrator\Downloads\AURORA\styles.css */
:root {
  --bg-base: #050304;
  --panel-bg: rgba(14, 8, 10, 0.94);
  --card-bg: #130b0e;
  --card-border: rgba(239, 68, 68, 0.12);
  --panel-border: rgba(239, 68, 68, 0.14);
  --accent: #dc2626;
  --accent-bright: #ef4444;
  --accent-light: #f87171;
  --text-main: #f4f4f6;
  --text-muted: #71717a;
  --text-dim: #52525b;
  --track-bg: #1c1014;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  height: 100vh;
  background-color: #000000;
  background-image: none;
  font-family: 'Inter', 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  position: relative;
}

/* Low-poly geometric shard overlay in purple-black */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(32deg, transparent 43%, rgba(239, 68, 68, 0.04) 43.5%, rgba(0, 0, 0, 0.4) 100%),
    linear-gradient(148deg, rgba(220, 38, 38, 0.07) 0%, transparent 38%),
    linear-gradient(215deg, transparent 58%, rgba(0, 0, 0, 0.55) 58.2%);
  pointer-events: none;
  z-index: 0;
}

.workspace {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  max-width: 1560px;
  width: 100%;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-bright);
}

/* ==================== LEFT PRESETS DOCK PANEL ==================== */
.presets-panel {
  width: 230px;
  flex-shrink: 0;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 14px 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(220, 38, 38, 0.08);
  backdrop-filter: blur(20px);
  max-height: 640px;
}

.presets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 2px;
}

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

.presets-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-bright);
  flex-shrink: 0;
}

.presets-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #a1a1aa;
}

.presets-count {
  font-size: 11px;
  font-weight: 600;
  color: #52525b;
  font-family: 'JetBrains Mono', 'Inter', monospace;
}

.btn-save-preset {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.42);
  background: rgba(220, 38, 38, 0.16);
  color: #f3e8ff;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.btn-save-preset:hover {
  background: rgba(220, 38, 38, 0.30);
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.38);
}

.presets-share-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 2px 0 0;
}

.btn-preset-io {
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(239, 68, 68, 0.24);
  background: rgba(20, 16, 30, 0.88);
  color: #fca5a5;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-preset-io svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-preset-io:hover {
  background: rgba(220, 38, 38, 0.22);
  border-color: rgba(248, 113, 113, 0.65);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.28);
}

.btn-preset-export {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.20) 0%, rgba(20, 16, 30, 0.92) 100%);
  border-color: rgba(239, 68, 68, 0.34);
}

.presets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 490px;
  padding-right: 2px;
}

.presets-list:empty {
  display: none;
}

.presets-list::-webkit-scrollbar {
  width: 4px;
}

.presets-list::-webkit-scrollbar-thumb {
  background: rgba(239, 68, 68, 0.35);
  border-radius: 999px;
}

.preset-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(20, 17, 29, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.16s ease;
  position: relative;
}

.preset-card:hover {
  background: rgba(28, 22, 42, 0.92);
  border-color: rgba(239, 68, 68, 0.28);
}

.preset-card.active {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.22) 0%, rgba(20, 17, 29, 0.92) 100%);
  border-color: rgba(239, 68, 68, 0.52);
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.18);
}

.preset-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.preset-card-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #52525b;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.preset-card.active .preset-card-dot {
  background: var(--accent-light);
  box-shadow: 0 0 6px var(--accent-bright);
}

.preset-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.preset-card-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #f4f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-card-date {
  font-size: 10.5px;
  font-weight: 500;
  color: #71717a;
  font-family: 'Inter', sans-serif;
}

.preset-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.preset-card-share,
.preset-card-del {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #71717a;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.14s ease;
  flex-shrink: 0;
}

.preset-card-share svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preset-card:hover .preset-card-share,
.preset-card:hover .preset-card-del {
  opacity: 1;
}

.preset-card-share:hover {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.38);
}

.preset-card-del:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.3);
}

.presets-footer {
  padding: 4px 2px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.presets-footer p {
  font-size: 10.5px;
  line-height: 1.45;
  color: #52525b;
}

/* ==================== PRESET NAME MODAL POPUP ==================== */
.preset-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 8, 0.76);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.preset-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.preset-modal-card {
  width: 100%;
  max-width: 370px;
  background: #120e1c;
  border: 1px solid rgba(239, 68, 68, 0.36);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 36px rgba(220, 38, 38, 0.22);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(10px) scale(0.97);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.preset-modal-overlay.open .preset-modal-card {
  transform: translateY(0) scale(1);
}

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

.preset-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preset-modal-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.preset-modal-close {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #a1a1aa;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.preset-modal-close:hover {
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(220, 38, 38, 0.18);
}

.preset-modal-desc {
  font-size: 11.5px;
  color: #a1a1aa;
  line-height: 1.4;
}

.preset-modal-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  background: #0b0812;
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #f4f4f6;
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  transition: all 0.16s ease;
}

.preset-modal-input::placeholder {
  color: #52525b;
}

.preset-modal-input:focus {
  border-color: #f87171;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.32);
}

.preset-modal-input.input-error {
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.preset-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.preset-modal-btn-cancel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d4d4d8;
}

.preset-modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.preset-modal-btn-confirm {
  padding: 7px 14px;
}

/* ==================== PRESET SHARE (EXPORT / IMPORT 25-CHAR CODE) MODAL ==================== */
.preset-share-card {
  max-width: 430px;
}

.share-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 11px;
  background: #0a0710;
  border: 1px solid rgba(239, 68, 68, 0.20);
}

.share-mode-tab {
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #a1a1aa;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.share-mode-tab svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-mode-tab:hover {
  color: #f3e8ff;
}

.share-mode-tab.active {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.34) 0%, rgba(153, 27, 27, 0.28) 100%);
  border-color: rgba(248, 113, 113, 0.55);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.28);
}

.share-tab-view {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.share-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.share-field-label {
  font-size: 11px;
  font-weight: 600;
  color: #a1a1aa;
}

.share-dropdown {
  position: relative;
  width: 100%;
  z-index: 20;
}

.share-dropdown-trigger {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: #0b0812;
  border: 1px solid rgba(239, 68, 68, 0.30);
  color: #f4f4f6;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.16s ease;
}

.share-dropdown-trigger:hover,
.share-dropdown.open .share-dropdown-trigger {
  border-color: #f87171;
  background: rgba(18, 13, 29, 0.96);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.28);
}

.share-dropdown-trigger-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.share-dropdown-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 6px var(--accent-bright);
  flex-shrink: 0;
}

.share-dropdown-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.share-dropdown-chevron {
  width: 15px;
  height: 15px;
  stroke: #a1a1aa;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: transform 0.18s ease, stroke 0.18s ease;
}

.share-dropdown.open .share-dropdown-chevron {
  transform: rotate(180deg);
  stroke: #fca5a5;
}

.share-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 5px;
  border-radius: 12px;
  background: rgba(15, 11, 24, 0.98);
  border: 1px solid rgba(239, 68, 68, 0.42);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.85), 0 0 24px rgba(220, 38, 38, 0.22);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 210px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.share-dropdown.open .share-dropdown-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.share-dropdown-menu::-webkit-scrollbar {
  width: 4px;
}

.share-dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(239, 68, 68, 0.35);
  border-radius: 999px;
}

.share-dropdown-item {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #d4d4d8;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}

.share-dropdown-item:hover {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(239, 68, 68, 0.28);
  color: #ffffff;
}

.share-dropdown-item.selected {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.32) 0%, rgba(153, 27, 27, 0.24) 100%);
  border-color: rgba(248, 113, 113, 0.48);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.22);
}

.share-dropdown-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.share-dropdown-item-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #52525b;
  flex-shrink: 0;
}

.share-dropdown-item.selected .share-dropdown-item-dot {
  background: #fca5a5;
  box-shadow: 0 0 6px #ef4444;
}

.share-dropdown-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-dropdown-item-meta {
  font-size: 10px;
  font-weight: 500;
  color: #a1a1aa;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

.share-code-box-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 11px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(17, 13, 27, 0.96) 0%, rgba(10, 7, 16, 0.98) 100%);
  border: 1px solid rgba(239, 68, 68, 0.32);
  box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.7), 0 0 18px rgba(220, 38, 38, 0.12);
}

.share-code-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.share-code-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fca5a5;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.22);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.share-code-status {
  font-family: 'JetBrains Mono', 'IBM Plex Sans Thai', monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: #a1a1aa;
}

.share-code-status.valid {
  color: #4ade80;
}

.share-code-status.invalid {
  color: #f87171;
}

.share-code-display {
  display: flex;
  align-items: center;
  gap: 6px;
}

.share-code-output,
.share-code-input {
  flex: 1;
  height: 38px;
  padding: 0 11px;
  border-radius: 8px;
  background: #07050c;
  border: 1px solid rgba(239, 68, 68, 0.38);
  color: #f3e8ff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  outline: none;
  user-select: text;
  transition: all 0.16s ease;
}

.share-code-output {
  text-align: center;
  color: #fecaca;
  text-shadow: 0 0 10px rgba(248, 113, 113, 0.38);
}

.share-code-input::placeholder {
  color: #52525b;
  font-weight: 500;
  letter-spacing: 0;
}

.share-code-input:focus {
  border-color: #f87171;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.34);
}

.share-code-input.input-error {
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.btn-regen-code,
.btn-paste-code {
  height: 38px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.32);
  background: rgba(220, 38, 38, 0.18);
  color: #fecaca;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.btn-regen-code svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-regen-code:hover,
.btn-paste-code:hover {
  background: rgba(220, 38, 38, 0.32);
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.share-summary-card {
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(20, 16, 30, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.share-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.share-summary-name {
  font-size: 12px;
  font-weight: 700;
  color: #f4f4f6;
}

.share-summary-date {
  font-size: 10.5px;
  color: #71717a;
}

.share-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.share-stat-pill {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(220, 38, 38, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.22);
  font-size: 10.5px;
  font-weight: 600;
  color: #fca5a5;
  font-family: 'JetBrains Mono', 'IBM Plex Sans Thai', sans-serif;
}

/* ==================== MAIN APPLICATION PANEL (FIXED HEIGHT, INTERNAL SCROLL) ==================== */
.main-panel {
  flex: 1;
  max-width: 880px;
  height: 640px;
  max-height: 640px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  display: flex;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(220, 38, 38, 0.08);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 210px;
  height: 100%;
  flex-shrink: 0;
  border-right: 1px solid rgba(239, 68, 68, 0.08);
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(9, 7, 14, 0.65);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 10px 20px;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #f87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.65);
  flex-shrink: 0;
}

.brand-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: #a1a1aa;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item:hover:not(.active) {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(239, 68, 68, 0.16);
  color: #e4e4e7;
}

.nav-item svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.24) 0%, rgba(220, 38, 38, 0.06) 100%);
  border-color: rgba(239, 68, 68, 0.32);
  color: #ffffff;
  font-weight: 600;
  position: relative;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-bright);
}

.nav-item.active svg {
  stroke: var(--accent-light);
  opacity: 1;
}

.sidebar-footer {
  padding: 12px 8px 0;
  border-top: 1px solid rgba(239, 68, 68, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-box {
  display: flex;
  align-items: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: #e4e4e7;
}

.user-pts {
  font-size: 10px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.engine-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.engine-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #52525b;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.engine-dot.online {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

/* ==================== CONTENT AREA (SCROLLS INTERNALLY ONLY) ==================== */
.content-area {
  flex: 1;
  height: 100%;
  min-height: 0;
  padding: 24px 18px 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.content-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-right: 8px;
}

.header-titles h1 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  border: 1px solid transparent;
}

.btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.btn-stop {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(239, 68, 68, 0.30);
  color: var(--accent-light);
}

.btn-stop:hover {
  background: rgba(220, 38, 38, 0.20);
  border-color: rgba(239, 68, 68, 0.50);
}

.btn-stop.stopped {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #4ade80;
}

.btn-reset {
  background: #15121d;
  border-color: rgba(255, 255, 255, 0.08);
  color: #a1a1aa;
}

.btn-reset:hover {
  background: #1d1828;
  color: #e4e4e7;
}

.btn-save {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.40);
}

.btn-save:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 4px 22px rgba(239, 68, 68, 0.60);
  transform: translateY(-1px);
}

/* ==================== CATEGORY CARDS (2 INDEPENDENT COLUMNS, NO VERTICAL GAP) ==================== */
.category-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  padding-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: start;
}

.category-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Custom Purple Scrollbar inside Menu */
.category-grid::-webkit-scrollbar,
.pose-list::-webkit-scrollbar {
  width: 6px;
}

.category-grid::-webkit-scrollbar-track,
.pose-list::-webkit-scrollbar-track {
  background: rgba(15, 11, 24, 0.6);
  border-radius: 999px;
}

.category-grid::-webkit-scrollbar-thumb,
.pose-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.55), rgba(153, 27, 27, 0.75));
  border-radius: 999px;
}

.category-grid::-webkit-scrollbar-thumb:hover,
.pose-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f87171, #dc2626);
}

.param-card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.card-header {
  font-size: 12px;
  font-weight: 600;
  color: #8b8b95;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Slider Controls */
.hit-area-control {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.hit-area-control.pose-item {
  cursor: pointer;
}

.hit-area-control.pose-item.selected {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.28);
}

.hit-area-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hit-area-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #8e8e98;
  text-transform: uppercase;
}

.hit-area-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hit-area-val {
  font-family: 'Inter', 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: #f87171;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}

.btn-inline-reset {
  background: transparent;
  border: none;
  color: #71717a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.15s ease, transform 0.2s ease;
}

.btn-inline-reset:hover {
  color: #e4e4e7;
  transform: rotate(-35deg);
}

.btn-inline-reset svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ==================== POSE BUILDER (UPGRADED INPUT + ADD / DELETE BUTTONS) ==================== */
.pose-builder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pose-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pose-input-icon {
  position: absolute;
  left: 12px;
  width: 14px;
  height: 14px;
  stroke: #dc2626;
  stroke-width: 2.2;
  fill: none;
  pointer-events: none;
  transition: stroke 0.18s ease, filter 0.18s ease;
}

.pose-input {
  width: 100%;
  background: linear-gradient(180deg, #0d0b14 0%, #14111f 100%);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 10px;
  padding: 10px 12px 10px 34px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  font-family: inherit;
  outline: none;
  user-select: text;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.65),
    0 1px 0 rgba(255, 255, 255, 0.03);
  transition: all 0.18s ease;
}

.pose-input::placeholder {
  color: #656372;
}

.pose-input:focus {
  border-color: var(--accent-bright);
  background: linear-gradient(180deg, #100d19 0%, #181326 100%);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.65),
    0 0 0 3px rgba(239, 68, 68, 0.16),
    0 0 16px rgba(239, 68, 68, 0.22);
}

.pose-input-wrap:focus-within .pose-input-icon {
  stroke: #f87171;
  filter: drop-shadow(0 0 5px rgba(248, 113, 113, 0.7));
}

.pose-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-pose {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid transparent;
}

.btn-pose::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: skewX(-22deg);
  transition: left 0.45s ease;
  pointer-events: none;
}

.btn-pose:hover::after {
  left: 140%;
}

.btn-pose-icon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s ease, background 0.18s ease;
}

.btn-pose-icon svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
}

/* Add Button — Neon Royal Purple */
.btn-pose-add {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 55%, #7f1d1d 100%);
  border-color: rgba(252, 165, 165, 0.45);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    0 6px 18px -3px rgba(220, 38, 38, 0.50);
}

.btn-pose-add .btn-pose-icon {
  background: rgba(255, 255, 255, 0.16);
}

.btn-pose-add:hover {
  transform: translateY(-1.5px);
  background: linear-gradient(135deg, #f87171 0%, #dc2626 55%, #991b1b 100%);
  border-color: rgba(254, 202, 202, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.40),
    0 8px 22px -2px rgba(239, 68, 68, 0.70);
}

.btn-pose-add:hover .btn-pose-icon {
  transform: rotate(90deg) scale(1.06);
  background: rgba(255, 255, 255, 0.24);
}

.btn-pose-add:active {
  transform: translateY(0.5px);
}

/* Delete Button — Crimson Tactical Glass */
.btn-pose-del {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.28) 0%, rgba(127, 29, 29, 0.42) 100%);
  border-color: rgba(248, 113, 113, 0.36);
  color: #fecaca;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 6px 16px -4px rgba(220, 38, 38, 0.28);
}

.btn-pose-del .btn-pose-icon {
  background: rgba(239, 68, 68, 0.20);
  color: #f87171;
}

.btn-pose-del:hover {
  transform: translateY(-1.5px);
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border-color: rgba(252, 165, 165, 0.65);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 22px -2px rgba(239, 68, 68, 0.55);
}

.btn-pose-del:hover .btn-pose-icon {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.btn-pose-del:active {
  transform: translateY(0.5px);
}

.pose-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pose-list:empty {
  display: none;
}

/* ==================== GENERAL CATEGORY (ทั่วไป) CONTROLS ==================== */
.general-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.general-label {
  font-size: 12px;
  font-weight: 600;
  color: #d4d4d8;
  line-height: 1.35;
}

.general-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Purple Neon Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 40px;
  height: 21px;
  background: linear-gradient(180deg, #0d0b14 0%, #171324 100%);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 999px;
  position: relative;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.75);
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #71717a;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.toggle-switch input:checked + .toggle-track {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border-color: #fca5a5;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.25),
    0 0 14px rgba(239, 68, 68, 0.55);
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(19px);
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

/* Keybind Chip for Auto Emo */
.keybind-chip {
  min-width: 36px;
  height: 24px;
  padding: 0 10px;
  border-radius: 7px;
  background: linear-gradient(180deg, #161222 0%, #0d0a14 100%);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: #fecaca;
  font-family: 'JetBrains Mono', 'Inter', monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 6px rgba(0, 0, 0, 0.45);
  transition: all 0.16s ease;
}

.keybind-chip:hover {
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.keybind-chip.listening,
.mode-key-btn.listening {
  border-color: #fca5a5 !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.38), rgba(153, 27, 27, 0.52)) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.75) !important;
  animation: pulseKeybind 1s infinite alternate;
}

.keybind-chip.key-active,
.mode-key-btn.key-active {
  border-color: #fca5a5 !important;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.45), rgba(127, 29, 29, 0.6)) !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.65) !important;
}

@keyframes pulseKeybind {
  0% {
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
  }
  100% {
    box-shadow: 0 0 18px rgba(252, 165, 165, 0.9);
  }
}

/* หัวแข็ง / ตัวไหล Block + Mode & Keybind Bar */
.head-strong-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mode-key-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 0.78fr;
  gap: 8px;
}

.mode-key-bar.hold-key-bar {
  grid-template-columns: 1.35fr 1fr;
}

.mode-pill {
  height: 32px;
  padding: 0 8px;
  border-radius: 9px;
  background: linear-gradient(180deg, #161321 0%, #100d18 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #a1a1aa;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 3px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-pill:hover {
  border-color: rgba(239, 68, 68, 0.38);
  color: #e4e4e7;
}

.mode-pill.active {
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.34) 0%, rgba(127, 29, 29, 0.46) 100%);
  border: 1.5px solid #ef4444;
  color: #f3e8ff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 14px rgba(239, 68, 68, 0.38);
}

.mode-key-btn {
  font-family: 'JetBrains Mono', 'Inter', monospace;
  font-weight: 700;
  color: #e4e4e7;
  background: linear-gradient(180deg, #181424 0%, #110e1a 100%);
  border-color: rgba(239, 68, 68, 0.25);
}

.mode-key-btn:hover {
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.42);
}

/* ==================== MELEE ANIM VIEWER (พรีวิวท่ารีตัว — IMAGE 2 & IMAGE 4) ==================== */
.workspace.mode-pose-preview .main-panel {
  max-width: 538px;
  flex: 0 1 538px;
  min-width: 380px;
}

.workspace.mode-pose-preview .content-area {
  padding: 16px 14px 0 16px;
}

.workspace.mode-pose-preview .visualizer-panel {
  flex: 1 1 0;
  width: auto;
  min-width: 400px;
  background: #000000;
}

.anim-browser-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: 'Outfit', 'IBM Plex Sans Thai', 'Inter', sans-serif;
  height: 100%;
  overflow: hidden;
}

.anim-brand {
  display: flex;
  align-items: center;
  padding: 2px 4px 0;
}

.anim-brand strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 22px;
  letter-spacing: 0.04em;
  color: #fafafa;
}

.anim-brand strong span {
  background: linear-gradient(160deg, #fca5a5, #ef4444 45%, #991b1b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.anim-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  flex-shrink: 0;
  padding: 0 12px;
  background: #050304;
  border: 1px solid #262230;
  border-radius: 12px;
  transition: border-color 0.14s ease-out;
}

.anim-field:hover {
  border-color: #443857;
}

.anim-field:focus-within {
  border-color: #ef4444;
}

.anim-field svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: #a3a3a3;
  stroke-width: 2;
  stroke-linecap: round;
}

.anim-field input {
  flex: 1 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: #fafafa;
  font-family: inherit;
  font-size: 14px;
  user-select: text;
}

.anim-field input::placeholder {
  color: #a3a3a3;
}

.anim-segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  flex-shrink: 0;
}

.anim-segmented button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  background: #0d0a13;
  border: 1px solid #262230;
  border-radius: 8px;
  color: #fafafa;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease-out, border-color 0.14s ease-out;
}

.anim-segmented button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anim-segmented button i {
  font-style: normal;
  font-size: 12px;
  color: #a3a3a3;
  font-variant-numeric: tabular-nums;
}

.anim-segmented button:hover {
  border-color: #443857;
  background: #171222;
}

.anim-segmented button[aria-pressed="true"] {
  background: rgba(239, 68, 68, 0.16);
  border-color: #ef4444;
}

.anim-segmented button[aria-pressed="true"] i {
  color: #fafafa;
}

.anim-list-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
  font-size: 12px;
  line-height: 16px;
  color: #a3a3a3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.anim-list-meta b {
  color: #fafafa;
  font-weight: 600;
}

.anim-meter {
  flex: 1 1;
  height: 2px;
  border-radius: 999px;
  background: #262230;
  overflow: hidden;
}

.anim-meter i {
  display: block;
  height: 100%;
  width: 100%;
  background: #ef4444;
  transition: width 0.14s ease-out;
}

.anim-clip-list {
  flex: 1 1;
  min-height: 0;
  margin: 0 -6px 0 0;
  padding: 0 6px 14px 0;
  list-style: none;
  overflow-y: auto;
  border-radius: 8px;
}

.anim-clip-list::-webkit-scrollbar {
  width: 6px;
}

.anim-clip-list::-webkit-scrollbar-track {
  background: transparent;
}

.anim-clip-list::-webkit-scrollbar-thumb {
  background: #3f384c;
  border-radius: 999px;
}

.anim-clip-list::-webkit-scrollbar-thumb:hover {
  background: #ef4444;
}

.anim-clip-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.14s ease-out, border-color 0.14s ease-out;
}

.anim-clip-list li + li {
  margin-top: 2px;
}

.anim-clip-list li:hover {
  background: #171222;
}

.anim-clip-list li[aria-selected="true"] {
  background: rgba(239, 68, 68, 0.16);
  border-color: #ef4444;
}

.anim-clip-list .name {
  font-size: 13.5px;
  font-weight: 600;
  color: #fafafa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anim-clip-list .dict {
  grid-column: 1;
  font-size: 12px;
  line-height: 16px;
  color: #a3a3a3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anim-clip-list .len {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-size: 12px;
  color: #a3a3a3;
  font-variant-numeric: tabular-nums;
}

.anim-clip-list li[aria-selected="true"] .len {
  color: #fafafa;
  font-weight: 600;
}

.anim-clip-list li.loading .len::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 6px;
  border: 2px solid #f87171;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: animSpin 0.7s linear infinite;
}

@keyframes animSpin {
  to {
    transform: rotate(1turn);
  }
}

.anim-clip-list .empty {
  display: block;
  cursor: default;
  color: #a3a3a3;
  padding: 24px 12px;
  text-align: center;
}

/* ==================== 3D STAGE VIEWPORT IN RIGHT PANEL (IMAGE 4) ==================== */
.anim-viewer-stage {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000000;
  overflow: hidden;
  font-family: 'Outfit', 'IBM Plex Sans Thai', 'Inter', sans-serif;
}

#anim-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.anim-now {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 248px;
  padding: 14px 16px;
  background: rgba(10, 8, 15, 0.84);
  border: 1px solid #2b2438;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px) saturate(120%);
  overflow: hidden;
  z-index: 5;
}

.anim-now::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, #fca5a5, #b91c1c 55%, transparent 90%);
}

.anim-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f87171;
}

.anim-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: animPulse 1.6s ease-out infinite;
}

@keyframes animPulse {
  to {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

.anim-now-name {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 24px;
  color: #fafafa;
  overflow-wrap: anywhere;
}

.anim-now-dict {
  margin: 3px 0 0;
  font-size: 12px;
  color: #a3a3a3;
  overflow-wrap: anywhere;
}

.anim-now-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.anim-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  background: #14111c;
  border: 1px solid #2b2438;
  border-radius: 8px;
  color: #fafafa;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease-out;
}

.anim-btn:hover {
  border-color: #4a3d63;
  background: #1d1829;
}

.anim-btn svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.anim-btn.primary {
  background: linear-gradient(160deg, #f87171, #dc2626 45%, #7f1d1d);
  border-color: transparent;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 6px 20px -8px rgba(239, 68, 68, 0.55);
}

.anim-btn.primary:hover {
  filter: brightness(1.12);
}

.anim-btn.copied {
  border-color: #ef4444;
  color: #fecaca;
}

.anim-btn.icon-btn {
  width: 36px;
  min-height: 36px;
  padding: 0;
  flex: none;
}

#anim-play svg {
  fill: currentColor;
}

#anim-play .i-play {
  display: none;
}

#anim-play[data-paused="true"] .i-play {
  display: block;
}

#anim-play[data-paused="true"] .i-pause {
  display: none;
}

.anim-transport {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: rgba(10, 8, 15, 0.84);
  border: 1px solid #2b2438;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px) saturate(120%);
  z-index: 5;
}

input[type="range"].anim-scrub {
  flex: 1 1;
  min-width: 60px;
  height: 5px;
  margin: 0 6px;
  border: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.22);
}

input[type="range"].anim-scrub::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #f3e8ff;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.85);
}

input[type="range"].anim-scrub::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #f3e8ff;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.85);
}

.anim-time {
  min-width: 90px;
  text-align: right;
  font-size: 12.5px;
  color: #a3a3a3;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.anim-control.inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  font-size: 12.5px;
  color: #a3a3a3;
  white-space: nowrap;
}

.anim-control select {
  min-height: 30px;
  padding: 0 8px;
  background: #050304;
  color: #fafafa;
  border: 1px solid #2b2438;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  outline: none;
}

.anim-control select:hover {
  border-color: #4a3d63;
}

/* ==================== UPGRADED SLIDER WITH PANEL PIXEL LOGO THUMB ==================== */
.range-wrap {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--track-bg);
  border: 1px solid rgba(239, 68, 68, 0.24);
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.85),
    0 0 10px rgba(220, 38, 38, 0.14);
  outline: none;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="range"]:hover {
  border-color: rgba(248, 113, 113, 0.45);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #000000 url('logo.png?v=3') center / cover no-repeat;
  border: 2px solid #f87171;
  box-shadow:
    0 0 12px rgba(239, 68, 68, 0.95),
    0 0 4px rgba(252, 165, 165, 0.85),
    inset 0 0 5px rgba(239, 68, 68, 0.55);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.15s ease, border-color 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.16);
  border-color: #f3e8ff;
  box-shadow:
    0 0 18px rgba(239, 68, 68, 1),
    0 0 28px rgba(220, 38, 38, 0.80),
    inset 0 0 6px rgba(248, 113, 113, 0.75);
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.06);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #000000 url('logo.png?v=3') center / cover no-repeat;
  border: 2px solid #f87171;
  box-shadow:
    0 0 12px rgba(239, 68, 68, 0.95),
    0 0 4px rgba(252, 165, 165, 0.85),
    inset 0 0 5px rgba(239, 68, 68, 0.55);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.15s ease, border-color 0.15s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.16);
  border-color: #f3e8ff;
  box-shadow:
    0 0 18px rgba(239, 68, 68, 1),
    0 0 28px rgba(220, 38, 38, 0.80),
    inset 0 0 6px rgba(248, 113, 113, 0.75);
}

/* ==================== RIGHT HIT-AREA VISUALIZER PANEL (FIXED HEIGHT) ==================== */
.visualizer-panel {
  width: 440px;
  height: 640px;
  max-height: 640px;
  flex-shrink: 0;
  background: radial-gradient(circle at 50% 46%, #1b1d24 0%, #101116 58%, #0a0a0e 100%);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(220, 38, 38, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.visualizer-stage {
  position: relative;
  width: 420px;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.front-indicator {
  position: absolute;
  top: auto;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 6;
  pointer-events: none;
}

.front-indicator span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #9ca3af;
}

.front-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7.5px solid #cbd5e1;
  border-bottom: none;
}

.side-marker {
  position: absolute;
  top: 198px;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  z-index: 6;
}

.side-marker.left {
  left: 34px;
  color: #64748b;
}

.side-marker.right {
  right: 34px;
  color: #994b4b;
}

/* Authentic FiveM GTA Character Render SVG */
.character-svg {
  width: 390px;
  height: 390px;
  position: absolute;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.85));
}

/* Expandable Golden Hexagonal Hit Area Sphere */
.hit-sphere-anchor {
  position: absolute;
  top: 174px;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hit-sphere {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  position: relative;
  border: 2px solid rgba(234, 179, 8, 0.82);
  box-shadow:
    0 0 20px rgba(234, 179, 8, 0.28),
    inset 0 0 22px rgba(234, 179, 8, 0.24);
  background-color: rgba(30, 34, 42, 0.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='48' viewBox='0 0 28 48'%3E%3Cg fill='none' stroke='%23eab308' stroke-width='0.95' stroke-opacity='0.52'%3E%3Cpath d='M14 0l14 8v16l-14 8L0 24V8zM14 48l14-8V24l-14-8L0 24v16z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 25px 43px;
  background-position: center;
  transition: width 0.08s ease-out, height 0.08s ease-out;
}

/* Inner rim ring for 3D spherical look */
.hit-sphere::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px dashed rgba(250, 204, 21, 0.45);
  background: radial-gradient(circle at 50% 50%, transparent 45%, rgba(234, 179, 8, 0.12) 82%, rgba(250, 204, 21, 0.28) 100%);
}

/* Center vertex dot */
.hit-sphere::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 6px #facc15;
  transform: translate(-50%, -50%);
}

/* Callout line + x1.0 multiplier badge on sphere */
.sphere-callout {
  position: absolute;
  top: 174px;
  left: 50%;
  z-index: 5;
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: transform 0.08s ease-out;
}

.callout-line {
  width: 30px;
  height: 13px;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1.2;
  fill: none;
  margin-right: 6px;
}

.callout-text {
  font-family: 'Inter', 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #e4e4e7;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}

/* Toast notification (disabled) */
.toast,
.toast.show {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ==================== FULLSCREEN LOGIN SCREEN (1 AGENT = 1 USER) ==================== */
.workspace.workspace-locked {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  background: #040208;
  overflow: hidden;
  padding: 20px 24px;
}

.login-screen.hidden {
  display: none !important;
}

/* Fullscreen pure black background */
.login-bg-backdrop {
  position: absolute;
  inset: 0;
  background-color: #000000;
  background-image: none;
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}

/* Subtle purple spotlight beam */
.login-spotlight-beam {
  position: absolute;
  inset: -20%;
  background:
    linear-gradient(122deg, rgba(239, 68, 68, 0.20) 0%, rgba(185, 28, 28, 0.12) 26%, transparent 52%),
    radial-gradient(ellipse 46% 58% at 32% 52%, rgba(239, 68, 68, 0.18) 0%, rgba(127, 29, 29, 0.10) 48%, transparent 75%);
  pointer-events: none;
  z-index: 1;
}

/* Right Glassmorphic Login Panel (Obsidian Crimson Theme) */
.login-hero-stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  min-width: 0;
}

.login-orbit-system {
  position: relative;
  width: 560px;
  height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 950px;
}

.login-orbit-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.30) 0%, rgba(185, 28, 28, 0.12) 52%, transparent 75%);
  filter: blur(22px);
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.10);
}

.orbit-ring-outer {
  width: 540px;
  height: 540px;
  animation: orbitSpinCW 24s linear infinite;
}

.orbit-ring-inner {
  width: 396px;
  height: 396px;
  border-color: rgba(239, 68, 68, 0.26);
  animation: orbitSpinCCW 16s linear infinite;
}

.orbit-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 12px 3px rgba(255, 255, 255, 0.90), 0 0 22px 5px rgba(239, 68, 68, 0.72);
}

.orbit-dot.dot-1 { top: -4.5px; left: 50%; transform: translateX(-50%); }
.orbit-dot.dot-2 { bottom: 58px; left: 36px; }
.orbit-dot.dot-3 { top: 32px; left: 42px; }
.orbit-dot.dot-4 { bottom: -4.5px; left: 50%; transform: translateX(-50%); }

.orbit-badge {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(14, 7, 10, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.40), inset 0 0 8px rgba(239, 68, 68, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.94);
}

.orbit-badge svg {
  width: 18px;
  height: 18px;
}

.orbit-ring-outer .orbit-badge {
  animation: orbitSpinCCW 24s linear infinite;
}

.orbit-ring-inner .orbit-badge {
  animation: orbitSpinCW 16s linear infinite;
}

.orbit-badge.badge-1 { top: 72px; right: 38px; }
.orbit-badge.badge-2 { bottom: 72px; right: 38px; }
.orbit-badge.badge-3 { top: 50%; left: -19px; margin-top: -19px; }
.orbit-badge.badge-4 { bottom: 38px; left: 34px; }

.login-hero-logo-wrap {
  position: relative;
  z-index: 3;
  width: 260px;
  height: 260px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  animation: heroLogoSpin 10s linear infinite;
}

.login-hero-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  backface-visibility: visible;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 28px rgba(239, 68, 68, 0.42));
}

@keyframes orbitSpinCW {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes orbitSpinCCW {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes heroLogoSpin {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(-360deg); }
}

@media (max-width: 960px) {
  .login-hero-stage {
    display: none;
  }
  .login-screen {
    justify-content: center;
  }
}

.login-card-panel {
  position: relative;
  z-index: 3;
  width: 450px;
  max-width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(14, 7, 10, 0.92) 0%, rgba(8, 4, 6, 0.96) 100%);
  border: 1px solid rgba(239, 68, 68, 0.24);
  border-radius: 20px;
  box-shadow:
    -20px 0 70px rgba(0, 0, 0, 0.88),
    0 0 42px rgba(220, 38, 38, 0.16),
    inset 0 1px 0 rgba(248, 113, 113, 0.12);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 44px 22px;
}

.login-card-inner {
  margin-top: auto;
  margin-bottom: auto;
  display: flex;
  flex-direction: column;
}

/* Top Brand Lockup inside Login Card */
.login-brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-brand-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(135deg, #fca5a5, #dc2626);
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.52);
  flex-shrink: 0;
}

.login-brand-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.login-brand-texts {
  display: flex;
  flex-direction: column;
}

.login-brand-name {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #ffffff 0%, #fecaca 55%, #f87171 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.login-brand-sub {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: #a1a1aa;
  margin-top: 3px;
}

/* Form Title (ลงชื่อเข้าใช้) */
.login-form-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 18px;
  letter-spacing: 0.01em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-label {
  font-size: 12px;
  font-weight: 500;
  color: #d4d4d8;
}

.login-forgot-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  color: #f87171;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.login-forgot-btn:hover {
  color: #fecaca;
  text-decoration: underline;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.20);
  background: rgba(9, 6, 16, 0.82);
  color: #f8fafc;
  font-family: 'Inter', 'IBM Plex Sans Thai', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-input.has-toggle {
  padding-right: 40px;
}

.login-input::placeholder {
  color: #71717a;
}

.login-input:focus {
  border-color: rgba(239, 68, 68, 0.72);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.login-eye-btn {
  position: absolute;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #71717a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.login-eye-btn:hover {
  color: #fca5a5;
}

.login-eye-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

/* Alert Box inside Login Card */
.login-alert-box {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.45;
  border: 1px solid rgba(244, 63, 94, 0.42);
  background: rgba(159, 18, 57, 0.26);
  color: #fecdd3;
}

.login-alert-box.info {
  border-color: rgba(239, 68, 68, 0.48);
  background: rgba(127, 29, 29, 0.30);
  color: #f3e8ff;
}

/* Primary Pill Button (เข้าสู่ระบบ) — Purple Gradient Pill */
.btn-login-primary {
  height: 44px;
  margin-top: 6px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg, #fca5a5 0%, #ef4444 48%, #b91c1c 100%);
  color: #ffffff;
  font-family: 'Inter', 'IBM Plex Sans Thai', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.38);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-login-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.50);
  filter: brightness(1.06);
}

.btn-login-primary:active {
  transform: translateY(0);
}

/* Sidebar Bound User & Agent Card */
.sidebar-user-card {
  margin-top: auto;
  padding: 10px;
  border-radius: 12px;
  background: rgba(17, 15, 24, 0.88);
  border: 1px solid rgba(239, 68, 68, 0.16);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-user-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(239, 68, 68, 0.4);
  flex-shrink: 0;
}

.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 12px;
  font-weight: 700;
  color: #f4f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-agent {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: #f87171;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sidebar-logout {
  width: 100%;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(244, 63, 94, 0.28);
  background: rgba(136, 19, 55, 0.18);
  color: #fda4af;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sidebar-logout:hover {
  background: rgba(190, 18, 60, 0.34);
  border-color: rgba(244, 63, 94, 0.52);
  color: #ffffff;
}

.btn-sidebar-logout svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

@media (max-width: 960px) {
  .login-card-panel {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
  }
}

@media (max-width: 1180px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }
  .workspace {
    flex-direction: column;
    align-items: center;
  }
  .presets-panel,
  .main-panel,
  .visualizer-panel,
  .workspace.mode-pose-preview .main-panel,
  .workspace.mode-pose-preview .visualizer-panel {
    flex: none;
    min-width: 0;
    width: 100%;
    max-width: 880px;
  }
  .visualizer-panel,
  .workspace.mode-pose-preview .visualizer-panel {
    height: 520px;
    max-height: 520px;
  }
}

@media (max-width: 760px) {
  .main-panel {
    flex-direction: column;
    height: 720px;
    max-height: 720px;
  }
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(239, 68, 68, 0.08);
  }
  .category-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== MOBILE / TOUCH KEY PICKER MODAL ==================== */
.mobile-keypicker-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 2, 8, 0.78);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mobile-keypicker-overlay.open {
  display: flex;
}

.mobile-keypicker-card {
  width: 100%;
  max-width: 420px;
  max-height: 86vh;
  background: linear-gradient(165deg, rgba(20, 14, 30, 0.98) 0%, rgba(10, 7, 16, 0.99) 100%);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 28px rgba(220, 38, 38, 0.25);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.mobile-keypicker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-keypicker-title {
  font-size: 14px;
  font-weight: 700;
  color: #fecaca;
}

.mobile-keypicker-sub {
  font-size: 11.5px;
  color: #a1a1aa;
}

.mobile-keypicker-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.mobile-keypicker-group-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #fca5a5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mobile-keypicker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 6px;
}

.mobile-key-opt {
  height: 34px;
  padding: 0 6px;
  border-radius: 8px;
  background: #14101f;
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #e4e4e7;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.14s ease;
}

.mobile-key-opt:hover,
.mobile-key-opt:active,
.mobile-key-opt.active {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.45), rgba(127, 29, 29, 0.65));
  border-color: #fca5a5;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}

.mobile-keypicker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.mobile-keypicker-btn {
  flex: 1;
  height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #171324;
  color: #e4e4e7;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mobile-keypicker-btn.danger {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(153, 27, 27, 0.28);
  color: #fca5a5;
}

