/* ==========================================================================
   Periodic Table · crypto dark theme
   ========================================================================== */
:root {
  --bg: #07090f;
  --bg-2: #0b0e17;
  --surface: #0f131d;
  --surface-2: #141927;
  --surface-3: #1a2033;
  --surface-hover: #1b2135;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.13);
  --text: #e8ecf4;
  --text-2: #b4bccd;
  --muted: #7d879c;
  --accent: #14f195;
  --accent-rgb: 20, 241, 149;
  --accent-2: #9945ff;
  --accent-2-rgb: 153, 69, 255;
  --accent-3: #00d1ff;
  --gold: #f5b700;
  --danger: #ff4d6d;
  --ok: #22c55e;
  --warn: #f59e0b;

  --cat-alkali: #ff5c7a;
  --cat-alkaline: #ff9f43;
  --cat-transition: #ffd24d;
  --cat-post-transition: #4ade80;
  --cat-metalloid: #2dd4bf;
  --cat-nonmetal: #60a5fa;
  --cat-halogen: #a78bfa;
  --cat-noble: #22d3ee;
  --cat-lanthanide: #f472b6;
  --cat-actinide: #a3aab8;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --topbar-h: 60px;
  --table-scale: 1;
}
:root[data-accent="purple"] { --accent: #b16cff; --accent-rgb: 177, 108, 255; --accent-2: #14f195; --accent-2-rgb: 20, 241, 149; }
:root[data-accent="cyan"] { --accent: #00d1ff; --accent-rgb: 0, 209, 255; --accent-2: #9945ff; --accent-2-rgb: 153, 69, 255; }
:root[data-accent="gold"] { --accent: #f5b700; --accent-rgb: 245, 183, 0; --accent-2: #ff5c7a; --accent-2-rgb: 255, 92, 122; }
:root[data-accent="pink"] { --accent: #ff5c9a; --accent-rgb: 255, 92, 154; --accent-2: #00d1ff; --accent-2-rgb: 0, 209, 255; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
sup, sub { font-size: 0.72em; line-height: 0; }
::selection { background: rgba(var(--accent-rgb), 0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Background effects -------------------------------------------------- */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
.bg-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35; }
.bg-orb-1 { width: 520px; height: 520px; top: -200px; left: -120px; background: rgba(var(--accent-2-rgb), 0.55); }
.bg-orb-2 { width: 480px; height: 480px; top: 10%; right: -160px; background: rgba(var(--accent-rgb), 0.35); }
.bg-orb-3 { width: 600px; height: 600px; bottom: -300px; left: 35%; background: rgba(0, 209, 255, 0.22); }

/* Top bar ------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  background: rgba(9, 12, 20, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-logo { display: grid; place-items: center; filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.45)); }
.brand-text { font-family: var(--font-head); font-weight: 700; letter-spacing: 0.12em; font-size: 14px; }
.brand-accent { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.search { position: relative; flex: 0 1 300px; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 38px; padding: 0 44px 0 36px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: rgba(var(--accent-rgb), 0.6); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15); }
.search input::-webkit-search-cancel-button { display: none; }
.search-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 6px; pointer-events: none;
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); max-height: 60vh; overflow: auto; padding: 6px;
}
.search-results[hidden] { display: none; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.search-item:hover, .search-item.active { background: var(--surface-hover); }
.search-item .sym { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.search-item .nm { flex: 1; }
.search-item .nm small { display: block; color: var(--muted); font-size: 12px; }
.search-item .num { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.search-empty { padding: 12px; color: var(--muted); text-align: center; font-size: 13px; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-2); transition: background .15s, color .15s; white-space: nowrap;
}
.nav-link:hover, .nav-link.active, .dropdown.open > .nav-link { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.nav-link .chev { opacity: 0.6; transition: transform .15s; }
.dropdown { position: relative; }
.dropdown.open .chev { transform: rotate(180deg); }
.menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; z-index: 60;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; display: none;
}
.dropdown.open .menu { display: block; animation: pop .14s ease-out; }
.menu a { display: block; padding: 9px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.menu a:hover { background: var(--surface-hover); color: var(--text); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.topbar-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.burger { display: none; }

/* Mobile nav */
@media (max-width: 1100px) {
  .nav-link span:not(.chev) { }
  .brand-text { display: none; }
}
@media (max-width: 960px) {
  .nav {
    position: fixed; top: var(--topbar-h); left: 0; right: 0; z-index: 49;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: rgba(11, 14, 23, 0.97); border-bottom: 1px solid var(--border-2);
    padding: 10px; display: none; max-height: calc(100vh - var(--topbar-h)); overflow: auto;
  }
  .nav.open { display: flex; }
  .nav-link { padding: 12px 14px; font-size: 13px; }
  .menu { position: static; display: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 28px; }
  .dropdown.open .menu { display: block; }
  .burger { display: grid; }
  .search { flex: 1 1 auto; }
  .brand-text { display: none; }
}

/* Layout -------------------------------------------------------------- */
.app { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 22px 18px 40px; outline: none; }
.page-head { text-align: center; margin: 4px 0 22px; }
.page-head h1 { font-family: var(--font-head); font-size: 26px; margin: 0 0 6px; letter-spacing: 0.02em; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.container-narrow { max-width: 860px; margin: 0 auto; }
.container-mid { max-width: 1100px; margin: 0 auto; }

.footer { border-top: 1px solid var(--border); background: rgba(9, 12, 20, 0.6); }
.footer-inner { max-width: 1440px; margin: 0 auto; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--text); }
.footer-meta { display: flex; align-items: center; gap: 8px; }
.footer-sep { opacity: 0.5; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05); }
.status-dot.on { background: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2), 0 0 12px rgba(var(--accent-rgb), 0.6); }

/* Cards & primitives -------------------------------------------------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 60%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.9), rgba(var(--accent-2-rgb), 0.8), transparent);
  opacity: 0.8;
}
.card.flat::before { display: none; }
.card.center { text-align: center; }
.card .note { color: var(--text-2); line-height: 1.7; }
.card .note p { margin: 0 0 12px; }
.card .note p:last-child { margin-bottom: 0; }
.card + .card { margin-top: 16px; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--bg); background: linear-gradient(90deg, var(--accent), var(--accent-3));
  margin-bottom: 14px;
}
.tag.ghost { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.35); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-2); }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.kv { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 1.4fr); gap: 10px 14px; align-items: start; }
.kv .k { color: var(--muted); font-size: 13.5px; }
.kv .v { font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv .v.mono { font-family: var(--mono); font-size: 13.5px; }
.kv .v .unit { color: var(--muted); font-weight: 400; margin-left: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14px;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.btn:hover { background: var(--surface-hover); border-color: rgba(255, 255, 255, 0.2); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-3)); color: #06110c; border-color: transparent;
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.3);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.active { border-color: rgba(var(--accent-rgb), 0.7); background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.input, .select, textarea.input {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 10px;
  color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 14px; resize: vertical; min-height: 90px; font-family: var(--mono); }
.input:focus, .select:focus, textarea.input:focus { border-color: rgba(var(--accent-rgb), 0.65); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15); }
.input::placeholder { color: var(--muted); }
.input.mono { font-family: var(--mono); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d879c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.select option { background: var(--surface-2); color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.field .hint { font-size: 12px; color: var(--muted); }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.input-group { display: flex; }
.input-group .input { border-radius: 10px 0 0 10px; }
.input-group .select { width: auto; min-width: 90px; border-left: 0; border-radius: 0 10px 10px 0; }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 999px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: rgba(var(--accent-rgb), 0.35); border-color: rgba(var(--accent-rgb), 0.7); }
.switch input:checked + .slider::before { transform: translateX(20px); background: var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.8); }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg button:hover { color: var(--text); }
.seg button.active { background: rgba(var(--accent-rgb), 0.16); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.4); }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: linear-gradient(90deg, #3b82f6, #22d3ee 25%, #facc15 55%, #f97316 80%, #ef4444); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.7); cursor: pointer; }
.range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { text-align: left; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border-2); background: var(--surface-2); position: sticky; top: var(--topbar-h); z-index: 1; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
.table .num { font-family: var(--mono); color: var(--muted); font-size: 12.5px; }
.table .formula { font-family: var(--mono); }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table-wrap .table th { top: 0; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 80; padding: 12px 16px; background: var(--surface-2); border: 1px solid rgba(var(--accent-rgb), 0.5); border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; display: flex; align-items: center; gap: 10px; animation: pop .2s ease-out; }
.toast[hidden] { display: none; }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.overlay { position: fixed; inset: 0; background: rgba(3, 5, 10, 0.6); z-index: 70; backdrop-filter: blur(2px); }
.overlay[hidden] { display: none; }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.small { font-size: 13px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.link { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(var(--accent-rgb), 0.4); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--accent); }

/* Settings drawer ----------------------------------------------------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100%); z-index: 75;
  background: var(--bg-2); border-left: 1px solid var(--border-2); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  overflow: auto; padding: 18px 20px 40px;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.drawer-head h2 { font-family: var(--font-head); font-size: 18px; margin: 0; }
.drawer h3 { font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 22px 0 10px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting .lbl { color: var(--text-2); font-size: 14px; }
.setting .ctl { flex: 0 0 auto; max-width: 60%; }
.setting .ctl .select { height: 36px; font-size: 13px; padding: 0 32px 0 10px; }
.style-opts { display: flex; gap: 8px; }
.style-opt { width: 54px; height: 44px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface-2); display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 5px; cursor: pointer; }
.style-opt.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.3); }
.style-opt i { display: block; border-radius: 3px; }
.style-opt[data-style="1"] i { background: var(--cat-alkali); opacity: .9; }
.style-opt[data-style="2"] i { background: color-mix(in srgb, var(--cat-alkali) 20%, transparent); border: 1px solid var(--cat-alkali); }
.style-opt[data-style="3"] i { background: transparent; border: 1px solid var(--cat-alkali); border-radius: 0; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--bg-2), 0 0 12px currentColor; }

/* Periodic table ------------------------------------------------------ */
.pt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pt-toolbar .left, .pt-toolbar .right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pt-toolbar .select { height: 36px; width: auto; min-width: 180px; font-size: 13px; }
.temp-ctl { display: flex; align-items: center; gap: 10px; min-width: 260px; flex: 1 1 260px; }
.temp-ctl .val { font-family: var(--mono); font-size: 13px; color: var(--accent); min-width: 70px; text-align: right; }
.heat-scale { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.heat-scale .bar { width: 160px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #1e3a8a, #2563eb, #22d3ee, #a3e635, #facc15, #f97316, #ef4444); }

.ptable-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; }
.ptable-wrap { container-type: inline-size; margin: 0 auto; width: calc(100% * var(--table-scale)); min-width: 900px; }
.ptable-wrap.wide { min-width: 1500px; }
.ptable {
  display: grid;
  grid-template-columns: 28px repeat(18, minmax(0, 1fr));
  grid-template-rows: 20px repeat(7, auto) 14px auto auto;
  gap: 4px;
}
.ptable.wide { grid-template-columns: 28px repeat(32, minmax(0, 1fr)); grid-template-rows: 20px repeat(7, auto); }
.pt-ghead { grid-row: 1; font-family: var(--mono); font-size: 10px; color: var(--muted); text-align: center; align-self: end; }
.pt-phead { grid-column: 1; font-family: var(--mono); font-size: 10px; color: var(--muted); display: grid; place-items: center; }
.pt-corner { grid-column: 1; grid-row: 1; font-size: 8.5px; color: var(--muted); line-height: 1.1; align-self: end; white-space: nowrap; }
.pt-corner span { display: block; }
.pt-series { grid-column: 1 / 4; font-size: 11px; color: var(--muted); display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; white-space: nowrap; }

.tile {
  --c: var(--cat-transition);
  position: relative; aspect-ratio: 1 / 1.08; border-radius: 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 9px 2px 3px;
  background: color-mix(in srgb, var(--c) 17%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 38%, transparent);
  color: var(--c);
  transition: transform .12s, box-shadow .15s, opacity .2s, filter .2s, background .2s;
  overflow: hidden; user-select: none; -webkit-user-select: none;
}
.tile .num { position: absolute; top: 2px; left: 4px; font-family: var(--mono); font-size: clamp(7px, 0.95cqw, 11px); color: var(--text-2); opacity: .85; }
.tile .sym { font-family: var(--font-head); font-weight: 700; font-size: clamp(10px, 2cqw, 22px); line-height: 1; }
.tile .name { font-size: clamp(6px, 0.75cqw, 9.5px); color: var(--text-2); margin-top: 2px; max-width: 96%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .mass { font-family: var(--mono); font-size: clamp(6px, 0.7cqw, 9px); color: var(--muted); margin-top: 1px; }
.tile:hover, .tile:focus-visible { transform: translateY(-2px) scale(1.06); z-index: 2; box-shadow: 0 0 0 1px var(--c), 0 8px 24px color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 32%, var(--surface)); }
.tile.dim { opacity: 0.18; filter: grayscale(.6); }
.tile.hl { box-shadow: 0 0 0 1px var(--c), 0 0 16px color-mix(in srgb, var(--c) 50%, transparent); }
.tile.ph { aspect-ratio: 1 / 1.08; }
.tile.marker { cursor: default; background: transparent; border-style: dashed; color: var(--muted); font-family: var(--mono); font-size: clamp(7px, 0.9cqw, 11px); }
.tile.marker:hover { transform: none; box-shadow: none; }
.tile.pulse { animation: tilepulse 1.1s ease-out 1; }
@keyframes tilepulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 70%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }

/* style 2: solid, style 3: outline */
.ptable.style-2 .tile { background: var(--c); color: #0a0d14; border-color: transparent; }
.ptable.style-2 .tile .num, .ptable.style-2 .tile .name, .ptable.style-2 .tile .mass { color: rgba(10, 13, 20, 0.75); }
.ptable.style-2 .tile:hover { background: var(--c); filter: brightness(1.12); }
.ptable.style-3 .tile { background: transparent; border-color: color-mix(in srgb, var(--c) 55%, transparent); border-radius: 2px; }
.ptable.style-3 .tile:hover { background: color-mix(in srgb, var(--c) 18%, transparent); }

/* heat-map coloring overrides */
.tile.heat { --c: var(--hc, #334155); background: var(--hc); color: #fff; border-color: rgba(255, 255, 255, 0.08); }
.tile.heat .num, .tile.heat .name, .tile.heat .mass { color: rgba(255, 255, 255, 0.8); }
.tile.heat.none { background: var(--surface-2); color: var(--muted); }
.tile .pv { font-family: var(--mono); font-size: clamp(6px, 0.72cqw, 9px); color: rgba(255, 255, 255, 0.85); margin-top: 2px; }

.hover-card {
  grid-column: 4 / 14; grid-row: 2 / 5; z-index: 3;
  --c: var(--cat-transition);
  display: grid; grid-template-columns: minmax(120px, 0.9fr) 1.6fr; gap: 0;
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  border-radius: 12px; overflow: hidden; min-height: 0;
  box-shadow: 0 10px 40px color-mix(in srgb, var(--c) 25%, transparent);
}
.hover-card.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; background: transparent; border: 1px dashed var(--border-2); box-shadow: none; }
.hc-left { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; position: relative; border-right: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.hc-left .num { position: absolute; top: 8px; left: 10px; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.hc-left .sym { font-family: var(--font-head); font-weight: 700; font-size: clamp(34px, 5cqw, 64px); line-height: 1; color: var(--c); text-shadow: 0 0 24px color-mix(in srgb, var(--c) 60%, transparent); }
.hc-left .mass { font-family: var(--mono); font-size: 12px; color: var(--text-2); margin-top: 8px; }
.hc-right { padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.hc-right .name { font-family: var(--font-head); font-weight: 700; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.hc-right .cat { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); padding: 2px 7px; border-radius: 999px; }
.hc-props { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 11px; }
.hc-props .k { color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 9.5px; white-space: nowrap; align-self: center; }
.hc-props .v { font-family: var(--mono); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.block-filter { grid-column: 14 / 19; grid-row: 2; display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 9px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; padding-right: 2px; }
.block-filter button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-2); font-family: var(--mono); font-size: 11px; color: var(--text-2); display: grid; place-items: center; transition: .15s; }
.block-filter button:hover { border-color: var(--accent); color: var(--accent); }
.block-filter button.active { background: var(--accent); color: var(--bg); border-color: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.6); }

.legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 6px; }
.legend button { --c: #fff; padding: 4px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); transition: .15s; }
.legend button:hover, .legend button.active { background: color-mix(in srgb, var(--c) 28%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 35%, transparent); }
.legend.phase button { --c: #94a3b8; }
.legend.phase button.solid { --c: #60a5fa; }
.legend.phase button.liquid { --c: #22d3ee; }
.legend.phase button.gas { --c: #f472b6; }
.legend.phase button.unknown { --c: #64748b; }

@media (max-width: 900px) {
  .hover-card, .block-filter { display: none !important; }
}

/* Element page -------------------------------------------------------- */
.el-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.el-head .crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.el-head .crumbs a:hover { color: var(--text); }
.el-nav { display: flex; gap: 8px; }
.el-masonry { columns: 3; column-gap: 16px; }
.el-masonry > * { break-inside: avoid; margin: 0 0 16px; display: block; }
.el-masonry > .card + .card { margin-top: 0; }
@media (max-width: 1100px) { .el-masonry { columns: 2; } }
@media (max-width: 700px) { .el-masonry { columns: 1; } }

.el-title { --c: var(--cat-transition); text-align: center; }
.el-title h1 { font-family: var(--font-head); margin: 0; font-size: 26px; letter-spacing: 0.18em; text-transform: uppercase; }
.el-title .cat { margin-top: 8px; display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.el-sq { --c: var(--cat-transition); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.el-sq .big { position: relative; aspect-ratio: 1; border-radius: var(--radius); display: grid; place-items: center; background: linear-gradient(145deg, color-mix(in srgb, var(--c) 22%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); box-shadow: inset 0 0 60px color-mix(in srgb, var(--c) 10%, transparent), 0 0 30px color-mix(in srgb, var(--c) 18%, transparent); }
.el-sq .big .num { position: absolute; top: 12px; left: 14px; font-family: var(--mono); font-size: 15px; color: var(--text-2); }
.el-sq .big .sym { font-family: var(--font-head); font-weight: 700; font-size: clamp(44px, 7vw, 68px); color: var(--c); text-shadow: 0 0 30px color-mix(in srgb, var(--c) 60%, transparent); line-height: 1; }
.el-sq .big .mass { position: absolute; bottom: 10px; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.el-sq .gpb { display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 14px 16px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.el-sq .gpb .k { color: var(--muted); font-size: 13px; }
.el-sq .gpb .v { font-family: var(--mono); font-weight: 600; }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 8px; }
.stat3 .k { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.stat3 .v { font-family: var(--font-head); font-size: 24px; font-weight: 700; margin-top: 6px; }
.el-img { padding: 0; overflow: hidden; }
.el-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.el-img .cap { padding: 12px 16px; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.el-img .cap .cr { color: var(--muted); font-size: 12px; display: block; margin-bottom: 4px; }
.el-img .cap a { color: var(--accent); }
.iso-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.iso-chips .chip { font-family: var(--mono); font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border-2); }
.iso-chips .chip.stable { border-color: rgba(var(--accent-rgb), 0.45); color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }
.iso-chips .chip sup { font-size: 9px; }
.sub-k { color: var(--muted); font-size: 13px; margin: 12px 0 8px; }
.sub-k:first-child { margin-top: 0; }
.links-list { display: grid; gap: 8px; }
.links-list a { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; transition: .15s; }
.links-list a:hover { border-color: rgba(var(--accent-rgb), 0.5); color: var(--accent); }
.links-list a svg { opacity: .5; }

.bohr { width: 100%; height: auto; display: block; margin-top: 10px; }
.bohr .orbit { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 1.2; }
.bohr .nucleus { fill: url(#nucleusGrad); }
.bohr .electron { fill: var(--accent); filter: drop-shadow(0 0 3px var(--accent)); }
.bohr .shell { transform-origin: 0 0; animation: spin linear infinite; }
.bohr .shell:nth-child(even) { animation-direction: reverse; }
.bohr text { font-family: var(--font-head); font-weight: 700; fill: #fff; font-size: 22px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bohr .shell { animation: none; } }

.crystal { width: 100%; max-width: 220px; margin: 12px auto 0; display: block; }
.crystal .edge { stroke: rgba(255, 255, 255, 0.65); stroke-width: 0.9; fill: none; }
.crystal .edge.hidden { stroke: rgba(255, 255, 255, 0.18); stroke-dasharray: 2 2; }
.crystal .atom { fill: var(--accent); stroke: #0b0f19; stroke-width: 0.6; }
.crystal .atom.inner { fill: var(--accent-2); }

.spectrum { width: 100%; height: 56px; border-radius: 8px; background: #000; display: block; border: 1px solid var(--border-2); }
.spectrum-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 6px; }

.mini-pt { display: grid; grid-template-columns: repeat(18, 1fr); gap: 2px; margin-bottom: 12px; }
.mini-pt i { --c: #334155; display: block; aspect-ratio: 1; border-radius: 1px; background: color-mix(in srgb, var(--c) 35%, transparent); }
.mini-pt i.gap { background: transparent; }
.mini-pt i.me { background: var(--c); box-shadow: 0 0 8px var(--c); outline: 1px solid #fff; }
.mini-nav { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 14px; }
.mini-nav a { color: var(--accent); }
.mini-nav .cur { font-family: var(--font-head); font-weight: 700; }

/* List page ----------------------------------------------------------- */
.list-tools { display: grid; grid-template-columns: 1.4fr repeat(3, auto); gap: 10px; align-items: center; margin-bottom: 16px; }
.list-tools .input { height: 42px; }
.list-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.list-item { --c: #fff; display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); transition: .15s; }
.list-item:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); background: var(--surface-2); transform: translateY(-1px); }
.list-item .sym { width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 16px; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); flex: 0 0 auto; }
.list-item .nm { flex: 1; font-weight: 600; }
.list-item .nm small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.list-item .num { font-family: var(--mono); color: var(--muted); }
@media (max-width: 760px) { .list-tools { grid-template-columns: 1fr 1fr; } .list-tools .input { grid-column: 1 / -1; } }

/* Compare page -------------------------------------------------------- */
.cmp-head { display: grid; grid-template-columns: 180px repeat(var(--n, 2), 1fr) auto; gap: 10px; align-items: center; margin-bottom: 14px; }
.cmp-head .select { height: 42px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp-table td, .cmp-table th { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cmp-table th { text-align: left; color: var(--muted); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; width: 180px; }
.cmp-table tr.sec td { padding: 22px 0 8px; border: 0; }
.cmp-table td.best { color: var(--accent); }
.cmp-table .v { font-family: var(--mono); font-size: 13.5px; }
@media (max-width: 700px) { .cmp-head { grid-template-columns: 1fr 1fr; } .cmp-head .lbl { display: none; } .cmp-table th { width: 120px; } }

/* Quiz ---------------------------------------------------------------- */
.quiz-modes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 18px; }
.quiz-mode { text-align: left; padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); transition: .15s; }
.quiz-mode:hover, .quiz-mode.active { border-color: rgba(var(--accent-rgb), 0.6); background: var(--surface-2); }
.quiz-mode b { display: block; margin-bottom: 4px; font-family: var(--font-head); }
.quiz-mode span { color: var(--muted); font-size: 12.5px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.quiz-top b { color: var(--accent); }
.quiz-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-bottom: 20px; }
.quiz-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-3)); transition: width .3s; }
.quiz-q { font-family: var(--font-head); font-size: 22px; text-align: center; margin: 10px 0 24px; }
.quiz-q .sym { --c: #fff; display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 16px; font-size: 38px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); margin-bottom: 12px; }
.quiz-opts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.quiz-opt { padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-2); font-weight: 600; font-size: 15px; transition: .15s; }
.quiz-opt:hover { border-color: rgba(var(--accent-rgb), 0.6); background: var(--surface-2); }
.quiz-opt.right { border-color: var(--ok); background: rgba(34, 197, 94, 0.15); color: #86efac; }
.quiz-opt.wrong { border-color: var(--danger); background: rgba(255, 77, 109, 0.14); color: #fda4af; }
.quiz-opt:disabled { cursor: default; }
.quiz-result { text-align: center; padding: 20px 0; }
.quiz-result .score { font-family: var(--font-head); font-size: 56px; font-weight: 700; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Chemistry tables ---------------------------------------------------- */
.sol-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sol { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 900px; width: 100%; }
.sol th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; padding: 10px 6px; font-family: var(--mono); font-weight: 600; border-bottom: 1px solid var(--border-2); text-align: center; }
.sol th.lead, .sol td.lead { position: sticky; left: 0; background: var(--surface-2); z-index: 3; text-align: left; padding-left: 12px; font-family: var(--mono); font-weight: 600; border-right: 1px solid var(--border-2); min-width: 90px; }
.sol th.lead { z-index: 4; }
.sol td { text-align: center; padding: 0; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); height: 42px; }
.sol td span { display: inline-block; font-family: var(--mono); font-weight: 700; }
.sol td.S { background: rgba(34, 197, 94, 0.10); color: #4ade80; }
.sol td.SS { background: rgba(245, 158, 11, 0.14); color: #fbbf24; }
.sol td.I { background: rgba(239, 68, 68, 0.14); color: #f87171; }
.sol td.R { background: rgba(153, 69, 255, 0.16); color: #c4b5fd; }
.sol td.X { color: var(--muted); }
.sol-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.sol-legend i { display: inline-grid; place-items: center; width: 30px; height: 24px; border-radius: 6px; font-family: var(--mono); font-style: normal; font-weight: 700; font-size: 12px; margin-right: 8px; }
.sol-legend .S i { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.sol-legend .SS i { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.sol-legend .I i { background: rgba(239, 68, 68, 0.18); color: #f87171; }
.sol-legend .R i { background: rgba(153, 69, 255, 0.2); color: #c4b5fd; }
.sol-legend .X i { background: var(--surface-3); color: var(--muted); }

.react td.r-violent { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.react td.r-strong { background: rgba(249, 115, 22, 0.16); color: #fdba74; }
.react td.r-moderate { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }
.react td.r-slow { background: rgba(34, 197, 94, 0.12); color: #86efac; }
.react td.r-veryslow { background: rgba(34, 211, 238, 0.12); color: #67e8f9; }
.react td.r-none { background: rgba(255, 255, 255, 0.025); color: var(--muted); }
.react td.r-cmp { color: var(--muted); font-style: italic; }
.react td.r-blank { background: transparent; }
.react td { text-align: center; }
.react td.lead { text-align: left; font-weight: 600; }
.react .grad { width: 10px; }

.flame-swatch { width: 54px; height: 28px; border-radius: 6px; display: inline-block; vertical-align: middle; margin-right: 10px; box-shadow: 0 0 14px var(--fc); background: var(--fc); }

.rank-bar { display: flex; align-items: center; gap: 10px; }
.rank-bar .bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.rank-bar .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-3)); border-radius: 999px; }
.rank-bar .val { font-family: var(--mono); min-width: 80px; text-align: right; }
.rank-tools { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 14px; }

/* Tools --------------------------------------------------------------- */
.tool-wrap { max-width: 760px; margin: 0 auto; }
.result-box { margin-top: 16px; padding: 16px; border-radius: 12px; background: rgba(var(--accent-rgb), 0.07); border: 1px solid rgba(var(--accent-rgb), 0.35); }
.result-box .big { font-family: var(--font-head); font-size: 28px; font-weight: 700; color: var(--accent); }
.result-box .big small { font-size: 14px; color: var(--text-2); font-weight: 500; margin-left: 6px; }
.result-box .sub { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.result-box.err { background: rgba(255, 77, 109, 0.08); border-color: rgba(255, 77, 109, 0.4); color: #fda4af; }
.formula-preview { font-family: var(--mono); font-size: 18px; margin-top: 8px; }
.rows-editor { display: grid; gap: 8px; }
.rows-editor .row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.steps { font-family: var(--mono); font-size: 13px; color: var(--text-2); line-height: 1.8; margin-top: 10px; }
.steps div { padding: 2px 0; }
.tools-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tools-grid a { padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); transition: .15s; }
.tools-grid a:hover { border-color: rgba(var(--accent-rgb), 0.6); transform: translateY(-2px); }
.tools-grid a b { display: block; font-family: var(--font-head); margin-bottom: 4px; }
.tools-grid a span { color: var(--muted); font-size: 12.5px; }

/* Misc pages ---------------------------------------------------------- */
.prose { color: var(--text-2); line-height: 1.75; }
.prose h2 { font-family: var(--font-head); color: var(--text); font-size: 18px; margin: 22px 0 8px; }
.prose p { margin: 0 0 12px; }
.prose ul { padding-left: 20px; }
.prose a { color: var(--accent); }
.not-found { text-align: center; padding: 60px 0; }
.not-found .code { font-family: var(--font-head); font-size: 72px; font-weight: 700; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.print-opts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Print --------------------------------------------------------------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f5f5f7; --text: #111; --text-2: #333; --muted: #555; --border: #ccc; --border-2: #bbb; }
  body { background: #fff; color: #111; }
  .bg-fx, .topbar, .footer, .drawer, .overlay, .toast, .pt-toolbar, .no-print { display: none !important; }
  .app { max-width: none; padding: 0; }
  .ptable-scroll { overflow: visible; }
  .ptable-wrap { min-width: 0; width: 100% !important; }
  .tile { border: 1px solid #999; background: #fff !important; color: #111 !important; box-shadow: none !important; transform: none !important; }
  .ptable.style-2 .tile { background: color-mix(in srgb, var(--c) 30%, #fff) !important; }
  .tile .num, .tile .name, .tile .mass { color: #333 !important; }
  .hover-card { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .card::before { display: none; }
  .el-masonry { columns: 2; }
  a { color: inherit; }
  @page { margin: 10mm; }
}
.print-only { display: none; }
@media print { .print-only { display: block; } }
