:root {
  --primary: #007AFF;
  --primary-hover: #0056b3;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1d1d1f;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --input-bg: #ffffff;
  --rainbow: linear-gradient(45deg, #ff9a9e, #fad0c4, #ffecd2, #a1c4fd, #c2e9fb, #d4fc79, #84fab0);
  --sidebar-width: 290px;
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* THEMES */
body.theme-ruled .np-content-area {
  background-image: repeating-linear-gradient(to bottom, transparent 0px, transparent 31px, #e2e8f0 32px);
  line-height: 32px;
}

body.theme-dark {
  --bg: #09090b;
  --card-bg: #18181b;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --border: #27272a;
  --input-bg: #18181b;
}

body.theme-dark .np-content-area {
  background-color: #18181b;
  color: #f4f4f5;
}

body.theme-dark .np-sidebar {
  background: #141416;
}

body.theme-dark .np-note-item {
  background: #1f1f23;
}

body.theme-dark .np-note-item:hover,
body.theme-dark .np-note-item.active {
  background: #27272a;
}

body.theme-mono .np-content-area {
  font-family: 'JetBrains Mono', monospace;
}

/* FONTS */
.font-sans { font-family: 'Inter', sans-serif !important; }
.font-serif { font-family: 'Merriweather', serif !important; }
.font-mono { font-family: 'JetBrains Mono', monospace !important; }
.font-handwriting { font-family: 'Caveat', cursive !important; font-size: 1.25em !important; }

/* LAYOUT CONTAINER */
main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px 50px;
  position: relative;
  z-index: 5;
}

.np-header-title {
  text-align: center;
  margin-bottom: 24px;
}

.np-header-title h1 {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.8px;
}

.np-header-title p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 6px;
}

/* RAINBOW WRAPPER */
.rainbow-wrapper {
  padding: 3px;
  border-radius: 26px;
  background: var(--rainbow);
  background-size: 300%;
  animation: rainbowMove 8s linear infinite;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

@keyframes rainbowMove {
  0% { background-position: 0% 50% }
  50% { background-position: 100% 50% }
  100% { background-position: 0% 50% }
}

/* STUDIO CARD CONTAINER */
.np-studio-card {
  background: var(--card-bg);
  border-radius: 24px;
  display: flex;
  height: 720px;
  min-height: 480px;
  overflow: hidden;
  position: relative;
  resize: vertical;
}

/* SIDEBAR (MULTI-NOTE DRAWER) */
.np-sidebar {
  width: var(--sidebar-width);
  background: #f8fafc;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, background 0.3s;
  flex-shrink: 0;
  z-index: 20;
}

.np-sidebar-top {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.np-sidebar-actions {
  display: flex;
  gap: 8px;
}

.np-btn-new-note {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.np-btn-new-note:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.np-search-box {
  position: relative;
}

.np-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.82rem;
  outline: none;
}

.np-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.np-notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.np-note-item {
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.np-note-item:hover {
  border-color: var(--primary);
  transform: translateX(2px);
}

.np-note-item.active {
  border-color: var(--primary);
  background: #eff6ff;
}

.np-note-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.np-note-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.np-note-item-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: 0.2s;
}

.np-note-item-delete:hover {
  opacity: 1;
  color: #ef4444;
  background: #fee2e2;
}

.np-note-item-snippet {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
  line-height: 1.4;
}

.np-note-item-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.np-empty-notes {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* MAIN EDITOR AREA */
.np-editor-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* TOP TOOLBAR */
.np-toolbar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--card-bg);
  z-index: 10;
}

.np-toolbar-left,
.np-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.np-btn {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.np-btn:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.np-btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.np-btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.np-btn-danger {
  color: #ef4444;
  border-color: #fecaca;
  background: #fff5f5;
}

.np-btn-danger:hover {
  color: #dc2626;
  border-color: #ef4444;
  background: #fee2e2;
}

body.theme-dark .np-btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

body.theme-dark .np-btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

/* KEYBOARD SHORTCUTS BANNER & KBD */
.np-shortcuts-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 18px;
  margin-top: 15px;
  margin-bottom: 25px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.np-shortcuts-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}

.np-shortcuts-list {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.np-kbd {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 1px 1px rgba(0,0,0,0.06);
}

body.theme-dark .np-kbd {
  background: #27272a;
  border-color: #3f3f46;
  color: #f4f4f5;
}

.np-view-all-shortcuts-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 2px 6px;
}

.np-view-all-shortcuts-btn:hover {
  text-decoration: underline;
}

/* SHORTCUTS MODAL TABLE */
.np-shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin-top: 10px;
}

.np-shortcuts-table tr {
  border-bottom: 1px solid var(--border);
}

.np-shortcuts-table td {
  padding: 8px 6px;
}

.np-shortcuts-table td:last-child {
  text-align: right;
}

.np-select {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.np-font-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 3px;
}

.np-font-zoom-group .np-btn-icon {
  border: none;
  background: transparent;
  padding: 5px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.np-font-zoom-group .np-btn-icon:hover {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
}

body.theme-dark .np-font-zoom-group .np-btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}

.np-font-size-val {
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
  color: var(--text-muted);
}

.np-toggle-sidebar-btn {
  display: inline-flex;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.np-sidebar.collapsed {
  display: none !important;
}

.np-sidebar-close-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.np-sidebar-close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.np-sidebar-backdrop {
  display: none;
}

/* QUICK TOOLS CHIPS ROW */
.np-quick-tools {
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.015);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.np-quick-tools::-webkit-scrollbar {
  display: none;
}

.np-chip-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: 0.2s;
}

.np-chip-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: #eff6ff;
}

/* FIND & REPLACE FLOATING BAR */
.np-find-bar {
  display: none;
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.np-find-bar.active {
  display: flex;
}

.np-find-input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  outline: none;
  width: 140px;
}

.np-find-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 50px;
}

/* NOTE TITLE INPUT */
.np-title-wrapper {
  padding: 16px 24px 8px;
  border-bottom: 1px dashed var(--border);
}

.np-title-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 800;
  outline: none;
  letter-spacing: -0.5px;
}

.np-title-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

/* CONTENT TEXTAREA */
.np-content-area {
  flex: 1;
  width: 100%;
  padding: 20px 24px;
  border: none;
  outline: none;
  resize: none;
  background: var(--card-bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  overflow-y: auto;
  transition: all 0.2s;
}

.np-content-area::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

/* BOTTOM STATS STATUS BAR */
.np-status-bar {
  padding: 8px 18px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.np-stats-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.np-stat-item span {
  color: var(--primary);
  font-weight: 700;
}

.np-autosave-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #10b981;
  font-weight: 700;
}

.np-autosave-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* LOCAL STORAGE WARNING NOTE */
.np-storage-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 16px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.78rem;
  line-height: 1.4;
}

body.theme-dark .np-storage-alert {
  background: rgba(30, 58, 138, 0.25);
  border-color: rgba(59, 130, 246, 0.3);
  color: #bfdbfe;
}

.np-storage-alert-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.np-storage-alert-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.np-storage-alert-btn {
  background: var(--card-bg);
  border: 1px solid rgba(30, 64, 175, 0.3);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.np-storage-alert-btn:hover {
  background: #dbeafe;
}

body.theme-dark .np-storage-alert-btn:hover {
  background: rgba(59, 130, 246, 0.3);
}

.np-storage-alert-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.7;
}

.np-storage-alert-close:hover {
  opacity: 1;
}

/* RESIZE HEIGHT CONTROLS IN STATUS BAR */
.np-resize-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1px 3px;
}

.np-resize-group .np-btn-icon {
  border: none;
  background: transparent;
  padding: 3px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.np-resize-group .np-btn-icon:hover {
  color: var(--primary);
}

/* ZEN MODE OVERRIDES */
body.zen-mode .np-header-title,
body.zen-mode .np-quick-tools,
body.zen-mode .np-storage-alert,
body.zen-mode #global-header,
body.zen-mode #global-footer,
body.zen-mode .guide-container,
body.zen-mode .faq-section,
body.zen-mode #explore-tools,
body.zen-mode .np-shortcuts-banner {
  display: none !important;
}

body.zen-mode .np-toggle-sidebar-btn {
  display: inline-flex !important;
}

body.zen-mode .np-sidebar-close-btn {
  display: inline-flex !important;
}

body.zen-mode .np-sidebar:not(.open) {
  display: none !important;
}

body.zen-mode .np-sidebar.open {
  display: flex !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 290px !important;
  max-width: 85vw !important;
  height: 100vh !important;
  background: var(--card-bg) !important;
  border-right: 1px solid var(--border) !important;
  box-shadow: 12px 0 35px rgba(0, 0, 0, 0.35) !important;
  z-index: 9999 !important;
  transform: translateX(0) !important;
}

body.zen-mode .np-sidebar-backdrop.active {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 9998 !important;
  background: rgba(15, 23, 42, 0.45) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

body.zen-mode main {
  max-width: 100% !important;
  width: 100vw !important;
  padding: 0 !important;
  height: 100vh !important;
  margin: 0 !important;
}

body.zen-mode .rainbow-wrapper {
  padding: 0 !important;
  box-shadow: none !important;
  animation: none !important;
  background: transparent !important;
  height: 100vh !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

body.zen-mode .np-studio-card {
  height: 100vh !important;
  width: 100vw !important;
  border-radius: 0 !important;
  border: none !important;
  resize: none !important;
  max-height: 100vh !important;
}

body.zen-mode .np-content-area {
  font-size: 19px !important;
  line-height: 1.8 !important;
  padding: 40px 60px !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
}

/* MODAL OVERLAYS */
.np-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.np-modal-overlay.active {
  display: flex;
}

.np-modal-card {
  background: var(--card-bg);
  color: var(--text);
  width: 100%;
  max-width: 480px;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  position: relative;
  margin: auto;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  animation: modalFadeIn 0.25s ease-out;
}

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

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

.np-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.np-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.np-modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.np-input-group {
  margin-bottom: 16px;
}

.np-input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.np-text-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
}

.np-text-input:focus {
  border-color: var(--primary);
}

.np-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* CLOUD SUCCESS SHARE BOX */
.np-cloud-success-box {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.np-qr-wrapper {
  display: flex;
  justify-content: center;
  margin: 14px 0;
}

.np-share-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.np-share-input-row {
  display: flex;
  gap: 6px;
}

.np-share-input-row input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
}

/* MODAL TABS FOR RESTORE / UPLOAD / EXPORT */
.np-modal-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.04);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

body.theme-dark .np-modal-tabs {
  background: rgba(255, 255, 255, 0.05);
}

.np-modal-tab {
  flex: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.np-modal-tab.active {
  background: var(--card-bg);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* RESTORE CHOICES BUTTONS */
.np-choice-btn-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.np-choice-btn {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.np-choice-btn:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

.np-choice-btn-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.np-choice-btn-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* TOAST */
.np-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: #1d1d1f;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.np-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* SEO GUIDE & FAQ STYLES */
.guide-container {
  width: 100%;
  max-width: 1200px;
  margin: 40px auto 20px;
  padding: 35px 25px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 30px;
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  text-align: left;
}

body.theme-dark .guide-container {
  background: rgba(24, 24, 27, 0.8);
}

.guide-container h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
  letter-spacing: -0.8px;
}

.guide-container h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 30px 0 12px;
  border-left: 4px solid var(--primary);
  padding-left: 12px;
}

.guide-container p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 16px;
}

.np-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.np-feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.np-feature-card h4 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.np-feature-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.6;
}

.faq-section {
  width: 100%;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 16px;
  text-align: left;
}

.faq-section h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
  text-align: center;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 16px 0;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  padding-right: 30px;
  color: var(--text);
}

.faq-question::after {
  content: '+';
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--primary);
  transition: transform 0.3s;
}

.faq-item.active .faq-question::after {
  transform: translateY(-50%) rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
}

.faq-answer p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
  padding-bottom: 16px;
}

/* RESPONSIVE DESIGN FOR ALL DEVICES */
@media (max-width: 840px) {
  .np-toggle-sidebar-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    min-width: 32px;
    padding: 5px 8px;
  }

  .np-sidebar-close-btn {
    display: inline-flex !important;
  }

  .np-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 290px;
    max-width: 86vw;
    height: 100%;
    background: var(--card-bg) !important;
    border-right: 1px solid var(--border);
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.28);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex !important;
    flex-direction: column;
  }

  .np-sidebar.open {
    transform: translateX(0) !important;
  }

  .np-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 95;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .np-sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .np-studio-card {
    height: 650px;
  }

  .np-header-title h1 {
    font-size: 1.8rem;
  }
}

@media (max-width: 640px) {
  .np-header-title {
    margin: 15px 0 10px;
  }

  .np-header-title h1 {
    font-size: 1.5rem;
  }

  .np-header-title p {
    font-size: 0.85rem;
  }

  .rainbow-wrapper {
    padding: 2px;
    border-radius: 20px;
    margin-bottom: 20px;
  }

  .np-studio-card {
    height: calc(100vh - 160px);
    min-height: 520px;
    border-radius: 18px;
  }

  .np-toolbar {
    padding: 8px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .np-toolbar-left {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    flex-wrap: nowrap;
  }

  .np-toolbar-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: none;
    gap: 6px;
  }

  .np-toolbar-right::-webkit-scrollbar {
    display: none;
  }

  .np-toolbar-right .np-btn {
    flex-shrink: 0;
    min-height: 34px;
    min-width: 34px;
    padding: 6px 9px;
  }

  /* Mobile: show ONLY SVG icons, hide text labels */
  .np-toolbar .np-btn span {
    display: none !important;
  }

  .np-select {
    max-width: 95px;
    padding: 5px 6px;
    font-size: 0.74rem;
  }

  .np-btn {
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  .np-title-wrapper {
    padding: 10px 16px 6px;
  }

  .np-title-input {
    font-size: 1.15rem;
  }

  .np-content-area {
    padding: 14px 16px;
  }

  .np-status-bar {
    padding: 6px 12px;
    font-size: 0.72rem;
    gap: 6px;
  }

  .np-stats-group {
    gap: 8px;
  }

  .np-shortcuts-banner {
    padding: 10px 14px;
  }

  .np-modal-card {
    padding: 18px 16px;
    border-radius: 20px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .np-font-size-val {
    font-size: 0.72rem;
    min-width: 24px;
    color: var(--primary);
  }

  .np-select {
    max-width: 86px;
    font-size: 0.72rem;
    padding: 4px 4px;
  }

  .np-font-zoom-group {
    padding: 2px 4px;
    gap: 2px;
  }

  .np-font-zoom-group .np-btn-icon {
    padding: 4px 6px;
    font-size: 0.74rem;
  }

  .np-stat-item-extra {
    display: none;
  }

  .guide-container {
    padding: 24px 16px;
    border-radius: 20px;
    margin: 25px auto 15px;
  }

  .guide-container h2 {
    font-size: 1.45rem;
  }

  .faq-section {
    padding: 0 12px;
  }
}

/* PRINT STYLES */
@media print {
  body * {
    visibility: hidden;
  }

  .np-editor-pane,
  .np-editor-pane * {
    visibility: visible;
  }

  .np-editor-pane {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
  }

  .np-toolbar,
  .np-quick-tools,
  .np-status-bar,
  .np-find-bar,
  .rainbow-wrapper,
  .np-sidebar,
  #global-header,
  #global-footer {
    display: none !important;
  }

  .np-title-input {
    font-size: 24pt;
    font-weight: bold;
    border: none;
  }

  .np-content-area {
    font-size: 12pt;
    line-height: 1.8;
  }
}
