"""Comprehensive element database for all 118 elements.

Properties per element (standard reference values):
    - Z: atomic number
    - symbol: IUPAC symbol
    - name: full element name
    - atomic_mass: standard atomic weight (amu / Da)
    - standard_state: phase at STP (Solid, Liquid, Gas, or Expected)
    - electron_config: ground-state electron configuration (abbreviated)
    - oxidation_states: common oxidation states (list of int)
    - electronegativity: Pauling scale (None if not determined)
    - atomic_radius_pm: empirical atomic radius in picometers (None if unknown)
    - ionization_energy_eV: first ionization energy in eV
    - electron_affinity_eV: electron affinity in eV (None if not measured)
    - melting_point_K: melting point in Kelvin (None if unknown)
    - boiling_point_K: boiling point in Kelvin (None if unknown)
    - density_g_cm3: density at STP in g/cm³ (None if unknown)

Sources:
    - NIST Atomic Spectra Database (ionization energies)
    - PubChem / National Library of Medicine (general properties)
    - IUPAC 2021 standard atomic weights
    - CRC Handbook of Chemistry and Physics, 104th ed.
    - WebElements (electronegativity, radii, electron affinity)
    - CODATA 2018 recommended values

Copyright-free reference data: atomic numbers, masses, and physical constants
are factual scientific measurements not subject to copyright.
"""

from __future__ import annotations

from dataclasses import dataclass
from typing import Any


@dataclass(frozen=True, slots=True)
class Element:
    """Complete element record with standard reference properties."""

    Z: int
    symbol: str
    name: str
    atomic_mass: float  # amu (Da)
    standard_state: str  # "Solid", "Liquid", "Gas", "Expected Solid", etc.
    electron_config: str  # Abbreviated, e.g. "[Ar] 3d6 4s2"
    oxidation_states: tuple[int, ...]  # Common oxidation states
    electronegativity: float | None  # Pauling scale (None = not determined)
    atomic_radius_pm: float | None  # Empirical, pm
    ionization_energy_eV: float  # First IE, eV
    electron_affinity_eV: float | None  # eV (None = not measured / positive)
    melting_point_K: float | None  # K
    boiling_point_K: float | None  # K
    density_g_cm3: float | None  # g/cm³ at STP

    # ── Traditional periodic table labels ────────────────────────
    period: int = 0  # Row 1-7
    group: int | None = None  # Column 1-18 (None for lanthanides/actinides)
    block: str = ""  # "s", "p", "d", "f"
    category: str = ""  # Traditional classification (see CATEGORIES below)

    def to_dict(self) -> dict[str, Any]:
        """Serialize to dict for JSON output."""
        return {
            "Z": self.Z,
            "symbol": self.symbol,
            "name": self.name,
            "atomic_mass": self.atomic_mass,
            "standard_state": self.standard_state,
            "electron_config": self.electron_config,
            "oxidation_states": list(self.oxidation_states),
            "electronegativity": self.electronegativity,
            "atomic_radius_pm": self.atomic_radius_pm,
            "ionization_energy_eV": self.ionization_energy_eV,
            "electron_affinity_eV": self.electron_affinity_eV,
            "melting_point_K": self.melting_point_K,
            "boiling_point_K": self.boiling_point_K,
            "density_g_cm3": self.density_g_cm3,
            "period": self.period,
            "group": self.group,
            "block": self.block,
            "category": self.category,
        }


# ═══════════════════════════════════════════════════════════════════
# COMPLETE PERIODIC TABLE — 118 elements
# ═══════════════════════════════════════════════════════════════════
# Data sourced from NIST, PubChem/NLM, IUPAC 2021, CRC Handbook.
# Radioactive/synthetic elements: mass = most stable isotope mass number,
# properties marked None where not experimentally determined.
# ═══════════════════════════════════════════════════════════════════

ELEMENTS: tuple[Element, ...] = (
    # ── Period 1 ─────────────────────────────────────────────────
    Element(
        Z=1,
        symbol="H",
        name="Hydrogen",
        atomic_mass=1.008,
        standard_state="Gas",
        electron_config="1s1",
        oxidation_states=(1, -1),
        electronegativity=2.20,
        atomic_radius_pm=25,
        ionization_energy_eV=13.598,
        electron_affinity_eV=0.754,
        melting_point_K=13.99,
        boiling_point_K=20.271,
        density_g_cm3=0.00008988,
        period=1,
        group=1,
        block="s",
        category="Reactive nonmetal",
    ),
    Element(
        Z=2,
        symbol="He",
        name="Helium",
        atomic_mass=4.0026,
        standard_state="Gas",
        electron_config="1s2",
        oxidation_states=(0,),
        electronegativity=None,
        atomic_radius_pm=31,
        ionization_energy_eV=24.587,
        electron_affinity_eV=None,
        melting_point_K=0.95,
        boiling_point_K=4.222,
        density_g_cm3=0.0001785,
        period=1,
        group=18,
        block="s",
        category="Noble gas",
    ),
    # ── Period 2 ─────────────────────────────────────────────────
    Element(
        Z=3,
        symbol="Li",
        name="Lithium",
        atomic_mass=6.941,
        standard_state="Solid",
        electron_config="[He] 2s1",
        oxidation_states=(1,),
        electronegativity=0.98,
        atomic_radius_pm=145,
        ionization_energy_eV=5.392,
        electron_affinity_eV=0.618,
        melting_point_K=453.65,
        boiling_point_K=1603.0,
        density_g_cm3=0.534,
        period=2,
        group=1,
        block="s",
        category="Alkali metal",
    ),
    Element(
        Z=4,
        symbol="Be",
        name="Beryllium",
        atomic_mass=9.0122,
        standard_state="Solid",
        electron_config="[He] 2s2",
        oxidation_states=(2,),
        electronegativity=1.57,
        atomic_radius_pm=105,
        ionization_energy_eV=9.323,
        electron_affinity_eV=None,
        melting_point_K=1560.0,
        boiling_point_K=2742.0,
        density_g_cm3=1.85,
        period=2,
        group=2,
        block="s",
        category="Alkaline earth metal",
    ),
    Element(
        Z=5,
        symbol="B",
        name="Boron",
        atomic_mass=10.81,
        standard_state="Solid",
        electron_config="[He] 2s2 2p1",
        oxidation_states=(3,),
        electronegativity=2.04,
        atomic_radius_pm=85,
        ionization_energy_eV=8.298,
        electron_affinity_eV=0.277,
        melting_point_K=2349.0,
        boiling_point_K=4200.0,
        density_g_cm3=2.34,
        period=2,
        group=13,
        block="p",
        category="Metalloid",
    ),
    Element(
        Z=6,
        symbol="C",
        name="Carbon",
        atomic_mass=12.011,
        standard_state="Solid",
        electron_config="[He] 2s2 2p2",
        oxidation_states=(4, 2, -4),
        electronegativity=2.55,
        atomic_radius_pm=70,
        ionization_energy_eV=11.260,
        electron_affinity_eV=1.263,
        melting_point_K=3823.0,
        boiling_point_K=4098.0,
        density_g_cm3=2.267,
        period=2,
        group=14,
        block="p",
        category="Reactive nonmetal",
    ),
    Element(
        Z=7,
        symbol="N",
        name="Nitrogen",
        atomic_mass=14.007,
        standard_state="Gas",
        electron_config="[He] 2s2 2p3",
        oxidation_states=(5, 3, -3),
        electronegativity=3.04,
        atomic_radius_pm=65,
        ionization_energy_eV=14.534,
        electron_affinity_eV=None,
        melting_point_K=63.15,
        boiling_point_K=77.355,
        density_g_cm3=0.0012506,
        period=2,
        group=15,
        block="p",
        category="Reactive nonmetal",
    ),
    Element(
        Z=8,
        symbol="O",
        name="Oxygen",
        atomic_mass=15.999,
        standard_state="Gas",
        electron_config="[He] 2s2 2p4",
        oxidation_states=(-2, -1),
        electronegativity=3.44,
        atomic_radius_pm=60,
        ionization_energy_eV=13.618,
        electron_affinity_eV=1.461,
        melting_point_K=54.36,
        boiling_point_K=90.188,
        density_g_cm3=0.001429,
        period=2,
        group=16,
        block="p",
        category="Reactive nonmetal",
    ),
    Element(
        Z=9,
        symbol="F",
        name="Fluorine",
        atomic_mass=18.998,
        standard_state="Gas",
        electron_config="[He] 2s2 2p5",
        oxidation_states=(-1,),
        electronegativity=3.98,
        atomic_radius_pm=50,
        ionization_energy_eV=17.423,
        electron_affinity_eV=3.401,
        melting_point_K=53.48,
        boiling_point_K=85.03,
        density_g_cm3=0.001696,
        period=2,
        group=17,
        block="p",
        category="Halogen",
    ),
    Element(
        Z=10,
        symbol="Ne",
        name="Neon",
        atomic_mass=20.180,
        standard_state="Gas",
        electron_config="[He] 2s2 2p6",
        oxidation_states=(0,),
        electronegativity=None,
        atomic_radius_pm=38,
        ionization_energy_eV=21.565,
        electron_affinity_eV=None,
        melting_point_K=24.56,
        boiling_point_K=27.104,
        density_g_cm3=0.0008999,
        period=2,
        group=18,
        block="p",
        category="Noble gas",
    ),
    # ── Period 3 ─────────────────────────────────────────────────
    Element(
        Z=11,
        symbol="Na",
        name="Sodium",
        atomic_mass=22.990,
        standard_state="Solid",
        electron_config="[Ne] 3s1",
        oxidation_states=(1,),
        electronegativity=0.93,
        atomic_radius_pm=180,
        ionization_energy_eV=5.139,
        electron_affinity_eV=0.548,
        melting_point_K=370.95,
        boiling_point_K=1156.0,
        density_g_cm3=0.971,
        period=3,
        group=1,
        block="s",
        category="Alkali metal",
    ),
    Element(
        Z=12,
        symbol="Mg",
        name="Magnesium",
        atomic_mass=24.305,
        standard_state="Solid",
        electron_config="[Ne] 3s2",
        oxidation_states=(2,),
        electronegativity=1.31,
        atomic_radius_pm=150,
        ionization_energy_eV=7.646,
        electron_affinity_eV=None,
        melting_point_K=923.0,
        boiling_point_K=1363.0,
        density_g_cm3=1.738,
        period=3,
        group=2,
        block="s",
        category="Alkaline earth metal",
    ),
    Element(
        Z=13,
        symbol="Al",
        name="Aluminum",
        atomic_mass=26.982,
        standard_state="Solid",
        electron_config="[Ne] 3s2 3p1",
        oxidation_states=(3,),
        electronegativity=1.61,
        atomic_radius_pm=125,
        ionization_energy_eV=5.986,
        electron_affinity_eV=0.441,
        melting_point_K=933.47,
        boiling_point_K=2792.0,
        density_g_cm3=2.70,
        period=3,
        group=13,
        block="p",
        category="Post-transition metal",
    ),
    Element(
        Z=14,
        symbol="Si",
        name="Silicon",
        atomic_mass=28.085,
        standard_state="Solid",
        electron_config="[Ne] 3s2 3p2",
        oxidation_states=(4, -4),
        electronegativity=1.90,
        atomic_radius_pm=110,
        ionization_energy_eV=8.152,
        electron_affinity_eV=1.385,
        melting_point_K=1687.0,
        boiling_point_K=3538.0,
        density_g_cm3=2.3296,
        period=3,
        group=14,
        block="p",
        category="Metalloid",
    ),
    Element(
        Z=15,
        symbol="P",
        name="Phosphorus",
        atomic_mass=30.974,
        standard_state="Solid",
        electron_config="[Ne] 3s2 3p3",
        oxidation_states=(5, 3, -3),
        electronegativity=2.19,
        atomic_radius_pm=100,
        ionization_energy_eV=10.487,
        electron_affinity_eV=0.746,
        melting_point_K=317.3,
        boiling_point_K=553.7,
        density_g_cm3=1.82,
        period=3,
        group=15,
        block="p",
        category="Reactive nonmetal",
    ),
    Element(
        Z=16,
        symbol="S",
        name="Sulfur",
        atomic_mass=32.06,
        standard_state="Solid",
        electron_config="[Ne] 3s2 3p4",
        oxidation_states=(6, 4, -2),
        electronegativity=2.58,
        atomic_radius_pm=100,
        ionization_energy_eV=10.360,
        electron_affinity_eV=2.077,
        melting_point_K=388.36,
        boiling_point_K=717.8,
        density_g_cm3=2.067,
        period=3,
        group=16,
        block="p",
        category="Reactive nonmetal",
    ),
    Element(
        Z=17,
        symbol="Cl",
        name="Chlorine",
        atomic_mass=35.45,
        standard_state="Gas",
        electron_config="[Ne] 3s2 3p5",
        oxidation_states=(7, 5, 3, 1, -1),
        electronegativity=3.16,
        atomic_radius_pm=100,
        ionization_energy_eV=12.968,
        electron_affinity_eV=3.613,
        melting_point_K=171.6,
        boiling_point_K=239.11,
        density_g_cm3=0.003214,
        period=3,
        group=17,
        block="p",
        category="Halogen",
    ),
    Element(
        Z=18,
        symbol="Ar",
        name="Argon",
        atomic_mass=39.948,
        standard_state="Gas",
        electron_config="[Ne] 3s2 3p6",
        oxidation_states=(0,),
        electronegativity=None,
        atomic_radius_pm=71,
        ionization_energy_eV=15.760,
        electron_affinity_eV=None,
        melting_point_K=83.81,
        boiling_point_K=87.302,
        density_g_cm3=0.001784,
        period=3,
        group=18,
        block="p",
        category="Noble gas",
    ),
    # ── Period 4 ─────────────────────────────────────────────────
    Element(
        Z=19,
        symbol="K",
        name="Potassium",
        atomic_mass=39.098,
        standard_state="Solid",
        electron_config="[Ar] 4s1",
        oxidation_states=(1,),
        electronegativity=0.82,
        atomic_radius_pm=220,
        ionization_energy_eV=4.341,
        electron_affinity_eV=0.501,
        melting_point_K=336.7,
        boiling_point_K=1032.0,
        density_g_cm3=0.862,
        period=4,
        group=1,
        block="s",
        category="Alkali metal",
    ),
    Element(
        Z=20,
        symbol="Ca",
        name="Calcium",
        atomic_mass=40.078,
        standard_state="Solid",
        electron_config="[Ar] 4s2",
        oxidation_states=(2,),
        electronegativity=1.00,
        atomic_radius_pm=180,
        ionization_energy_eV=6.113,
        electron_affinity_eV=0.025,
        melting_point_K=1115.0,
        boiling_point_K=1757.0,
        density_g_cm3=1.55,
        period=4,
        group=2,
        block="s",
        category="Alkaline earth metal",
    ),
    Element(
        Z=21,
        symbol="Sc",
        name="Scandium",
        atomic_mass=44.956,
        standard_state="Solid",
        electron_config="[Ar] 3d1 4s2",
        oxidation_states=(3,),
        electronegativity=1.36,
        atomic_radius_pm=160,
        ionization_energy_eV=6.562,
        electron_affinity_eV=0.188,
        melting_point_K=1814.0,
        boiling_point_K=3109.0,
        density_g_cm3=2.989,
        period=4,
        group=3,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=22,
        symbol="Ti",
        name="Titanium",
        atomic_mass=47.867,
        standard_state="Solid",
        electron_config="[Ar] 3d2 4s2",
        oxidation_states=(4, 3, 2),
        electronegativity=1.54,
        atomic_radius_pm=140,
        ionization_energy_eV=6.828,
        electron_affinity_eV=0.079,
        melting_point_K=1941.0,
        boiling_point_K=3560.0,
        density_g_cm3=4.506,
        period=4,
        group=4,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=23,
        symbol="V",
        name="Vanadium",
        atomic_mass=50.942,
        standard_state="Solid",
        electron_config="[Ar] 3d3 4s2",
        oxidation_states=(5, 4, 3, 2),
        electronegativity=1.63,
        atomic_radius_pm=135,
        ionization_energy_eV=6.746,
        electron_affinity_eV=0.525,
        melting_point_K=2183.0,
        boiling_point_K=3680.0,
        density_g_cm3=6.11,
        period=4,
        group=5,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=24,
        symbol="Cr",
        name="Chromium",
        atomic_mass=51.996,
        standard_state="Solid",
        electron_config="[Ar] 3d5 4s1",
        oxidation_states=(6, 3, 2),
        electronegativity=1.66,
        atomic_radius_pm=140,
        ionization_energy_eV=6.767,
        electron_affinity_eV=0.666,
        melting_point_K=2180.0,
        boiling_point_K=2944.0,
        density_g_cm3=7.15,
        period=4,
        group=6,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=25,
        symbol="Mn",
        name="Manganese",
        atomic_mass=54.938,
        standard_state="Solid",
        electron_config="[Ar] 3d5 4s2",
        oxidation_states=(7, 4, 3, 2),
        electronegativity=1.55,
        atomic_radius_pm=140,
        ionization_energy_eV=7.434,
        electron_affinity_eV=None,
        melting_point_K=1519.0,
        boiling_point_K=2334.0,
        density_g_cm3=7.44,
        period=4,
        group=7,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=26,
        symbol="Fe",
        name="Iron",
        atomic_mass=55.845,
        standard_state="Solid",
        electron_config="[Ar] 3d6 4s2",
        oxidation_states=(3, 2, 6),
        electronegativity=1.83,
        atomic_radius_pm=140,
        ionization_energy_eV=7.902,
        electron_affinity_eV=0.151,
        melting_point_K=1811.0,
        boiling_point_K=3134.0,
        density_g_cm3=7.874,
        period=4,
        group=8,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=27,
        symbol="Co",
        name="Cobalt",
        atomic_mass=58.933,
        standard_state="Solid",
        electron_config="[Ar] 3d7 4s2",
        oxidation_states=(3, 2),
        electronegativity=1.88,
        atomic_radius_pm=135,
        ionization_energy_eV=7.881,
        electron_affinity_eV=0.662,
        melting_point_K=1768.0,
        boiling_point_K=3200.0,
        density_g_cm3=8.90,
        period=4,
        group=9,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=28,
        symbol="Ni",
        name="Nickel",
        atomic_mass=58.693,
        standard_state="Solid",
        electron_config="[Ar] 3d8 4s2",
        oxidation_states=(2, 3),
        electronegativity=1.91,
        atomic_radius_pm=135,
        ionization_energy_eV=7.640,
        electron_affinity_eV=1.156,
        melting_point_K=1728.0,
        boiling_point_K=3186.0,
        density_g_cm3=8.912,
        period=4,
        group=10,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=29,
        symbol="Cu",
        name="Copper",
        atomic_mass=63.546,
        standard_state="Solid",
        electron_config="[Ar] 3d10 4s1",
        oxidation_states=(2, 1),
        electronegativity=1.90,
        atomic_radius_pm=135,
        ionization_energy_eV=7.726,
        electron_affinity_eV=1.235,
        melting_point_K=1357.77,
        boiling_point_K=2835.0,
        density_g_cm3=8.96,
        period=4,
        group=11,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=30,
        symbol="Zn",
        name="Zinc",
        atomic_mass=65.38,
        standard_state="Solid",
        electron_config="[Ar] 3d10 4s2",
        oxidation_states=(2,),
        electronegativity=1.65,
        atomic_radius_pm=135,
        ionization_energy_eV=9.394,
        electron_affinity_eV=None,
        melting_point_K=692.68,
        boiling_point_K=1180.0,
        density_g_cm3=7.134,
        period=4,
        group=12,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=31,
        symbol="Ga",
        name="Gallium",
        atomic_mass=69.723,
        standard_state="Solid",
        electron_config="[Ar] 3d10 4s2 4p1",
        oxidation_states=(3,),
        electronegativity=1.81,
        atomic_radius_pm=130,
        ionization_energy_eV=5.999,
        electron_affinity_eV=0.43,
        melting_point_K=302.91,
        boiling_point_K=2477.0,
        density_g_cm3=5.907,
        period=4,
        group=13,
        block="p",
        category="Post-transition metal",
    ),
    Element(
        Z=32,
        symbol="Ge",
        name="Germanium",
        atomic_mass=72.630,
        standard_state="Solid",
        electron_config="[Ar] 3d10 4s2 4p2",
        oxidation_states=(4, 2),
        electronegativity=2.01,
        atomic_radius_pm=125,
        ionization_energy_eV=7.900,
        electron_affinity_eV=1.233,
        melting_point_K=1211.4,
        boiling_point_K=3106.0,
        density_g_cm3=5.323,
        period=4,
        group=14,
        block="p",
        category="Metalloid",
    ),
    Element(
        Z=33,
        symbol="As",
        name="Arsenic",
        atomic_mass=74.922,
        standard_state="Solid",
        electron_config="[Ar] 3d10 4s2 4p3",
        oxidation_states=(5, 3, -3),
        electronegativity=2.18,
        atomic_radius_pm=115,
        ionization_energy_eV=9.815,
        electron_affinity_eV=0.804,
        melting_point_K=1090.0,
        boiling_point_K=887.0,
        density_g_cm3=5.776,
        period=4,
        group=15,
        block="p",
        category="Metalloid",
    ),
    Element(
        Z=34,
        symbol="Se",
        name="Selenium",
        atomic_mass=78.971,
        standard_state="Solid",
        electron_config="[Ar] 3d10 4s2 4p4",
        oxidation_states=(6, 4, -2),
        electronegativity=2.55,
        atomic_radius_pm=115,
        ionization_energy_eV=9.752,
        electron_affinity_eV=2.021,
        melting_point_K=494.0,
        boiling_point_K=958.0,
        density_g_cm3=4.809,
        period=4,
        group=16,
        block="p",
        category="Reactive nonmetal",
    ),
    Element(
        Z=35,
        symbol="Br",
        name="Bromine",
        atomic_mass=79.904,
        standard_state="Liquid",
        electron_config="[Ar] 3d10 4s2 4p5",
        oxidation_states=(5, 3, 1, -1),
        electronegativity=2.96,
        atomic_radius_pm=115,
        ionization_energy_eV=11.814,
        electron_affinity_eV=3.364,
        melting_point_K=265.8,
        boiling_point_K=332.0,
        density_g_cm3=3.122,
        period=4,
        group=17,
        block="p",
        category="Halogen",
    ),
    Element(
        Z=36,
        symbol="Kr",
        name="Krypton",
        atomic_mass=83.798,
        standard_state="Gas",
        electron_config="[Ar] 3d10 4s2 4p6",
        oxidation_states=(2, 0),
        electronegativity=3.00,
        atomic_radius_pm=88,
        ionization_energy_eV=14.000,
        electron_affinity_eV=None,
        melting_point_K=115.78,
        boiling_point_K=119.93,
        density_g_cm3=0.003749,
        period=4,
        group=18,
        block="p",
        category="Noble gas",
    ),
    # ── Period 5 ─────────────────────────────────────────────────
    Element(
        Z=37,
        symbol="Rb",
        name="Rubidium",
        atomic_mass=85.468,
        standard_state="Solid",
        electron_config="[Kr] 5s1",
        oxidation_states=(1,),
        electronegativity=0.82,
        atomic_radius_pm=235,
        ionization_energy_eV=4.177,
        electron_affinity_eV=0.486,
        melting_point_K=312.46,
        boiling_point_K=961.0,
        density_g_cm3=1.532,
        period=5,
        group=1,
        block="s",
        category="Alkali metal",
    ),
    Element(
        Z=38,
        symbol="Sr",
        name="Strontium",
        atomic_mass=87.62,
        standard_state="Solid",
        electron_config="[Kr] 5s2",
        oxidation_states=(2,),
        electronegativity=0.95,
        atomic_radius_pm=200,
        ionization_energy_eV=5.695,
        electron_affinity_eV=0.048,
        melting_point_K=1050.0,
        boiling_point_K=1650.0,
        density_g_cm3=2.64,
        period=5,
        group=2,
        block="s",
        category="Alkaline earth metal",
    ),
    Element(
        Z=39,
        symbol="Y",
        name="Yttrium",
        atomic_mass=88.906,
        standard_state="Solid",
        electron_config="[Kr] 4d1 5s2",
        oxidation_states=(3,),
        electronegativity=1.22,
        atomic_radius_pm=180,
        ionization_energy_eV=6.217,
        electron_affinity_eV=0.307,
        melting_point_K=1799.0,
        boiling_point_K=3203.0,
        density_g_cm3=4.469,
        period=5,
        group=3,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=40,
        symbol="Zr",
        name="Zirconium",
        atomic_mass=91.224,
        standard_state="Solid",
        electron_config="[Kr] 4d2 5s2",
        oxidation_states=(4,),
        electronegativity=1.33,
        atomic_radius_pm=155,
        ionization_energy_eV=6.634,
        electron_affinity_eV=0.426,
        melting_point_K=2128.0,
        boiling_point_K=4682.0,
        density_g_cm3=6.506,
        period=5,
        group=4,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=41,
        symbol="Nb",
        name="Niobium",
        atomic_mass=92.906,
        standard_state="Solid",
        electron_config="[Kr] 4d4 5s1",
        oxidation_states=(5, 3),
        electronegativity=1.60,
        atomic_radius_pm=145,
        ionization_energy_eV=6.759,
        electron_affinity_eV=0.893,
        melting_point_K=2750.0,
        boiling_point_K=5017.0,
        density_g_cm3=8.57,
        period=5,
        group=5,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=42,
        symbol="Mo",
        name="Molybdenum",
        atomic_mass=95.95,
        standard_state="Solid",
        electron_config="[Kr] 4d5 5s1",
        oxidation_states=(6, 4, 2),
        electronegativity=2.16,
        atomic_radius_pm=145,
        ionization_energy_eV=7.092,
        electron_affinity_eV=0.746,
        melting_point_K=2896.0,
        boiling_point_K=4912.0,
        density_g_cm3=10.22,
        period=5,
        group=6,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=43,
        symbol="Tc",
        name="Technetium",
        atomic_mass=97.0,
        standard_state="Solid",
        electron_config="[Kr] 4d5 5s2",
        oxidation_states=(7, 4),
        electronegativity=1.90,
        atomic_radius_pm=135,
        ionization_energy_eV=7.28,
        electron_affinity_eV=0.55,
        melting_point_K=2430.0,
        boiling_point_K=4538.0,
        density_g_cm3=11.5,
        period=5,
        group=7,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=44,
        symbol="Ru",
        name="Ruthenium",
        atomic_mass=101.07,
        standard_state="Solid",
        electron_config="[Kr] 4d7 5s1",
        oxidation_states=(4, 3, 2, 8),
        electronegativity=2.20,
        atomic_radius_pm=130,
        ionization_energy_eV=7.361,
        electron_affinity_eV=1.05,
        melting_point_K=2607.0,
        boiling_point_K=4423.0,
        density_g_cm3=12.37,
        period=5,
        group=8,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=45,
        symbol="Rh",
        name="Rhodium",
        atomic_mass=102.91,
        standard_state="Solid",
        electron_config="[Kr] 4d8 5s1",
        oxidation_states=(3, 4),
        electronegativity=2.28,
        atomic_radius_pm=135,
        ionization_energy_eV=7.459,
        electron_affinity_eV=1.137,
        melting_point_K=2237.0,
        boiling_point_K=3968.0,
        density_g_cm3=12.41,
        period=5,
        group=9,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=46,
        symbol="Pd",
        name="Palladium",
        atomic_mass=106.42,
        standard_state="Solid",
        electron_config="[Kr] 4d10",
        oxidation_states=(2, 4),
        electronegativity=2.20,
        atomic_radius_pm=140,
        ionization_energy_eV=8.337,
        electron_affinity_eV=0.562,
        melting_point_K=1828.1,
        boiling_point_K=3236.0,
        density_g_cm3=12.02,
        period=5,
        group=10,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=47,
        symbol="Ag",
        name="Silver",
        atomic_mass=107.87,
        standard_state="Solid",
        electron_config="[Kr] 4d10 5s1",
        oxidation_states=(1,),
        electronegativity=1.93,
        atomic_radius_pm=160,
        ionization_energy_eV=7.576,
        electron_affinity_eV=1.302,
        melting_point_K=1234.93,
        boiling_point_K=2435.0,
        density_g_cm3=10.501,
        period=5,
        group=11,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=48,
        symbol="Cd",
        name="Cadmium",
        atomic_mass=112.41,
        standard_state="Solid",
        electron_config="[Kr] 4d10 5s2",
        oxidation_states=(2,),
        electronegativity=1.69,
        atomic_radius_pm=155,
        ionization_energy_eV=8.994,
        electron_affinity_eV=None,
        melting_point_K=594.22,
        boiling_point_K=1040.0,
        density_g_cm3=8.69,
        period=5,
        group=12,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=49,
        symbol="In",
        name="Indium",
        atomic_mass=114.82,
        standard_state="Solid",
        electron_config="[Kr] 4d10 5s2 5p1",
        oxidation_states=(3,),
        electronegativity=1.78,
        atomic_radius_pm=155,
        ionization_energy_eV=5.786,
        electron_affinity_eV=0.30,
        melting_point_K=429.75,
        boiling_point_K=2345.0,
        density_g_cm3=7.31,
        period=5,
        group=13,
        block="p",
        category="Post-transition metal",
    ),
    Element(
        Z=50,
        symbol="Sn",
        name="Tin",
        atomic_mass=118.71,
        standard_state="Solid",
        electron_config="[Kr] 4d10 5s2 5p2",
        oxidation_states=(4, 2),
        electronegativity=1.96,
        atomic_radius_pm=145,
        ionization_energy_eV=7.344,
        electron_affinity_eV=1.112,
        melting_point_K=505.08,
        boiling_point_K=2875.0,
        density_g_cm3=7.287,
        period=5,
        group=14,
        block="p",
        category="Post-transition metal",
    ),
    Element(
        Z=51,
        symbol="Sb",
        name="Antimony",
        atomic_mass=121.76,
        standard_state="Solid",
        electron_config="[Kr] 4d10 5s2 5p3",
        oxidation_states=(5, 3, -3),
        electronegativity=2.05,
        atomic_radius_pm=145,
        ionization_energy_eV=8.608,
        electron_affinity_eV=1.047,
        melting_point_K=903.78,
        boiling_point_K=1860.0,
        density_g_cm3=6.685,
        period=5,
        group=15,
        block="p",
        category="Metalloid",
    ),
    Element(
        Z=52,
        symbol="Te",
        name="Tellurium",
        atomic_mass=127.60,
        standard_state="Solid",
        electron_config="[Kr] 4d10 5s2 5p4",
        oxidation_states=(6, 4, -2),
        electronegativity=2.10,
        atomic_radius_pm=140,
        ionization_energy_eV=9.010,
        electron_affinity_eV=1.971,
        melting_point_K=722.66,
        boiling_point_K=1261.0,
        density_g_cm3=6.232,
        period=5,
        group=16,
        block="p",
        category="Metalloid",
    ),
    Element(
        Z=53,
        symbol="I",
        name="Iodine",
        atomic_mass=126.90,
        standard_state="Solid",
        electron_config="[Kr] 4d10 5s2 5p5",
        oxidation_states=(7, 5, 1, -1),
        electronegativity=2.66,
        atomic_radius_pm=140,
        ionization_energy_eV=10.451,
        electron_affinity_eV=3.059,
        melting_point_K=386.85,
        boiling_point_K=457.4,
        density_g_cm3=4.93,
        period=5,
        group=17,
        block="p",
        category="Halogen",
    ),
    Element(
        Z=54,
        symbol="Xe",
        name="Xenon",
        atomic_mass=131.29,
        standard_state="Gas",
        electron_config="[Kr] 4d10 5s2 5p6",
        oxidation_states=(2, 4, 6, 0),
        electronegativity=2.60,
        atomic_radius_pm=108,
        ionization_energy_eV=12.130,
        electron_affinity_eV=None,
        melting_point_K=161.4,
        boiling_point_K=165.051,
        density_g_cm3=0.005887,
        period=5,
        group=18,
        block="p",
        category="Noble gas",
    ),
    # ── Period 6 ─────────────────────────────────────────────────
    Element(
        Z=55,
        symbol="Cs",
        name="Cesium",
        atomic_mass=132.91,
        standard_state="Solid",
        electron_config="[Xe] 6s1",
        oxidation_states=(1,),
        electronegativity=0.79,
        atomic_radius_pm=260,
        ionization_energy_eV=3.894,
        electron_affinity_eV=0.472,
        melting_point_K=301.59,
        boiling_point_K=944.0,
        density_g_cm3=1.873,
        period=6,
        group=1,
        block="s",
        category="Alkali metal",
    ),
    Element(
        Z=56,
        symbol="Ba",
        name="Barium",
        atomic_mass=137.33,
        standard_state="Solid",
        electron_config="[Xe] 6s2",
        oxidation_states=(2,),
        electronegativity=0.89,
        atomic_radius_pm=215,
        ionization_energy_eV=5.212,
        electron_affinity_eV=0.145,
        melting_point_K=1000.0,
        boiling_point_K=2118.0,
        density_g_cm3=3.594,
        period=6,
        group=2,
        block="s",
        category="Alkaline earth metal",
    ),
    # ── Lanthanides ──────────────────────────────────────────────
    Element(
        Z=57,
        symbol="La",
        name="Lanthanum",
        atomic_mass=138.91,
        standard_state="Solid",
        electron_config="[Xe] 5d1 6s2",
        oxidation_states=(3,),
        electronegativity=1.10,
        atomic_radius_pm=195,
        ionization_energy_eV=5.577,
        electron_affinity_eV=0.47,
        melting_point_K=1193.0,
        boiling_point_K=3737.0,
        density_g_cm3=6.145,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=58,
        symbol="Ce",
        name="Cerium",
        atomic_mass=140.12,
        standard_state="Solid",
        electron_config="[Xe] 4f1 5d1 6s2",
        oxidation_states=(4, 3),
        electronegativity=1.12,
        atomic_radius_pm=185,
        ionization_energy_eV=5.539,
        electron_affinity_eV=0.955,
        melting_point_K=1068.0,
        boiling_point_K=3716.0,
        density_g_cm3=6.770,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=59,
        symbol="Pr",
        name="Praseodymium",
        atomic_mass=140.91,
        standard_state="Solid",
        electron_config="[Xe] 4f3 6s2",
        oxidation_states=(3, 4),
        electronegativity=1.13,
        atomic_radius_pm=185,
        ionization_energy_eV=5.473,
        electron_affinity_eV=0.962,
        melting_point_K=1208.0,
        boiling_point_K=3793.0,
        density_g_cm3=6.773,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=60,
        symbol="Nd",
        name="Neodymium",
        atomic_mass=144.24,
        standard_state="Solid",
        electron_config="[Xe] 4f4 6s2",
        oxidation_states=(3,),
        electronegativity=1.14,
        atomic_radius_pm=185,
        ionization_energy_eV=5.525,
        electron_affinity_eV=1.916,
        melting_point_K=1297.0,
        boiling_point_K=3347.0,
        density_g_cm3=7.008,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=61,
        symbol="Pm",
        name="Promethium",
        atomic_mass=145.0,
        standard_state="Solid",
        electron_config="[Xe] 4f5 6s2",
        oxidation_states=(3,),
        electronegativity=1.13,
        atomic_radius_pm=185,
        ionization_energy_eV=5.582,
        electron_affinity_eV=0.129,
        melting_point_K=1315.0,
        boiling_point_K=3273.0,
        density_g_cm3=7.26,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=62,
        symbol="Sm",
        name="Samarium",
        atomic_mass=150.36,
        standard_state="Solid",
        electron_config="[Xe] 4f6 6s2",
        oxidation_states=(3, 2),
        electronegativity=1.17,
        atomic_radius_pm=185,
        ionization_energy_eV=5.644,
        electron_affinity_eV=0.162,
        melting_point_K=1345.0,
        boiling_point_K=2067.0,
        density_g_cm3=7.52,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=63,
        symbol="Eu",
        name="Europium",
        atomic_mass=151.96,
        standard_state="Solid",
        electron_config="[Xe] 4f7 6s2",
        oxidation_states=(3, 2),
        electronegativity=1.20,
        atomic_radius_pm=185,
        ionization_energy_eV=5.670,
        electron_affinity_eV=0.116,
        melting_point_K=1099.0,
        boiling_point_K=1802.0,
        density_g_cm3=5.244,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=64,
        symbol="Gd",
        name="Gadolinium",
        atomic_mass=157.25,
        standard_state="Solid",
        electron_config="[Xe] 4f7 5d1 6s2",
        oxidation_states=(3,),
        electronegativity=1.20,
        atomic_radius_pm=180,
        ionization_energy_eV=6.150,
        electron_affinity_eV=0.137,
        melting_point_K=1585.0,
        boiling_point_K=3546.0,
        density_g_cm3=7.901,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=65,
        symbol="Tb",
        name="Terbium",
        atomic_mass=158.93,
        standard_state="Solid",
        electron_config="[Xe] 4f9 6s2",
        oxidation_states=(3, 4),
        electronegativity=1.20,
        atomic_radius_pm=175,
        ionization_energy_eV=5.864,
        electron_affinity_eV=1.165,
        melting_point_K=1629.0,
        boiling_point_K=3503.0,
        density_g_cm3=8.230,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=66,
        symbol="Dy",
        name="Dysprosium",
        atomic_mass=162.50,
        standard_state="Solid",
        electron_config="[Xe] 4f10 6s2",
        oxidation_states=(3,),
        electronegativity=1.22,
        atomic_radius_pm=175,
        ionization_energy_eV=5.939,
        electron_affinity_eV=0.352,
        melting_point_K=1680.0,
        boiling_point_K=2840.0,
        density_g_cm3=8.550,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=67,
        symbol="Ho",
        name="Holmium",
        atomic_mass=164.93,
        standard_state="Solid",
        electron_config="[Xe] 4f11 6s2",
        oxidation_states=(3,),
        electronegativity=1.23,
        atomic_radius_pm=175,
        ionization_energy_eV=6.022,
        electron_affinity_eV=0.338,
        melting_point_K=1734.0,
        boiling_point_K=2993.0,
        density_g_cm3=8.795,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=68,
        symbol="Er",
        name="Erbium",
        atomic_mass=167.26,
        standard_state="Solid",
        electron_config="[Xe] 4f12 6s2",
        oxidation_states=(3,),
        electronegativity=1.24,
        atomic_radius_pm=175,
        ionization_energy_eV=6.108,
        electron_affinity_eV=0.312,
        melting_point_K=1802.0,
        boiling_point_K=3141.0,
        density_g_cm3=9.066,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=69,
        symbol="Tm",
        name="Thulium",
        atomic_mass=168.93,
        standard_state="Solid",
        electron_config="[Xe] 4f13 6s2",
        oxidation_states=(3, 2),
        electronegativity=1.25,
        atomic_radius_pm=175,
        ionization_energy_eV=6.184,
        electron_affinity_eV=1.029,
        melting_point_K=1818.0,
        boiling_point_K=2223.0,
        density_g_cm3=9.321,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=70,
        symbol="Yb",
        name="Ytterbium",
        atomic_mass=173.04,
        standard_state="Solid",
        electron_config="[Xe] 4f14 6s2",
        oxidation_states=(3, 2),
        electronegativity=1.10,
        atomic_radius_pm=175,
        ionization_energy_eV=6.254,
        electron_affinity_eV=-0.020,
        melting_point_K=1097.0,
        boiling_point_K=1469.0,
        density_g_cm3=6.965,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    Element(
        Z=71,
        symbol="Lu",
        name="Lutetium",
        atomic_mass=174.97,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d1 6s2",
        oxidation_states=(3,),
        electronegativity=1.27,
        atomic_radius_pm=175,
        ionization_energy_eV=5.426,
        electron_affinity_eV=0.34,
        melting_point_K=1925.0,
        boiling_point_K=3675.0,
        density_g_cm3=9.841,
        period=6,
        group=None,
        block="f",
        category="Lanthanide",
    ),
    # ── 6d transition metals ─────────────────────────────────────
    Element(
        Z=72,
        symbol="Hf",
        name="Hafnium",
        atomic_mass=178.49,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d2 6s2",
        oxidation_states=(4,),
        electronegativity=1.30,
        atomic_radius_pm=155,
        ionization_energy_eV=6.825,
        electron_affinity_eV=0.178,
        melting_point_K=2506.0,
        boiling_point_K=4876.0,
        density_g_cm3=13.31,
        period=6,
        group=4,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=73,
        symbol="Ta",
        name="Tantalum",
        atomic_mass=180.95,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d3 6s2",
        oxidation_states=(5,),
        electronegativity=1.50,
        atomic_radius_pm=145,
        ionization_energy_eV=7.550,
        electron_affinity_eV=0.322,
        melting_point_K=3290.0,
        boiling_point_K=5731.0,
        density_g_cm3=16.654,
        period=6,
        group=5,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=74,
        symbol="W",
        name="Tungsten",
        atomic_mass=183.84,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d4 6s2",
        oxidation_states=(6, 4, 2),
        electronegativity=2.36,
        atomic_radius_pm=135,
        ionization_energy_eV=7.864,
        electron_affinity_eV=0.816,
        melting_point_K=3695.0,
        boiling_point_K=5828.0,
        density_g_cm3=19.25,
        period=6,
        group=6,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=75,
        symbol="Re",
        name="Rhenium",
        atomic_mass=186.21,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d5 6s2",
        oxidation_states=(7, 4),
        electronegativity=1.90,
        atomic_radius_pm=135,
        ionization_energy_eV=7.833,
        electron_affinity_eV=0.15,
        melting_point_K=3459.0,
        boiling_point_K=5869.0,
        density_g_cm3=21.02,
        period=6,
        group=7,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=76,
        symbol="Os",
        name="Osmium",
        atomic_mass=190.23,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d6 6s2",
        oxidation_states=(4, 8),
        electronegativity=2.20,
        atomic_radius_pm=130,
        ionization_energy_eV=8.438,
        electron_affinity_eV=1.10,
        melting_point_K=3306.0,
        boiling_point_K=5285.0,
        density_g_cm3=22.59,
        period=6,
        group=8,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=77,
        symbol="Ir",
        name="Iridium",
        atomic_mass=192.22,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d7 6s2",
        oxidation_states=(4, 3),
        electronegativity=2.20,
        atomic_radius_pm=135,
        ionization_energy_eV=8.967,
        electron_affinity_eV=1.565,
        melting_point_K=2719.0,
        boiling_point_K=4701.0,
        density_g_cm3=22.56,
        period=6,
        group=9,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=78,
        symbol="Pt",
        name="Platinum",
        atomic_mass=195.08,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d9 6s1",
        oxidation_states=(4, 2),
        electronegativity=2.28,
        atomic_radius_pm=135,
        ionization_energy_eV=8.959,
        electron_affinity_eV=2.128,
        melting_point_K=2041.4,
        boiling_point_K=4098.0,
        density_g_cm3=21.46,
        period=6,
        group=10,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=79,
        symbol="Au",
        name="Gold",
        atomic_mass=196.97,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d10 6s1",
        oxidation_states=(3, 1),
        electronegativity=2.54,
        atomic_radius_pm=135,
        ionization_energy_eV=9.226,
        electron_affinity_eV=2.309,
        melting_point_K=1337.33,
        boiling_point_K=3129.0,
        density_g_cm3=19.282,
        period=6,
        group=11,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=80,
        symbol="Hg",
        name="Mercury",
        atomic_mass=200.59,
        standard_state="Liquid",
        electron_config="[Xe] 4f14 5d10 6s2",
        oxidation_states=(2, 1),
        electronegativity=2.00,
        atomic_radius_pm=150,
        ionization_energy_eV=10.438,
        electron_affinity_eV=None,
        melting_point_K=234.32,
        boiling_point_K=629.88,
        density_g_cm3=13.534,
        period=6,
        group=12,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=81,
        symbol="Tl",
        name="Thallium",
        atomic_mass=204.38,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d10 6s2 6p1",
        oxidation_states=(3, 1),
        electronegativity=1.62,
        atomic_radius_pm=190,
        ionization_energy_eV=6.108,
        electron_affinity_eV=0.377,
        melting_point_K=577.0,
        boiling_point_K=1746.0,
        density_g_cm3=11.85,
        period=6,
        group=13,
        block="p",
        category="Post-transition metal",
    ),
    Element(
        Z=82,
        symbol="Pb",
        name="Lead",
        atomic_mass=207.2,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d10 6s2 6p2",
        oxidation_states=(4, 2),
        electronegativity=1.87,
        atomic_radius_pm=180,
        ionization_energy_eV=7.417,
        electron_affinity_eV=0.364,
        melting_point_K=600.61,
        boiling_point_K=2022.0,
        density_g_cm3=11.342,
        period=6,
        group=14,
        block="p",
        category="Post-transition metal",
    ),
    Element(
        Z=83,
        symbol="Bi",
        name="Bismuth",
        atomic_mass=208.98,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d10 6s2 6p3",
        oxidation_states=(3, 5),
        electronegativity=2.02,
        atomic_radius_pm=160,
        ionization_energy_eV=7.286,
        electron_affinity_eV=0.942,
        melting_point_K=544.7,
        boiling_point_K=1837.0,
        density_g_cm3=9.807,
        period=6,
        group=15,
        block="p",
        category="Post-transition metal",
    ),
    Element(
        Z=84,
        symbol="Po",
        name="Polonium",
        atomic_mass=209.0,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d10 6s2 6p4",
        oxidation_states=(4, 2),
        electronegativity=2.00,
        atomic_radius_pm=190,
        ionization_energy_eV=8.414,
        electron_affinity_eV=1.9,
        melting_point_K=527.0,
        boiling_point_K=1235.0,
        density_g_cm3=9.32,
        period=6,
        group=16,
        block="p",
        category="Post-transition metal",
    ),
    Element(
        Z=85,
        symbol="At",
        name="Astatine",
        atomic_mass=210.0,
        standard_state="Solid",
        electron_config="[Xe] 4f14 5d10 6s2 6p5",
        oxidation_states=(7, 5, 3, 1, -1),
        electronegativity=2.20,
        atomic_radius_pm=None,
        ionization_energy_eV=9.318,
        electron_affinity_eV=2.8,
        melting_point_K=575.0,
        boiling_point_K=610.0,
        density_g_cm3=None,
        period=6,
        group=17,
        block="p",
        category="Halogen",
    ),
    Element(
        Z=86,
        symbol="Rn",
        name="Radon",
        atomic_mass=222.0,
        standard_state="Gas",
        electron_config="[Xe] 4f14 5d10 6s2 6p6",
        oxidation_states=(2, 0),
        electronegativity=2.20,
        atomic_radius_pm=None,
        ionization_energy_eV=10.749,
        electron_affinity_eV=None,
        melting_point_K=202.0,
        boiling_point_K=211.5,
        density_g_cm3=0.00973,
        period=6,
        group=18,
        block="p",
        category="Noble gas",
    ),
    # ── Period 7 ─────────────────────────────────────────────────
    Element(
        Z=87,
        symbol="Fr",
        name="Francium",
        atomic_mass=223.0,
        standard_state="Solid",
        electron_config="[Rn] 7s1",
        oxidation_states=(1,),
        electronegativity=0.70,
        atomic_radius_pm=None,
        ionization_energy_eV=4.073,
        electron_affinity_eV=0.486,
        melting_point_K=300.0,
        boiling_point_K=950.0,
        density_g_cm3=None,
        period=7,
        group=1,
        block="s",
        category="Alkali metal",
    ),
    Element(
        Z=88,
        symbol="Ra",
        name="Radium",
        atomic_mass=226.0,
        standard_state="Solid",
        electron_config="[Rn] 7s2",
        oxidation_states=(2,),
        electronegativity=0.90,
        atomic_radius_pm=215,
        ionization_energy_eV=5.278,
        electron_affinity_eV=0.10,
        melting_point_K=973.0,
        boiling_point_K=2010.0,
        density_g_cm3=5.5,
        period=7,
        group=2,
        block="s",
        category="Alkaline earth metal",
    ),
    # ── Actinides ────────────────────────────────────────────────
    Element(
        Z=89,
        symbol="Ac",
        name="Actinium",
        atomic_mass=227.0,
        standard_state="Solid",
        electron_config="[Rn] 6d1 7s2",
        oxidation_states=(3,),
        electronegativity=1.10,
        atomic_radius_pm=195,
        ionization_energy_eV=5.170,
        electron_affinity_eV=0.35,
        melting_point_K=1323.0,
        boiling_point_K=3471.0,
        density_g_cm3=10.07,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=90,
        symbol="Th",
        name="Thorium",
        atomic_mass=232.04,
        standard_state="Solid",
        electron_config="[Rn] 6d2 7s2",
        oxidation_states=(4,),
        electronegativity=1.30,
        atomic_radius_pm=180,
        ionization_energy_eV=6.307,
        electron_affinity_eV=1.17,
        melting_point_K=2023.0,
        boiling_point_K=5061.0,
        density_g_cm3=11.72,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=91,
        symbol="Pa",
        name="Protactinium",
        atomic_mass=231.04,
        standard_state="Solid",
        electron_config="[Rn] 5f2 6d1 7s2",
        oxidation_states=(5, 4),
        electronegativity=1.50,
        atomic_radius_pm=180,
        ionization_energy_eV=5.890,
        electron_affinity_eV=0.55,
        melting_point_K=1841.0,
        boiling_point_K=4300.0,
        density_g_cm3=15.37,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=92,
        symbol="U",
        name="Uranium",
        atomic_mass=238.03,
        standard_state="Solid",
        electron_config="[Rn] 5f3 6d1 7s2",
        oxidation_states=(6, 4, 3),
        electronegativity=1.38,
        atomic_radius_pm=175,
        ionization_energy_eV=6.194,
        electron_affinity_eV=0.53,
        melting_point_K=1405.3,
        boiling_point_K=4404.0,
        density_g_cm3=19.05,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=93,
        symbol="Np",
        name="Neptunium",
        atomic_mass=237.0,
        standard_state="Solid",
        electron_config="[Rn] 5f4 6d1 7s2",
        oxidation_states=(5, 4, 3),
        electronegativity=1.36,
        atomic_radius_pm=175,
        ionization_energy_eV=6.266,
        electron_affinity_eV=0.48,
        melting_point_K=917.0,
        boiling_point_K=4175.0,
        density_g_cm3=20.45,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=94,
        symbol="Pu",
        name="Plutonium",
        atomic_mass=244.0,
        standard_state="Solid",
        electron_config="[Rn] 5f6 7s2",
        oxidation_states=(4, 6, 3),
        electronegativity=1.28,
        atomic_radius_pm=175,
        ionization_energy_eV=6.026,
        electron_affinity_eV=None,
        melting_point_K=912.5,
        boiling_point_K=3501.0,
        density_g_cm3=19.84,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=95,
        symbol="Am",
        name="Americium",
        atomic_mass=243.0,
        standard_state="Solid",
        electron_config="[Rn] 5f7 7s2",
        oxidation_states=(3, 4, 5, 6),
        electronegativity=1.30,
        atomic_radius_pm=175,
        ionization_energy_eV=5.974,
        electron_affinity_eV=0.10,
        melting_point_K=1449.0,
        boiling_point_K=2880.0,
        density_g_cm3=13.69,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=96,
        symbol="Cm",
        name="Curium",
        atomic_mass=247.0,
        standard_state="Solid",
        electron_config="[Rn] 5f7 6d1 7s2",
        oxidation_states=(3,),
        electronegativity=1.30,
        atomic_radius_pm=None,
        ionization_energy_eV=5.991,
        electron_affinity_eV=0.28,
        melting_point_K=1613.0,
        boiling_point_K=3383.0,
        density_g_cm3=13.51,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=97,
        symbol="Bk",
        name="Berkelium",
        atomic_mass=247.0,
        standard_state="Solid",
        electron_config="[Rn] 5f9 7s2",
        oxidation_states=(3, 4),
        electronegativity=1.30,
        atomic_radius_pm=None,
        ionization_energy_eV=6.198,
        electron_affinity_eV=-0.165,
        melting_point_K=1259.0,
        boiling_point_K=2900.0,
        density_g_cm3=14.79,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=98,
        symbol="Cf",
        name="Californium",
        atomic_mass=251.0,
        standard_state="Solid",
        electron_config="[Rn] 5f10 7s2",
        oxidation_states=(3,),
        electronegativity=1.30,
        atomic_radius_pm=None,
        ionization_energy_eV=6.282,
        electron_affinity_eV=-0.097,
        melting_point_K=1173.0,
        boiling_point_K=1743.0,
        density_g_cm3=15.1,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=99,
        symbol="Es",
        name="Einsteinium",
        atomic_mass=252.0,
        standard_state="Solid",
        electron_config="[Rn] 5f11 7s2",
        oxidation_states=(3,),
        electronegativity=1.30,
        atomic_radius_pm=None,
        ionization_energy_eV=6.367,
        electron_affinity_eV=-0.30,
        melting_point_K=1133.0,
        boiling_point_K=1269.0,
        density_g_cm3=8.84,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=100,
        symbol="Fm",
        name="Fermium",
        atomic_mass=257.0,
        standard_state="Solid",
        electron_config="[Rn] 5f12 7s2",
        oxidation_states=(3,),
        electronegativity=1.30,
        atomic_radius_pm=None,
        ionization_energy_eV=6.50,
        electron_affinity_eV=0.35,
        melting_point_K=1800.0,
        boiling_point_K=None,
        density_g_cm3=None,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=101,
        symbol="Md",
        name="Mendelevium",
        atomic_mass=258.0,
        standard_state="Solid",
        electron_config="[Rn] 5f13 7s2",
        oxidation_states=(3, 2),
        electronegativity=1.30,
        atomic_radius_pm=None,
        ionization_energy_eV=6.58,
        electron_affinity_eV=0.98,
        melting_point_K=1100.0,
        boiling_point_K=None,
        density_g_cm3=None,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=102,
        symbol="No",
        name="Nobelium",
        atomic_mass=259.0,
        standard_state="Solid",
        electron_config="[Rn] 5f14 7s2",
        oxidation_states=(2, 3),
        electronegativity=1.30,
        atomic_radius_pm=None,
        ionization_energy_eV=6.65,
        electron_affinity_eV=-2.33,
        melting_point_K=1100.0,
        boiling_point_K=None,
        density_g_cm3=None,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    Element(
        Z=103,
        symbol="Lr",
        name="Lawrencium",
        atomic_mass=266.0,
        standard_state="Solid",
        electron_config="[Rn] 5f14 7s2 7p1",
        oxidation_states=(3,),
        electronegativity=1.30,
        atomic_radius_pm=None,
        ionization_energy_eV=4.96,
        electron_affinity_eV=-0.31,
        melting_point_K=1900.0,
        boiling_point_K=None,
        density_g_cm3=None,
        period=7,
        group=None,
        block="f",
        category="Actinide",
    ),
    # ── Period 7 transition metals (superheavy) ──────────────────
    Element(
        Z=104,
        symbol="Rf",
        name="Rutherfordium",
        atomic_mass=267.0,
        standard_state="Expected Solid",
        electron_config="[Rn] 5f14 6d2 7s2",
        oxidation_states=(4,),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=6.01,
        electron_affinity_eV=None,
        melting_point_K=2400.0,
        boiling_point_K=5800.0,
        density_g_cm3=23.2,
        period=7,
        group=4,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=105,
        symbol="Db",
        name="Dubnium",
        atomic_mass=268.0,
        standard_state="Expected Solid",
        electron_config="[Rn] 5f14 6d3 7s2",
        oxidation_states=(5,),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=6.89,
        electron_affinity_eV=None,
        melting_point_K=None,
        boiling_point_K=None,
        density_g_cm3=29.3,
        period=7,
        group=5,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=106,
        symbol="Sg",
        name="Seaborgium",
        atomic_mass=269.0,
        standard_state="Expected Solid",
        electron_config="[Rn] 5f14 6d4 7s2",
        oxidation_states=(6,),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=7.10,
        electron_affinity_eV=None,
        melting_point_K=None,
        boiling_point_K=None,
        density_g_cm3=35.0,
        period=7,
        group=6,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=107,
        symbol="Bh",
        name="Bohrium",
        atomic_mass=270.0,
        standard_state="Expected Solid",
        electron_config="[Rn] 5f14 6d5 7s2",
        oxidation_states=(7,),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=7.40,
        electron_affinity_eV=None,
        melting_point_K=None,
        boiling_point_K=None,
        density_g_cm3=37.1,
        period=7,
        group=7,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=108,
        symbol="Hs",
        name="Hassium",
        atomic_mass=277.0,
        standard_state="Expected Solid",
        electron_config="[Rn] 5f14 6d6 7s2",
        oxidation_states=(8,),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=7.60,
        electron_affinity_eV=None,
        melting_point_K=None,
        boiling_point_K=None,
        density_g_cm3=40.7,
        period=7,
        group=8,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=109,
        symbol="Mt",
        name="Meitnerium",
        atomic_mass=278.0,
        standard_state="Expected Solid",
        electron_config="[Rn] 5f14 6d7 7s2",
        oxidation_states=(3, 6),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=8.00,
        electron_affinity_eV=None,
        melting_point_K=None,
        boiling_point_K=None,
        density_g_cm3=37.4,
        period=7,
        group=9,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=110,
        symbol="Ds",
        name="Darmstadtium",
        atomic_mass=281.0,
        standard_state="Expected Solid",
        electron_config="[Rn] 5f14 6d8 7s2",
        oxidation_states=(6,),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=8.40,
        electron_affinity_eV=None,
        melting_point_K=None,
        boiling_point_K=None,
        density_g_cm3=34.8,
        period=7,
        group=10,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=111,
        symbol="Rg",
        name="Roentgenium",
        atomic_mass=282.0,
        standard_state="Expected Solid",
        electron_config="[Rn] 5f14 6d9 7s2",
        oxidation_states=(3,),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=8.80,
        electron_affinity_eV=None,
        melting_point_K=None,
        boiling_point_K=None,
        density_g_cm3=28.7,
        period=7,
        group=11,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=112,
        symbol="Cn",
        name="Copernicium",
        atomic_mass=285.0,
        standard_state="Expected Liquid",
        electron_config="[Rn] 5f14 6d10 7s2",
        oxidation_states=(2,),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=9.40,
        electron_affinity_eV=None,
        melting_point_K=283.0,
        boiling_point_K=340.0,
        density_g_cm3=23.7,
        period=7,
        group=12,
        block="d",
        category="Transition metal",
    ),
    Element(
        Z=113,
        symbol="Nh",
        name="Nihonium",
        atomic_mass=286.0,
        standard_state="Expected Solid",
        electron_config="[Rn] 5f14 6d10 7s2 7p1",
        oxidation_states=(1,),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=7.306,
        electron_affinity_eV=0.68,
        melting_point_K=700.0,
        boiling_point_K=1430.0,
        density_g_cm3=16.0,
        period=7,
        group=13,
        block="p",
        category="Post-transition metal",
    ),
    Element(
        Z=114,
        symbol="Fl",
        name="Flerovium",
        atomic_mass=289.0,
        standard_state="Expected Liquid",
        electron_config="[Rn] 5f14 6d10 7s2 7p2",
        oxidation_states=(2, 4),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=8.539,
        electron_affinity_eV=None,
        melting_point_K=200.0,
        boiling_point_K=380.0,
        density_g_cm3=14.0,
        period=7,
        group=14,
        block="p",
        category="Post-transition metal",
    ),
    Element(
        Z=115,
        symbol="Mc",
        name="Moscovium",
        atomic_mass=290.0,
        standard_state="Expected Solid",
        electron_config="[Rn] 5f14 6d10 7s2 7p3",
        oxidation_states=(1, 3),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=5.58,
        electron_affinity_eV=0.35,
        melting_point_K=670.0,
        boiling_point_K=1400.0,
        density_g_cm3=13.5,
        period=7,
        group=15,
        block="p",
        category="Post-transition metal",
    ),
    Element(
        Z=116,
        symbol="Lv",
        name="Livermorium",
        atomic_mass=293.0,
        standard_state="Expected Solid",
        electron_config="[Rn] 5f14 6d10 7s2 7p4",
        oxidation_states=(2, 4),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=6.80,
        electron_affinity_eV=0.74,
        melting_point_K=709.0,
        boiling_point_K=1085.0,
        density_g_cm3=12.9,
        period=7,
        group=16,
        block="p",
        category="Post-transition metal",
    ),
    Element(
        Z=117,
        symbol="Ts",
        name="Tennessine",
        atomic_mass=294.0,
        standard_state="Expected Solid",
        electron_config="[Rn] 5f14 6d10 7s2 7p5",
        oxidation_states=(1, 3, 5),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=7.70,
        electron_affinity_eV=1.65,
        melting_point_K=723.0,
        boiling_point_K=883.0,
        density_g_cm3=7.2,
        period=7,
        group=17,
        block="p",
        category="Halogen",
    ),
    Element(
        Z=118,
        symbol="Og",
        name="Oganesson",
        atomic_mass=294.0,
        standard_state="Expected Gas",
        electron_config="[Rn] 5f14 6d10 7s2 7p6",
        oxidation_states=(0, 2, 4),
        electronegativity=None,
        atomic_radius_pm=None,
        ionization_energy_eV=8.90,
        electron_affinity_eV=0.056,
        melting_point_K=325.0,
        boiling_point_K=450.0,
        density_g_cm3=5.0,
        period=7,
        group=18,
        block="p",
        category="Noble gas",
    ),
)


# ═══════════════════════════════════════════════════════════════════
# Lookup indices
# ═══════════════════════════════════════════════════════════════════

ELEMENTS_BY_Z: dict[int, Element] = {el.Z: el for el in ELEMENTS}
ELEMENTS_BY_SYMBOL: dict[str, Element] = {el.symbol: el for el in ELEMENTS}
ELEMENTS_BY_NAME: dict[str, Element] = {el.name.lower(): el for el in ELEMENTS}


def get_element(key: int | str) -> Element | None:
    """Look up an element by Z (int), symbol (str), or name (str).

    Returns None if not found.

    >>> get_element(26).name
    'Iron'
    >>> get_element("Fe").Z
    26
    >>> get_element("iron").symbol
    'Fe'
    """
    if isinstance(key, int):
        return ELEMENTS_BY_Z.get(key)
    if isinstance(key, str):
        # Try symbol first (case-sensitive), then name (case-insensitive)
        return ELEMENTS_BY_SYMBOL.get(key) or ELEMENTS_BY_NAME.get(key.lower())
    return None


def element_card(el: Element) -> str:
    """Render a human-readable element info card.

    >>> print(element_card(get_element("Fe")))
    ┌─────────────────────────────────────────┐
    │  26  Fe  Iron                           │
    │  ─────────────────────────────────────  │
    │  Atomic mass:     55.845 amu            │
    │  State (STP):     Solid                 │
    │  Config:          [Ar] 3d6 4s2          │
    │  Oxidation:       +3, +2, +6            │
    │  Electronegativity: 1.83 (Pauling)      │
    │  Atomic radius:   140 pm                │
    │  IE₁:             7.902 eV              │
    │  Electron affin:  0.151 eV              │
    │  Melting point:   1811.0 K              │
    │  Boiling point:   3134.0 K              │
    │  Density:         7.874 g/cm³           │
    └─────────────────────────────────────────┘
    """
    w = 43
    ox = ", ".join(f"{'+' if x > 0 else ''}{x}" for x in el.oxidation_states)
    en = f"{el.electronegativity:.2f} (Pauling)" if el.electronegativity else "n/a"
    ar = f"{el.atomic_radius_pm:.0f} pm" if el.atomic_radius_pm else "n/a"
    ea = f"{el.electron_affinity_eV:.3f} eV" if el.electron_affinity_eV is not None else "n/a"
    mp = f"{el.melting_point_K:.1f} K" if el.melting_point_K is not None else "n/a"
    bp = f"{el.boiling_point_K:.1f} K" if el.boiling_point_K is not None else "n/a"
    dn = f"{el.density_g_cm3:.4g} g/cm³" if el.density_g_cm3 is not None else "n/a"

    lines = [
        f"┌{'─' * (w - 2)}┐",
        f"│  {el.Z:<3d} {el.symbol:<3s} {el.name:<{w - 12}}│",
        f"│  {'─' * (w - 6)}  │",
        f"│  Atomic mass:     {el.atomic_mass:<20} amu  │"[: w - 1] + "│",
        f"│  State (STP):     {el.standard_state:<{w - 22}}│",
        f"│  Config:          {el.electron_config:<{w - 22}}│",
        f"│  Oxidation:       {ox:<{w - 22}}│",
        f"│  Electronegativity: {en:<{w - 24}}│",
        f"│  Atomic radius:   {ar:<{w - 22}}│",
        f"│  IE₁:             {el.ionization_energy_eV:<8.3f} eV{' ' * (w - 28)}│",
        f"│  Electron affin:  {ea:<{w - 22}}│",
        f"│  Melting point:   {mp:<{w - 22}}│",
        f"│  Boiling point:   {bp:<{w - 22}}│",
        f"│  Density:         {dn:<{w - 22}}│",
        f"└{'─' * (w - 2)}┘",
    ]
    return "\n".join(lines)


# ═══════════════════════════════════════════════════════════════════
# Validation
# ═══════════════════════════════════════════════════════════════════


def validate_database() -> dict[str, Any]:
    """Run integrity checks on the element database.

    Returns dict with counts and any issues found.
    """
    issues: list[str] = []

    # Check count
    if len(ELEMENTS) != 118:
        issues.append(f"Expected 118 elements, got {len(ELEMENTS)}")

    # Check Z sequence
    for i, el in enumerate(ELEMENTS):
        if i + 1 != el.Z:
            issues.append(f"Element at index {i} has Z={el.Z}, expected {i + 1}")

    # Check no duplicate symbols
    symbols = [el.symbol for el in ELEMENTS]
    if len(set(symbols)) != len(symbols):
        dupes = [s for s in symbols if symbols.count(s) > 1]
        issues.append(f"Duplicate symbols: {set(dupes)}")

    # Check lookup consistency
    for el in ELEMENTS:
        if ELEMENTS_BY_Z[el.Z] is not el:
            issues.append(f"ELEMENTS_BY_Z[{el.Z}] mismatch")
        if ELEMENTS_BY_SYMBOL[el.symbol] is not el:
            issues.append(f"ELEMENTS_BY_SYMBOL[{el.symbol}] mismatch")

    # Property ranges
    for el in ELEMENTS:
        if el.atomic_mass <= 0:
            issues.append(f"{el.symbol}: atomic_mass={el.atomic_mass} <= 0")
        if el.ionization_energy_eV <= 0:
            issues.append(f"{el.symbol}: IE={el.ionization_energy_eV} <= 0")
        if el.electronegativity is not None and not 0.5 <= el.electronegativity <= 4.1:
            issues.append(f"{el.symbol}: EN={el.electronegativity} out of [0.5, 4.1]")

    return {
        "count": len(ELEMENTS),
        "unique_symbols": len(set(symbols)),
        "issues": issues,
        "valid": len(issues) == 0,
    }


if __name__ == "__main__":
    # Self-test
    result = validate_database()
    print(f"Database: {result['count']} elements, {result['unique_symbols']} unique symbols")
    if result["valid"]:
        print("✓ All integrity checks passed")
    else:
        print(f"✗ {len(result['issues'])} issues:")
        for issue in result["issues"]:
            print(f"  - {issue}")

    # Show a few example cards
    for sym in ("H", "Fe", "Au", "Og"):
        el = get_element(sym)
        if el:
            print()
            print(element_card(el))
