:root {
  --primary: #095ce1;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --secondary: #0ea5e9;
  --accent: #0284c7;
  --success: #10b981;
  --success-light: #34d399;
  --success-dark: #059669;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-light: #ffffff;
  --surface-dark: #f1f5f9;
  --text: #1e293b;
  --text-light: #64748b;
  --text-lighter: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-dark: #cbd5e1;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.07);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.1);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 24px;
  max-width: 1300px;
  margin: 0 auto;
}
.header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 0px;
}
.logo-icon {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trident-logo {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.outer-circle {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #3b82f6 0%,
    #f59e0b 25%,
    #f97316 50%,
    #ef4444 75%,
    #10b981 87%,
    #06b6d4 93%,
    #3b82f6 100%
  );
  animation: rotate 3s linear infinite;
  filter: blur(2px);
  opacity: 0.3;
  z-index: 0;
}
.outer-circle::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--bg);
  border-radius: 50%;
  z-index: 1;
}
.trident-logo svg {
  position: relative;
  width: 42px;
  height: 42px;
  z-index: 2;
  filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.3));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.trident-logo path {
  fill: var(--primary);
  stroke: var(--primary-dark);
  stroke-width: 0.5;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes bluePulse {
  0%, 100% { fill: var(--primary); stroke: var(--primary-dark); filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.5)); }
  50% { fill: var(--primary-light); stroke: var(--primary); filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.8)); }
}
@keyframes blueGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.4)); }
  50% { filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.6)); }
}
.trident-logo path:nth-child(1) { animation: bluePulse 3s ease-in-out infinite, blueGlow 2s ease-in-out infinite; }
.trident-logo path:nth-child(2) { animation: bluePulse 3s ease-in-out infinite 0.3s, blueGlow 2s ease-in-out infinite 0.3s; }
.trident-logo path:nth-child(3) { animation: bluePulse 3s ease-in-out infinite 0.6s, blueGlow 2s ease-in-out infinite 0.6s; }
.trident-logo path:nth-child(4) { animation: bluePulse 3s ease-in-out infinite 0.9s, blueGlow 2s ease-in-out infinite 0.9s; }
.trident-logo path:nth-child(5) { animation: bluePulse 3s ease-in-out infinite 1.2s, blueGlow 2s ease-in-out infinite 1.2s; }
.trident-logo:hover path { stroke-width: 1; filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6)); animation-duration: 1.5s, 1s; }
.trident-logo:hover svg { filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.6)) drop-shadow(0 0 10px rgba(96, 165, 250, 0.4)); transform: scale(1.05); }
.trident-logo:hover .outer-circle { animation-duration: 2s; filter: blur(3px); opacity: 0.4; }
.trident-logo:active svg { filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.8)) drop-shadow(0 0 12px rgba(96, 165, 250, 0.6)); transform: scale(1.02); }
.trident-logo:active .outer-circle { animation-duration: 1s; filter: blur(4px); opacity: 0.5; }
.background-glow {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.15) 0%, rgba(96, 165, 250, 0.05) 30%, transparent 70%);
  animation: glowPulse 4s ease-in-out infinite;
  z-index: 1;
}
@keyframes rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes glowPulse { 0%, 100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 0.8; transform: scale(1.05); } }
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-2px); } }
.trident-logo { animation: float 4s ease-in-out infinite; }
.trident-logo:hover { animation: float 2s ease-in-out infinite; }
h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { color: var(--text-light); font-size: 16px; max-width: 600px; margin: 0 auto; }
.layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
.main-content { display: flex; flex-direction: column; gap: 24px; }
.main-content-inner { max-width: 1100px; width: 100%; margin: 0 auto; display: block; }
.editor-section,
.preview-section {
  background: var(--surface-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  position: relative;
  width: 1000px;
  max-width: 90%;
  min-width: 350px;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden;
}
.editor-section { margin-bottom: 24px; }
@media (max-width: 1000px) {
  .editor-section, .preview-section { width: 90%; min-width: 350px; }
}
@media (max-width: 500px) {
  .editor-section, .preview-section { width: 95%; min-width: 350px; }
  .example-card { flex: 1 1 calc(33.333% - 20px); }
}
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; color: var(--text); }
.section-icon { width: 36px; height: 36px; background: var(--surface-dark); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--primary); }
.editor-container { position: relative; }
.editor-textarea {
  width: 100% !important;
  min-height: 150px;
  padding: 10px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', 'Courier New', 'monospace';
  font-size: 18px;
  line-height: 1.5;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  resize: vertical;
  overflow: hidden;
  box-sizing: border-box;
  display: block;
}
.editor-textarea:focus { outline: none; border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(9, 92, 225, 0.1); }
.editor-textarea::placeholder { color: var(--text-lighter); font-size: 18px; font-family: 'monospace'; }
.editor-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.btn { padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; border: none; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--surface-dark); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border-light); }
.btn-disabled { background: var(--surface); color: var(--text-lighter); cursor: not-allowed; opacity: 0.6; }
.btn-disabled:hover { transform: none; box-shadow: none; background: var(--surface); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-help { background: var(--success); color: white; border: none; position: relative; overflow: hidden; }
.btn-help:hover { background: var(--success-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
.btn-help::after { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%); opacity: 0; transition: opacity 0.3s; }
.btn-help:hover::after { opacity: 1; }
.help-icon-wrapper { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.help-icon { position: relative; z-index: 2; }
.help-icon-glow { position: absolute; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, rgba(16, 185, 129, 0) 70%); z-index: 1; animation: gentleGlow 2s infinite ease-in-out; }
.tip-badge { display: inline-block; background: var(--success); color: white; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 10px; margin-left: 4px; vertical-align: middle; }
@keyframes gentlePulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes gentleGlow { 0%, 100% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.3); } 50% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.5); } }
.gentle-pulse { animation: gentlePulse 3s infinite ease-in-out; }
.gentle-glow { animation: gentleGlow 2s infinite ease-in-out; }
.btn-pro {
  position: relative;
  background: linear-gradient(135deg, #FFD700, #FFA500) !important;
  color: #000 !important;
  font-weight: 700 !important;
  border: 2px solid #FFD700 !important;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3) !important;
  transition: all 0.3s ease !important;
  overflow: hidden !important;
  padding: 8px 12px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-width: 125px !important;
  height: auto !important;
  cursor: pointer !important;
}
.btn-pro::before { content: 'PRO'; position: absolute; top: -8px; right: -25px; background: #000; color: #FFD700; font-size: 10px; font-weight: bold; padding: 2px 18px 1px 18px; transform: rotate(45deg); z-index: 1; text-indent: 22px; }
.btn-pro:hover { background: linear-gradient(135deg, #FFC107, #FF9800) !important; transform: translateY(-1px) !important; box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4) !important; }
.preview-container {
  width: 100% !important;
  min-height: 180px;
  max-height: calc(100vh - 400px);
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  padding: 10px;
  margin-top: 0px;
  position: relative;
  overflow-x: auto;
  overflow-y: auto;
  box-sizing: border-box;
  display: block;
  min-width: 0;
}
.preview-container::-webkit-scrollbar { width: 8px; height: 8px; }
.preview-container::-webkit-scrollbar-track { background: var(--border-light); border-radius: 4px; }
.preview-container::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
.preview-container::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }
#preview {
  padding: 0 !important;
  margin: 0 !important;
  width: fit-content !important;
  min-width: 100%;
  display: block !important;
  box-sizing: border-box;
  min-height: 100px;
  max-width: clamp(280px, 71vw, 1000px) !important;
}
.preview-placeholder { color: var(--text-light); text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100px; width: 100%; margin: 0 auto; font-size: 18px !important; }
.preview-icon { font-size: 40px; margin-bottom: 10px; color: var(--text-lighter); }
#preview .MathJax, #preview mjx-container { font-size: var(--formula-size, 18px) !important; }
.symbol-katex .MathJax, .symbol-katex mjx-container, #examplesGrid .MathJax, #examplesGrid mjx-container { font-size: 18px !important; }
.MathJax_Display { margin: 0 !important; padding: 0 !important; text-align: left !important; display: inline-block !important; width: auto !important; max-width: none !important; overflow: auto hidden !important; }
.MathJax, mjx-container { pointer-events: none; }
#preview mjx-container { display: inline-block !important; margin: 0 !important; padding: 0 !important; }
#preview mjx-container[jax="SVG"] { overflow: auto !important; }
.preview-controls { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 10px; position: relative; z-index: 100; }
.preview-controls > div { position: relative; display: inline-block; }
#sizeDropdownMenu, #verticalSpaceDropdownMenu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  max-height: 250px;
  overflow-y: auto;
  min-width: 120px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--border-light);
}
.size-option { padding: 8px 12px; cursor: pointer; font-size: 14px; color: var(--text); border-bottom: 1px solid var(--border-light); }
.size-option:hover { background: var(--surface-dark); }
.size-option.active { background: var(--primary); color: white; }
.size-option:last-child { border-bottom: none; }
#sizeDropdownMenu input[type="number"], #verticalSpaceDropdownMenu input[type="number"] { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: 13px; }
#sizeDropdownMenu input[type="number"]::-webkit-outer-spin-button,
#sizeDropdownMenu input[type="number"]::-webkit-inner-spin-button,
#verticalSpaceDropdownMenu input[type="number"]::-webkit-outer-spin-button,
#verticalSpaceDropdownMenu input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: inner-spin-button !important; opacity: 1; background: transparent; border-width: 0px; margin: 0; height: 24px; width: 16px; cursor: pointer; }
#sizeDropdownMenu input[type="number"], #verticalSpaceDropdownMenu input[type="number"] { -moz-appearance: textfield; }
#sizeDropdownMenu input[type="number"]:hover, #sizeDropdownMenu input[type="number"]:focus,
#verticalSpaceDropdownMenu input[type="number"]:hover, #verticalSpaceDropdownMenu input[type="number"]:focus { -moz-appearance: number-input; }
#sizeDropdownMenu input[type="number"]:focus, #verticalSpaceDropdownMenu input[type="number"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(9, 92, 225, 0.1); }
.color-swatch-container { margin-top: 16px; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-instruction { font-size: 13px; color: var(--text-light); }
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.symbols-panel { background: var(--surface-light); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-md); border: 1px solid var(--border); max-width: 1000px; min-width: 350px; width: 90%; margin: 0 auto; }
.symbols-search { width: 100%; padding: 14px 16px; border: 2px solid var(--border); border-radius: var(--radius-md); font-size: 14px; margin-bottom: 10px; margin-top: 10px; transition: var(--transition); }
.symbols-search:focus { outline: none; border-color: var(--primary); }
.symbols-search::placeholder { color: var(--text-lighter); }
.symbols-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--text-light); cursor: pointer; transition: var(--transition); }
.tab:hover { background: var(--surface-dark); color: var(--text); }
.tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.symbols-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; scrollbar-color: var(--primary) var(--border-light); max-height: 300px; overflow-y: auto; padding: 2px; }
.symbols-draggable-grid { scrollbar-width: thin; scrollbar-color: var(--primary) var(--border-light); }
#symbolsGrid > div[style*="grid-column:1/-1"] { display: none; }
#symbolsGrid .symbol-btn { display: flex !important; }
.symbol-btn { min-height: 75px; aspect-ratio: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); padding: 5px 5px; text-align: center; }
.symbol-btn:hover { background: var(--surface-dark); border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.symbol-katex { font-size: 18px !important; line-height: 1.2; margin-bottom: 4px; max-width: 100%; overflow: hidden; color: var(--text); }
.symbol-label { font-size: 10px; color: var(--text-light); text-align: center; line-height: 1.2; padding: 0 2px; word-break: break-word; }
.tools-panel { background: var(--surface-light); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-md); border: 1px solid var(--border); max-width: 1000px; min-width: 350px; width: 90%; margin: 0 auto; }
.tool-section { margin-bottom: 24px; }
.tool-section:last-child { margin-bottom: 0; }
.tool-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--text); display: flex; align-items: center; gap: 10px; }
.tool-options { display: flex; flex-direction: column; margin-top: 16px; gap: 12px; }
.export-panel { background: var(--surface-light); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-md); border: 1px solid var(--border); text-align: center; max-width: 1000px; min-width: 350px; width: 90%; margin: 0 auto; }
.export-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; color: var(--text); display: flex; align-items: center; justify-content: center; gap: 10px; }
.export-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.export-btn { width: 100%; padding: 16px; background: var(--surface-dark); border: 2px solid var(--border); border-radius: var(--radius-md); font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 12px; transition: var(--transition); color: var(--text); }
.export-btn:hover { background: var(--surface); border-color: var(--primary); transform: translateY(-2px); }
.export-btn.svg { background: linear-gradient(135deg, var(--success), #10b981); color: white; border: none; }
.export-btn.png { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; border: none; }
.export-btn.svg:hover, .export-btn.png:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.export-btn.svg.pro { background: linear-gradient(135deg, #FFD700, #FFA500) !important; color: #000 !important; font-weight: 700 !important; position: relative; overflow: hidden !important; padding: 16px !important; border-radius: var(--radius-md) !important; display: flex !important; align-items: center !important; justify-content: center !important; gap: 12px !important; width: 100% !important; margin-bottom: 12px !important; border: none !important; cursor: pointer !important; }
.export-btn.svg.pro::before { content: 'PRO'; position: absolute; top: -8px; right: -25px; background: #000; color: #FFD700; font-size: 10px; font-weight: bold; padding: 2px 20px 1px 20px; transform: rotate(45deg); text-indent: 30px; z-index: 1; }
.export-btn.svg.pro:hover { background: linear-gradient(135deg, #FFC107, #FF9800) !important; transform: translateY(-3px) !important; box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4) !important; }
.features { display: flex; justify-content: space-around; padding-top: 20px; border-top: 1px solid var(--border); }
.feature { text-align: center; position: relative; }
.feature-icon { width: 40px; height: 40px; background: var(--surface-dark); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; color: var(--primary); font-size: 18px; }
.feature-label { font-size: 12px; color: var(--text-light); font-weight: 500; }
.footer { text-align: center; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-light); font-size: 14px; }
#floatingSymbolsBtn { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; border-radius: 50%; background: var(--primary); color: white; border: none; box-shadow: var(--shadow-xl); z-index: 9998; display: flex; align-items: center; justify-content: center; font-size: 24px; cursor: pointer; transition: all 0.3s ease; }
#floatingSymbolsBtn:hover { background: var(--primary-dark); transform: scale(1.1); box-shadow: 0 8px 25px rgba(9, 92, 225, 0.4); }
.symbols-draggable-window { position: fixed; top: 100px; right: 100px; width: 450px; height: 550px; background: var(--surface-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); border: 1px solid var(--border); z-index: 9999; display: none; flex-direction: column; overflow: hidden; resize: both; min-width: 350px; min-height: 400px; max-width: 90vw; max-height: 90vh; }
.symbols-draggable-window::after { content: ''; position: absolute; bottom: 0; right: 0; width: 15px; height: 15px; background: linear-gradient(135deg, transparent 50%, var(--primary) 50%); cursor: se-resize; z-index: 10000; border-top-left-radius: 4px; }
.symbols-draggable-window.active { display: flex; }
.symbols-draggable-header { padding: 16px 20px; background: var(--primary); color: white; cursor: move; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.symbols-draggable-header h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; margin: 0; }
#closeDraggableSymbolsPanel { width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
#closeDraggableSymbolsPanel:hover { background: rgba(255, 255, 255, 0.3); }
.symbols-draggable-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.symbols-draggable-search { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: 0; font-size: 14px; transition: var(--transition); border-left: none; border-right: none; }
.symbols-draggable-search:focus { outline: none; border-color: var(--primary); }
.symbols-draggable-tabs { padding: 12px 16px; display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border); overflow-x: auto; max-height: 120px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--primary) var(--border-light); }
.symbols-draggable-tab { padding: 6px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: 12px; font-weight: 500; color: var(--text-light); cursor: pointer; transition: var(--transition); white-space: nowrap; }
.symbols-draggable-tab:hover { background: var(--surface-dark); color: var(--text); }
.symbols-draggable-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.symbols-draggable-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; padding: 16px; overflow-y: auto; }
.symbols-draggable-grid .symbol-btn { min-height: 60px; padding: 4px; }
.symbols-draggable-grid .symbol-katex { font-size: 16px !important; }
.symbols-draggable-grid .symbol-label { font-size: 9px; }
@media (max-width: 768px) {
  body { padding: 16px; }
  .editor-section, .preview-section, .symbols-panel, .tools-panel, .export-panel { padding: 20px; }
  h1 { font-size: 30px; }
  .symbols-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; }
  .trident-logo { width: 60px; height: 60px; }
  .symbols-panel { display: none; }
  .symbols-draggable-window { width: 90vw; height: 70vh; top: 50px; right: 5vw; left: 5vw; }
}
@media (max-width: 480px) {
  .section-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .editor-actions { justify-content: stretch; }
  .btn { flex: 1; justify-content: center; }
  .logo { gap: 0px; }
  h1 { font-size: 26px; }
  .trident-logo { width: 50px; height: 50px; }
  .symbols-draggable-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 6px;
  }
}
@media (max-width: 390px) { #preview { max-width: 280px !important; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: flex; justify-content: center; align-items: center; z-index: 10000; }
.loading-spinner { width: 60px; height: 60px; border: 4px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top-color: white; animation: spin 1s linear infinite; }
.loading-text { color: white; margin-top: 20px; font-size: 16px; font-weight: 500; }
.fresh-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: none; justify-content: center; align-items: center; z-index: 10000; }
.fresh-modal-content { background: white; padding: 32px; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); max-width: 420px; width: 90%; text-align: center; }
.fresh-modal-icon { color: #ef4444; font-size: 52px; margin-bottom: 20px; }
.fresh-modal-title { font-size: 26px; font-weight: bold; margin-bottom: 15px; color: #1e293b; }
.fresh-modal-text { color: #64748b; margin-bottom: 32px; line-height: 1.6; font-size: 16px; }
.fresh-modal-buttons { display: flex; gap: 15px; justify-content: center; }
.fresh-modal-button { padding: 14px 28px; border: none; border-radius: 10px; font-weight: 600; font-size: 16px; cursor: pointer; min-width: 120px; transition: all 0.2s; }
.fresh-modal-button.no { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.fresh-modal-button.no:hover { background: #e2e8f0; }
.fresh-modal-button.yes { background: #ef4444; color: white; }
.fresh-modal-button.yes:hover { background: #dc2626; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4); }
.examples-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: none; justify-content: center; align-items: center; z-index: 10001; animation: fadeIn 0.3s ease; }
.examples-modal-content { background: var(--surface-light); border-radius: var(--radius-lg); width: 90%; max-width: 1000px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--shadow-xl); border: 1px solid var(--border); overflow: hidden; }
.examples-modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); position: relative; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; }
.examples-modal-header h3 { font-size: 22px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.examples-modal-header p { font-size: 13px; opacity: 0.9; max-width: 700px; }
.examples-modal-header .fa-lightbulb { color: #FBD424 !important; }
#examplesToggleBtn .fa-lightbulb { color: #FBD424 !important; }
.examples-close-btn { position: absolute; top: 20px; right: 20px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.examples-close-btn:hover { background: rgba(255, 255, 255, 0.3); transform: rotate(90deg); }
.examples-categories { padding: 16px 24px 0; display: flex; gap: 8px; flex-wrap: wrap; background: var(--surface-light); border-bottom: 1px solid var(--border); padding-bottom: 16px; scrollbar-width: thin; scrollbar-color: var(--primary) var(--border-light); overflow-x: auto; }
.examples-categories::-webkit-scrollbar { height: 6px; }
.examples-categories::-webkit-scrollbar-track { background: var(--border-light); border-radius: 3px; }
.examples-categories::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
.examples-categories::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }
.examples-category-btn { padding: 8px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text-light); cursor: pointer; transition: var(--transition); white-space: nowrap; }
.examples-category-btn:hover { background: var(--surface-dark); color: var(--text); transform: translateY(-1px); }
.examples-category-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: var(--shadow-sm); }
.examples-grid { display: flex !important; flex-wrap: wrap !important; gap: 20px !important; padding: 20px !important; overflow-y: auto !important; background: var(--surface-light) !important; justify-content: center !important; }
.example-card { background: white; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; align-items: center; justify-content: space-between; height: 180px; position: relative; overflow: hidden; }
.example-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.example-card:hover::after { content: 'Օգտագործել'; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(9, 92, 225, 0.2); color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; border-radius: var(--radius-md); }
.example-preview { width: 100%; height: 130px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; overflow: hidden; }
.example-name { font-size: 13px; font-weight: 600; color: var(--text); text-align: center; margin-bottom: 0px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.examples-grid::-webkit-scrollbar { width: 6px; }
.examples-grid::-webkit-scrollbar-track { background: var(--border-light); border-radius: 3px; }
.examples-grid::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
.examples-grid::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }
@media (max-width: 768px) { .example-card { height: 170px; padding: 10px; } .example-preview { height: 140px; } }
@media (max-width: 500px) {
  .examples-grid { display: flex !important; flex-direction: column !important; flex-wrap: nowrap !important; align-items: center !important; justify-content: flex-start !important; gap: 12px !important; padding: 12px !important; width: 100% !important; max-width: 100% !important; overflow-x: hidden !important; overflow-y: auto !important; }
  .example-card { display: block !important; width: 90% !important; max-width: 280px !important; flex: 0 0 auto !important; margin: 0 !important; padding: 0px !important; box-sizing: border-box !important; }
  .example-preview { font-size: 8px !important; height: 130px; }
  .examples-categories { overflow-x: auto; padding-bottom: 12px; }
  .examples-category-btn { flex-shrink: 0; }
  .examples-modal-header h3 { font-size: 18px; }
}
.url-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: none; justify-content: center; align-items: center; z-index: 10002; }
.url-modal-content { background: white; padding: 30px; border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); max-width: 500px; width: 90%; }
.url-modal-title { font-size: 20px; font-weight: 600; margin-bottom: 20px; color: var(--text); display: flex; align-items: center; gap: 10px; }
.url-input-group { margin-bottom: 20px; }
.url-input-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text); }
.url-input { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; transition: var(--transition); }
.url-input:focus { outline: none; border-color: var(--primary); }
.url-modal-buttons { display: flex; gap: 12px; justify-content: flex-end; }
.url-modal-button { padding: 10px 20px; border: none; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; transition: var(--transition); }
.url-modal-button.cancel { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.url-modal-button.cancel:hover { background: var(--surface-dark); }
.url-modal-button.add { background: var(--primary); color: white; }
.url-modal-button.add:hover { background: var(--primary-dark); }
.environments-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: none; justify-content: center; align-items: center; z-index: 10003; animation: fadeIn 0.3s ease; }
.environments-modal-content { background: var(--surface-light); border-radius: var(--radius-lg); width: 90%; max-width: 1000px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--shadow-xl); border: 1px solid var(--border); overflow: hidden; }
.environments-modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); position: relative; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; }
.environments-modal-header h3 { font-size: 22px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.environments-modal-header p { font-size: 13px; opacity: 0.9; max-width: 700px; }
.environments-close-btn { position: absolute; top: 20px; right: 20px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.environments-close-btn:hover { background: rgba(255, 255, 255, 0.3); transform: rotate(90deg); }
.environments-search-container { padding: 16px 24px; background: var(--surface-light); border-bottom: 1px solid var(--border); }
.environments-search { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius-md); font-size: 14px; transition: var(--transition); }
.environments-search:focus { outline: none; border-color: var(--primary); }
.environments-search::placeholder { color: var(--text-lighter); }
.environments-container { flex: 1; overflow-y: auto; padding: 0; }
.environments-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); gap: 0; }
.environment-card { display: flex; background: white; border: 1px solid var(--border); border-left: 4px solid var(--primary); cursor: pointer; transition: all 0.2s ease; min-height: 120px; }
.environment-card:hover { background: var(--surface-dark); border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); z-index: 2; }
.environment-left { flex: 0 0 55%; padding: 16px; border-right: 1px solid var(--border-light); display: flex; flex-direction: column; justify-content: center; }
.environment-right { flex: 1; padding: 16px; display: flex; flex-direction: column; justify-content: center; }
.environment-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.environment-name i { color: var(--primary); font-size: 14px; }
.environment-latex { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 13px; color: var(--text-light); background: var(--surface); padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-light); overflow-x: auto; white-space: nowrap; margin-top: 4px; }
.environment-description { font-size: 13px; line-height: 1.5; color: var(--text); }
.environment-usage { font-size: 12px; color: var(--text-light); margin-top: 8px; font-style: italic; }
.environments-container::-webkit-scrollbar { width: 6px; }
.environments-container::-webkit-scrollbar-track { background: var(--border-light); }
.environments-container::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
@media (max-width: 768px) { .environments-grid { grid-template-columns: 1fr; } .environment-card { flex-direction: column; } .environment-left { border-right: none; border-bottom: 1px solid var(--border-light); } }
.help-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: none; justify-content: center; align-items: center; z-index: 10004; animation: fadeIn 0.3s ease; }
.help-modal-content { background: var(--surface-light); border-radius: var(--radius-lg); width: 90%; max-width: 900px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--shadow-xl); border: 1px solid var(--border); overflow: hidden; }
.help-modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); position: relative; background: linear-gradient(135deg, var(--success), var(--success-dark)); color: white; }
.help-modal-header h3 { font-size: 22px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.help-modal-header p { font-size: 13px; opacity: 0.9; max-width: 700px; }
.help-close-btn { position: absolute; top: 20px; right: 20px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.help-close-btn:hover { background: rgba(255, 255, 255, 0.3); transform: rotate(90deg); }
.help-content { flex: 1; overflow-y: auto; padding: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 768px) { .help-content { grid-template-columns: 1fr; } }
.help-section { margin-bottom: 0; padding: 16px; background: white; border-radius: var(--radius-md); border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); transition: var(--transition); }
.help-section:hover { border-color: var(--success); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.help-section h4 { font-size: 15px; font-weight: 600; color: var(--success-dark); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(16, 185, 129, 0.2); }
.help-section ul { list-style: none; padding-left: 0; margin: 0; }
.help-section li { padding: 6px 0; font-size: 13px; color: var(--text); line-height: 1.5; position: relative; padding-left: 20px; }
.help-section li:before { content: '✓'; color: var(--success); font-weight: bold; position: absolute; left: 0; font-size: 12px; }
.help-section strong { color: var(--text); font-weight: 600; background: linear-gradient(120deg, rgba(16,185,129,0.1) 0%, rgba(16,185,129,0.1) 100%); padding: 0 2px; border-radius: 2px; }
.help-content::-webkit-scrollbar { width: 6px; }
.help-content::-webkit-scrollbar-track { background: var(--border-light); border-radius: 3px; }
.help-content::-webkit-scrollbar-thumb { background: var(--success); border-radius: 3px; }
.help-content::-webkit-scrollbar-thumb:hover { background: var(--success-dark); }
.tool-tip { position: relative; display: inline-block; }
.tool-tip .tooltip-text { visibility: hidden; width: 200px; background-color: var(--text); color: white; text-align: center; border-radius: var(--radius-sm); padding: 8px; position: absolute; z-index: 1; bottom: 125%; left: 50%; margin-left: -100px; opacity: 0; transition: opacity 0.3s; font-size: 12px; font-weight: normal; }
.tool-tip .tooltip-text::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: var(--text) transparent transparent transparent; }
.tool-tip:hover .tooltip-text { visibility: visible; opacity: 1; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.025); } 100% { transform: scale(1); } }
.btn-pro, .export-btn.svg.pro { animation: pulse 2s infinite; }
.pro-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: none; justify-content: center; align-items: center; z-index: 10005; animation: fadeIn 0.3s ease; }
.pro-modal-content { background: var(--surface-light); border-radius: var(--radius-lg); width: 90%; max-width: 500px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--shadow-xl); border: 1px solid var(--border); overflow: hidden; }
.pro-modal-header { padding: 24px; background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; text-align: center; position: relative; }
.pro-modal-header h3 { font-size: 24px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.pro-modal-header p { font-size: 14px; opacity: 0.9; font-weight: 500; }
.pro-modal-close-btn { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, 0.2); border: none; color: #000; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.pro-modal-close-btn:hover { background: rgba(0, 0, 0, 0.3); transform: rotate(90deg); }
.pro-modal-body { padding: 24px; background: white; flex: 1; overflow-y: auto; }
.pro-feature { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border-light); }
.pro-feature:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.pro-feature-icon { width: 40px; height: 40px; background: linear-gradient(135deg, #FFD700, #FFA500); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: #000; font-size: 18px; flex-shrink: 0; }
.pro-feature-text h4 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.pro-feature-text p { font-size: 14px; color: var(--text-light); line-height: 1.5; }
.pro-modal-footer { padding: 24px; background: var(--surface); border-top: 1px solid var(--border); text-align: center; }
.pro-subscribe-btn { display: inline-block; padding: 16px 32px; background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; text-decoration: none; border-radius: var(--radius-md); font-weight: 700; font-size: 16px; transition: all 0.3s ease; border: none; cursor: pointer; width: 100%; box-sizing: border-box; }
.pro-subscribe-btn:hover { background: linear-gradient(135deg, #FFC107, #FF9800); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4); }
