@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

.chemistry-theme {
    --bg-1: #140815;
    --bg-2: #241028;
    --bg-3: #47184a;
    --surface: rgba(28, 10, 30, 0.66);
    --surface-strong: rgba(37, 14, 40, 0.84);
    --border: rgba(255, 215, 236, 0.14);
    --accent: #ff8fce;
    --accent-2: #ffb8e4;
    --text: #fff2f8;
    --muted: rgba(255, 233, 244, 0.74);
    font-family: "IBM Plex Sans", "Space Grotesk", sans-serif;
}

.chemistry-home-card {
    background:
        radial-gradient(circle at 18% 16%, rgba(255, 143, 206, 0.12), transparent 34%),
        radial-gradient(circle at 82% 12%, rgba(255, 184, 228, 0.1), transparent 32%),
        var(--surface);
}

.chemistry-balancing-page .container {
    max-width: 1480px;
}

.chemistry-balancing-page .daily-progress-host::before {
    height: 390px;
}

.chemistry-page-head {
    text-align: center;
    margin-bottom: 18px;
}

.chemistry-page-title {
    margin: 0;
    color: var(--accent);
    font-size: clamp(36px, 5vw, 60px);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.chem-mode-links {
    margin-top: 6px;
}

.chem-legend {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}

.chem-legend-chip {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 20, 36, 0.42);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chem-legend-chip.is-common {
    color: #f3f1ea;
    border-color: rgba(243, 241, 234, 0.26);
}

.chem-legend-chip.is-rare {
    color: #ffe28f;
    border-color: rgba(255, 226, 143, 0.28);
}

.chem-legend-chip.is-mythic {
    color: #e2b5ff;
    border-color: rgba(226, 181, 255, 0.28);
}

.balancing-toolbar {
    margin-top: 2px;
}

.balancing-stats {
    margin-top: 10px;
    margin-bottom: 16px;
}

.balancing-stage {
    position: relative;
    display: grid;
    gap: 14px;
}

.balancing-card {
    position: relative;
    padding: 24px;
    border-radius: 28px;
    border: 1px solid rgba(226, 239, 255, 0.1);
    background:
        radial-gradient(circle at 84% 14%, rgba(255, 143, 206, 0.12), transparent 28%),
        radial-gradient(circle at 18% 100%, rgba(255, 184, 228, 0.08), transparent 32%),
        linear-gradient(160deg, rgba(40, 15, 44, 0.8), rgba(20, 8, 24, 0.66));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.balancing-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.balancing-badges {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.balancing-side-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 184, 228, 0.26);
    background: rgba(255, 184, 228, 0.1);
    color: rgba(255, 241, 248, 0.9);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.balancing-family {
    margin: 0;
    color: rgba(234, 244, 255, 0.58);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.balancing-title {
    margin: 6px 0 0;
    color: var(--text);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.08;
}

.rarity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.rarity-badge.is-common {
    color: #f3f1ea;
    background: rgba(243, 241, 234, 0.08);
    border-color: rgba(243, 241, 234, 0.2);
}

.rarity-badge.is-rare {
    color: #ffe289;
    background: rgba(255, 226, 137, 0.1);
    border-color: rgba(255, 226, 137, 0.24);
    box-shadow: 0 0 24px rgba(255, 200, 64, 0.08);
}

.rarity-badge.is-mythic {
    color: #e1b3ff;
    background: rgba(163, 110, 238, 0.14);
    border-color: rgba(163, 110, 238, 0.28);
    box-shadow: 0 0 28px rgba(163, 110, 238, 0.14);
}

.balancing-hover-note {
    margin: 14px 0 0;
    color: rgba(236, 247, 255, 0.76);
    font-size: 14px;
    line-height: 1.55;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 20, 36, 0.34);
}

.equation-workbench {
    margin-top: 18px;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
        rgba(8, 18, 30, 0.6);
}

.equation-board {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 14px;
}

.equation-side {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px;
}

.equation-side-products {
    align-items: stretch;
}

.equation-side-builder {
    gap: 12px;
}

.equation-arrow {
    color: rgba(255, 240, 203, 0.92);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    line-height: 1;
    padding: 0 6px;
}

.equation-plus {
    color: rgba(238, 246, 255, 0.48);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.chem-term {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 68px;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(7, 17, 29, 0.7);
}

.chem-term:hover,
.chem-term:focus-within {
    border-color: rgba(255, 143, 206, 0.28);
    box-shadow: 0 0 0 1px rgba(255, 143, 206, 0.08), 0 10px 20px rgba(0, 0, 0, 0.18);
}

.chem-term-product {
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    min-height: 112px;
    min-width: min(340px, 76vw);
}

.chem-entry-compound {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
        rgba(9, 20, 35, 0.78);
}

.chem-entry-coefficient-box {
    align-self: center;
    flex: 0 0 auto;
}

.chem-product-shell {
    display: grid;
    gap: 10px;
    min-width: min(260px, 72vw);
}

.chem-product-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.chem-product-label {
    color: rgba(255, 238, 246, 0.86);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.chem-add-compound-card {
    margin: 0;
    min-width: min(280px, 72vw);
    min-height: 148px;
    padding: 18px 20px;
    border-radius: 24px;
    border: 1px dashed rgba(255, 184, 228, 0.34);
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 184, 228, 0.14), transparent 44%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        rgba(10, 22, 38, 0.72);
    color: #fff3fa;
    display: grid;
    place-items: center;
    gap: 6px;
    text-align: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.chem-add-compound-card:hover {
    border-color: rgba(255, 204, 235, 0.54);
    box-shadow: 0 0 0 1px rgba(255, 176, 221, 0.12), 0 16px 30px rgba(31, 8, 26, 0.28);
}

.chem-add-compound-card.is-compact {
    min-width: min(220px, 64vw);
    min-height: 120px;
}

.chem-add-compound-plus {
    color: #ffd9ef;
    font-size: 48px;
    font-weight: 500;
    line-height: 1;
}

.chem-add-compound-copy {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.chem-add-compound-note {
    color: rgba(255, 229, 241, 0.68);
    font-size: 12px;
    line-height: 1.4;
}

.chem-product-mode-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.chem-product-mode-chip.is-guided {
    color: #ffe9f6;
    background: rgba(255, 184, 228, 0.12);
    border-color: rgba(255, 184, 228, 0.3);
}

.chem-product-mode-chip.is-build {
    color: #ffd88d;
    background: rgba(255, 216, 141, 0.1);
    border-color: rgba(255, 216, 141, 0.28);
}

.chem-product-builder {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
}

.chem-builder-part {
    display: inline-flex;
    align-items: flex-end;
    gap: 4px;
}

.chem-element-input,
.chem-part-subscript-input {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(12, 26, 44, 0.92);
    color: #fff6fa;
    text-align: center;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.chem-element-input {
    width: 52px;
    min-width: 52px;
    height: 42px;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 700;
}

.chem-part-subscript-input {
    width: 32px;
    min-width: 32px;
    height: 26px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    transform: translateY(8px);
}

.chem-element-input:focus,
.chem-part-subscript-input:focus {
    border-color: rgba(255, 143, 206, 0.42);
    box-shadow: 0 0 0 1px rgba(255, 143, 206, 0.14), 0 0 18px rgba(255, 143, 206, 0.08);
}

.chem-product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.chem-product-preview {
    color: rgba(255, 233, 244, 0.7);
    font-size: 13px;
    line-height: 1.4;
}

.chem-product-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chem-mini-button {
    margin: 0;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 184, 228, 0.26);
    background: rgba(255, 184, 228, 0.12);
    color: #fff0f8;
    font-size: 12px;
    font-weight: 700;
}

.chem-mini-button.is-muted {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.chem-mini-button:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
}

.chem-coefficient-box {
    width: 52px;
    min-width: 52px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 26, 44, 0.88);
    color: #f8fbff;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.chem-coefficient-box:focus {
    border-color: rgba(255, 143, 206, 0.5);
    box-shadow: 0 0 0 1px rgba(255, 143, 206, 0.18), 0 0 22px rgba(255, 143, 206, 0.12);
}

.chem-formula-button {
    position: relative;
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    margin: 0;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    cursor: help;
    font: inherit;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.chem-formula-button:hover,
.chem-formula-button:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.chem-formula {
    display: inline-flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1px;
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 700;
    line-height: 1;
}

.chem-token-element {
    display: inline-flex;
    align-items: flex-end;
    line-height: 1;
}

.chem-token-element.is-h {
    color: #ffe3cf;
}

.chem-token-element.is-o {
    color: #95d3ff;
}

.chem-token-element.is-c {
    color: #97f0dd;
}

.chem-token-element.is-n {
    color: #cfb8ff;
}

.chem-token-element.is-cl {
    color: #ffe78d;
}

.chem-token-element.is-na,
.chem-token-element.is-k,
.chem-token-element.is-ca,
.chem-token-element.is-mg {
    color: #b9ffcf;
}

.chem-token-element.is-fe,
.chem-token-element.is-mn,
.chem-token-element.is-pb,
.chem-token-element.is-al,
.chem-token-element.is-ag,
.chem-token-element.is-ba,
.chem-token-element.is-si,
.chem-token-element.is-p {
    color: #ffd6a2;
}

.chem-token-paren {
    color: rgba(238, 246, 255, 0.76);
}

.chem-script-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 3px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: #f4fbff;
    font-size: 11px;
    font-weight: 700;
}

.chem-script-box.is-sub {
    transform: translateY(9px);
}

.chem-script-box.is-super {
    transform: translateY(-11px);
}

.chem-script-input {
    width: 24px;
    height: 22px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(12, 26, 44, 0.92);
    color: #f8fbff;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
}

.chem-script-input.is-sub {
    transform: translateY(9px);
}

.chem-formula-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    width: min(280px, calc(100vw - 48px));
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(180deg, rgba(8, 19, 34, 0.98), rgba(6, 14, 26, 0.96)),
        rgba(7, 16, 28, 0.96);
    color: #eef8ff;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity 180ms ease, transform 180ms ease;
    z-index: 8;
}

.chem-formula-button:hover .chem-formula-tooltip,
.chem-formula-button:focus-visible .chem-formula-tooltip,
.chem-formula-button:focus-within .chem-formula-tooltip {
    opacity: 1;
    transform: translate(-50%, 0);
}

.chem-formula-tooltip h3 {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 14px;
}

.chem-formula-tooltip p {
    margin: 0;
    color: rgba(236, 247, 255, 0.76);
    font-size: 12px;
    line-height: 1.5;
}

.atom-board {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.atom-board-placeholder {
    grid-template-columns: 1fr;
}

.atom-chip {
    padding: 12px 12px 11px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 18, 30, 0.64);
    display: grid;
    gap: 8px;
}

.atom-chip.is-balanced {
    border-color: rgba(111, 227, 147, 0.22);
    box-shadow: 0 0 0 1px rgba(111, 227, 147, 0.06);
}

.atom-chip.is-unbalanced {
    border-color: rgba(255, 135, 135, 0.22);
}

.atom-chip-placeholder {
    min-height: 90px;
}

.atom-chip-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.atom-chip-head strong {
    color: #f5fbff;
    font-size: 16px;
}

.atom-chip-head span {
    color: rgba(236, 247, 255, 0.58);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.atom-chip.is-balanced .atom-chip-head span {
    color: rgba(167, 255, 187, 0.76);
}

.atom-chip.is-unbalanced .atom-chip-head span {
    color: rgba(255, 191, 191, 0.84);
}

.atom-chip-values {
    display: flex;
    gap: 10px;
}

.atom-chip-values p {
    margin: 0;
    display: grid;
    gap: 2px;
}

.atom-chip-values span {
    color: rgba(236, 247, 255, 0.58);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.atom-chip-values strong {
    color: #f4fbff;
    font-size: 22px;
    line-height: 1;
}

.atom-chip-placeholder-copy {
    margin: 0;
    color: rgba(255, 233, 244, 0.72);
    font-size: 14px;
    line-height: 1.5;
}

.balancing-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.balancing-card-actions button {
    margin: 0;
}

#open-reaction-sheet {
    color: #fff4fb;
    background: linear-gradient(135deg, rgba(255, 130, 198, 0.28), rgba(255, 186, 230, 0.22));
    border: 2px solid rgba(255, 192, 229, 0.6);
    box-shadow: 0 0 0 1px rgba(255, 145, 206, 0.18), 0 14px 26px rgba(61, 9, 46, 0.26);
}

#open-reaction-sheet:hover {
    border-color: rgba(255, 213, 238, 0.82);
    box-shadow: 0 0 0 1px rgba(255, 176, 221, 0.26), 0 18px 34px rgba(78, 10, 58, 0.34);
}

.balancing-status {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    flex: 1 1 320px;
    align-self: center;
}

.solution-panel {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(7, 18, 32, 0.56);
}

.solution-panel[hidden] {
    display: none;
}

.solution-panel h3 {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 18px;
}

.solution-panel p,
.solution-panel li {
    color: rgba(237, 247, 255, 0.76);
}

.solution-panel ul {
    margin: 0;
    padding-left: 20px;
}

.balancing-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.balancing-progress-pill {
    min-width: 140px;
    text-align: center;
    color: rgba(238, 246, 255, 0.72);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 18, 32, 0.52);
}

.balancing-nav {
    display: flex;
    gap: 10px;
}

.balancing-nav button {
    margin: 0;
}

.balancing-empty {
    padding: 28px;
    border-radius: 24px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    color: var(--muted);
    text-align: center;
    background: rgba(8, 18, 30, 0.48);
}

.balancing-card.is-correct {
    border-color: rgba(111, 227, 147, 0.24);
    box-shadow: 0 0 0 1px rgba(111, 227, 147, 0.06), 0 18px 50px rgba(0, 0, 0, 0.22);
}

.balancing-card.is-incorrect {
    border-color: rgba(255, 135, 135, 0.2);
}

.balancing-card.flash-green {
    animation: balancing-correct-pulse 950ms ease-out;
}

.balancing-card.flash-green::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 50% 50%, rgba(71, 215, 150, 0.34), transparent 56%),
        linear-gradient(135deg, rgba(71, 215, 150, 0.18), transparent 64%);
    opacity: 0;
    pointer-events: none;
    animation: balancing-correct-shader 950ms ease-out forwards;
}

@keyframes balancing-correct-shader {
    0% {
        opacity: 0;
    }
    12% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
    }
}

@keyframes balancing-correct-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(71, 215, 150, 0.48), 0 18px 50px rgba(0, 0, 0, 0.22);
    }
    42% {
        box-shadow: 0 0 0 10px rgba(71, 215, 150, 0), 0 18px 50px rgba(0, 0, 0, 0.22);
    }
    100% {
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    }
}

.chemistry-balancing-page.is-reaction-sheet-open {
    overflow: hidden;
}

.reaction-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px;
}

.reaction-sheet-overlay[hidden] {
    display: none;
}

.reaction-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 8, 16, 0.56);
    backdrop-filter: blur(8px);
}

.reaction-sheet-window {
    position: relative;
    z-index: 1;
    width: min(980px, calc(100vw - 48px));
    min-width: 560px;
    max-width: calc(100vw - 48px);
    height: min(78vh, 760px);
    min-height: 380px;
    max-height: calc(100vh - 48px);
    resize: both;
    overflow: auto;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        radial-gradient(circle at top right, rgba(255, 184, 228, 0.14), transparent 28%),
        radial-gradient(circle at top left, rgba(255, 143, 206, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(42, 14, 40, 0.98), rgba(20, 8, 24, 0.96));
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.44);
}

.reaction-sheet-window-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(7, 16, 28, 0.94);
    backdrop-filter: blur(10px);
}

.reaction-sheet-eyebrow {
    margin: 0 0 4px;
    color: rgba(237, 247, 255, 0.54);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.reaction-sheet-window-head h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(24px, 2.6vw, 34px);
    line-height: 1.04;
}

.reaction-sheet-window-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.reaction-sheet-window-button {
    margin: 0;
    min-height: 40px;
    padding: 0 16px;
    font-size: 14px;
}

.reaction-sheet-window-body {
    padding: 18px 20px 20px;
}

.reaction-sheet-grid {
    display: grid;
    gap: 12px;
}

.reaction-sheet-row {
    display: grid;
    grid-template-columns: minmax(280px, 1.35fr) repeat(2, minmax(180px, 1fr));
    gap: 14px;
    align-items: start;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(8, 18, 30, 0.74);
}

.reaction-sheet-row.is-acid {
    border-color: rgba(255, 192, 120, 0.22);
    background: linear-gradient(135deg, rgba(255, 168, 84, 0.1), rgba(8, 18, 30, 0.74));
}

.reaction-sheet-row.is-gas {
    border-color: rgba(148, 222, 255, 0.24);
    background: linear-gradient(135deg, rgba(109, 198, 255, 0.1), rgba(8, 18, 30, 0.74));
}

.reaction-sheet-row.is-ionic,
.reaction-sheet-row.is-precipitation {
    border-color: rgba(129, 219, 183, 0.22);
    background: linear-gradient(135deg, rgba(98, 224, 208, 0.08), rgba(8, 18, 30, 0.74));
}

.reaction-sheet-row.is-combustion {
    border-color: rgba(255, 198, 111, 0.3);
    background: linear-gradient(135deg, rgba(255, 163, 56, 0.13), rgba(8, 18, 30, 0.74));
}

.reaction-sheet-row.is-synthesis {
    border-color: rgba(207, 184, 255, 0.26);
    background: linear-gradient(135deg, rgba(161, 121, 255, 0.12), rgba(8, 18, 30, 0.74));
}

.reaction-sheet-row.is-decomposition {
    border-color: rgba(255, 168, 168, 0.26);
    background: linear-gradient(135deg, rgba(255, 132, 132, 0.1), rgba(8, 18, 30, 0.74));
}

.reaction-sheet-row.is-replacement {
    border-color: rgba(255, 226, 143, 0.28);
    background: linear-gradient(135deg, rgba(255, 226, 143, 0.1), rgba(8, 18, 30, 0.74));
}

.reaction-sheet-row.is-electro {
    border-color: rgba(108, 196, 255, 0.26);
    background: linear-gradient(135deg, rgba(102, 177, 255, 0.12), rgba(8, 18, 30, 0.74));
}

.reaction-sheet-row-main {
    display: grid;
    gap: 10px;
}

.reaction-sheet-row-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.reaction-sheet-family-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #f4fbff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.reaction-sheet-family-chip.is-acid {
    color: #ffd79f;
}

.reaction-sheet-family-chip.is-gas {
    color: #9adfff;
}

.reaction-sheet-family-chip.is-ionic,
.reaction-sheet-family-chip.is-precipitation {
    color: #aaf3d9;
}

.reaction-sheet-family-chip.is-combustion {
    color: #ffd88d;
}

.reaction-sheet-family-chip.is-synthesis {
    color: #dbbeff;
}

.reaction-sheet-family-chip.is-decomposition {
    color: #ffb7b7;
}

.reaction-sheet-family-chip.is-replacement {
    color: #ffe89a;
}

.reaction-sheet-family-chip.is-electro {
    color: #abd8ff;
}

.reaction-sheet-pattern,
.reaction-sheet-example {
    margin: 0;
    color: #f4fbff;
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    line-height: 1.55;
}

.reaction-sheet-pattern {
    font-size: 16px;
    font-weight: 700;
}

.reaction-sheet-example {
    color: rgba(237, 247, 255, 0.74);
    font-size: 13px;
}

.reaction-sheet-meta {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.reaction-sheet-meta span {
    color: rgba(237, 247, 255, 0.54);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.reaction-sheet-meta p {
    margin: 0;
    color: rgba(237, 247, 255, 0.82);
    font-size: 13px;
    line-height: 1.5;
}

.reaction-sheet-dock {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 55;
    margin: 0;
    min-height: 42px;
    padding: 0 16px;
    color: #fff4fb;
    background: linear-gradient(135deg, rgba(255, 136, 202, 0.92), rgba(255, 188, 231, 0.92));
    border: 2px solid rgba(255, 220, 240, 0.74);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

@media (max-width: 980px) {
    .chemistry-balancing-page .daily-progress-host::before {
        height: 0;
    }

    .reaction-sheet-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .equation-board {
        flex-direction: column;
    }

    .equation-arrow {
        transform: rotate(90deg);
    }

    .atom-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .balancing-card {
        padding: 20px 16px;
    }

    .chem-formula {
        font-size: 24px;
    }

    .chem-coefficient-box {
        width: 46px;
        min-width: 46px;
        height: 44px;
        font-size: 21px;
    }

    .chem-term-product {
        width: 100%;
        justify-content: flex-start;
        min-width: 0;
    }

    .chem-product-shell {
        min-width: 0;
        width: 100%;
    }

    .chem-add-compound-card,
    .chem-add-compound-card.is-compact {
        width: 100%;
        min-width: 0;
    }

    .chem-product-meta {
        align-items: stretch;
        flex-direction: column;
    }

    .balancing-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .balancing-nav {
        width: 100%;
    }

    .balancing-nav button {
        flex: 1 1 0;
    }

    .reaction-sheet-overlay {
        padding: 12px;
    }

    .reaction-sheet-window {
        min-width: 0;
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        min-height: 320px;
        height: min(82vh, 760px);
    }

    .reaction-sheet-window-head {
        flex-direction: column;
        align-items: stretch;
    }

    .reaction-sheet-window-actions {
        width: 100%;
    }

    .reaction-sheet-window-button {
        flex: 1 1 0;
    }
}
