/* ==========================================================================
   Outsmart Notes - Modern Design System & Stylesheet
   ========================================================================== */

:root {
  /* Colors - Light Theme (Default) */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --bg-surface-active: #e2e8f0;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-color-hover: #cbd5e1;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-subtle: #fff7ed;
  --primary-text: #c2410c;

  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-subtle: #ffedd5;
  --accent-text: #9a3412;

  --success: #10b981;
  --success-subtle: #ecfdf5;
  --danger: #ef4444;
  --danger-subtle: #fef2f2;
  --warning: #f59e0b;
  --warning-subtle: #fffbeb;

  --editor-bg: #ffffff;
  --editor-text: #1e293b;
  --gutter-bg: #f8fafc;
  --gutter-text: #94a3b8;
  --gutter-border: #e2e8f0;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  --font-serif: 'Lora', Georgia, Cambria, serif;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-app: #0c0a09;
  --bg-surface: #1c1917;
  --bg-surface-hover: #292524;
  --bg-surface-active: #44403c;
  --bg-subtle: #1c1917;
  --border-color: #292524;
  --border-color-hover: #44403c;

  --text-main: #fafaf9;
  --text-muted: #a8a29e;
  --text-subtle: #78716c;

  --primary: #f97316;
  --primary-hover: #fb923c;
  --primary-subtle: rgba(249, 115, 22, 0.16);
  --primary-text: #fed7aa;

  --accent: #ea580c;
  --accent-subtle: rgba(234, 88, 12, 0.18);
  --accent-text: #fdba74;

  --editor-bg: #1c1917;
  --editor-text: #f5f5f4;
  --gutter-bg: #0c0a09;
  --gutter-text: #78716c;
  --gutter-border: #292524;

  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

/* Sepia Theme */
[data-theme="sepia"] {
  --bg-app: #f4ecd8;
  --bg-surface: #fbf0d9;
  --bg-surface-hover: #eddcc0;
  --bg-surface-active: #e2cca8;
  --bg-subtle: #eddcc0;
  --border-color: #dfcdb0;
  --border-color-hover: #cbb493;

  --text-main: #433422;
  --text-muted: #79654e;
  --text-subtle: #a18e77;

  --primary: #c2410c;
  --primary-hover: #9a3412;
  --primary-subtle: rgba(194, 65, 12, 0.14);
  --primary-text: #9a3412;

  --accent: #ea580c;
  --accent-subtle: rgba(234, 88, 12, 0.14);
  --accent-text: #ea580c;

  --editor-bg: #fbf0d9;
  --editor-text: #3d2f1f;
  --gutter-bg: #f4ecd8;
  --gutter-text: #968169;
  --gutter-border: #dfcdb0;
}

/* Midnight / OLED Theme */
[data-theme="oled"] {
  --bg-app: #000000;
  --bg-surface: #0a0a0a;
  --bg-surface-hover: #171717;
  --bg-surface-active: #262626;
  --bg-subtle: #121212;
  --border-color: #262626;
  --border-color-hover: #404040;

  --text-main: #ededed;
  --text-muted: #a1a1aa;
  --text-subtle: #71717a;

  --primary: #f97316;
  --primary-hover: #fb923c;
  --primary-subtle: rgba(249, 115, 22, 0.18);
  --primary-text: #fed7aa;

  --accent: #ea580c;
  --accent-subtle: rgba(234, 88, 12, 0.2);
  --accent-text: #fdba74;

  --editor-bg: #050505;
  --editor-text: #f4f4f5;
  --gutter-bg: #000000;
  --gutter-text: #52525b;
  --gutter-border: #262626;
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.brand-logo .logo-text {
  font-size: clamp(1rem, 3.2vw, 1.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  white-space: nowrap;
}

.brand-logo .logo-text span {
  color: var(--primary);
  display: inline !important;
}

.brand-tagline {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

@media (max-width: 640px) {
  .brand-tagline { display: none; }
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-new-note {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-new-note:hover {
  background-color: var(--primary-hover);
}

.btn-notes-drawer {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-notes-drawer:hover {
  background-color: var(--bg-surface-active);
  border-color: var(--border-color-hover);
}

.notes-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  min-width: 18px;
  height: 18px;
}

.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background-color: transparent;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.nav-icon-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-hover);
  border-color: var(--border-color);
}

/* Theme Icons Toggle */
.theme-icon-light, .theme-icon-dark, .theme-icon-sepia { display: none; }
[data-theme="light"] .theme-icon-dark { display: inline-block; }
[data-theme="dark"] .theme-icon-light { display: inline-block; }
[data-theme="oled"] .theme-icon-light { display: inline-block; }
[data-theme="sepia"] .theme-icon-sepia { display: inline-block; }

/* Dropdown Menus */
.theme-dropdown-wrapper, .dropdown-wrapper, .mobile-menu-wrapper {
  position: relative;
}

.theme-dropdown-menu, .mobile-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 0.4rem;
  z-index: 200;
  display: none;
  animation: fadeInDown 0.15s ease-out;
}

.notepad-toolbar .dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  max-width: min(90vw, 340px);
  padding: 0.45rem;
  z-index: 200;
  display: none;
  animation: fadeInDown 0.15s ease-out;
}

.theme-dropdown-menu.show, .dropdown-menu.show, .mobile-dropdown.show {
  display: block;
}

.notepad-toolbar .dropdown-menu-wide {
  left: auto;
  right: 0;
  min-width: 320px;
  width: max-content;
  max-width: min(94vw, 440px);
}

.dropdown-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  padding: 0.4rem 0.6rem 0.2rem;
}

.dropdown-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
}

.dropdown-item, .theme-opt {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  text-align: left;
  white-space: nowrap;
  transition: background var(--transition-fast);
}

.dropdown-item:hover, .theme-opt:hover {
  background-color: var(--bg-surface-hover);
  color: var(--primary);
}

.dropdown-item .shortcut-hint {
  margin-left: auto;
  padding-left: 1rem;
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.35rem 0;
}

.text-danger { color: var(--danger) !important; }
.text-danger:hover { background-color: var(--danger-subtle) !important; }

/* Mobile Menu */
.mobile-menu-wrapper { display: none; }
@media (max-width: 768px) {
  .mobile-menu-wrapper { display: block; }
  .btn-new-note span, .btn-notes-drawer span { display: none; }
}

/* ==========================================================================
   Notepad Main Application
   ========================================================================== */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.notepad-app-wrapper {
  padding: 0.65rem 1.25rem 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.notepad-container {
  background-color: var(--editor-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all var(--transition-normal);
}

/* Shared Note Banner */
.shared-note-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  color: #ffffff;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
}

.shared-banner-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.shared-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tabs Bar */
.notepad-tabs-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.35rem 0.5rem 0;
  gap: 0.25rem;
  position: relative;
}

.tabs-scroll-area {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.tabs-scroll-area::-webkit-scrollbar {
  height: 3px;
}

.tabs-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.tabs-scroll-area::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 3px;
}

.tabs-scroll-area::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary);
}

.btn-tab-nav {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.725rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}

.btn-tab-nav:hover:not(:disabled) {
  background-color: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-tab-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.btn-tab-nav.visible {
  display: inline-flex;
}

.tabs-track {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding-bottom: 0.35rem;
}

.tab-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  max-width: 200px;
  position: relative;
  transition: all var(--transition-fast);
}

.tab-item:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
}

.tab-item.active {
  background-color: var(--editor-bg);
  color: var(--primary);
  border-bottom-color: var(--editor-bg);
  font-weight: 600;
  box-shadow: 0 -2px 0 var(--primary) inset;
}

.tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-subtle);
  transition: all var(--transition-fast);
}

.tab-close-btn:hover {
  background-color: var(--danger-subtle);
  color: var(--danger);
}

.btn-add-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  transition: all var(--transition-fast);
}

.btn-add-tab:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Toolbar */
.notepad-toolbar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.45rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toolbar-primary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.note-title-box {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 200px;
  max-width: 380px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  transition: border-color var(--transition-fast);
}

.note-title-box:focus-within {
  border-color: var(--primary);
}

.title-icon {
  color: var(--text-subtle);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.note-title-input {
  border: none;
  background: transparent;
  outline: none;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-main);
  width: 100%;
}

.toolbar-btn-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.toolbar-main-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* Secondary Row */
.toolbar-secondary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border-color);
}

.toolbar-tool-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.toolbar-md-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.toolbar-view-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-tool:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-color-hover);
}

.dd-arrow {
  font-size: 0.65rem;
  color: var(--text-subtle);
}

.btn-icon-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background-color: transparent;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.btn-icon-tool:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--border-color);
}

.toolbar-separator {
  width: 1px;
  height: 18px;
  background-color: var(--border-color);
  margin: 0 0.15rem;
}

.toolbar-select {
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  max-width: 190px;
}

.font-size-control {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.1rem;
}

.font-size-display {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 32px;
  text-align: center;
  font-family: var(--font-mono);
}

/* Find & Replace Bar */
.find-replace-bar {
  background-color: var(--bg-surface-hover);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  animation: fadeIn 0.15s ease-out;
}

.find-inputs-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 300px;
}

.find-input-wrap, .replace-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  flex: 1;
}

.find-input-wrap input, .replace-input-wrap input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.825rem;
  width: 100%;
}

.match-count {
  font-size: 0.725rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.find-actions-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

/* Editor Workspace */
.editor-workspace {
  display: flex;
  min-height: 380px;
  height: calc(100vh - 220px);
  max-height: 760px;
  position: relative;
  background-color: var(--editor-bg);
}

.editor-pane {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Line Numbers Gutter */
.line-numbers-gutter {
  background-color: var(--gutter-bg);
  color: var(--gutter-text);
  border-right: 1px solid var(--gutter-border);
  padding: 1.25rem 0.6rem 1.25rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  text-align: right;
  user-select: none;
  white-space: pre;
  overflow: hidden;
  display: none;
  min-width: 45px;
}

.line-numbers-gutter.show {
  display: block;
}

/* Main Textarea */
.main-editor {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 1.25rem;
  background-color: transparent;
  color: var(--editor-text);
  font-size: 16px;
  line-height: 1.6;
  tab-size: 4;
  white-space: pre-wrap;
  word-wrap: break-word;
  scrollbar-width: thin;
}

/* Notepad Font Families */
.main-editor.font-sans { font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.main-editor.font-consolas { font-family: Consolas, 'Lucida Console', 'Courier New', monospace; letter-spacing: -0.2px; }
.main-editor.font-courier { font-family: 'Courier New', Courier, monospace; letter-spacing: -0.3px; }
.main-editor.font-lucida { font-family: 'Lucida Console', Monaco, monospace; letter-spacing: -0.3px; }
.main-editor.font-jetbrains, .main-editor.font-mono { font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace; letter-spacing: -0.2px; }
.main-editor.font-fira { font-family: 'Fira Code', 'JetBrains Mono', Consolas, monospace; font-variant-ligatures: normal; }
.main-editor.font-cascadia { font-family: 'Cascadia Code', Consolas, monospace; }
.main-editor.font-source-code { font-family: 'Source Code Pro', Consolas, monospace; }
.main-editor.font-inconsolata { font-family: 'Inconsolata', Consolas, monospace; }
.main-editor.font-roboto-mono { font-family: 'Roboto Mono', Consolas, monospace; }
.main-editor.font-segoe { font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; }
.main-editor.font-system { font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.main-editor.font-caveat { font-family: 'Caveat', cursive, sans-serif; font-size: 1.25em; line-height: 1.45; }
.main-editor.font-patrick { font-family: 'Patrick Hand', cursive, sans-serif; font-size: 1.15em; line-height: 1.5; }
.main-editor.font-georgia { font-family: Georgia, 'Times New Roman', serif; }
.main-editor.font-lora, .main-editor.font-serif { font-family: 'Lora', Georgia, Cambria, serif; }
.main-editor.font-merriweather { font-family: 'Merriweather', Georgia, serif; }

/* Markdown Preview Pane */
.preview-pane {
  flex: 1;
  border-left: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.825rem;
  font-weight: 600;
}

.preview-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  color: var(--text-main);
}

/* Markdown Rendering Typography */
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  margin-top: 1.2em;
  margin-bottom: 0.6em;
  font-weight: 700;
  line-height: 1.25;
}
.markdown-body h1 { font-size: 1.8rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.4rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.2rem; }
.markdown-body p { margin-bottom: 1em; }
.markdown-body ul, .markdown-body ol { margin-bottom: 1em; padding-left: 2em; }
.markdown-body li { margin-bottom: 0.25em; }
.markdown-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 0.5em 1em;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  margin-bottom: 1em;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.markdown-body code {
  background-color: var(--bg-subtle);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.markdown-body pre {
  background-color: var(--bg-subtle);
  padding: 1em;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 1em;
  border: 1px solid var(--border-color);
}
.markdown-body pre code { background: none; padding: 0; }
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
}
.markdown-body th, .markdown-body td {
  border: 1px solid var(--border-color);
  padding: 0.5em 0.75em;
  text-align: left;
}
.markdown-body th { background-color: var(--bg-subtle); font-weight: 600; }

/* Status Bar */
.notepad-statusbar {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.775rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.status-stat strong {
  color: var(--text-main);
}

.status-save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--success);
  font-weight: 600;
}

/* Fullscreen Mode */
.btn-exit-fullscreen {
  display: none !important;
  background-color: var(--danger-subtle);
  color: var(--danger);
  border: 1px solid var(--danger);
  font-weight: 600;
}

.btn-exit-fullscreen:hover {
  background-color: var(--danger);
  color: #ffffff;
}

body.editor-fullscreen {
  overflow: hidden;
}

body.editor-fullscreen .site-header,
body.editor-fullscreen .section-features,
body.editor-fullscreen .section-faq,
body.editor-fullscreen .page-intro-section,
body.editor-fullscreen .section-content-guide,
body.editor-fullscreen .site-footer {
  display: none !important;
}

body.editor-fullscreen .notepad-app-wrapper {
  padding: 0;
  max-width: 100%;
  height: 100vh;
}

body.editor-fullscreen .notepad-container {
  border-radius: 0;
  height: 100vh;
  border: none;
}

body.editor-fullscreen .editor-workspace {
  height: calc(100vh - 95px);
}

body.editor-fullscreen .btn-exit-fullscreen {
  display: inline-flex !important;
}

body.editor-fullscreen #toolbarFullscreenBtn {
  display: none !important;
}

/* ==========================================================================
   Buttons, Modals & Components
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-xs { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}
.btn-primary:hover { background-color: var(--primary-hover); color: #ffffff; }

.btn-secondary {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background-color: var(--bg-surface-active); border-color: var(--border-color-hover); }

.btn-light {
  background-color: #ffffff;
  color: #0f172a;
}

.btn-danger-outline {
  color: var(--danger);
  border: 1px solid var(--border-color);
}
.btn-danger-outline:hover {
  background-color: var(--danger-subtle);
  border-color: var(--danger);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-overlay.show {
  display: flex;
}

.modal-dialog {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-drawer { max-width: 680px; }
.modal-md { max-width: 560px; }
.modal-sm { max-width: 440px; }

/* Export Options Modal Grid */
.export-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (max-width: 560px) {
  .export-options-grid {
    grid-template-columns: 1fr;
  }
}

.export-card-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: left;
  transition: all var(--transition-fast);
  cursor: pointer;
  width: 100%;
}

.export-card-btn:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.export-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.icon-txt { background-color: rgba(59, 130, 246, 0.12); color: #2563eb; }
.icon-md { background-color: rgba(14, 165, 233, 0.12); color: #0284c7; }
.icon-pdf { background-color: rgba(239, 68, 68, 0.12); color: #dc2626; }
.icon-docx { background-color: rgba(37, 99, 235, 0.12); color: #1d4ed8; }
.icon-json { background-color: rgba(245, 158, 11, 0.12); color: #d97706; }
.icon-csv { background-color: rgba(16, 185, 129, 0.12); color: #059669; }
.icon-qr { background-color: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.icon-print { background-color: rgba(100, 116, 139, 0.12); color: #475569; }

.export-card-info {
  flex: 1;
  min-width: 0;
}

.export-card-info h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.export-card-info p {
  font-size: 0.725rem;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.export-arrow {
  font-size: 0.8rem;
  color: var(--text-subtle);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.export-card-btn:hover .export-arrow {
  color: var(--primary);
  transform: translateX(2px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-title-group h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close-btn {
  font-size: 1.4rem;
  color: var(--text-muted);
  line-height: 1;
}

.modal-close-btn:hover { color: var(--text-main); }

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
}

.drawer-footer {
  justify-content: space-between;
}

.drawer-backup-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Saved Notes List */
.drawer-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.search-notes-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
}

.search-notes-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.85rem;
}

.notes-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.saved-note-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.saved-note-card:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.saved-note-card.active-note {
  border-color: var(--primary);
  background-color: var(--primary-subtle);
}

.note-card-info {
  flex: 1;
  min-width: 0;
}

.note-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

.note-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.75rem;
}

/* Shortcuts Modal Grid */
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 540px) {
  .shortcuts-grid { grid-template-columns: 1fr; }
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.shortcut-desc { font-weight: 500; }
kbd {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  box-shadow: 0 1px 0 var(--border-color);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.1rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideInUp 0.2s ease-out;
}

.toast-success i { color: var(--success); }
.toast-error i { color: var(--danger); }
.toast-info i { color: var(--primary); }

/* ==========================================================================
   Features, FAQ & Content Sections
   ========================================================================== */

.section-features, .section-faq {
  padding: 4rem 0;
}

.section-features {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  margin-bottom: 3rem;
}

.text-center { text-align: center; }

.section-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background-color: var(--primary-subtle);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

.section-heading {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.section-subheading {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}

.bg-blue-subtle { background-color: var(--primary-subtle); }
.bg-indigo-subtle { background-color: var(--accent-subtle); }
.bg-green-subtle { background-color: var(--success-subtle); }
.bg-purple-subtle { background-color: rgba(168, 85, 247, 0.15); }
.bg-amber-subtle { background-color: var(--warning-subtle); }
.bg-teal-subtle { background-color: rgba(20, 184, 166, 0.15); }

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.6;
}

/* FAQ */
.faq-accordion {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.1rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  text-align: left;
  color: var(--text-main);
  transition: background var(--transition-fast);
}

.faq-question:hover {
  background-color: var(--bg-surface-hover);
}

.faq-icon {
  font-size: 0.85rem;
  color: var(--text-subtle);
  transition: transform var(--transition-fast);
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.25rem 1.1rem;
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.6;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

/* ==========================================================================
   Static Pages, Breadcrumbs & Contact
   ========================================================================== */

.page {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 2rem auto;
  box-shadow: var(--shadow-sm);
  max-width: 920px;
}

.breadcrumbs {
  margin: 1.5rem 0 1rem;
  font-size: 0.85rem;
}

.breadcrumbs ol {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  padding: 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--text-subtle);
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  color: var(--text-main);
}

.lead-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.cms-section {
  margin-bottom: 2rem;
}

.cms-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.cms-section p {
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.cms-section ul, .cms-section ol {
  margin: 1rem 0 1.25rem 1.5rem;
  color: var(--text-muted);
  line-height: 1.75;
  font-size: 0.95rem;
}

.cms-section li {
  margin-bottom: 0.5rem;
}

.cms-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.cms-card {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition-fast);
}

.cms-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cms-card-icon {
  width: 42px;
  height: 42px;
  background-color: var(--primary-subtle);
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.cms-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.cms-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 600px;
}

.form-row, .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row label, .form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-control, .contact-form input[type="text"], .contact-form input[type="email"], .contact-form textarea {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-app);
  color: var(--text-main);
  outline: none;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}

.form-control:focus, .contact-form input:focus, .contact-form textarea:focus {
  border-color: var(--primary);
}

.hp-field { display: none; }

.alert-box {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.alert-success { background-color: var(--success-subtle); color: var(--success); border: 1px solid var(--success); }
.alert-error { background-color: var(--danger-subtle); color: var(--danger); border: 1px solid var(--danger); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 2rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

.footer-brand .brand-logo { margin-bottom: 0.75rem; }
.footer-tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 360px;
}

.footer-links-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.footer-links-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links-col a {
  color: var(--text-muted);
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links-col a i { font-size: 0.65rem; color: var(--text-subtle); }
.footer-links-col a:hover { color: var(--primary); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-subtle);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

/* ==========================================================================
   Programmatic Page Intro & Guide Sections
   ========================================================================== */

.page-intro-section {
  padding: 1.75rem 0 0.5rem;
  background-color: var(--bg-app);
}

.page-intro-header {
  max-width: 1400px;
  margin: 0 auto;
}

.page-main-heading {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

.page-intro-lead {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 850px;
  line-height: 1.5;
}

.section-content-guide {
  padding: 3rem 0;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
}

.content-guide-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.guide-block h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.guide-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.guide-text p { margin-bottom: 0.85rem; }
.guide-text ul, .guide-text ol { margin: 0.85rem 0; padding-left: 1.5rem; }
.guide-text li { margin-bottom: 0.4rem; }
.guide-text code {
  background-color: var(--bg-subtle);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
}

/* QR Code Modal Preview */
.qr-preview-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.25rem auto;
  padding: 1.25rem;
  background-color: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  width: fit-content;
  min-width: 250px;
  min-height: 250px;
  box-shadow: var(--shadow-sm);
}

.qr-preview-wrapper canvas, .qr-preview-wrapper img {
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

.qr-info-text {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Print Optimization */
@media print {
  .site-header, .notepad-toolbar, .notepad-tabs-bar, .notepad-statusbar,
  .section-features, .section-faq, .site-footer, .modal-overlay,
  .find-replace-bar, .line-numbers-gutter {
    display: none !important;
  }
  body, .notepad-app-wrapper, .notepad-container, .editor-workspace, .editor-pane {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    height: auto !important;
  }
  .main-editor {
    font-size: 12pt !important;
    line-height: 1.5 !important;
    color: #000000 !important;
  }
}

/* ==========================================================================
   User Account Dropdown & Header Badges
   ========================================================================== */

.btn-pricing-link {
  color: var(--text-main);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-weight: 600;
}

.btn-pricing-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.user-dropdown-wrapper {
  position: relative;
}

.btn-user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.user-avatar-mini {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  overflow: hidden;
}

.user-avatar-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-nav-name {
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-pro-pill {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.dd-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
  z-index: 1000;
  display: none;
}

.user-dropdown-menu.show {
  display: block;
}

.user-dd-header {
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
}

.user-dd-header strong {
  font-size: 0.9rem;
  color: var(--text-main);
}

.user-dd-header small {
  font-size: 0.75rem;
  color: var(--text-muted);
  word-break: break-all;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.4rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-main);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--bg-app);
}

.dropdown-item.text-danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ==========================================================================
   Pricing Page Styles
   ========================================================================== */

.section-pricing-hero {
  padding: 3.5rem 0 5rem;
}

.pricing-header {
  max-width: 750px;
  margin: 0 auto 3rem;
}

.pricing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.pricing-title span {
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pricing-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Billing Toggle Switch */
.billing-switcher-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1.25rem;
  border-radius: 30px;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.switcher-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.badge-save {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  margin-left: 0.25rem;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  margin: 0;
  cursor: pointer;
}

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

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-color);
  transition: var(--transition-fast);
  border-radius: 34px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: var(--transition-fast);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch-toggle input:checked + .slider-round {
  background-color: var(--primary);
}

.switch-toggle input:checked + .slider-round:before {
  transform: translateX(22px);
}

/* Pricing Cards Grid */
.pricing-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 950px;
  margin: 0 auto 4rem;
}

.pricing-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.pricing-card.card-featured {
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(234, 88, 12, 0.15);
}

.popular-ribbon {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.85rem;
  border-radius: 12px;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
}

.card-tier-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.card-tier-badge.badge-pro {
  color: var(--primary);
}

.tier-name {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.tier-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  min-height: 42px;
}

.tier-price-box {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.price-val {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.price-period {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tier-features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex-grow: 1;
}

.tier-features-list li {
  font-size: 0.9rem;
  color: var(--text-main);
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  line-height: 1.4;
}

.tier-features-list li i {
  margin-top: 0.2rem;
  font-size: 0.95rem;
}

.tier-action-wrap {
  margin-top: auto;
}

.btn-upgrade-pro {
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.85rem;
  background: linear-gradient(135deg, #ea580c, #f97316);
  border: none;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
  transition: all var(--transition-fast);
}

.btn-upgrade-pro:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.45);
}

.stripe-secure-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* Feature Matrix */
.pricing-matrix-section {
  max-width: 950px;
  margin: 4rem auto;
}

.matrix-title, .faq-header-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 2rem;
  color: var(--text-main);
}

.matrix-table-wrap {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.matrix-table th, .matrix-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.925rem;
}

.matrix-table thead th {
  background-color: var(--bg-app);
  font-weight: 700;
  color: var(--text-main);
}

.matrix-table .highlight-col {
  background-color: rgba(234, 88, 12, 0.05);
}

.matrix-table thead th {
  background-color: var(--bg-app);
  font-weight: 700;
  color: var(--text-main);
}

.matrix-table .highlight-col {
  background-color: rgba(59, 130, 246, 0.04);
}

/* ==========================================================================
   Account Dashboard Styles
   ========================================================================== */

.section-account-dashboard {
  padding: 3rem 0 5rem;
  max-width: 950px;
  margin: 0 auto;
}

.account-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 1.5rem;
}

.account-user-badge {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.user-avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  overflow: hidden;
  border: 2px solid var(--border-color);
}

.user-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-header-details h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  color: var(--text-main);
}

.user-email-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.account-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pro-status-pill {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.5px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.account-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.account-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-app);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-title-icon {
  font-size: 1.1rem;
  color: var(--primary);
}

.account-card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.account-card-body {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.plan-summary-box {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.plan-type-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.plan-type-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.2rem;
}

.plan-details-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.detail-label {
  color: var(--text-muted);
}

.detail-val {
  color: var(--text-main);
  font-weight: 600;
}

.card-action-footer {
  margin-top: auto;
}

.storage-stat-box {
  text-align: center;
  padding: 1.5rem;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.storage-info-text {
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Authentication Modal & Free Limit Modal
   ========================================================================== */

.modal-auth {
  max-width: 440px;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.auth-alert.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-alert.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.google-auth-section {
  margin-bottom: 1.25rem;
}

.google-btn-wrapper {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0;
  color: var(--text-subtle);
  font-size: 0.8rem;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 0.75rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-auth-submit {
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

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

.forgot-password-link {
  font-size: 0.8rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.forgot-password-link:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  margin-top: 0.5rem;
  align-self: center;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.auth-back-link:hover {
  color: var(--primary);
}

.auth-form-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

/* Free Limit Modal */
.limit-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 0.5rem;
}

.limit-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.limit-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.limit-perks-box {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.limit-perk {
  font-size: 0.875rem;
  color: var(--text-main);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Status Bar Session Timer Pill */
.status-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
  font-weight: 700;
  font-size: 0.775rem;
  cursor: pointer;
  border: 1px solid rgba(245, 158, 11, 0.25);
  transition: all var(--transition-fast);
}

.status-timer-pill:hover {
  background-color: rgba(245, 158, 11, 0.22);
}

.status-timer-pill.warning {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
  animation: pulse-danger 1.2s infinite;
}

@keyframes pulse-danger {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Editor Lock Overlay & Restriction States
   ========================================================================== */

.editor-is-locked .main-editor {
  pointer-events: none !important;
  user-select: none !important;
  opacity: 0.25 !important;
  filter: blur(2px) grayscale(60%) !important;
  cursor: not-allowed !important;
}

.editor-is-locked .note-title-input {
  pointer-events: none !important;
  opacity: 0.5 !important;
}

.editor-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(12, 10, 9, 0.82);
  backdrop-filter: blur(6px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  animation: fadeInLock 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInLock {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.lock-overlay-content {
  max-width: 460px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 2.25rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  color: var(--text-main);
  position: relative;
}

.lock-overlay-content h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 1rem 0 0.5rem;
  color: var(--text-main);
}

.lock-overlay-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.lock-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lock-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(234, 88, 12, 0.15);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto;
}

/* ==========================================================================
   Comprehensive Dynamic Responsive System
   ========================================================================== */

/* Tablet & Smaller Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .header-container {
    padding: 0 1rem;
  }

  .brand-tagline {
    display: none;
  }

  .notepad-app-wrapper {
    padding: 0.75rem 1rem 1.75rem;
    max-width: 100%;
  }

  .editor-workspace {
    height: 60vh;
    min-height: 480px;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .pricing-matrix-section {
    padding: 0 1rem;
  }
}

/* Tablets & Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  .site-header {
    min-height: 54px;
  }

  .header-container {
    padding: 0.35rem 0.75rem;
    gap: 0.75rem;
  }

  .brand-group {
    gap: 0.4rem;
    margin-right: auto;
    flex-shrink: 0;
  }

  .brand-logo {
    gap: 0.45rem;
    margin-right: 0.5rem;
  }

  .brand-logo .logo-icon {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  .brand-logo .logo-text {
    font-size: 1.15rem;
    white-space: nowrap;
  }

  .brand-logo .logo-text span {
    display: inline !important;
  }

  .header-nav {
    gap: 0.35rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  /* Consolidate top bar icons into one mobile dropdown menu */
  .btn-new-note,
  .btn-notes-drawer,
  .btn-pricing-link,
  #fullscreenBtn,
  #shortcutsBtn {
    display: none !important;
  }

  /* Mobile User Profile: Compact circular avatar button without name text */
  .btn-user-profile {
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    flex-shrink: 0;
  }

  .btn-user-profile .user-nav-name,
  .btn-user-profile .badge-pro-pill,
  .btn-user-profile .dd-arrow {
    display: none !important;
  }

  .user-avatar-mini {
    width: 26px !important;
    height: 26px !important;
  }

  .btn-auth-trigger {
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
  }

  .btn-auth-trigger span {
    display: none !important;
  }

  .nav-icon-btn {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  .mobile-menu-wrapper {
    display: block;
  }

  .mobile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0.5rem;
    width: 240px;
    max-width: calc(100vw - 1rem);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem 0;
    z-index: 1000;
    display: none;
    animation: fadeIn 0.18s ease-out;
  }

  .mobile-dropdown.show {
    display: block;
  }

  .mobile-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    transition: background-color var(--transition-fast);
  }

  .mobile-dropdown a i {
    width: 18px;
    text-align: center;
    color: var(--primary);
  }

  .mobile-dropdown a:hover {
    background-color: var(--bg-app);
  }

  /* Notepad App Wrapper & Container */
  .notepad-app-wrapper {
    padding: 0.4rem 0.5rem 1.5rem;
  }

  .notepad-container {
    border-radius: var(--radius-md);
  }

  /* Tabs Bar */
  .notepad-tabs-bar {
    padding: 0.25rem 0.4rem 0;
  }

  .tabs-scroll-area {
    -webkit-overflow-scrolling: touch;
  }

  .tab-item {
    padding: 0.35rem 0.65rem;
    font-size: 0.775rem;
    max-width: 140px;
  }

  /* Toolbar */
  .notepad-toolbar {
    padding: 0.4rem 0.5rem;
    gap: 0.35rem;
  }

  .toolbar-primary-row {
    gap: 0.35rem;
  }

  .note-title-box {
    flex: 1 1 140px;
    min-width: 120px;
    padding: 0.25rem 0.5rem;
  }

  .note-title-input {
    font-size: 0.8rem;
  }

  .toolbar-main-actions {
    gap: 0.25rem;
  }

  .btn-tool {
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
  }

  .toolbar-secondary-row {
    padding-top: 0.25rem;
    gap: 0.35rem;
    flex-wrap: wrap;
  }

  .toolbar-md-cluster {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: none;
    flex-wrap: nowrap;
    max-width: 100%;
  }

  .toolbar-md-cluster::-webkit-scrollbar {
    display: none;
  }

  .toolbar-view-cluster {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar-select.font-family-select {
    flex: 1;
    max-width: 140px;
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
  }

  .font-size-control {
    padding: 0.05rem;
  }

  .font-size-display {
    font-size: 0.7rem;
    min-width: 28px;
  }

  /* Editor Canvas & Markdown Split Pane */
  .editor-workspace {
    flex-direction: column;
    height: auto;
    min-height: 350px;
  }

  .editor-pane {
    min-height: 300px;
    height: calc(100vh - 230px);
    max-height: 600px;
  }

  .preview-pane {
    border-left: none;
    border-top: 1px solid var(--border-color);
    min-height: 280px;
    max-height: 45vh;
  }

  .line-numbers-gutter {
    min-width: 32px;
    padding: 0.85rem 0.3rem;
    font-size: 12px;
  }

  .main-editor {
    padding: 0.85rem;
    font-size: 15px;
  }

  /* Status Bar */
  .notepad-statusbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.45rem 0.75rem;
    gap: 0.35rem;
  }

  .status-left, .status-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  /* Modals */
  .modal-dialog {
    width: min(94vw, 480px);
    margin: 1rem auto;
    max-height: 90vh;
  }

  /* Pricing Cards */
  .pricing-cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
  }

  .pricing-card {
    padding: 2rem 1.5rem;
  }

  .matrix-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .matrix-table {
    min-width: 580px;
  }

  /* Account Dashboard */
  .account-header-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .header-container {
    padding: 0.3rem 0.5rem;
    gap: 0.5rem;
  }

  .brand-group {
    gap: 0.35rem;
    margin-right: auto;
    flex-shrink: 0;
  }

  .brand-logo {
    gap: 0.35rem;
    margin-right: 0.4rem;
  }

  .brand-logo .logo-icon {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .brand-logo .logo-text {
    font-size: 1rem;
    white-space: nowrap;
  }

  .brand-logo .logo-text span {
    display: inline !important;
  }

  .header-nav {
    gap: 0.3rem;
    flex-shrink: 0;
  }

  .btn-user-profile {
    width: 30px !important;
    height: 30px !important;
  }

  .user-avatar-mini {
    width: 24px !important;
    height: 24px !important;
  }

  .btn-auth-trigger {
    width: 30px !important;
    height: 30px !important;
  }

  .nav-icon-btn {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .btn-icon-tool {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .pricing-title {
    font-size: 1.75rem;
  }

  .pricing-subtitle {
    font-size: 0.95rem;
  }

  .billing-switcher-wrapper {
    flex-direction: row;
    padding: 0.35rem 0.75rem;
    gap: 0.5rem;
  }

  .switcher-label {
    font-size: 0.8rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .footer-bottom-links {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Extra Small Mobile (<= 360px) */
@media (max-width: 360px) {
  .brand-logo .logo-icon {
    width: 20px;
    height: 20px;
    font-size: 0.65rem;
  }

  .brand-logo .logo-text {
    font-size: 0.85rem;
  }
}

/* Print Optimization */
@media print {
  .site-header,
  .notepad-tabs-bar,
  .notepad-toolbar,
  .find-replace-bar,
  .line-numbers-gutter,
  .preview-pane,
  .notepad-statusbar,
  .site-footer,
  .notes-drawer,
  .modal-overlay,
  .toast-container {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .notepad-app-wrapper {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .notepad-container {
    border: none !important;
    box-shadow: none !important;
  }

  .main-editor {
    font-size: 12pt !important;
    line-height: 1.5 !important;
    color: #000000 !important;
  }
}