@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
  --bg: #0c0b16;
  --surface: #151328;
  --surface-2: #1c1a33;
  --border: #2b2846;
  --text: #e7e7f5;
  --muted: #9ea0b8;
  --accent: #8b7bff;
  --accent-2: #ec6fb4;
  --glow: 0 12px 30px rgba(139, 123, 255, 0.15);
}

/* Reset + base */
body {
  margin: 0;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(139, 123, 255, 0.08), transparent 30%),
    linear-gradient(135deg, var(--bg) 0%, #0f0e1c 100%);
  color: var(--text);
  min-height: 100vh;
}

/* Custom scrollbar (Webkit + Firefox) */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 123, 255, 0.4) rgba(21, 19, 40, 0.6);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: rgba(21, 19, 40, 0.6);
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(139, 123, 255, 0.5), rgba(236, 111, 180, 0.4));
  border-radius: 8px;
  border: 1px solid rgba(43, 40, 70, 0.5);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(139, 123, 255, 0.75), rgba(236, 111, 180, 0.6));
}

/* Layout */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.top-bar {
  background: rgba(21, 19, 40, 0.85);
  backdrop-filter: blur(20px);
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(139, 123, 255, 0.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
  position: sticky;
  top: 0;
  z-index: 3000;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avatar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.user-dropdown {
  position: absolute;
  top: 52px;
  right: 0;
  width: 240px;
  background: linear-gradient(160deg, rgba(12, 10, 22, 0.98), rgba(18, 16, 32, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 4000;
}

.avatar-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4500;
}

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

.avatar-modal-content {
  width: min(820px, 96vw);
  background: linear-gradient(160deg, rgba(12, 10, 22, 0.98), rgba(18, 16, 32, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.avatar-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.avatar-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.avatar-modal-body {
  padding: 22px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}


.pill-btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.pill-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.upload-drop {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 28px;
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
}

.upload-drop:hover {
  border-color: rgba(139, 123, 255, 0.45);
  background: rgba(139, 123, 255, 0.08);
}

.upload-icon {
  font-size: 26px;
}

.upload-hint {
  color: var(--muted);
  font-size: 12px;
}

.avatar-editor {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.avatar-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-weight: 700;
}

.avatar-editor-actions {
  display: flex;
  gap: 8px;
}

.avatar-editor-stage {
  display: grid;
  place-items: center;
  padding: 12px;
}

.avatar-editor-circle {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.avatar-edit-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  border-radius: 50%;
}

.avatar-edit-image.dragging {
  cursor: grabbing;
}

.avatar-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.avatar-zoom input[type="range"] {
  flex: 1;
}

.avatar-preview-frame {
  width: 160px;
  height: 160px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
}

#avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.avatar-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.avatar-modal-footer {
  padding: 14px 18px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.user-dropdown.open {
  display: flex;
}

.user-dropdown-header {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.user-dropdown .avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.user-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.user-email {
  font-size: 12px;
  color: var(--muted);
}

.user-dropdown-actions {
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border 0.15s ease;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-menu-item:hover {
  background: linear-gradient(135deg, rgba(139, 123, 255, 0.18), rgba(236, 111, 180, 0.16));
  border-color: rgba(139, 123, 255, 0.35);
  transform: translateY(-1px);
}

.user-menu-item .icon {
  width: 20px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  flex-shrink: 0;
}

.icon-btn {
  background: rgba(99, 102, 241, 0.15);
  color: #a78bfa;
  border: 1.5px solid rgba(167, 139, 250, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(167, 139, 250, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
}

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

.icon-btn:disabled {
  background: rgba(100, 100, 120, 0.1);
  border-color: rgba(100, 100, 120, 0.2);
  color: #888;
  cursor: not-allowed;
  opacity: 0.5;
}

.badge {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#pro-badge {
  display: none; /* shown by JS only when user is confirmed Pro */
}

.main-layout {
  display: flex;
  flex: 1;
}

.sidebar {
  width: 250px;
  background: var(--surface);
  padding: 24px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar h2 {
  margin-bottom: 16px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  opacity: 0.6;
}

.workflow-list {
  margin-top: 12px;
  list-style: none;
  padding: 0;
}

.workflow-item {
  margin: 8px 0;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  transition: all 0.25s ease;
  font-size: 14px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workflow-item:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #e8e8f0;
  border-color: rgba(139, 123, 255, 0.35);
}

.workflow-item.active {
  background: linear-gradient(135deg, rgba(139, 123, 255, 0.25) 0%, rgba(236, 111, 180, 0.2) 100%);
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
  border-color: rgba(139, 123, 255, 0.35);
}

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

.workflow-dots {
  opacity: 0;
  transition: opacity 0.15s ease;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}

.workflow-item:hover .workflow-dots {
  opacity: 1;
}

.rename-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

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

.rename-dialog {
  width: min(420px, 90vw);
  background: linear-gradient(160deg, rgba(12, 10, 22, 0.98), rgba(18, 16, 32, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.rename-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rename-header h4 {
  margin: 0;
  font-size: 16px;
}

.rename-close {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}

.rename-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rename-body label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.rename-body input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}

.rename-body input:focus {
  border-color: rgba(139, 123, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 123, 255, 0.2);
}

.primary-btn {
  padding: 12px 20px;
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  margin-top: 12px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

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

.content {
  flex: 1;
  padding: 28px 28px 40px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  background: linear-gradient(135deg, rgba(21, 19, 40, 0.7) 0%, rgba(18, 16, 32, 0.9) 100%);
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.workspace-header .hint {
  margin-bottom: 0;
  font-size: 12px;
  margin-top: 3px;
}

.workspace-header h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.card {
  background: rgba(28, 26, 51, 0.6);
  backdrop-filter: blur(20px);
  padding: 24px;
  margin-bottom: 24px;
  border-radius: 16px;
  border: 1px solid rgba(139, 123, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(139, 123, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card h2 {
  margin-top: 0;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: var(--text);
}

textarea {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: rgba(20, 18, 35, 0.9);
  border: 1.5px solid var(--border);
  color: var(--text);
  margin-bottom: 16px;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  transition: all 0.25s ease;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(10, 10, 20, 1);
  box-shadow: 0 0 20px rgba(139, 123, 255, 0.18);
}

.hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
  opacity: 0.75;
  line-height: 1.5;
}

.placeholder {
  opacity: 0.7;
}

.result-block {
  opacity: 0;
  animation: fadeInResult 0.35s ease-out forwards;
}

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

/* Workflow section - two column layout */
.workflow-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.workflow-input-card {
  display: flex;
  flex-direction: column;
}

.workflow-input-card textarea {
  flex: 1;
  resize: none;
}

/* AI Chat Panel */
.ai-chat-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  max-height: 520px;
}

.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.ai-chat-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.ai-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

#clear-chat-btn {
  font-size: 16px;
  padding: 6px 10px;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 120px;
  max-height: 340px;
}

.ai-message, .user-message {
  animation: slideInChat 0.3s ease;
  max-width: 90%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.ai-message {
  align-self: flex-start;
  background: rgba(139, 123, 255, 0.12);
  border: 1px solid rgba(139, 123, 255, 0.3);
  color: var(--text);
}

.user-message {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(139, 123, 255, 0.25) 0%, rgba(236, 111, 180, 0.18) 100%);
  border: 1px solid rgba(139, 123, 255, 0.35);
  color: var(--text);
}

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

.ai-chat-input-area {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid rgba(100, 50, 200, 0.15);
  background: rgba(10, 10, 20, 0.4);
}

.ai-chat-input {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid rgba(100, 50, 200, 0.2);
  border-radius: 10px;
  background: rgba(10, 10, 20, 0.8);
  color: #e8e8f0;
  font-size: 14px;
  transition: all 0.25s ease;
}

.ai-chat-input:focus {
  outline: none;
  border-color: rgba(100, 50, 200, 0.5);
  background: rgba(10, 10, 20, 1);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.ai-chat-input::placeholder {
  color: #707080;
}

/* AI suggestion card */
.ai-suggestion-card {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  padding: 14px;
  margin-top: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.ai-suggestion-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: #e8e8f0;
}

.ai-suggestion-steps {
  background: rgba(10, 10, 20, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 8px;
  padding: 10px;
  margin: 0;
  white-space: pre-wrap;
  color: #cfd4ff;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
}

.ai-suggestion-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.inline-btn {
  width: auto;
  min-width: 140px;
  margin-top: 0;
}

.secondary-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: rgba(99, 102, 241, 0.08);
  color: #e8e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.secondary-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}

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

/* Toasts */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(20, 20, 35, 0.9);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #e8e8f0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-weight: 600;
  pointer-events: auto;
}

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

.toast-success {
  border-color: rgba(72, 199, 116, 0.5);
  background: linear-gradient(135deg, rgba(72, 199, 116, 0.18), rgba(20, 20, 35, 0.95));
}

.toast-error {
  border-color: rgba(244, 63, 94, 0.5);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.18), rgba(20, 20, 35, 0.95));
}

.toast-info {
  border-color: rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(20, 20, 35, 0.95));
}

/* Graph section with side-by-side layout */
.graph-section {
  display: flex;
  flex-direction: column;
}

.graph-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.graph-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.graph-controls {
  display: flex;
  gap: 8px;
}

.graph-icon-btn {
  background: #2d79ff;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s ease;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.graph-icon-btn:hover {
  background: #5592ff;
  transform: translateY(-2px);
}

.graph-icon-btn:active {
  transform: translateY(0);
}

.graph-icon-btn:disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.5;
}

.graph-container {
  display: flex;
  gap: 12px;
  min-height: 500px;
  height: 65vh;
  max-height: 75vh;
  width: 100%;
  box-sizing: border-box;
  background: radial-gradient(circle at 20% 20%, rgba(139,123,255,0.06), rgba(15,15,30,0.28)),
    radial-gradient(circle at 80% 0%, rgba(236,111,180,0.05), rgba(15,15,30,0.24));
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: visible;
}

/* Graph container */
#graph {
  flex: 1;
  background:
    radial-gradient(circle at 30% 20%, rgba(139,123,255,0.08), rgba(15,15,30,0.6)),
    linear-gradient(160deg, rgba(21,19,40,0.9), rgba(12,10,22,0.95));
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
  z-index: 10;
  box-sizing: border-box;
  box-shadow: var(--glow);
}

.graph-resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: rgba(255,255,255,0.9);
  border: 1.5px solid rgba(139, 123, 255, 0.8);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: se-resize;
  z-index: 100;
  display: none;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.graph-resize-handle:hover {
  transform: translate(-50%, -50%) scale(1.3);
  box-shadow: 0 2px 8px rgba(139, 123, 255, 0.5);
  background: #fff;
}

.graph-inline-editor {
  position: fixed;
  z-index: 5000;
  background: rgba(12, 10, 22, 0.96);
  color: var(--text);
  border: 1px solid rgba(139, 123, 255, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  min-width: 160px;
  max-width: 420px;
  resize: none;
  outline: none;
  box-sizing: border-box;
}

/* Graph toolbar */
.graph-actions {
  display: flex;
  gap: 6px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(139, 123, 255, 0.04);
  color: var(--muted);
  border: 1px solid rgba(139, 123, 255, 0.08);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
  min-width: 36px;
  white-space: nowrap;
}

.ghost-btn svg {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.ghost-btn:hover {
  background: rgba(139, 123, 255, 0.1);
  color: var(--text);
  border-color: rgba(139, 123, 255, 0.2);
  transform: translateY(-1px);
}

.ghost-btn:hover svg {
  opacity: 1;
  color: var(--accent);
}

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

.ghost-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* ===== Node Editor Panel ===== */
#node-editor-panel {
  width: 280px;
  min-width: 280px;
  flex-shrink: 0;
  padding: 0;
  background: linear-gradient(180deg, rgba(16, 14, 32, 0.98) 0%, rgba(11, 10, 22, 0.98) 100%);
  color: var(--text);
  border-radius: 16px;
  box-sizing: border-box;
  border: 1px solid rgba(139, 123, 255, 0.12);
  overflow-y: auto;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.node-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(139, 123, 255, 0.06);
}

.node-editor-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.node-editor-header h3 svg {
  opacity: 0.6;
  color: var(--accent);
}

.node-editor-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(139, 123, 255, 0.08);
  padding: 3px 10px;
  border-radius: 20px;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em;
  border: 1px solid rgba(139, 123, 255, 0.12);
}

/* Empty state */
.node-editor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  gap: 10px;
}

.node-editor-empty svg {
  color: var(--accent);
}

.node-editor-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.node-editor-empty small {
  font-size: 11px;
  color: rgba(158, 160, 184, 0.5);
}

/* Editor content */
.node-editor-content {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Section layout */
.node-editor-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.node-editor-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Labels */
.node-editor-section label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

.node-editor-section label svg {
  opacity: 0.5;
  color: var(--accent);
}

/* Text input */
.node-editor-section input[type="text"],
#node-label-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(139, 123, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#node-label-input:focus {
  border-color: rgba(139, 123, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(139, 123, 255, 0.08);
  background: rgba(139, 123, 255, 0.04);
}

#node-label-input:hover:not(:focus) {
  border-color: rgba(139, 123, 255, 0.2);
}

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

.current-color-display {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.current-color-display:hover {
  transform: scale(1.1);
  border-color: rgba(139, 123, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.color-picker-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-family: 'Space Grotesk', monospace;
  opacity: 0.7;
}

/* Size sliders */
.size-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.size-label {
  min-width: 16px;
  font-weight: 700;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  opacity: 0.6;
}

.size-slider {
  flex: 1;
  display: flex;
  align-items: center;
}

.size-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(139, 123, 255, 0.12);
  border-radius: 3px;
  outline: none;
  transition: background 0.2s ease;
}

.size-slider input[type="range"]:hover {
  background: rgba(139, 123, 255, 0.2);
}

.size-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px rgba(139, 123, 255, 0.3), 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.size-slider input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 4px rgba(139, 123, 255, 0.15), 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: scale(1.1);
}

.size-slider input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px rgba(139, 123, 255, 0.3), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.size-value {
  min-width: 34px;
  text-align: right;
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  font-family: 'Space Grotesk', monospace;
  opacity: 0.7;
}

/* Match sizes button */
.node-editor-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(139, 123, 255, 0.1);
  background: rgba(139, 123, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.node-editor-action-btn:hover {
  background: rgba(139, 123, 255, 0.12);
  color: var(--text);
  border-color: rgba(139, 123, 255, 0.25);
  transform: translateY(-1px);
}

.node-editor-action-btn svg {
  opacity: 0.6;
  color: var(--accent);
}

/* Divider */
.node-editor-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 123, 255, 0.1), transparent);
  margin: 6px 0 14px;
}

/* Delete button */
.node-editor-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 80, 80, 0.1);
  background: rgba(255, 60, 60, 0.04);
  color: #e06666;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.2s ease;
}

.node-editor-delete-btn:hover {
  background: rgba(255, 60, 60, 0.1);
  color: #ff7777;
  border-color: rgba(255, 80, 80, 0.2);
  transform: translateY(-1px);
}

.node-editor-delete-btn svg {
  opacity: 0.7;
}

.ai-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: 12px;
}

.ai-thinking .spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

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



/* ===== Google-style Color Picker ===== */
.color-picker-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 6000;
  align-items: center;
  justify-content: center;
}

.color-picker-modal.active {
  display: flex;
}

.color-picker-content {
  background: linear-gradient(160deg, rgba(14, 12, 26, 0.99), rgba(10, 9, 20, 0.99));
  border-radius: 16px;
  padding: 20px;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(139, 123, 255, 0.15);
  border: 1px solid rgba(139, 123, 255, 0.12);
}

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

.color-picker-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.close-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.close-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.1);
}

/* Gradient square */
.cp-gradient-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  cursor: crosshair;
  flex-shrink: 0;
}

#cp-gradient {
  width: 100%;
  height: 100%;
  display: block;
}

.cp-cursor {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
  top: 0;
  left: 0;
}

/* Hue + opacity sliders row */
.cp-sliders {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cp-preview-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.cp-slider-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Hue rainbow slider */
.cp-hue-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right,
    hsl(0,100%,50%), hsl(30,100%,50%), hsl(60,100%,50%),
    hsl(90,100%,50%), hsl(120,100%,50%), hsl(150,100%,50%),
    hsl(180,100%,50%), hsl(210,100%,50%), hsl(240,100%,50%),
    hsl(270,100%,50%), hsl(300,100%,50%), hsl(330,100%,50%),
    hsl(360,100%,50%));
  outline: none;
  cursor: pointer;
  border: none;
}

.cp-hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
}

.cp-hue-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
}

/* Opacity slider */
.cp-opacity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, transparent, var(--accent));
  outline: none;
  cursor: pointer;
  border: none;
}

.cp-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
}

.cp-opacity-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
}

/* Hex input row */
.cp-hex-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(139,123,255,0.1);
  border-radius: 8px;
  padding: 6px 10px;
}

.cp-hex-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.7;
  flex-shrink: 0;
}

.cp-hex-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Space Grotesk', monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0;
}

/* Presets grid */
.cp-presets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cp-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 4px;
}

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

.cp-swatch {
  aspect-ratio: 1;
  border-radius: 5px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.cp-swatch:hover {
  transform: scale(1.18);
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.3);
}

.color-picker-footer {
  padding: 0;
}

/* Node Edit Modal */
.node-edit-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.node-edit-modal.active {
  display: flex;
}

.node-edit-dialog {
  width: min(460px, 90vw);
  background: linear-gradient(160deg, rgba(12, 10, 22, 0.98), rgba(18, 16, 32, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.node-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.node-edit-header h4 {
  margin: 0;
  font-size: 16px;
}

.node-edit-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.node-edit-body label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.node-edit-body textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease;
  resize: vertical;
}

.node-edit-body textarea:focus {
  border-color: rgba(139, 123, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 123, 255, 0.2);
}

.node-edit-footer {
  padding: 12px 16px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Rename footer with delete button */
.rename-footer {
  padding: 12px 16px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.rename-footer-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.rename-footer .primary-btn {
  width: auto;
  margin-top: 0;
  min-width: 80px;
  padding: 8px 18px;
}

.rename-footer .secondary-btn {
  padding: 8px 14px;
}

.danger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 80, 80, 0.15);
  background: rgba(255, 60, 60, 0.06);
  color: #cc6666;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.15s ease;
}

.danger-btn:hover {
  background: rgba(255, 60, 60, 0.14);
  color: #ff7777;
  border-color: rgba(255, 80, 80, 0.3);
}

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

.danger-btn svg {
  opacity: 0.7;
}

/* Graph toolbar flex wrap for smaller screens */
.graph-actions {
  flex-wrap: wrap;
}

.graph-actions .ghost-btn {
  font-size: 12px;
}

/* ===== Dropdown Wrappers ===== */
.layout-dropdown-wrapper,
.calendar-dropdown-wrapper {
  position: relative;
}

/* ===== Layout Dropdown ===== */
.layout-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: var(--surface);
  border: 1px solid rgba(139, 123, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  z-index: 4000;
  padding: 6px;
  backdrop-filter: blur(20px);
}

.layout-dropdown.open {
  display: block;
}

.layout-dropdown-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 8px 12px 4px;
}

.layout-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
  text-align: left;
}

.layout-dropdown-item:hover {
  background: rgba(139, 123, 255, 0.08);
}

.layout-dropdown-item svg {
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.6;
  color: var(--accent);
}

.layout-dropdown-item:hover svg {
  opacity: 1;
}

.layout-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.layout-item-text span {
  font-weight: 600;
  font-size: 13px;
}

.layout-item-text small {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.7;
  line-height: 1.3;
}

.layout-dropdown-divider {
  height: 1px;
  background: rgba(139, 123, 255, 0.08);
  margin: 4px 8px;
}

.layout-ai-item {
  color: var(--accent);
}

.layout-ai-item:hover {
  background: rgba(139, 123, 255, 0.12);
}

/* ===== Calendar Dropdown ===== */
.calendar-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid rgba(139, 123, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  z-index: 4000;
  padding: 6px;
  backdrop-filter: blur(20px);
}

.calendar-dropdown.open {
  display: block;
}

.calendar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
  text-align: left;
}

.calendar-dropdown-item:hover {
  background: rgba(139, 123, 255, 0.08);
}

.calendar-dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.6;
  color: var(--accent);
}

.calendar-dropdown-item:hover svg {
  opacity: 1;
}
/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {

  /* Hide the complex workspace on mobile */
  .app-shell {
    display: none !important;
  }

  /* Show mobile message instead */
  .mobile-message {
    display: flex !important;
  }
}

/* Mobile message — hidden on desktop */
.mobile-message {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
  text-align: center;
  background: #0a0612;
  color: #e8e0ff;
}

.mobile-message-logo {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #8b7bff, #ec6fb4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 32px;
}

.mobile-message-icon {
  font-size: 56px;
  margin-bottom: 24px;
}

.mobile-message h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.mobile-message p {
  font-size: 15px;
  color: rgba(232, 224, 255, 0.6);
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 32px;
}

.mobile-message-btn {
  display: inline-block;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: white;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 16px;
}

.mobile-message-secondary {
  font-size: 13px;
  color: rgba(232, 224, 255, 0.4);
}
/* ===== Node Date Input ===== */
.node-date-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(139, 123, 255, 0.1);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  color-scheme: dark;
}

.node-date-input:focus {
  border-color: rgba(139, 123, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(139, 123, 255, 0.08);
}

/* ===== Node Notes Textarea ===== */
.node-notes-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(139, 123, 255, 0.1);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 400;
  outline: none;
  box-sizing: border-box;
  resize: vertical;
  line-height: 1.5;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 0;
}

.node-notes-input:focus {
  border-color: rgba(139, 123, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(139, 123, 255, 0.08);
}

.node-notes-input::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

/* ===== Calendar View Modal ===== */
.calendar-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 6000;
  align-items: center;
  justify-content: center;
}

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

.calendar-modal-content {
  background: linear-gradient(160deg, rgba(14, 12, 26, 0.99), rgba(10, 9, 20, 0.99));
  border: 1px solid rgba(139, 123, 255, 0.15);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  width: min(760px, 95vw);
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.calendar-nav h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  min-width: 160px;
  text-align: center;
}

.cal-nav-btn {
  background: rgba(139, 123, 255, 0.1);
  border: 1px solid rgba(139, 123, 255, 0.2);
  color: var(--accent);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.cal-nav-btn:hover {
  background: rgba(139, 123, 255, 0.2);
  border-color: rgba(139, 123, 255, 0.4);
}

.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.calendar-grid-header div {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0.6;
  padding: 6px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-cell {
  min-height: 80px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(139, 123, 255, 0.06);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 0.15s ease;
}

.cal-cell:hover {
  background: rgba(139, 123, 255, 0.06);
}

.cal-cell.cal-empty {
  background: transparent;
  border-color: transparent;
}

.cal-cell.cal-today {
  border-color: rgba(139, 123, 255, 0.4);
  background: rgba(139, 123, 255, 0.08);
}

.cal-day-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.7;
}

.cal-cell.cal-today .cal-day-num {
  color: var(--accent);
  opacity: 1;
}

.cal-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.cal-chip:hover {
  opacity: 0.85;
}

/* ===== Custom Node Date Picker ===== */
.node-date-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.node-date-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(139, 123, 255, 0.1);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
  cursor: pointer;
  transition: border 0.2s ease;
}

.node-date-input:hover {
  border-color: rgba(139, 123, 255, 0.25);
}

.node-date-input::placeholder {
  color: var(--muted);
  opacity: 0.4;
}

.node-date-clear {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  opacity: 0.5;
  padding: 4px;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.node-date-clear:hover {
  opacity: 1;
  color: #ff7777;
}

.node-date-picker {
  background: linear-gradient(160deg, rgba(14, 12, 26, 0.99), rgba(18, 16, 34, 0.99));
  border: 1px solid rgba(139, 123, 255, 0.2);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  margin-top: 4px;
  position: relative;
  z-index: 100;
}

.ndp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ndp-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.ndp-nav {
  background: rgba(139, 123, 255, 0.1);
  border: 1px solid rgba(139, 123, 255, 0.15);
  color: var(--accent);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}

.ndp-nav:hover {
  background: rgba(139, 123, 255, 0.2);
}

.ndp-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.ndp-dow span {
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  opacity: 0.5;
  padding: 2px 0;
}

.ndp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.ndp-day {
  background: none;
  border: none;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 500;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ndp-day:hover {
  background: rgba(139, 123, 255, 0.15);
  color: var(--accent);
}

.ndp-day.ndp-today {
  border: 1px solid rgba(139, 123, 255, 0.4);
  color: var(--accent);
  font-weight: 700;
}

.ndp-day.ndp-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.ndp-day.ndp-selected:hover {
  background: var(--accent-2);
}
.ndp-manual-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(139, 123, 255, 0.15);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 10px;
  transition: border 0.2s ease;
}

.ndp-manual-input:focus {
  border-color: rgba(139, 123, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(139, 123, 255, 0.08);
}

.ndp-manual-input::placeholder {
  color: var(--muted);
  opacity: 0.4;
}
.ndp-error {
  font-size: 11px;
  color: #ff7777;
  font-weight: 600;
  padding: 4px 2px;
  font-family: 'Space Grotesk', sans-serif;
}
/* ── Password field with toggle ─────────────────────────────────────────── */
.pw-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-field-wrap input {
  flex: 1;
  padding-right: 44px !important;
}

.pw-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(232, 224, 255, 0.4);
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.pw-toggle:hover { color: rgba(232, 224, 255, 0.8); }

.pw-countdown {
  font-size: 11px;
  font-weight: 600;
  color: #8b7bff;
  min-width: 14px;
}

/* ── Signup validation checklist ────────────────────────────────────────── */
.pw-checklist {
  list-style: none;
  padding: 10px 4px 4px;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pw-checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(232, 224, 255, 0.4);
  transition: color 0.2s;
  line-height: 1.4;
}

.pw-checklist li::before {
  content: '●';
  font-size: 10px;
  color: rgba(232, 224, 255, 0.2);
  flex-shrink: 0;
  width: 14px;
  text-align: center;
  transition: all 0.2s;
}

.pw-checklist li.valid {
  color: #4ade80;
}

.pw-checklist li.valid::before {
  content: '✓';
  color: #4ade80;
  font-size: 12px;
  font-weight: 700;
}

/* ── Signup inline error ─────────────────────────────────────────────────── */
.signup-inline-error {
  display: none;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 9px 12px;
  margin-bottom: 10px;
  text-align: left;
}
/* Header text nav links */
.header-text-btn {
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #8b7bff, #ec6fb4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
  transition: opacity 0.2s;
  user-select: none;
  letter-spacing: -0.3px;
}
.header-text-btn:hover {
  opacity: 0.8;
}