/* Кнопка «Скопіювати» в блоках коду (js/reference-code-copy.js): повні статті довідника й блоки коду уроку.
   Іконка — у правому верхньому куті блока, поза областю горизонтальної прокрутки. */
.reference-code { position: relative; min-width: 0; max-width: 100%; margin: 1rem 0; }
.reference-code__actions { position: absolute; z-index: 1; top: 9px; right: 9px; }
.reference-code__copy { display: grid; place-items: center; width: 30px; height: 30px; padding: 5px; border: 0; border-radius: 5px; background: transparent; color: var(--code-text); cursor: pointer; }
.reference-code__copy svg { width: 17px; height: 17px; }
.reference-code__copy:hover { color: var(--accent); background: var(--code-bg); }
.reference-code__copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.reference-code__copy:disabled { cursor: wait; opacity: .7; }
.reference-code__check-glyph, .reference-code__copy[data-state="copied"] .reference-code__copy-glyph { display: none; }
.reference-code__copy[data-state="copied"] .reference-code__check-glyph { display: inline; }
.reference-code__copy[data-state="copied"] { color: var(--accent); }
.reference-code__status { position: absolute; right: 0; bottom: calc(100% + 6px); width: max-content; max-width: min(320px, calc(100vw - 64px)); color: var(--code-text); background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 5px; padding: 5px 8px; font: 12px/1.4 var(--font-mono); }
.reference-code__status:empty { padding: 0; border: 0; }
.reference-code pre { margin: 0; padding-right: 58px; }
@media (pointer: coarse) {
    .reference-code__actions { top: 3px; right: 3px; }
    .reference-code__copy { width: 44px; height: 44px; }
}
@media (max-width: 420px) {
    .reference-code pre { padding-top: 50px; padding-right: 18px; }
}
