/* ═══════════════════════════════════════════════════════════════════════════
   PERIODIC TABLE 3D PRINT GENERATOR - STYLE.CSS
   Dark Glassmorphism Theme
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #080b10;
  --panel: #0c1018;
  --card: #111a26;
  --card-hover: #152030;
  --text: #e8f0ff;
  --muted: #8899b0;
  --accent: #4cc9f0;
  --accent2: #7b61ff;
  --accent-hover: #7dd8f5;
  --accent-glow: rgba(76, 201, 240, 0.25);
  --warn: #ffcc00;
  --err: #ff4d6d;
  --ok: #57d163;
  --border: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(76, 201, 240, 0.25);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══ RESET & BASE ═══ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  overflow: hidden;
}

/* ═══ LAYOUT ═══ */

.app {
  display: grid;
  grid-template-columns: 400px 1fr;
  height: 100vh;
  width: 100vw;
}

.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  position: relative;
  z-index: 10;
}

.panel::-webkit-scrollbar {
  width: 6px;
}

.panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent2) 100%);
  border-radius: 3px;
}

.panel::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

.view {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0d1219 0%, var(--bg) 100%);
}

.view canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.view canvas:active {
  cursor: grabbing;
}

/* ═══ HEADER ═══ */

h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

h1::before {
  content: '⚛';
  -webkit-text-fill-color: var(--accent);
  font-size: 24px;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

/* ═══ CARDS ═══ */

.card {
  background: linear-gradient(135deg, var(--card) 0%, rgba(17, 26, 38, 0.8) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 4px 32px var(--accent-glow), var(--shadow);
}

.card h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ═══ SECTION LABELS ═══ */

.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}

.section-label::before,
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border) 50%, transparent 100%);
}

/* ═══ FORM ELEMENTS ═══ */

label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text);
}

label span {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--muted);
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="number"]:hover,
input[type="text"]:hover,
select:hover {
  border-color: var(--border-accent);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234cc9f0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

input[type="number"] {
  text-align: right;
}

/* ═══ GRID LAYOUTS ═══ */

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* ═══ BUTTONS ═══ */

button,
.filebtn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 8px var(--accent-glow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  outline: none;
}

button:hover,
.filebtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
  border-color: var(--accent-hover);
}

button:active,
.filebtn:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

button:disabled:hover {
  transform: none;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btnrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btnrow button {
  flex: 1;
  min-width: 0;
}

button.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
}

/* ═══ PSE GRID ═══ */

.pse-grid {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  gap: 2px;
  margin: 12px 0;
}

.pse-cell {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: 4px;
  padding: 4px;
  min-height: 36px;
  min-width: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.pse-cell:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px var(--accent-glow);
  border-color: var(--accent);
  border-left-width: 3px;
  z-index: 5;
}

.pse-cell.active {
  border: 2px solid var(--accent);
  border-left: 3px solid var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  background: rgba(76, 201, 240, 0.1);
}

.pse-cell .num {
  font-size: 8px;
  color: var(--muted);
  line-height: 1;
  margin-bottom: 2px;
}

.pse-cell .sym {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.cat-nonmetal {
  border-left-color: #4cc9f0;
  background: rgba(76, 201, 240, 0.05);
}

.cat-noble-gas {
  border-left-color: #7b61ff;
  background: rgba(123, 97, 255, 0.05);
}

.cat-alkali-metal {
  border-left-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.05);
}

.cat-alkaline-earth {
  border-left-color: #f2cc8f;
  background: rgba(242, 204, 143, 0.05);
}

.cat-metalloid {
  border-left-color: #81b29a;
  background: rgba(129, 178, 154, 0.05);
}

.cat-halogen {
  border-left-color: #5dadec;
  background: rgba(93, 173, 236, 0.05);
}

.cat-transition-metal {
  border-left-color: #e07a5f;
  background: rgba(224, 122, 95, 0.05);
}

.cat-post-transition {
  border-left-color: #c9a96e;
  background: rgba(201, 169, 110, 0.05);
}

.cat-lanthanide {
  border-left-color: #d4a373;
  background: rgba(212, 163, 115, 0.05);
}

.cat-actinide {
  border-left-color: #9b59b6;
  background: rgba(155, 89, 182, 0.05);
}

.cat-unknown {
  border-left-color: #666;
  background: rgba(102, 102, 102, 0.05);
}

/* ═══ PSE SPACER ═══ */

.pse-spacer {
  visibility: hidden;
  pointer-events: none;
}

.pse-lanthanide-label,
.pse-actinide-label {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ═══ ELEMENT INFO CARD ═══ */

.element-info {
  text-align: center;
  padding: 20px;
}

.element-symbol {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 0 0 20px var(--accent-glow);
}

.element-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.element-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
  font-size: 11px;
}

.element-details > div {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
}

.element-details .label {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.element-details .value {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* ═══ TABS ═══ */

.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: none;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  transform: none;
  box-shadow: none;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  box-shadow: none;
}

.tab-btn.active:hover {
  transform: none;
}

/* ═══ RANGE SLIDERS ═══ */

input[type="range"] {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  outline: none;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--accent-glow);
  transition: all var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 16px var(--accent-glow);
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--accent-glow);
  transition: all var(--transition);
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* ═══ CHECKBOXES ═══ */

input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
  flex-shrink: 0;
}

input[type="checkbox"]:hover {
  border-color: var(--accent);
}

input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

/* ═══ TOGGLE ROW ═══ */

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.toggle-row label {
  margin-bottom: 0;
  cursor: pointer;
  user-select: none;
}

.toggle-row input[type="checkbox"] {
  margin: 0;
}

/* ═══ COLOR SWATCHES ═══ */

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: all var(--transition);
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.1);
  border-color: var(--accent);
}

.color-swatch.active {
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transform: scale(1.1);
}

.color-swatch.active::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

/* ═══ PRINT MODE CARDS ═══ */

.print-mode {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.print-mode:hover {
  border-color: var(--accent);
  background: rgba(76, 201, 240, 0.05);
  transform: translateY(-2px);
}

.print-mode.selected {
  border-color: var(--accent);
  background: rgba(76, 201, 240, 0.1);
  box-shadow: 0 0 16px var(--accent-glow);
}

.print-mode .icon {
  font-size: 24px;
  line-height: 1;
}

.print-mode .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text);
}

.print-mode .desc {
  font-size: 9px;
  color: var(--muted);
  line-height: 1.3;
}

/* ═══ EXPORT BUTTONS ═══ */

.export-btn {
  position: relative;
}

.export-btn::before {
  content: '↓';
  margin-right: 4px;
  font-size: 14px;
}

button[data-format="stl"]::before {
  content: '📦';
}

button[data-format="obj"]::before {
  content: '🔷';
}

button[data-format="gltf"]::before {
  content: '✨';
}

button[data-format="3mf"]::before {
  content: '🎯';
}

button[data-format="zip"]::before {
  content: '📁';
}

/* ═══ TOAST ═══ */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: linear-gradient(135deg, var(--card) 0%, rgba(17, 26, 38, 0.95) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 13px;
  min-width: 250px;
  max-width: 400px;
  pointer-events: auto;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.ok {
  border-color: var(--ok);
  background: linear-gradient(135deg, rgba(87, 209, 99, 0.15) 0%, var(--card) 100%);
}

.toast.warn {
  border-color: var(--warn);
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.15) 0%, var(--card) 100%);
}

.toast.err {
  border-color: var(--err);
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.15) 0%, var(--card) 100%);
}

.toast::before {
  content: 'ℹ';
  font-size: 18px;
  flex-shrink: 0;
}

.toast.ok::before {
  content: '✓';
  color: var(--ok);
}

.toast.warn::before {
  content: '⚠';
  color: var(--warn);
}

.toast.err::before {
  content: '✕';
  color: var(--err);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ═══ 3D VIEW ═══ */

.info-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(17, 26, 38, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  backdrop-filter: blur(8px);
  font-size: 11px;
  color: var(--text);
  font-family: 'Monaco', 'Courier New', monospace;
  pointer-events: none;
  line-height: 1.6;
}

.info-overlay .dim {
  color: var(--accent);
  font-weight: 600;
}

.view-toolbar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 26, 38, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  backdrop-filter: blur(12px);
  display: flex;
  gap: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.view-toolbar button {
  padding: 8px 12px;
  font-size: 11px;
  min-width: 60px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  box-shadow: none;
}

.view-toolbar button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.view-toolbar button.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  border-color: var(--accent);
}

/* ═══ MODAL/OVERLAY ═══ */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal {
  background: linear-gradient(135deg, var(--panel) 0%, var(--card) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.7);
  position: relative;
  animation: slideInModal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal::-webkit-scrollbar {
  width: 8px;
}

.modal::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.modal::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent2) 100%);
  border-radius: 4px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(255, 77, 109, 0.2);
  border: 1px solid var(--err);
  border-radius: 50%;
  color: var(--err);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--err);
  color: white;
  transform: rotate(90deg) scale(1.1);
}

.modal h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--accent);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInModal {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ═══ PSE FULL TABLE MODAL ═══ */

.pse-full-grid {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  gap: 4px;
  margin: 20px 0;
}

.pse-full-grid .pse-cell {
  min-height: 48px;
  min-width: 42px;
  padding: 6px;
}

.pse-full-grid .pse-cell .num {
  font-size: 9px;
  margin-bottom: 3px;
}

.pse-full-grid .pse-cell .sym {
  font-size: 14px;
  margin-bottom: 2px;
}

.pse-full-grid .pse-cell .name {
  font-size: 8px;
  color: var(--muted);
  line-height: 1;
  text-align: center;
}

/* ═══ WARNINGS/STATUS ═══ */

.warnings {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.5;
}

.warnings > div {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.warnings .ok {
  background: rgba(87, 209, 99, 0.1);
  border: 1px solid var(--ok);
  color: var(--ok);
}

.warnings .warn {
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid var(--warn);
  color: var(--warn);
}

.warnings .err {
  background: rgba(255, 77, 109, 0.1);
  border: 1px solid var(--err);
  color: var(--err);
}

.warnings .ok::before {
  content: '✓';
  font-size: 14px;
  font-weight: 700;
}

.warnings .warn::before {
  content: '⚠';
  font-size: 14px;
}

.warnings .err::before {
  content: '✕';
  font-size: 14px;
  font-weight: 700;
}

/* ═══ SCROLLBAR ═══ */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(0, 0, 0, 0.2);
}

/* ═══ FOOTER ═══ */

.foot {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.mini {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.mini a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

.mini a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ═══ RESPONSIVE ═══ */

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .panel {
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .view {
    height: 50vh;
  }

  .info-overlay {
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 8px 10px;
  }

  .view-toolbar {
    bottom: 12px;
    padding: 6px;
    gap: 4px;
  }

  .view-toolbar button {
    padding: 6px 10px;
    font-size: 10px;
    min-width: 50px;
  }

  .modal {
    max-width: 95vw;
    max-height: 85vh;
    padding: 20px;
  }

  .pse-grid {
    gap: 1px;
  }

  .pse-cell {
    min-height: 32px;
    min-width: 24px;
    padding: 3px;
  }

  .pse-cell .num {
    font-size: 7px;
  }

  .pse-cell .sym {
    font-size: 10px;
  }

  .pse-full-grid {
    gap: 2px;
  }

  .pse-full-grid .pse-cell {
    min-height: 40px;
    min-width: 36px;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 16px;
  }

  h1::before {
    font-size: 20px;
  }

  .card {
    padding: 12px;
  }

  .card h2 {
    font-size: 10px;
  }

  button,
  .filebtn {
    padding: 8px 12px;
    font-size: 11px;
  }

  .element-symbol {
    font-size: 36px;
  }

  .element-name {
    font-size: 14px;
  }

  .toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }

  .toast {
    font-size: 12px;
    min-width: 0;
  }
}

/* ═══ ANIMATIONS ═══ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInModal {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* ═══ UTILITY CLASSES ═══ */

.hidden {
  display: none !important;
}

.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.gap-sm { gap: 6px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 20px; }

/* ═══ BOARD (SAMMELPLATTE) ═══ */

.board-size-info {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(76, 201, 240, 0.06);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.board-size-info b {
  color: var(--text);
  font-size: 13px;
}

/* ═══ END ═══ */
