:root {
            --primary-color: #2c7da0;
            --secondary-color: #a9d6e5;
            --accent-color: #01497c;
            --chemistry-color: #6a994e;
            --calculation-color: #e63946;
            --light-gray: #f8f9fa;
            --border-color: #eaeaea;
            --text-color: #333;
            --text-muted: #6c757d;
        }
         .page-header {
            background: linear-gradient(135deg, rgba(169, 214, 229, 0.4) 0%, rgba(44, 125, 160, 0.4) 100%);
            padding: 1.5rem 0;
            margin-bottom: 2rem;
            border-bottom: 1px solid rgba(44, 125, 160, 0.2);
            position: relative;
            overflow: hidden;   color: var(--text-color);
        }
        .breadcrumb {
            background-color: transparent;
            padding: 0.5rem 0;
            margin-bottom: 0.5rem;
        }
        .breadcrumb-item a {
            color: var(--text-muted);
            text-decoration: none;
        }
        .breadcrumb-item.active {
            color: var(--text-color);
        }
        .chemistry-formula {
            font-family: 'Cambria', 'Times New Roman', serif;
            font-size: 1.3rem;
            background-color: rgba(106, 153, 78, 0.1);
            padding: 0.5rem 1rem;
            border-radius: 6px;
            border-left: 4px solid var(--chemistry-color);
            display: inline-block;
        }
        .element-box {
            display: inline-block;
            padding: 0.2rem 0.5rem;
            margin: 0 2px;
            background-color: rgba(44, 125, 160, 0.1);
            border-radius: 4px;
            font-weight: 600;
        }
        .subscript {
            font-size: 0.8em;
            vertical-align: sub;
        }
        .superscript {
            font-size: 0.8em;
            vertical-align: super;
        }
        .form-control:focus {
            border-color: var(--chemistry-color);
            box-shadow: 0 0 0 3px rgba(106, 153, 78, 0.15);
        }
        .weight-result {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--chemistry-color);
            text-align: center;
            margin: 1rem 0;
        }
        .unit-label {
            font-size: 1rem;
            color: var(--text-muted);
            margin-left: 0.5rem;
        }
        .calculation-step {
            margin-bottom: 1.5rem;
            padding-bottom: 1.5rem;
            border-bottom: 1px dashed var(--border-color);
        }
        .element-table {
            width: 100%;
            border-collapse: collapse;
            margin: 1.5rem 0;
        }
        .element-table th, .element-table td {
            padding: 0.75rem;
            text-align: left;
            border: 1px solid var(--border-color);
        }
        .element-table th {
            background-color: var(--light-gray);
            font-weight: 600;
        }
        .element-table tr:nth-child(even) {
            background-color: rgba(44, 125, 160, 0.05);
        }
        .element-table .element-symbol {
            font-weight: 700;
            color: var(--chemistry-color);
        }
        .chemical-examples {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin: 1rem 0;
        }
        .example-btn {
            background-color: rgba(106, 153, 78, 0.1);
            border: 1px solid rgba(106, 153, 78, 0.2);
            border-radius: 4px;
            padding: 0.5rem 0.75rem;
            font-size: 0.9rem;
            color: var(--chemistry-color);
            cursor: pointer;
            transition: all 0.2s;
        }
        .example-btn:hover {
            background-color: rgba(106, 153, 78, 0.2);
            transform: translateY(-2px);
        }
        .periodic-preview {
            display: grid;
            grid-template-columns: repeat(18, 1fr);
            gap: 2px;
            margin: 1.5rem 0;
            background-color: #f1f1f1;
            padding: 10px;
            border-radius: 6px;
        }
        .periodic-element {
            background-color: white;
            border: 1px solid #ddd;
            border-radius: 3px;
            padding: 4px 2px;
            text-align: center;
            font-size: 0.7rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .periodic-element:hover {
            transform: scale(1.1);
            z-index: 10;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }
        .element-symbol {
            font-weight: 700;
            font-size: 0.8rem;
        }
        .element-number {
            font-size: 0.6rem;
            color: var(--text-muted);
        }
        .alkali-metal {
            background-color: #f8d7da;
            border-color: #f5c2c7;
        }
        .alkaline-earth-metal {
            background-color: #fff3cd;
            border-color: #ffecb5;
        }
        .transition-metal {
            background-color: #d1ecf1;
            border-color: #bee5eb;
        }
        .post-transition-metal {
            background-color: #d4edda;
            border-color: #c3e6cb;
        }
        .metalloid {
            background-color: #e2d9f3;
            border-color: #d6c8f0;
        }
        .nonmetal {
            background-color: #f8d7da;
            border-color: #f5c2c7;
        }
        .halogen {
            background-color: #cce5ff;
            border-color: #b3d9ff;
        }
        .noble-gas {
            background-color: #f8f9fa;
            border-color: #e9ecef;
        }
        .lanthanide, .actinide {
            background-color: #e9ecef;
            border-color: #dee2e6;
        }
        .chemistry-box {
            background-color: rgba(106, 153, 78, 0.05);
            border-left: 3px solid var(--chemistry-color);
            padding: 1rem;
            border-radius: 0 4px 4px 0;
            margin: 1.5rem 0;
        }
        @media (max-width: 768px) {
            .periodic-preview {
                grid-template-columns: repeat(9, 1fr);
                overflow-x: auto;
            }
        }
        .formula-display {
            font-size: 1.5rem;
            padding: 1rem;
            text-align: center;
            background-color: white;
            border-radius: 6px;
            border: 1px solid #eee;
            margin: 1rem 0;
        }
        .formula-builder {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin: 1rem 0;
            padding: 1rem;
            background-color: #f8f9fa;
            border-radius: 6px;
        }
        .formula-part {
            display: flex;
            align-items: center;
        }
        .formula-input {
            width: 80px;
            text-align: center;
        }
        .formula-count {
            width: 60px;
        }
        .isotope-selector {
            display: none;
            position: absolute;
            background: white;
            border: 1px solid #ddd;
            border-radius: 6px;
            padding: 1rem;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            z-index: 1000;
        }
        .isotope-option {
            padding: 0.5rem;
            cursor: pointer;
            border-radius: 4px;
        }
        .isotope-option:hover {
            background-color: #f0f0f0;
        }
        .valid-formula {
            border-color: #28a745 !important;
        }
        .invalid-formula {
            border-color: #dc3545 !important;
        }
        .compound-selector {
            margin-bottom: 1rem;
        }
        .compound-select {
            font-size: 0.95rem;
        }
        .compound-info {
            font-size: 0.85rem;
            color: #6c757d;
            margin-top: 0.25rem;
        }
        .nested-example {
            background-color: rgba(106, 153, 78, 0.08);
            border-radius: 6px;
            padding: 0.75rem;
            margin: 0.75rem 0;
            border-left: 3px solid var(--chemistry-color);
        }
        .nested-example-title {
            font-weight: 600;
            color: var(--chemistry-color);
            margin-bottom: 0.5rem;
        }
        .stack-visualization {
            background-color: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 6px;
            padding: 1rem;
            margin: 1rem 0;
            font-family: 'Courier New', monospace;
            font-size: 0.9rem;
        }
        .stack-step {
            margin-bottom: 0.5rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px dashed #dee2e6;
        }
        .stack-step:last-child {
            border-bottom: none;
        }
        .stack-label {
            font-weight: 600;
            color: #2c7da0;
        }
        .hydration-note {
            background-color: rgba(44, 125, 160, 0.08);
            border-radius: 6px;
            padding: 0.75rem;
            margin: 0.75rem 0;
            border-left: 3px solid var(--primary-color);
        }