/* ==========================================================================
   Doberman Comments — общие токены и базовые элементы
   Наследует переменные темы (--bg --tx --mu --ln --ac --inv --inv-tx --ease),
   поэтому светлая/тёмная тема переключается вместе с сайтом.
   Если темы с такими переменными нет — работают нейтральные значения по умолчанию.
   Внешних шрифтов и сторонних запросов нет: шрифт наследуется от темы.
   ========================================================================== */

:is(#dc-comments, .dc-login-wrap, .dc-profile-wrap, .dcr-wrap) {
    --dc-bg:     var(--bg,     #fbfbfd);
    --dc-tx:     var(--tx,     #1d1d1f);
    --dc-mu:     var(--mu,     #6e6e73);
    --dc-ln:     var(--ln,     rgba(0, 0, 0, .09));
    --dc-ac:     var(--ac,     #0071e3);
    --dc-inv:    var(--inv,    #1d1d1f);
    --dc-inv-tx: var(--inv-tx, #f5f5f7);
    --dc-err:    #d70015;
    --dc-ok:     #248a3d;
    --dc-ease:   var(--ease, cubic-bezier(.2, .7, .1, 1));

    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.55;
    color: var(--dc-tx);
    -webkit-font-smoothing: antialiased;
}

/* Тёмная тема: токены темы подставятся сами; здесь — запасные значения и цвета статусов */
html[data-ab="dark"] :is(#dc-comments, .dc-login-wrap, .dc-profile-wrap, .dcr-wrap),
html.dark :is(#dc-comments, .dc-login-wrap, .dc-profile-wrap, .dcr-wrap),
html[data-theme="dark"] :is(#dc-comments, .dc-login-wrap, .dc-profile-wrap, .dcr-wrap) {
    --dc-bg:     var(--bg,     #232323);
    --dc-tx:     var(--tx,     #f5f5f7);
    --dc-mu:     var(--mu,     #a1a1a6);
    --dc-ln:     var(--ln,     rgba(255, 255, 255, .13));
    --dc-ac:     var(--ac,     #2997ff);
    --dc-inv:    var(--inv,    #f5f5f7);
    --dc-inv-tx: var(--inv-tx, #1d1d1f);
    --dc-err:    #ff6961;
    --dc-ok:     #30d158;
}
@media (prefers-color-scheme: dark) {
    html:not([data-ab]):not(.light):not([data-theme="light"]) :is(#dc-comments, .dc-login-wrap, .dc-profile-wrap, .dcr-wrap) {
        --dc-bg:     var(--bg,     #232323);
        --dc-tx:     var(--tx,     #f5f5f7);
        --dc-mu:     var(--mu,     #a1a1a6);
        --dc-ln:     var(--ln,     rgba(255, 255, 255, .13));
        --dc-ac:     var(--ac,     #2997ff);
        --dc-inv:    var(--inv,    #f5f5f7);
        --dc-inv-tx: var(--inv-tx, #1d1d1f);
        --dc-err:    #ff6961;
        --dc-ok:     #30d158;
    }
}

:is(#dc-comments, .dc-login-wrap, .dc-profile-wrap, .dcr-wrap) *,
:is(#dc-comments, .dc-login-wrap, .dc-profile-wrap, .dcr-wrap) *::before,
:is(#dc-comments, .dc-login-wrap, .dc-profile-wrap, .dcr-wrap) *::after { box-sizing: border-box; }

/* Не даём стилям статьи (.ab-prose p {opacity: .88}, скругление картинок) просочиться внутрь.
   Отступы не сбрасываем здесь — их задают сами компоненты. */
:is(#dc-comments, .dc-login-wrap, .dc-profile-wrap) :is(p, li) { opacity: 1; }
:is(#dc-comments, .dc-login-wrap, .dc-profile-wrap) img { max-width: none; border-radius: 0; }
:where(#dc-comments, .dc-login-wrap, .dc-profile-wrap, .dcr-wrap) :where(p, h2, h3) { margin: 0; }

/* ── Кнопки ─────────────────────────────────────────────────────────── */
:is(.dc-btn, .dcl-btn, .dcp-btn) {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 40px; padding: 0 18px;
    border: 1px solid transparent; border-radius: 999px;
    background: none; color: var(--dc-tx);
    font: inherit; font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
    cursor: pointer; text-decoration: none;
    transition: background .25s, color .25s, border-color .25s, opacity .25s;
}
:is(.dc-btn, .dcl-btn, .dcp-btn):disabled { opacity: .4; cursor: not-allowed; }

:is(.dc-btn--primary, .dcl-btn--primary, .dcp-btn--primary) {
    background: var(--dc-inv); color: var(--dc-inv-tx); border-color: var(--dc-inv);
}
:is(.dc-btn--primary, .dcl-btn--primary, .dcp-btn--primary):not(:disabled):hover { opacity: .82; }

:is(.dc-btn--ghost, .dcl-btn--ghost, .dcp-btn--ghost) { border-color: var(--dc-ln); }
:is(.dc-btn--ghost, .dcl-btn--ghost, .dcp-btn--ghost):not(:disabled):hover { background: var(--dc-ln); }

:is(.dc-btn--link, .dcl-btn--link) {
    height: auto; padding: 0; border: 0; border-radius: 2px;
    color: var(--dc-mu); font-size: 13px;
    text-decoration: underline; text-decoration-color: var(--dc-ln); text-underline-offset: 3px;
}
:is(.dc-btn--link, .dcl-btn--link):hover { color: var(--dc-tx); text-decoration-color: currentColor; }

.dcp-btn--danger { border-color: var(--dc-ln); color: var(--dc-err); }
.dcp-btn--danger:not(:disabled):hover { border-color: var(--dc-err); }

:is(.dc-btn--sm) { height: 32px; padding: 0 14px; font-size: 13px; }

:is(.dc-btn, .dcl-btn, .dcp-btn, .dc-input, .dcl-input, .dcp-input, .dc-profile-link):focus-visible,
:is(#dc-comments, .dc-login-wrap, .dc-profile-wrap) a:focus-visible {
    outline: 2px solid var(--dc-ac); outline-offset: 2px;
}

/* ── Поля ───────────────────────────────────────────────────────────── */
:is(.dc-input, .dcl-input, .dcp-input) {
    display: block; width: 100%; height: 44px; margin: 0; padding: 0 16px;
    border: 1px solid var(--dc-ln); border-radius: 14px;
    background: transparent; color: var(--dc-tx);
    font: inherit; font-size: 15px; line-height: 1.4;
    box-shadow: none; -webkit-appearance: none; appearance: none;
    transition: border-color .25s, box-shadow .25s;
}
:is(.dc-input, .dcl-input, .dcp-input)::placeholder { color: var(--dc-mu); opacity: .8; }
:is(.dc-input, .dcl-input, .dcp-input):focus {
    outline: none; border-color: var(--dc-ac);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dc-ac) 22%, transparent);
}
.dc-input--textarea { height: auto; min-height: 104px; padding: 12px 16px; resize: vertical; }
.dc-input--reply    { min-height: 72px; }
:is(.dc-input--code, .dcl-input--code) { letter-spacing: .28em; text-transform: uppercase; font-variant-numeric: tabular-nums; }

/* ── Сообщения ──────────────────────────────────────────────────────── */
/* (префикс-контейнер нужен, чтобы перебить правило темы `.ab-body p { margin: 0 }`) */
:is(#dc-comments, .dc-login-wrap, .dc-profile-wrap) :is(.dc-auth__msg, .dcl-msg, .dcp-msg, .dc-notice) { min-height: 1.4em; margin: 10px 0 0; font-size: 13px; color: var(--dc-mu); }
:is(#dc-comments, .dc-login-wrap, .dc-profile-wrap) :is(.dc-auth__msg, .dcl-msg, .dcp-msg, .dc-notice).is-error { color: var(--dc-err); }
:is(#dc-comments, .dc-login-wrap, .dc-profile-wrap) :is(.dc-auth__msg, .dcl-msg, .dcp-msg, .dc-notice).is-ok    { color: var(--dc-ok); }

/* ── Согласие ───────────────────────────────────────────────────────── */
:is(.dc-auth__agree, .dcl-agree) {
    display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 0;
    font-size: 13px; line-height: 1.5; color: var(--dc-mu); cursor: pointer;
}
:is(.dc-auth__agree-check, .dcl-agree__checkbox) {
    flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--dc-inv); cursor: pointer;
}
:is(.dc-auth__agree, .dcl-agree) a,
:is(.dc-auth__privacy, .dcl-privacy) a {
    color: var(--dc-tx); text-decoration: underline; text-decoration-color: var(--dc-ln); text-underline-offset: 3px;
}
:is(.dc-auth__agree, .dcl-agree) a:hover,
:is(.dc-auth__privacy, .dcl-privacy) a:hover { text-decoration-color: currentColor; }
:is(#dc-comments, .dc-login-wrap) :is(.dc-auth__privacy, .dcl-privacy) { margin: 14px 0 0; font-size: 12px; line-height: 1.55; color: var(--dc-mu); }

/* ── Аватар: буква на нейтральной подложке ─────────────────────────── */
:is(.dc-avatar, .dcl-avatar, .dcp-avatar) {
    display: inline-grid; place-items: center; flex: none;
    width: var(--s, 36px); height: var(--s, 36px); border-radius: 50%;
    background: var(--dc-ln); color: var(--dc-tx);
    font-size: calc(var(--s, 36px) * .42); font-weight: 600; line-height: 1; text-transform: uppercase; user-select: none;
}

.dc-visually-hidden {
    position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    :is(#dc-comments, .dc-login-wrap, .dc-profile-wrap, .dcr-wrap) * { transition: none !important; animation-duration: .01ms !important; }
}

/* Кнопки/блоки с display из этого файла не должны игнорировать атрибут hidden */
:is(#dc-comments, .dc-login-wrap, .dc-profile-wrap) [hidden] { display: none !important; }
