/* ============================================
   PERIODIC TABLE ONLINE — MAIN STYLESHEET
   ============================================ */

:root {
  --orange: #FF6700;
  --orange-light: #FF8C38;
  --orange-glow: rgba(255,103,0,0.15);
  --bg: #f8f9fb;
  --bg2: #ffffff;
  --bg3: #f0f2f5;
  --text: #1a1d23;
  --text2: #4a5568;
  --text3: #718096;
  --border: #e2e8f0;
  --border2: #cbd5e0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --navbar-h: 60px;

  /* Element Category Colors */
  --alkali: #FF6B35;
  --alkaline: #F7C59F;
  --transition: #4ECDC4;
  --post-transition: #45B7D1;
  --metalloid: #96CEB4;
  --nonmetal: #88D8B0;
  --halogen: #FFEAA7;
  --noble: #DDA0DD;
  --lanthanide: #FFB347;
  --actinide: #87CEEB;
  --unknown: #d1d5db;
}

body.dark {
  --bg: #0f1117;
  --bg2: #1a1d26;
  --bg3: #252836;
  --text: #f0f2f5;
  --text2: #a0aec0;
  --text3: #718096;
  --border: #2d3142;
  --border2: #3d4155;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* ============ NAVBAR ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  height: var(--navbar-h);
  box-shadow: var(--shadow);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-icon { width: 32px; height: 32px; }

.brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  color: var(--orange);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 20px;
}

.nav-link {
  text-decoration: none;
  color: var(--text2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover, .nav-link.active {
  background: var(--orange-glow);
  color: var(--orange);
}

.badge {
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 600;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon svg { width: 18px; height: 18px; }

.btn-icon:hover {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

/* ============ TABLE SECTION ============ */
.table-section {
  padding: 24px 16px 32px;
  background: var(--bg);
}

.table-controls {
  max-width: 1400px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.control-label {
  font-size: 0.85rem;
  color: var(--text3);
  font-weight: 500;
}

.ctrl-btn {
  padding: 6px 14px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text2);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.ctrl-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.ctrl-btn.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  color: var(--text3);
}

#searchInput {
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text);
  border-radius: 20px;
  font-size: 0.85rem;
  outline: none;
  width: 220px;
  font-family: inherit;
  transition: border-color 0.2s;
}

#searchInput:focus {
  border-color: var(--orange);
}

/* TEMPERATURE SLIDER */
.temp-slider-wrap {
  max-width: 1400px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.temp-slider-wrap label {
  font-size: 0.9rem;
  color: var(--text2);
  white-space: nowrap;
  min-width: 160px;
}

.temp-slider-wrap input[type=range] {
  flex: 1;
  max-width: 400px;
  accent-color: var(--orange);
}

.trend-select-wrap {
  max-width: 1400px;
  margin: 0 auto 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hidden { display: none !important; }

/* ============ PERIODIC TABLE GRID ============ */
.periodic-table {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  gap: 3px;
}

.element-cell {
  aspect-ratio: 1;
  min-width: 0;
  padding: 4px 3px 3px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
  border: 1px solid transparent;
  overflow: hidden;
}

.element-cell:hover {
  transform: scale(1.15);
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  border-color: rgba(255,255,255,0.3);
}

.element-cell.dimmed {
  opacity: 0.2;
}

.element-cell.highlighted {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--orange);
  opacity: 1 !important;
}

.el-number {
  font-size: 0.48rem;
  color: rgba(0,0,0,0.5);
  line-height: 1;
  align-self: flex-start;
  font-family: 'JetBrains Mono', monospace;
}

.el-symbol {
  font-size: clamp(0.7rem, 1.4vw, 1.1rem);
  font-weight: 700;
  line-height: 1.1;
  color: rgba(0,0,0,0.85);
  letter-spacing: -0.03em;
}

.el-name {
  font-size: 0.38rem;
  color: rgba(0,0,0,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
  line-height: 1.2;
}

.el-mass {
  font-size: 0.35rem;
  color: rgba(0,0,0,0.5);
  font-family: 'JetBrains Mono', monospace;
}

/* Spacer cells */
.element-spacer {
  aspect-ratio: 1;
}

/* Phase indicators */
.element-cell.gas::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3498db;
}

.element-cell.liquid::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e74c3c;
}

/* LEGEND */
.legend {
  max-width: 1400px;
  margin: 20px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text2);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ============ ELEMENT MODAL ============ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

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

.element-modal {
  background: var(--bg2);
  border-radius: 16px;
  padding: 28px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-header {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.modal-symbol-block {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 10px;
}

.modal-atomic {
  font-size: 0.75rem;
  color: rgba(0,0,0,0.5);
  font-family: 'JetBrains Mono', monospace;
  align-self: flex-start;
}

.modal-symbol {
  font-size: 2.8rem;
  font-weight: 800;
  color: rgba(0,0,0,0.85);
  line-height: 1;
}

.modal-name-sm {
  font-size: 0.7rem;
  color: rgba(0,0,0,0.6);
}

.modal-mass {
  font-size: 0.65rem;
  color: rgba(0,0,0,0.5);
  font-family: 'JetBrains Mono', monospace;
}

.modal-info h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-info p {
  color: var(--text2);
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.modal-3d {
  text-align: center;
  margin: 16px 0;
}

#atomCanvas {
  border-radius: 12px;
  background: var(--bg3);
  max-width: 100%;
}

.canvas-label {
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 6px;
}

.modal-props {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.prop-item {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.prop-label {
  font-size: 0.72rem;
  color: var(--text3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.prop-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}

.btn-explore {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-explore:hover {
  background: var(--orange-light);
}

/* ============ PDF SECTION ============ */
.pdfs-section {
  background: var(--bg2);
  padding: 64px 20px;
  border-top: 1px solid var(--border);
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.03em;
}

.section-header p {
  color: var(--text2);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto;
}

.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.pdf-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
  cursor: pointer;
}

.pdf-card:hover {
  border-color: var(--orange);
  box-shadow: 0 4px 20px var(--orange-glow);
  transform: translateY(-2px);
}

.pdf-icon {
  font-size: 2rem;
}

.pdf-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.pdf-desc {
  font-size: 0.8rem;
  color: var(--text2);
  flex: 1;
}

.pdf-download {
  font-size: 0.8rem;
  color: var(--orange);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============ EXPLORER SECTION ============ */
.explorer-section {
  background: var(--bg3);
  padding: 64px 20px;
  border-top: 1px solid var(--border);
}

.explorer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.badge-pill {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.explorer-text h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.03em;
}

.explorer-text p {
  color: var(--text2);
  margin-bottom: 20px;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.feature-list li {
  font-size: 0.9rem;
  color: var(--text2);
}

.btn-primary {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-block;
}

.btn-primary:hover {
  background: var(--orange-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--orange-glow);
}

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

#explorerCanvas {
  border-radius: 16px;
  background: var(--bg2);
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.explorer-label {
  font-size: 0.85rem;
  color: var(--text3);
  margin-top: 12px;
}

/* EXPLORER MODAL */
.explorer-modal {
  background: var(--bg2);
  border-radius: 16px;
  padding: 28px;
  max-width: 640px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

.explorer-modal h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.explorer-search input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  margin-bottom: 16px;
}

.explorer-search input:focus {
  border-color: var(--orange);
}

.explorer-3d-wrap {
  text-align: center;
  margin-bottom: 16px;
}

#explorerModal3D {
  border-radius: 12px;
  background: var(--bg3);
  max-width: 100%;
  border: 1px solid var(--border);
}

.explorer-info {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.85rem;
  color: var(--text2);
  min-height: 60px;
}

/* ============ CALCULATOR SECTION ============ */
.calc-section {
  background: var(--bg2);
  padding: 64px 20px;
  border-top: 1px solid var(--border);
}

.calc-box {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 680px;
  margin: 0 auto;
}

.calc-input-wrap {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.calc-input-wrap input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  outline: none;
}

.calc-input-wrap input:focus {
  border-color: var(--orange);
}

.calc-result {
  font-size: 1rem;
  color: var(--text);
  min-height: 40px;
}

.calc-result .result-main {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--orange);
  font-family: 'JetBrains Mono', monospace;
}

.calc-result .result-breakdown {
  font-size: 0.85rem;
  color: var(--text2);
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.8;
}

.calc-result .result-error {
  color: #e74c3c;
  font-size: 0.9rem;
}

/* ============ CONVERTER SECTION ============ */
.converter-section {
  background: var(--bg);
  padding: 64px 20px;
  border-top: 1px solid var(--border);
}

.converter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.converter-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.converter-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--orange);
  margin-bottom: 4px;
}

.converter-card input {
  padding: 9px 12px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.converter-card input:focus {
  border-color: var(--orange);
}

/* ============ ABOUT SECTION ============ */
.about-section {
  background: var(--bg3);
  padding: 64px 20px;
  border-top: 1px solid var(--border);
}

.about-inner {
  max-width: 900px;
}

.about-text h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.03em;
}

.about-text > p {
  color: var(--text2);
  margin-bottom: 32px;
  font-size: 1.05rem;
}

.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.feat-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg2);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.feat-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.feat-item strong {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.feat-item p {
  font-size: 0.85rem;
  color: var(--text2);
}

/* ============ BLOG SECTION ============ */
.blog-section {
  background: var(--bg2);
  padding: 64px 20px;
  border-top: 1px solid var(--border);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.blog-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.blog-img {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-element {
  font-size: 3.5rem;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  font-family: 'JetBrains Mono', monospace;
}

.blog-body {
  padding: 20px;
  background: var(--bg2);
}

.blog-tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--orange-glow);
  color: var(--orange);
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.blog-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 10px 0 8px;
  line-height: 1.4;
}

.blog-body p {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 12px;
}

.blog-read {
  font-size: 0.85rem;
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
}

/* ============ FOOTER ============ */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 32px 20px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand .brand-icon {
  width: 28px;
  height: 28px;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text3);
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-left: auto;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text2);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--orange);
}

.footer-contact a {
  font-size: 0.82rem;
  color: var(--text3);
  text-decoration: none;
}

.footer-contact a:hover {
  color: var(--orange);
}

/* ============ HELP MODAL ============ */
.help-modal {
  background: var(--bg2);
  border-radius: 16px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

.help-modal h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.help-modal ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-modal li {
  font-size: 0.88rem;
  color: var(--text2);
  padding-left: 12px;
  border-left: 3px solid var(--orange);
}

/* ============ TREND GRADIENT ============ */
.trend-low { background: #e8f5e9 !important; }
.trend-mid { background: #fff9c4 !important; }
.trend-high { background: #ffccbc !important; }
body.dark .trend-low { background: #1a3a2a !important; }
body.dark .trend-mid { background: #3a3a1a !important; }
body.dark .trend-high { background: #3a1a1a !important; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .explorer-inner {
    grid-template-columns: 1fr;
  }

  .periodic-table {
    gap: 2px;
  }

  .el-name, .el-mass { display: none; }
  .el-symbol { font-size: clamp(0.55rem, 2.5vw, 0.9rem); }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-links { margin-left: 0; }
}

@media (max-width: 600px) {
  .table-controls { flex-direction: column; align-items: flex-start; }
  #searchInput { width: 100%; }

  .section-header h2 { font-size: 1.5rem; }
  .explorer-text h2 { font-size: 1.6rem; }

  .periodic-table { gap: 1.5px; }
  .el-number { display: none; }
  .element-cell { padding: 2px; }

  .calc-input-wrap { flex-direction: column; }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg3); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange); }
