/* «23 пари» · хімічні схеми: структурні формули, 3D-моделі молекул, ланцюжки амінокислот, рівняння реакцій */
.ch-bar { display: flex; }
.ch-mode { width: min(100%, 250px); margin-bottom: 12px; }
.ch-mode button b { font-size: 13px; }
.ch-hint { margin: 10px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.ch-flow { display: flex; gap: 10px; align-items: stretch; }
.ch.col .ch-flow { flex-direction: column; }
.ch-set { display: flex; flex: 1 1 auto; min-width: 0; gap: 10px; align-items: stretch; justify-content: center; }
.ch.col .ch-set { flex-wrap: wrap; }

.ch-mol { position: relative; flex: 1 1 var(--fb, 140px); min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 9px 8px 9px; border-radius: 8px; text-align: center;
  background: linear-gradient(180deg, #FFFFFF, #F1F8FC); border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 #fff, 0 2px 0 rgba(11, 37, 50, .1), 0 10px 20px rgba(11, 37, 50, .08); transition: box-shadow .2s, border-color .2s, transform .15s; }
.ch-mol.can { cursor: pointer; }
.ch-mol.can:hover { transform: translateY(-1px); border-color: var(--sky-300); }
.ch-mol.can:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.ch-mol.on { border-color: var(--peach-500); box-shadow: 0 0 0 2px rgba(255, 157, 69, .35), 0 2px 0 rgba(11, 37, 50, .1), 0 12px 24px rgba(11, 37, 50, .12); }
.ch-stage { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.viz-stage .ch-stage svg.ch-2d { max-width: 100%; max-height: 100%; width: auto; height: auto; overflow: visible; }
.ch-stage.is3 { touch-action: pan-y; cursor: grab; }
.ch-stage.is3:active { cursor: grabbing; }
.ch-name { margin-top: 7px; font-family: var(--font-body); font-weight: 800; font-size: 13px; line-height: 1.25; color: var(--navy-900); overflow-wrap: anywhere; }
.ch-meta { margin-top: 3px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.ch-meta span { white-space: nowrap; }
.ch-meta sub, .ch-meta sup, .ch-f sub, .ch-f sup { font-size: .72em; line-height: 0; }
.ch-no3 { position: absolute; right: 2px; top: 0; padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, .9); font-size: 10.5px; color: var(--muted); }

/* структурна формула */
.ch-2d .ch-bonds line { stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; }
.ch-2d .ch-bonds .hs { stroke-width: 1.2; }
.ch-2d .ch-bonds .wd { fill: var(--ink); }
.ch-2d text { font-family: var(--font-body); font-weight: 700; font-size: 13px; text-anchor: middle; }
.ch-2d text.s { font-size: 9px; }
.ce-C, .ce-H { fill: var(--ink); }
.ce-O { fill: #D4452C; }
.ce-N { fill: #1E658C; }
.ce-S { fill: #A9790A; }
.ce-P { fill: #C8611A; }
.ce-I { fill: #7440B8; }
.ch-glow circle { fill: rgba(255, 157, 69, .4); }
.ch-glow line { stroke: rgba(255, 157, 69, .4); stroke-width: 13; stroke-linecap: round; }
.ch-glow { animation: chPulse 2.6s ease-in-out infinite; }
@keyframes chPulse { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }

/* 3D-модель */
.ch-3d { display: block; }
.ch-3d .bd { stroke: #8FA6B3; stroke-linecap: round; }
.ch-3d .at { stroke: rgba(11, 37, 50, .3); stroke-width: .6; }
.ch-3d .at.on { stroke: var(--peach-500); stroke-width: 2.4; }

/* стрілка з ферментом */
.ch-arr { flex: 0 0 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; }
.ch-arr em { font-style: normal; font-family: var(--font-body); font-weight: 800; font-size: 12.5px; line-height: 1.25; color: var(--link); overflow-wrap: anywhere; }
.ch.col .ch-arr em { font-size: 13.5px; }
.ch-arr small { font-size: 11px; line-height: 1.3; color: var(--ink-2); }
.ch-arr i { position: relative; width: 100%; height: 12px; }
.ch-arr i::before { content: ""; position: absolute; left: 4px; right: 10px; top: 4.8px; height: 2.4px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--navy-800) 0 7px, transparent 7px 11px); animation: chFlow 1.1s linear infinite; }
.ch-arr i::after { content: ""; position: absolute; right: 1px; top: 0; border-left: 9px solid var(--navy-800); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
@keyframes chFlow { to { background-position: 11px 0; } }
.ch.col .ch-arr { flex: 0 0 auto; display: grid; grid-template-columns: 12px auto; column-gap: 12px; row-gap: 2px; justify-content: center; align-items: center; text-align: left; padding: 2px 0; }
.ch.col .ch-arr i { grid-column: 1; grid-row: 1 / span 2; width: 12px; height: 40px; }
.ch.col .ch-arr em { grid-column: 2; align-self: end; }
.ch.col .ch-arr small { grid-column: 2; align-self: start; }
.ch.col .ch-arr i::before { left: 4.8px; right: auto; top: 2px; bottom: 9px; width: 2.4px; height: auto; background: repeating-linear-gradient(180deg, var(--navy-800) 0 7px, transparent 7px 11px); animation-name: chFlowY; }
.ch.col .ch-arr i::after { right: auto; left: 0; top: auto; bottom: 0; border-top: 9px solid var(--navy-800); border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 0; }
@keyframes chFlowY { to { background-position: 0 11px; } }
.ch-plus { flex: 0 0 auto; align-self: center; font-family: var(--font-head); font-size: 20px; font-weight: 500; color: var(--muted); }

/* ланцюжок амінокислот і послідовність ДНК */
.ch-stage.ch-pep, .ch-stage.ch-seq, .ch-stage.ch-ico { min-height: 78px; flex-wrap: wrap; gap: 5px 4px; padding: 8px 0; align-content: center; }
.ch-pep .aa { display: inline-grid; place-items: center; min-width: 37px; height: 30px; padding: 0 5px; border-radius: 15px; font-family: var(--font-body); font-size: 11.5px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #5FB4CC, #1E658C); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 2px 0 #0F3A52; }
.ch-pep .aa.on { color: #3A1A02; background: linear-gradient(180deg, #FFC998, #EE8A3A); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 2px 0 #A54A12; }
.ch-pep .cut { width: 2px; height: 36px; margin: 0 3px; background: repeating-linear-gradient(180deg, var(--peach-700) 0 4px, transparent 4px 7px); }
.ch-pep u, .ch-seq u { text-decoration: none; font-size: 11px; font-weight: 700; color: var(--muted); }
.ch-seq .nt { display: inline-grid; place-items: center; width: 21px; height: 28px; border-radius: 4px; font-family: var(--font-body); font-size: 13px; font-weight: 800; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 2px 0 rgba(11, 37, 50, .35); }
.ch-seq i { width: 6px; }
.nt-T { background: linear-gradient(180deg, #F59A52, #C2621F); }
.nt-A { background: linear-gradient(180deg, #7CC68F, #2F7D48); }
.nt-G { background: linear-gradient(180deg, #5FB4CC, #1E658C); }
.nt-C { background: linear-gradient(180deg, #B49AE6, #6B45B5); }

/* пояснення, рівняння, легенда атомів */
.ch-note { margin-top: 12px; padding: 11px 14px; border-radius: 8px; background: var(--ice); border-left: 3px solid var(--peach-500); font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.ch-note:empty { display: none; }
.ch-note > b { margin-right: 8px; font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--navy-900); }
.ch-f { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ch-note p { margin-top: 4px; }
.ch-src { display: inline-block; margin-top: 5px; font-size: 12px; color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.ch-eq { margin-top: 8px; padding: 10px 14px 11px; border-radius: 8px; background: linear-gradient(180deg, #133547, #0B2532); color: #EAF6FB; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 2px 0 #071A24; }
.ch-eq span { display: block; margin-bottom: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9CC3D6; }
.ch-eq p { font-size: 13.5px; font-weight: 600; line-height: 1.6; }
.ch-el { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.ch-el span { color: var(--muted); }
.ch-el i { display: inline-flex; align-items: center; gap: 4px; font-style: normal; }
.ch-el b { font-weight: 700; color: var(--navy-900); }

@media (prefers-reduced-motion: reduce) {
  .ch-glow, .ch-arr i::before { animation: none; }
}

/* розділ для тих, кому цікаві формули й рівняння */
.ch-more { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.ch-more summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--link); }
.ch-more summary:hover { text-decoration: underline; }
.ch-more ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.ch-more li b { font-weight: 700; color: var(--navy-900); }
.ch-more .ch-src { margin: 0 0 0 4px; }

/* брутто-формула під назвою молекули */
.ch-form { margin-top: 3px; font-size: 11.5px; line-height: 1.3; color: var(--muted); white-space: nowrap; }
.ch-form sub, .ch-form sup { font-size: .72em; line-height: 0; }
