:root {
            --bg: #060913;
            --card: rgba(15, 23, 42, 0.76);
            --border: rgba(148, 163, 184, 0.16);
            --text: #f8fafc;
            --muted: #94a3b8;
            --cyan: #00f2fe;
            --blue: #38bdf8;
            --purple: #a855f7;
            --emerald: #10b981;
            --sans: 'Inter', system-ui, sans-serif;
            --display: 'Space Grotesk', sans-serif;
            --mono: 'JetBrains Mono', monospace;
        }
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            background: var(--bg);
            color: var(--text);
            font-family: var(--sans);
            min-height: 100vh;
            overflow-x: hidden;
            line-height: 1.5;
        }
        .bg-grid {
            position: fixed; inset: 0; pointer-events: none; z-index: 0;
            background-image: linear-gradient(to right, rgba(56,189,248,0.04) 1px, transparent 1px),
                              linear-gradient(to bottom, rgba(56,189,248,0.04) 1px, transparent 1px);
            background-size: 36px 36px;
        }
        .app-wrap { position: relative; z-index: 1; max-width: 1360px; margin: 0 auto; padding: 22px 24px 48px; }
        .glass {
            background: var(--card);
            backdrop-filter: blur(18px);
            border: 1px solid var(--border);
            border-radius: 18px;
            padding: 20px;
            box-shadow: 0 16px 40px rgba(0,0,0,0.4);
        }
        .top-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; }
        .brand { display: flex; align-items: center; gap: 14px; }
        .brand-logo {
            width: 44px; height: 44px; border-radius: 12px;
            background: radial-gradient(circle, rgba(0,242,254,0.25), rgba(99,102,241,0.15));
            border: 1px solid var(--cyan);
            display: flex; align-items: center; justify-content: center;
            font-family: var(--mono); font-weight: 700; color: var(--cyan);
            box-shadow: 0 0 15px rgba(0,242,254,0.3);
        }
        .badge-sub { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; color: var(--cyan); }
        .brand h1 { font-family: var(--display); font-size: 1.55rem; }
        .brand h1 span { background: linear-gradient(90deg, var(--cyan), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

        .controls { display: flex; flex-direction: column; gap: 8px; flex: 1; max-width: 720px; }
        .search-row { display: flex; gap: 8px; align-items: center; }
        .input-box {
            flex: 1; display: flex; align-items: center;
            background: rgba(9, 14, 28, 0.9);
            border: 1px solid rgba(56, 189, 248, 0.4);
            border-radius: 12px; padding: 5px 8px 5px 14px;
        }
        .input-box span { font-family: var(--mono); font-weight: 700; color: var(--cyan); margin-right: 8px; }
        .input-box input {
            flex: 1; background: transparent; border: none; outline: none;
            color: #fff; font-family: var(--mono); font-size: 1.05rem; font-weight: 600;
        }
        .btn {
            border: none; border-radius: 9px; padding: 9px 16px;
            font-family: var(--display); font-weight: 600; font-size: 0.88rem;
            cursor: pointer; transition: 0.2s; color: #fff;
            background: linear-gradient(135deg, #0284c7, #4f46e5);
        }
        .btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
        .made-by {
            background: #2563eb;
            color: #fff;
            border-radius: 10px;
            padding: 9px 16px;
            font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
            white-space: nowrap;
            user-select: none;
        }
        .quick-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
        .chip, .step-btn {
            background: rgba(15,23,42,0.85); border: 1px solid var(--border);
            color: var(--muted); font-family: var(--mono); font-size: 0.73rem;
            padding: 4px 9px; border-radius: 7px; cursor: pointer; transition: 0.15s;
        }
        .chip:hover, .chip.active, .step-btn:hover {
            color: var(--cyan); border-color: var(--cyan); background: rgba(56,189,248,0.15);
        }

        .main-grid { display: grid; grid-template-columns: 380px 1fr; gap: 22px; margin-bottom: 22px; }
        .hero-top { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
        .el-tile {
            width: 106px; height: 118px; border-radius: 16px;
            background: rgba(56,189,248,0.12); border: 2px solid var(--blue);
            display: flex; flex-direction: column; justify-content: space-between; padding: 9px 11px;
            flex-shrink: 0;
        }
        .el-z { font-family: var(--mono); font-weight: 700; color: var(--cyan); font-size: 0.9rem; }
        .el-sym { font-family: var(--display); font-size: 2.5rem; font-weight: 700; text-align: center; line-height: 1; }
        .el-mass { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); text-align: center; }
        .type-pill {
            display: inline-block; font-family: var(--mono); font-size: 0.7rem; font-weight: 700;
            padding: 2px 10px; border-radius: 99px; margin-bottom: 5px;
        }
        .hero-meta h2 { font-family: var(--display); font-size: 1.35rem; margin-bottom: 2px; }
        .hero-sub { font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; }
        .mini-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
        .mini-box { background: rgba(9,14,28,0.6); border: 1px solid var(--border); border-radius: 9px; padding: 6px 9px; }
        .mini-box span { display: block; font-size: 0.68rem; color: var(--muted); }
        .mini-box strong { font-family: var(--mono); font-size: 0.82rem; }

        .bohr-box {
            background: radial-gradient(circle, rgba(14,25,47,0.9), rgba(6,9,19,0.95));
            border: 1px solid var(--border); border-radius: 14px; padding: 14px;
            display: flex; flex-direction: column; align-items: center; gap: 10px;
        }
        .bohr-title { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; }
        .shells-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
        .shell-tag {
            background: rgba(30,41,59,0.75); border: 1px solid rgba(56,189,248,0.28);
            border-radius: 7px; padding: 3px 8px; font-family: var(--mono); font-size: 0.72rem;
        }
        .shell-tag b { color: var(--cyan); }

        .right-col { display: flex; flex-direction: column; gap: 18px; }
        .kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
        .kpi-label { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); margin-bottom: 6px; display: block; }
        .kpi-val { font-family: var(--display); font-size: 1.95rem; font-weight: 700; line-height: 1.15; margin-bottom: 5px; }
        .kpi-desc { font-size: 0.76rem; color: var(--muted); }

        .sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
        .sec-head h3 { font-family: var(--display); font-size: 1.12rem; }
        .pill-info {
            font-family: var(--mono); font-size: 0.75rem; padding: 4px 11px; border-radius: 99px;
            background: rgba(56,189,248,0.14); border: 1px solid rgba(56,189,248,0.4); color: var(--cyan);
        }
        .cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
        .cfg-box { background: rgba(9,14,28,0.65); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; }
        .cfg-box.full { grid-column: 1 / -1; border-color: rgba(56,189,248,0.4); }
        .cfg-label { font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; display: flex; justify-content: space-between; }
        .cfg-val { font-family: var(--mono); font-size: 1.04rem; font-weight: 600; color: #fff; }
        .cfg-val sup { color: var(--cyan); font-size: 0.78em; margin-right: 3px; }
        .note-box {
            margin-top: 10px; padding: 9px 13px; border-radius: 9px;
            background: rgba(245,158,11,0.14); border: 1px solid rgba(245,158,11,0.4);
            color: #fcd34d; font-size: 0.8rem;
        }
        .hidden { display: none !important; }

        .sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 10px; }
        .sub-item { background: rgba(9,14,28,0.65); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; }
        .sub-top { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.88rem; font-weight: 700; margin-bottom: 6px; }
        .sub-top span:last-child { color: var(--cyan); }
        .bar-bg { height: 5px; background: rgba(30,41,59,0.9); border-radius: 99px; overflow: hidden; margin-bottom: 7px; }
        .bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
        .orb-row { display: flex; gap: 4px; flex-wrap: wrap; }
        .orb {
            width: 23px; height: 23px; border: 1px solid rgba(148,163,184,0.3);
            background: rgba(15,23,42,0.9); border-radius: 4px;
            display: flex; align-items: center; justify-content: center;
            font-family: var(--mono); font-size: 0.68rem; color: var(--cyan); letter-spacing: -1px;
        }
        .orb.empty { opacity: 0.3; }

        /* Periodic Table Chuẩn 18 Cột SGK */
        .pt-legend { display: flex; gap: 16px; margin-bottom: 12px; font-size: 0.8rem; color: var(--muted); }
        .pt-dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
        .pt-scroll { overflow-x: auto; padding-bottom: 6px; }
        .pt-matrix {
            display: grid;
            grid-template-columns: 34px repeat(18, minmax(43px, 1fr));
            gap: 5px; min-width: 880px;
        }
        .pt-head {
            font-family: var(--mono); font-size: 0.66rem; font-weight: 700; color: var(--cyan);
            text-align: center; padding: 3px 0; display: flex; align-items: flex-end; justify-content: center;
        }
        .pt-head.viiib { background: rgba(56,189,248,0.08); border-bottom: 2px solid var(--blue); border-radius: 5px 5px 0 0; }
        .pt-p {
            font-family: var(--mono); font-size: 0.73rem; font-weight: 700; color: var(--muted);
            display: flex; align-items: center; justify-content: center;
            background: rgba(15,23,42,0.5); border: 1px dashed rgba(148,163,184,0.2); border-radius: 6px;
        }
        .pt-cell {
            aspect-ratio: 1 / 1.06; border-radius: 6px; padding: 3px 4px;
            display: flex; flex-direction: column; justify-content: space-between; align-items: center;
            cursor: pointer; transition: 0.14s; border: 1px solid var(--border); background: rgba(15,23,42,0.88);
        }
        .pt-cell.metal { background: rgba(56,189,248,0.08); border-color: rgba(56,189,248,0.3); }
        .pt-cell.nonmetal { background: rgba(16,185,129,0.09); border-color: rgba(16,185,129,0.34); }
        .pt-cell.noble { background: rgba(168,85,247,0.11); border-color: rgba(168,85,247,0.36); }
        .pt-cell:hover { transform: scale(1.13); z-index: 4; border-color: var(--cyan); box-shadow: 0 4px 14px rgba(0,242,254,0.35); }
        .pt-cell.active { background: rgba(56,189,248,0.3) !important; border: 2px solid var(--cyan) !important; box-shadow: 0 0 14px rgba(0,242,254,0.5); }
        .c-z { font-family: var(--mono); font-size: 0.56rem; color: var(--muted); align-self: flex-start; line-height: 1; }
        .c-sym { font-family: var(--display); font-size: 0.9rem; font-weight: 700; line-height: 1; }
        .c-m { font-family: var(--mono); font-size: 0.48rem; color: var(--muted); line-height: 1; }
        .pt-holder {
            background: rgba(56,189,248,0.07); border: 1px dashed rgba(56,189,248,0.45);
            border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center;
            font-family: var(--mono); font-size: 0.56rem; color: var(--cyan); text-align: center;
        }
        .pt-row-label {
            font-family: var(--mono); font-size: 0.7rem; font-weight: 700; color: var(--cyan);
            display: flex; align-items: center; justify-content: flex-end; padding-right: 10px;
            background: rgba(15,23,42,0.65); border: 1px solid rgba(56,189,248,0.25); border-radius: 6px;
        }
        @media (max-width: 1040px) { .main-grid { grid-template-columns: 1fr; } .kpi-row { grid-template-columns: 1fr 1fr; } }