/* Коментарі під новиною (js/comments.js). Підключається лише на сторінках новин ([aviable=showfull] у main.tpl). */
.svc { --svc-bubble: #F0F2F5; --svc-bubble-2: #E4E6EB; --svc-pend: #FFF6DA; --svc-pend-ink: #7A5B00; --svc-hl: rgba(204, 0, 0, .08);
  position: relative; background: var(--surface); border-radius: var(--radius); padding: 20px 16px 22px; scroll-margin-top: 80px; }
@media (min-width: 768px) { .svc { padding: 28px 48px 32px; } }
:root[data-theme="dark"] .svc { --svc-bubble: #2A2C30; --svc-bubble-2: #34363B; --svc-pend: #3A3018; --svc-pend-ink: #F2D27A; --svc-hl: rgba(255, 107, 102, .12); }
.svc[hidden] { display: none; }
.svc button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.svc__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 16px; border-bottom: 2px solid var(--line-2); padding-bottom: 12px; margin-bottom: 18px; }
.svc__head h2 { margin: 0; font-size: 24px; text-transform: uppercase; letter-spacing: .02em; }
.svc__n { color: var(--red-text); margin-left: 4px; }
.svc__sort { display: flex; gap: 4px; flex-wrap: wrap; }
.svc .svc__sort button { font-size: 14px; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 16px; }
.svc .svc__sort button:hover { background: var(--svc-bubble); color: var(--ink); }
.svc .svc__sort button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.svc__note { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.svc__preview { font-size: 13px; background: var(--svc-pend); color: var(--svc-pend-ink); border-radius: 8px; padding: 8px 12px; margin: 0 0 16px; }
.svc__empty { color: var(--muted); margin: 6px 0 4px; }
.svc__login { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; background: var(--svc-bubble); border-radius: 12px; padding: 14px 16px; margin: 0 0 22px; }
.svc__login p { margin: 0; flex: 1 1 220px; font-weight: 600; }
.svc__login a { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 20px; background: var(--red); color: #fff !important; font-weight: 700; text-decoration: none !important; }
.svc__login a:hover { background: var(--red-dark); }
.svc__more { display: block; margin: 18px 0 0; font-weight: 700 !important; color: var(--muted) !important; font-size: 15px; }
.svc__more:hover { color: var(--ink) !important; text-decoration: underline; }

/* Аватарки */
.svc-ava { flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 17px; background: var(--ph); text-decoration: none !important; }
.svc-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.svc-replies .svc-ava, .svc-form--reply .svc-ava { width: 32px; height: 32px; font-size: 14px; }

/* Форма */
.svc-form { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 22px; position: relative; }
.svc-form--reply { margin: 8px 0 4px; }
.svc-form__main { flex: 1; min-width: 0; }
.svc-form__to { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 0 0 4px 4px; }
.svc .svc-form__to button { font-size: 16px; line-height: 1; color: var(--muted); padding: 0 4px; }
.svc-form__box { background: var(--svc-bubble); border-radius: 18px; padding: 8px 8px 6px 14px; transition: box-shadow .15s; }
.svc-form__box:focus-within { box-shadow: 0 0 0 2px var(--line-2); }
.svc-form textarea { display: block; width: 100%; border: 0; background: none; resize: none; font: inherit; font-size: 15px; line-height: 1.4; color: var(--ink); padding: 4px 0; min-height: 24px; max-height: 300px; outline: none; overflow-y: hidden; }
.svc-form textarea::placeholder { color: var(--muted); }
.svc-form__tools { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.svc-form__cnt { font-size: 12px; color: var(--muted); margin-right: auto; }
.svc-form__cnt.is-over { color: var(--red-text); font-weight: 700; }
.svc .svc-ic { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.svc .svc-ic:hover { background: var(--svc-bubble-2); color: var(--ink); }
.svc-ic svg { width: 20px; height: 20px; }
.svc .svc-send { color: var(--red-text); }
.svc .svc-send:disabled { color: var(--line-2); cursor: default; background: none; }
.svc-form__hint { font-size: 12px; color: var(--muted); margin: 5px 0 0 14px; }
.svc-form__err { font-size: 13px; color: var(--red-text); margin: 6px 0 0 14px; font-weight: 600; }
.svc-form__ok { font-size: 13px; color: #1e7e34; margin: 6px 0 0 14px; font-weight: 600; }
:root[data-theme="dark"] .svc-form__ok { color: #7bd88f; }

/* Смайлики */
.svc-emo { position: absolute; z-index: 30; right: 0; bottom: calc(100% + 6px); width: 320px; max-width: calc(100vw - 32px); max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 8px 10px; }
.svc-form--top .svc-emo { bottom: auto; top: calc(100% + 6px); }
.svc-emo b { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 6px 4px 4px; }
.svc-emo__grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.svc .svc-emo__grid button { font-size: 22px; line-height: 1; height: 36px; border-radius: 8px; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.svc .svc-emo__grid button:hover { background: var(--svc-bubble); transform: scale(1.15); }

/* Коментар */
.svc-th { margin: 0 0 16px; }
.svc-c { display: flex; gap: 8px; align-items: flex-start; position: relative; border-radius: 12px; transition: background 1.2s; }
.svc-c.is-hl { background: var(--svc-hl); }
.svc-c__body { min-width: 0; flex: 1; }
.svc-c__bubble { position: relative; display: inline-block; max-width: 100%; background: var(--svc-bubble); border-radius: 18px; padding: 8px 14px 9px; }
.svc-c__name { font-weight: 700; font-size: 14px; color: var(--ink) !important; text-decoration: none !important; }
.svc-c__name:hover { text-decoration: underline !important; }
.svc-badge { display: inline-block; vertical-align: 1px; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--red-text); background: var(--red-soft); border-radius: 8px; padding: 1px 7px; }
.svc-c__text { font-size: 15px; line-height: 1.42; overflow-wrap: anywhere; color: var(--ink); }
.svc-c__text a { color: var(--red-text); text-decoration: underline; text-underline-offset: 2px; }
.svc-c__text .svc-at { font-weight: 700; text-decoration: none; color: var(--ink); }
.svc-c__text .svc-at:hover { text-decoration: underline; }
.svc-c.is-gone .svc-c__bubble { background: none; border: 1px dashed var(--line-2); color: var(--muted); font-style: italic; font-size: 14px; }
.svc-c.is-pending .svc-c__bubble, .svc-c.is-rejected .svc-c__bubble { opacity: .78; }
.svc-c__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; font-size: 13px; color: var(--muted); margin: 3px 0 0 12px; min-height: 22px; }
.svc .svc-c__bar button { font-weight: 700; font-size: 13px; color: var(--muted); }
.svc .svc-c__bar button:hover { text-decoration: underline; }
.svc-c__bar time { cursor: default; }
.svc .svc-like.is-on { color: var(--rxc, var(--red-text)); }
.svc .svc-dots { font-size: 18px !important; line-height: 1; letter-spacing: 1px; padding: 0 4px !important; text-decoration: none !important; border-radius: 10px; }
.svc .svc-dots:hover { background: var(--svc-bubble); }
.svc-c__note { font-size: 12.5px; margin: 4px 0 0 12px; padding: 4px 10px; border-radius: 8px; background: var(--svc-pend); color: var(--svc-pend-ink); display: inline-block; }
.svc-c__note--bad { background: var(--red-soft); color: var(--red-text); }
.svc-c__mod { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0 12px; }
.svc .svc-c__mod button { font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 14px; background: var(--svc-bubble); }
.svc .svc-c__mod button:hover { background: var(--svc-bubble-2); }
.svc .svc-c__mod .is-ok { background: #1e7e34; color: #fff; }
.svc .svc-c__mod .is-ok:hover { background: #17692b; }
.svc-edit textarea { display: block; width: 100%; min-width: 220px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; padding: 6px 10px; resize: vertical; min-height: 60px; }
.svc-edit__b { display: flex; gap: 12px; margin-top: 6px; font-size: 13px; }
.svc .svc-edit__b button { font-weight: 700; color: var(--red-text); }
.svc .svc-edit__b button + button { color: var(--muted); }

/* Підсумок реакцій на бульбашці (як у Facebook) */
.svc .svc-rxsum { position: absolute; right: -8px; bottom: -11px; display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 6px 0 2px; border-radius: 11px; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); font-size: 13px; color: var(--muted); white-space: nowrap; }
.svc-rxsum i { font-style: normal; font-size: 14px; line-height: 18px; width: 18px; text-align: center; margin-right: -3px; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.svc-rxsum i:last-of-type { margin-right: 1px; }
.svc-c__bubble.has-rx { margin-bottom: 6px; min-width: 96px; padding-right: 22px; }

/* Вибір реакції */
.svc-rxpick { position: absolute; z-index: 40; display: flex; gap: 2px; padding: 4px 6px; background: var(--surface); border-radius: 26px; box-shadow: 0 2px 12px rgba(0, 0, 0, .22); animation: svcPop .18s var(--ease); }
.svc-rxpick button { font-size: 30px !important; line-height: 1; width: 42px; height: 42px; border-radius: 50%; transition: transform .15s var(--ease); position: relative; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.svc-rxpick button:hover, .svc-rxpick button:focus-visible { transform: scale(1.3) translateY(-4px); }
.svc-rxpick button span { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); font-family: var(--font); font-size: 11px; font-weight: 700; white-space: nowrap; background: rgba(0, 0, 0, .78); color: #fff; padding: 2px 7px; border-radius: 10px; opacity: 0; pointer-events: none; }
.svc-rxpick button:hover span { opacity: 1; }
@media (max-width: 420px) { .svc-rxpick button { width: 38px; height: 38px; font-size: 26px !important; } }
@keyframes svcPop { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: none; } }

/* Відповіді */
.svc-replies { margin: 8px 0 0 48px; display: flex; flex-direction: column; gap: 10px; }
.svc-replies:empty { display: none; }
.svc .svc-replies__more { align-self: flex-start; font-size: 14px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.svc .svc-replies__more:hover { text-decoration: underline; color: var(--ink); }
.svc-replies__more svg { width: 16px; height: 16px; }
@media (max-width: 559px) { .svc-replies { margin-left: 40px; } }

/* Спливні меню і вікно «Хто відреагував» */
.svc-pop { position: absolute; z-index: 40; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.svc .svc-pop button { text-align: left; padding: 8px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; }
.svc .svc-pop button:hover { background: var(--svc-bubble); }
.svc .svc-pop .is-danger { color: var(--red-text); font-weight: 700; }
.svc-pop b { font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 12px 2px; }
.svc-who { position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.svc-who__box { background: var(--surface); color: var(--ink); border-radius: 12px; width: 100%; max-width: 380px; max-height: 70vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.svc-who__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 700; }
.svc-who__head button { font-size: 22px; line-height: 1; width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; cursor: pointer; color: var(--muted); }
.svc-who__list { overflow-y: auto; padding: 8px 16px 12px; }
.svc-who__row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.svc-who__row .svc-ava { width: 36px; height: 36px; font-size: 15px; position: relative; overflow: visible; }
.svc-who__row .svc-ava img { border-radius: 50%; }
.svc-who__row .svc-ava i { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 15px; }
@media (max-width: 559px) {
  .svc__head h2 { font-size: 21px; }
  .svc .svc__sort button { font-size: 13px; padding: 5px 9px; }
  .svc-c__bar { gap: 2px 11px; margin-left: 10px; }
  .svc-c__bubble { padding: 7px 12px 8px; }
}
.svc-rep { width: 300px; max-width: calc(100vw - 32px); padding: 8px 10px 12px; }
.svc-rep__opt { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 14px; cursor: pointer; border-radius: 6px; }
.svc-rep__opt:hover { background: var(--svc-bubble); }
.svc-rep__opt input { accent-color: var(--red); margin: 0; }
.svc-rep__note { display: block; width: 100%; margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.svc .svc-rep__send { width: 100%; padding: 9px 12px !important; border-radius: 18px !important; background: var(--red) !important; color: #fff; font-weight: 700 !important; text-align: center !important; }
.svc .svc-rep__send:disabled { background: var(--line-2) !important; cursor: default; }
.svc-rep__msg { color: var(--red-text); font-size: 13px; margin-top: 6px; }
.svc-rep__done { margin: 6px 4px 0; font-size: 14px; }
.svc__note a { color: var(--red-text); font-weight: 600; }
