/* Единая система тем для публичных страниц (лендинг, форум, тема, профиль, ЛК).
   Светлая тема - честная палитра через CSS-переменные, без фильтров. */

:root {
    --fg: 255,255,255;
    --bg-rgb: 9,9,9;
    --white: #ffffff;
    --black: #000000;
    --pub-bg: #090909;
    --pub-bg-raised: #0e0e0e;
    --pub-bg-input: #101010;
    --pub-text: #e5e5e5;
    --accent-rgb: 170,155,225;
    --amber: #d9a020;
    --danger-soft: 240,140,140;
}

html.pub-light {
    --fg: 22,22,30;
    --bg-rgb: 243,243,246;
    --white: #1a1a20;
    --black: #ffffff;
    --pub-bg: #f3f3f6;
    --pub-bg-raised: #ffffff;
    --pub-bg-input: #ffffff;
    --pub-text: #22222a;
    --accent-rgb: 100,82,180;
    --amber: #9a6f10;
    --danger-soft: 185,60,60;
}
html.pub-light { background: var(--pub-bg); }

/* Зоны с видеофоном на лендинге остаются тёмными в любой теме */
html.pub-light .hero-section,
html.pub-light .video-bg,
html.pub-light .hire-card-left,
html.pub-light .landing-announcement,
html.pub-light .recruit-modal-video,
html.pub-light .easter-toast {
    --fg: 255,255,255;
    --white: #ffffff;
    --black: #000000;
    --pub-text: #e5e5e5;
}

/* Точечные правки светлой темы (лендинг) */
html.pub-light .contact-img-icon { filter: grayscale(1) invert(1) brightness(1.6); }

/* Тени мягче на светлом фоне */
html.pub-light * {
    --shadow-soft: rgba(30, 30, 50, 0.12);
}

/* ── Плавающая кнопка смены темы ── */
.pub-theme-btn {
    position: fixed; right: 18px; bottom: 18px; z-index: 500;
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(var(--fg), .06); border: 1px solid rgba(var(--fg), .18);
    color: rgba(var(--fg), .6); cursor: pointer; font-size: .95rem;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s; backdrop-filter: blur(8px); font-family: inherit;
}
.pub-theme-btn:hover { color: rgb(var(--fg)); border-color: rgba(var(--fg), .45); }
.pub-theme-btn.pulse { animation: pubPulse 1.6s ease infinite; }
.pub-theme-btn.with-fab-stack { right: 28px; bottom: 88px; }
.pub-theme-btn.with-fab-stack ~ .pub-theme-hint { right: 80px; bottom: 96px; }
@keyframes pubPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--fg), .25); }
    50% { box-shadow: 0 0 0 8px rgba(var(--fg), 0); }
}
.pub-theme-hint {
    position: fixed; right: 70px; bottom: 26px; z-index: 500;
    background: var(--white); color: var(--black); font-size: .74rem; font-weight: 600;
    padding: 7px 12px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.35);
    animation: pubHintIn .3s ease; pointer-events: none; font-family: inherit;
}
.pub-theme-hint::after {
    content: ""; position: absolute; right: -5px; top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px; height: 10px; background: var(--white);
}
@keyframes pubHintIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}
@media (max-width: 600px) {
    .pub-theme-btn { right: 12px; bottom: 12px; width: 38px; height: 38px; }
    .pub-theme-hint { right: 60px; bottom: 20px; }
    .pub-theme-btn.with-fab-stack { right: 16px; bottom: 72px; }
    .pub-theme-btn.with-fab-stack ~ .pub-theme-hint { right: 64px; bottom: 80px; }
}

/* ── Уведомления (публичные страницы) ── */
.pub-bell-wrap { position: relative; display: inline-flex; }
.pub-bell {
    position: relative; background: none; border: 0; cursor: pointer;
    color: rgba(var(--fg), .35); font-size: .9rem; padding: 8px 10px;
    transition: color .15s; font-family: inherit;
}
.pub-bell:hover { color: rgba(var(--fg), .75); }
.pub-bell-dot {
    position: absolute; top: 6px; right: 7px; width: 7px; height: 7px;
    border-radius: 50%; background: #e05555; box-shadow: 0 0 0 2px var(--pub-bg);
}
.pub-bell-panel {
    display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 300;
    width: 320px; max-width: calc(100vw - 24px);
    background: var(--pub-bg-raised); border: 1px solid rgba(var(--fg), .1);
    box-shadow: 0 12px 36px rgba(0,0,0,.3);
}
.pub-bell-panel.open { display: block; }
.pub-bell-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-bottom: 1px solid rgba(var(--fg), .06);
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: rgba(var(--fg), .35);
}
.pub-bell-readall {
    background: none; border: 0; color: rgba(var(--fg), .3); cursor: pointer;
    font-size: .75rem; padding: 4px 6px; transition: color .15s;
}
.pub-bell-readall:hover { color: rgba(var(--fg), .7); }
.pub-bell-list { max-height: 360px; overflow: auto; }
.pub-bell-empty {
    padding: 28px 16px; text-align: center; color: rgba(var(--fg), .2); font-size: .78rem;
}
.pub-bell-empty i { display: block; font-size: 1.1rem; margin-bottom: 8px; opacity: .5; }
.pub-bell-item {
    display: flex; gap: 11px; padding: 11px 14px; text-decoration: none;
    border-bottom: 1px solid rgba(var(--fg), .04); transition: background .12s;
}
.pub-bell-item:hover { background: rgba(var(--fg), .03); }
.pub-bell-item:last-child { border-bottom: none; }
.pub-bell-item.unread { background: rgba(var(--fg), .035); }
.pub-bell-ico {
    width: 30px; height: 30px; flex-shrink: 0; display: flex;
    align-items: center; justify-content: center;
    background: rgba(var(--fg), .06); color: rgba(var(--fg), .45);
    font-size: .72rem; border-radius: 50%;
}
.pub-bell-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pub-bell-title { font-size: .78rem; font-weight: 700; color: rgba(var(--fg), .7); }
.pub-bell-msg {
    font-size: .72rem; color: rgba(var(--fg), .35); overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pub-bell-time { font-size: .64rem; color: rgba(var(--fg), .18); }

/* ── Скругления ── */
html[data-rounded="1"] :where(
    button, input, select, textarea,
    .f-section, .f-topic, .f-vote, .f-chip, .f-select, .f-search,
    .f-create-btn, .f-submit-btn, .f-modal, .f-attach-zone, .f-attach-prev img,
    .f-badge, .f-cat, .f-fmtbar button, .f-stat, .f-hero,
    .t-card, .t-vote, .t-act, .t-mod, .t-mod-btn, .t-mod-reply, .t-admin-reply,
    .t-gallery a img, .t-rich code,
    .c-item, .c-input, .c-send-btn, .c-attach-btn, .c-form, .c-login-note,
    .c-reply-quote, .c-attachments img, .c-staff,
    .rel-item,
    .p-hero, .p-stat, .p-topic, .p-role,
    .acc-hero, .acc-stat, .acc-btn, .acc-hero-link, .acc-flash, .acc-section,
    .ticket-item, .settings-section, .form-input,
    .apoll-card, .apoll-opt, .apoll-vote-btn, .apoll-text-input, .apoll-text-mine,
    .apoll-cat, .apoll-img img,
    .pub-theme-hint, .theme-pick, .pub-bell-panel,
    .f-pager button, .ide-pagination button,
    .hero-chip, .ide-card, .pol-card, .rmp-col, .rmp-card, .contact-card,
    .rv-card, .rv-team-summary, .fbk-input, .fbk-submit
) {
    border-radius: 10px;
}

html[data-rounded="1"] :where(.f-badge, .c-staff, .p-role, .apoll-cat, .f-section__count, .rmp-pill) {
    border-radius: 6px;
}

html[data-rounded="1"] :where(.f-attach-prev button, .f-author-initial, .pub-theme-btn, .rm-ava) {
    border-radius: 50%;
}

html[data-rounded="1"] :where(.f-topic-comments, .f-topic-nums span, .rmp-asg__chip) {
    border-radius: 20px;
}
