html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* Длинные значения без пробелов — provider id, токены, ISO-даты, списки через
   запятую — единственная причина, по которой текст вылезал за карточку. Правило
   стоит один раз и наследуется всем документом: до этого его добавляли по
   селектору, и таких копий накопилось 52, а каждая новая карточка всё равно
   начинала с переполнения. nowrap там, где он нужен, продолжает выигрывать —
   он задаётся отдельным свойством. */
body {
    overflow-wrap: anywhere;
    margin: 0;
    background: #f7f8f5;
    color: #202526;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* Shared confirmation popup. Native alert/confirm boxes cannot express the
   consequence of an operator action consistently and look foreign on every
   platform. The HTML dialog supplies focus trapping and Escape handling while
   this layer keeps all confirmations visually and semantically uniform. */
.confirmation-dialog {
    position: fixed;
    z-index: 2100;
    width: min(32rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    margin: auto;
    overflow: auto;
    padding: 0;
    border: 1px solid #d4ded9;
    border-radius: 18px;
    background: #fff;
    color: #202526;
    box-shadow: 0 28px 80px rgba(10, 20, 15, .32);
}

.confirmation-dialog::backdrop {
    background: rgba(17, 25, 22, .62);
    backdrop-filter: blur(2px);
}

.confirmation-dialog__header {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    padding: 1.25rem 1.25rem .6rem;
}

.confirmation-dialog__header .eyebrow {
    margin: 0 0 .2rem;
}

.confirmation-dialog__header h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.25;
}

.confirmation-dialog__icon {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e8f5ee;
    color: #13795b;
    font-size: 1.1rem;
}

.confirmation-dialog--danger .confirmation-dialog__icon {
    background: #fdeceb;
    color: #b33a32;
}

.confirmation-dialog__message {
    margin: 0;
    padding: .55rem 1.25rem 1.25rem;
    color: #4d5c56;
    line-height: 1.55;
    white-space: pre-line;
}

.confirmation-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid #e4ebe7;
    background: #f8faf9;
}

@media (max-width: 575.98px) {
    .confirmation-dialog {
        width: calc(100vw - 1rem);
        max-height: calc(100dvh - 1rem);
        border-radius: 16px;
    }

    .confirmation-dialog__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .confirmation-dialog__actions .btn {
        width: 100%;
    }
}

.app-container {
    /* One fluid shell for navigation, workspaces and footer. Keep a ceiling
       only for ultrawide monitors; individual reading/form panels own theirs. */
    max-width: 2240px;
}

@media (min-width: 1200px) {
    .app-container {
        padding-inline: clamp(1.25rem, 2vw, 3rem);
    }
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding-top: .75rem;
    padding-bottom: 1.5rem;
    color: #6f7d77;
    font-size: .82rem;
}

.app-footer__product {
    font-weight: 650;
}

.app-footer__link {
    color: inherit;
    text-underline-offset: .16em;
}

.app-footer__version {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    white-space: nowrap;
}

/* App shell header.
   The top-level menu grew past a single row, so the shell now switches between
   two modes at 1200px: an inline row on wide screens and a slide-in drawer
   below it. wwwroot/js/site.js owns the drawer state. */
.app-header {
    position: sticky;
    top: 0;
    z-index: 900;
}

.app-navbar {
    padding: 0;
    background: rgba(255, 255, 255, .98);
    /* Bootstrap's .navbar sets flex-wrap: wrap and .app-navbar__inner is the
       .container-fluid that inherits it, so one item too many did not overflow —
       it silently doubled the header height, and every sticky panel below then
       had to chase the new number. The rarely-used sections moved behind
       .nav-more so the row genuinely fits. */
    flex-wrap: nowrap;
}

.app-navbar__inner {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 3.5rem;
    padding-top: .4rem;
    padding-bottom: .4rem;
}

.navbar-brand {
    text-decoration: none;
}

.app-brand {
    display: inline-flex;
    min-width: 0;
    max-width: min(54vw, 18rem);
    align-items: center;
    gap: .55rem;
    margin-right: .35rem;
    color: #17211e;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1;
}

.app-brand:hover,
.app-brand:focus-visible {
    color: #0f6b4f;
    text-decoration: none;
}

.app-brand:focus-visible {
    outline: 2px solid #91c7ad;
    outline-offset: 3px;
    border-radius: 12px;
}

.app-brand__logo {
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 auto;
    border-radius: .85rem;
    filter: drop-shadow(0 6px 12px rgba(19, 121, 91, .18));
}

.app-brand__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .app-brand {
        max-width: calc(100vw - 7.25rem);
        gap: .45rem;
        margin-right: .45rem;
    }

    .app-brand__logo {
        width: 2.2rem;
        height: 2.2rem;
    }
}

@media (max-width: 359.98px) {
    .app-brand {
        max-width: 2.6rem;
    }

    .app-brand__text {
        display: none;
    }
}

/* Wide-screen navigation: one row that never wraps. Items shrink before they
   wrap, and the row scrolls as a last resort so the shell height stays fixed. */
.app-nav {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.app-nav__bar {
    display: none;
}

.navbar .nav-links {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .15rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.navbar .nav-links::-webkit-scrollbar {
    display: none;
}

.navbar .nav-links a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex: 0 0 auto;
    color: #33413d;
    font-size: .95rem;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

.navbar .nav-links a.active,
.navbar .nav-links a:hover,
.navbar .nav-links a:focus-visible {
    background: #edf5ef;
    color: #0f6b4f;
}

.navbar .nav-links a:focus-visible {
    outline: 2px solid #91c7ad;
    outline-offset: 2px;
}

/* Overflow menu for the sections that are consulted rarely. */
.nav-more {
    position: relative;
    flex: 0 0 auto;
}

.nav-more__trigger {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .7rem .62rem;
    border: 0;
    border-radius: 10px 10px 0 0;
    background: none;
    color: #33413d;
    font-size: .95rem;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.nav-more__trigger:hover,
.nav-more__trigger[aria-expanded="true"] {
    background: #edf5ef;
    color: #0f6b4f;
}

.nav-more__trigger:focus-visible {
    outline: 2px solid #91c7ad;
    outline-offset: 2px;
}

.nav-more__chevron {
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
}

.nav-more__trigger[aria-expanded="true"] .nav-more__chevron {
    transform: rotate(180deg);
}

/* Sits outside .nav-links on purpose: that row is a scroll container
   (overflow-x: auto), which would clip an absolutely positioned panel.

   Visibility rides on a class rather than the hidden attribute: Bootstrap ships
   [hidden] { display: none !important }, which no author rule can undo — and the
   drawer below needs to show this same panel inline. */
.nav-more__panel {
    position: absolute;
    top: calc(100% + .35rem);
    right: 0;
    z-index: 960;
    display: none;
    gap: .1rem;
    min-width: 11rem;
    padding: .35rem;
    border: 1px solid #d9ded7;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(23, 33, 30, .14);
}

.nav-more__panel.is-open {
    display: grid;
}

.nav-more__item {
    padding: .5rem .6rem;
    border-radius: 8px;
    color: #33413d;
    font-size: .95rem;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.nav-more__item.active,
.nav-more__item:hover,
.nav-more__item:focus-visible {
    background: #edf5ef;
    color: #0f6b4f;
}

/* Drawer trigger and overlay: hidden while the inline row fits. */
.app-nav-toggle {
    position: relative;
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0;
    border: 1px solid #dbe4de;
    border-radius: 12px;
    background: #fff;
    color: #17211e;
}

.app-nav-toggle:focus-visible {
    outline: 2px solid #91c7ad;
    outline-offset: 2px;
}

.app-nav-toggle__icon {
    display: grid;
    width: 1.25rem;
    gap: 4px;
}

.app-nav-toggle__icon span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
}

.app-nav-toggle[aria-expanded="true"] .app-nav-toggle__icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.app-nav-toggle[aria-expanded="true"] .app-nav-toggle__icon span:nth-child(2) {
    opacity: 0;
}

.app-nav-toggle[aria-expanded="true"] .app-nav-toggle__icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.app-nav-toggle__badge {
    position: absolute;
    top: .3rem;
    right: .3rem;
    width: .6rem;
    height: .6rem;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #d92d20;
}

.app-nav-toggle__badge[hidden] {
    display: none;
}

.app-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 940;
    background: rgba(15, 27, 23, .45);
    opacity: 0;
    transition: opacity .2s ease;
}

.app-nav-backdrop[hidden] {
    display: none;
}

.app-nav-backdrop.is-visible {
    opacity: 1;
}

@media (max-width: 1199.98px) {
    .app-nav-toggle {
        display: inline-flex;
    }

    /* The drawer is a vertical list with room to spare, so the rarely-used
       sections show inline there rather than behind a second trigger. */
    .nav-more__trigger {
        display: none;
    }

    .nav-more__panel {
        position: static;
        display: grid;
        min-width: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: none;
        box-shadow: none;
    }

    .app-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 950;
        display: flex;
        width: min(20rem, 86vw);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 0 0 1rem;
        overflow-y: auto;
        background: #fff;
        box-shadow: -18px 0 44px rgba(15, 27, 23, .18);
        transform: translateX(100%);
        transition: transform .22s ease;
        visibility: hidden;
    }

    .app-nav.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .app-nav__bar {
        position: sticky;
        top: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: .85rem 1rem;
        border-bottom: 1px solid #e8ede9;
        background: #fff;
    }

    .app-nav__title {
        color: #6f7d77;
        font-size: .78rem;
        font-weight: 700;
        letter-spacing: .08em;
        text-transform: uppercase;
    }

    .app-nav__close {
        display: inline-flex;
        width: 2.25rem;
        height: 2.25rem;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 10px;
        background: #f2f5f2;
        color: #33413d;
        font-size: 1.4rem;
        line-height: 1;
    }

    .navbar .nav-links {
        align-items: stretch;
        flex-direction: column;
        gap: .15rem;
        padding: .75rem;
        overflow-x: visible;
    }

    .navbar .nav-links a {
        min-height: 3rem;
        padding: .75rem .9rem;
        font-size: 1rem;
        justify-content: space-between;
    }
}

@media (max-width: 1199.98px) {
    /* Keep the page behind the drawer from scrolling under the overlay. */
    body.app-nav-open {
        overflow: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-nav,
    .app-nav-backdrop {
        transition: none;
    }
}

.nav-unread-badge {
    display: inline-flex;
    min-width: 1.35rem;
    height: 1.35rem;
    align-items: center;
    justify-content: center;
    margin-left: .35rem;
    border-radius: 999px;
    background: #d92d20;
    color: #fff;
    font-size: .75rem;
    font-weight: 800;
    line-height: 1;
}

.nav-unread-badge[hidden] {
    display: none !important;
}

.login-display__form {
    margin: 0;
}

/* Account control: avatar + name + role, with the sign-out action inside a
   popover so the header row keeps its space for navigation. */
.account-menu {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
}

.account-menu__trigger {
    display: inline-flex;
    max-width: 14rem;
    align-items: center;
    gap: .5rem;
    padding: .3rem .55rem .3rem .3rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #202526;
    line-height: 1.15;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.account-menu__trigger:hover,
.account-menu__trigger[aria-expanded="true"] {
    border-color: #dbe4de;
    background: #f4f7f4;
}

.account-menu__trigger:focus-visible {
    outline: 2px solid #91c7ad;
    outline-offset: 2px;
}

.account-menu__avatar {
    display: inline-flex;
    width: 2.1rem;
    height: 2.1rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #0f6b4f;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.account-menu__label {
    display: grid;
    min-width: 0;
    gap: .1rem;
}

.account-menu__name {
    overflow: hidden;
    font-size: .88rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu__role {
    overflow: hidden;
    color: #6f7d77;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu__chevron {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    color: #6f7d77;
    stroke-width: 2;
    transition: transform .15s ease;
}

.account-menu__trigger[aria-expanded="true"] .account-menu__chevron {
    transform: rotate(180deg);
}

.account-menu__panel {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    z-index: 960;
    display: grid;
    min-width: 15rem;
    gap: .35rem;
    padding: .75rem;
    border: 1px solid #e2e8e4;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 27, 23, .16);
}

.account-menu__panel[hidden] {
    display: none;
}

.account-menu__identity {
    display: grid;
    gap: .2rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid #eef2ef;
}

.account-menu__email {
    overflow: hidden;
    color: #6f7d77;
    font-size: .8rem;
    text-overflow: ellipsis;
}

.account-menu__identity .status-pill {
    justify-self: start;
    margin-top: .25rem;
}

.account-menu__item,
.account-menu__logout {
    display: block;
    width: 100%;
    padding: .55rem .6rem;
    border-radius: 10px;
    color: #33413d;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
}

.account-menu__item:hover,
.account-menu__item:focus-visible,
.account-menu__logout:hover,
.account-menu__logout:focus-visible {
    background: #edf5ef;
    color: #0f6b4f;
    text-decoration: none;
}

/* Wins over the generic .nav-action colour that is declared later in the file. */
.account-menu .account-menu__logout {
    color: #a8342a;
}

.account-menu .account-menu__logout:hover,
.account-menu .account-menu__logout:focus-visible {
    background: #fdeeec;
    color: #8c2b22;
}

.nav-action {
    appearance: none;
    border: 0;
    background: transparent;
    color: #0f6b4f;
    font: inherit;
    font-weight: 650;
    line-height: 1;
    padding: .35rem .5rem;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
}

.nav-action:hover,
.nav-action:focus-visible {
    background: #edf5ef;
    color: #0f6b4f;
    text-decoration: none;
}

.nav-action:focus-visible {
    outline: 2px solid #91c7ad;
    outline-offset: 2px;
}

/* Inside the drawer the account control sits at the bottom, full width, and its
   popover opens upward so it never runs off the panel. */
@media (max-width: 1199.98px) {
    .account-menu {
        margin: auto 0 0;
        padding: .75rem;
        border-top: 1px solid #e8ede9;
    }

    .account-menu__trigger {
        width: 100%;
        max-width: none;
        min-height: 3rem;
        border-color: #dbe4de;
        border-radius: 12px;
    }

    .account-menu__label {
        flex: 1 1 auto;
    }

    .account-menu__panel {
        top: auto;
        right: .75rem;
        bottom: calc(100% - .25rem);
        left: .75rem;
        min-width: 0;
    }
}

/* Dropped: nothing in the markup carries Bootstrap's .nav-link — the shell menu
   uses .nav-links a, styled above. The rule matched nothing and existed only to
   out-shout a Bootstrap colour that was never applied. */

.access-denied-panel {
    display: grid;
    justify-items: start;
    gap: .85rem;
    max-width: 34rem;
}

.content {
    max-width: 1280px;
    margin: 0 auto;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.page-heading h1 {
    margin: 0;
}

/* Blazor FocusOnNavigate programmatically focuses the page heading after route changes.
   Keep that accessible focus target, but do not render a browser focus ring on a
   non-interactive heading; real keyboard-focusable controls keep their indicators. */
h1[tabindex="-1"]:focus {
    outline: none;
}

.eyebrow {
    margin: 0 0 .25rem;
    color: #557164;
    font-size: .8rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.settings-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.settings-grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .75rem 1rem;
}

/* Settings pages stack panels in one column by default; a route opts into a
   curated composition (.settings-stack--*) where card widths follow content
   weight — heavy cards get the wide slot, light ones share narrow slots. */
.settings-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

@media (min-width: 1200px) {
    /* Мессенджеры: слева узкие Telegram Bot и под ним Telegram User,
       справа широкий MAX — у него заметно больше данных. */
    .settings-stack--messengers {
        grid-template-columns: minmax(22rem, 2fr) minmax(0, 3fr);
        align-items: start;
    }

    .settings-stack--messengers > #settings-telegram-bot {
        grid-column: 1;
        grid-row: 1;
    }

    .settings-stack--messengers > #settings-telegram-user {
        grid-column: 1;
        grid-row: 2;
    }

    .settings-stack--messengers > #settings-max {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    /* Площадки: равные по весу карточки-подключения VK/YouTube/Rutube делят
       один ряд, тяжёлые (intro, Restream, Instagram, реестр) занимают всю
       ширину. */
    .settings-stack--platforms {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .settings-stack--platforms > * {
        grid-column: 1 / -1;
    }

    .settings-stack--platforms > #settings-vk-connection,
    .settings-stack--platforms > #settings-youtube-connection,
    .settings-stack--platforms > #settings-rutube-connection {
        grid-column: auto;
    }

    /* Сервисы: Telegram-выдачи (список + редактор) — во всю ширину, средние
       Tilda и Qodx делят один ряд пополам. */
    .settings-stack--services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-stack--services > * {
        grid-column: 1 / -1;
    }

    .settings-stack--services > #settings-tilda-catalog,
    .settings-stack--services > #settings-product-copy {
        grid-column: auto;
    }

    /* Публикация: маленький Reposting остаётся короткой полосой во всю ширину,
       средние «Атрибуция ссылок» и «Форматирование» делят один ряд. */
    .settings-stack--publication {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-stack--publication > * {
        grid-column: 1 / -1;
    }

    .settings-stack--publication > #settings-short-link-rewrite,
    .settings-stack--publication > #settings-max-rules {
        grid-column: auto;
    }

    /* Поддержка: родственные карточки MAX-поддержки делят один ряд, тяжёлые
       (Telegram-боты, QA bridge, оформление) занимают всю ширину. */
    .settings-stack--support {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-stack--support > * {
        grid-column: 1 / -1;
    }

    .settings-stack--support > #settings-max-support-group-chats,
    .settings-stack--support > #settings-max-support-bots {
        grid-column: auto;
    }
}

.support-widget-preview {
    position: relative;
    min-height: 10rem;
    margin: .8rem 0;
    overflow: hidden;
    border: 1px solid var(--widget-preview-line, #dce5ea);
    border-radius: .8rem;
    color: var(--widget-preview-ink, #002b3f);
    background: var(--widget-preview-canvas, #f5f8fa);
}

.support-widget-preview header {
    padding: .7rem 1rem;
    color: var(--widget-preview-header-foreground, #fff);
    background: var(--widget-preview-header-bg, #05579b);
}

.support-widget-preview__bubble {
    width: min(75%, 25rem);
    margin: 1rem;
    padding: .65rem .8rem;
    border-radius: .75rem .75rem .75rem .2rem;
    background: var(--widget-preview-surface, #fff);
    box-shadow: 0 2px 8px rgb(0 43 63 / 8%);
}

.support-widget-preview__tabs {
    display: flex;
    gap: .35rem;
    padding: .55rem 1rem;
    border-bottom: 1px solid #dce5ea;
    background: #fff;
    font-size: .78rem;
}

.support-widget-preview__tabs span,
.support-widget-preview__tabs strong {
    padding: .3rem .55rem;
    border-radius: 999px;
}

.support-widget-preview__tabs strong {
    color: var(--widget-preview-accent-foreground, #fff);
    background: var(--widget-preview-accent, #0974d8);
}

.support-widget-preview__request {
    width: min(80%, 28rem);
    margin: .8rem 1rem 4rem;
    display: grid;
    gap: .45rem;
    font-size: .78rem;
}

.support-widget-preview__request > span:not(.support-widget-preview__field) {
    color: #526b78;
}

.support-widget-preview__field {
    min-height: 2rem;
    padding: .45rem .6rem;
    border: 1px solid #dce5ea;
    border-radius: .45rem;
    color: #6c7f89;
    background: #fff;
}

.support-widget-preview__field--large {
    min-height: 3rem;
}

.support-widget-preview > button {
    position: absolute;
    right: .7rem;
    bottom: .7rem;
    width: 2.8rem;
    height: 2.8rem;
    border: 0;
    border-radius: 50%;
    color: var(--widget-preview-accent-foreground, #fff);
    background: var(--widget-preview-accent, #0974d8);
}

.settings-shell {
    display: grid;
    align-items: start;
}

.settings-content {
    min-width: 0;
    display: grid;
    gap: 1rem;
}

.settings-sidebar {
    align-self: start;
    border: 1px solid #d9ded7;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 24px rgba(23, 33, 30, .05);
}

.settings-nav {
    display: grid;
    gap: .25rem;
}

.settings-nav a {
    color: #33413d;
    text-decoration: none;
    font-weight: 650;
}

.settings-nav a:hover,
.settings-nav a:focus-visible,
.settings-nav a.active {
    background: #edf4ef;
    color: #13795b;
}

.settings-nav__group-title {
    margin: .7rem .6rem .2rem;
    color: #60736d;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.settings-nav__sections {
    display: grid;
    gap: .1rem;
    margin: .1rem 0 .3rem;
    padding-left: .7rem;
}

.settings-nav__section-link {
    padding: .28rem .55rem;
    border-radius: 6px;
    color: #4c5f59;
    text-decoration: none;
    font-size: .84rem;
    font-weight: 550;
}

.settings-nav__section-link:hover,
.settings-nav__section-link:focus-visible {
    background: #edf4ef;
    color: #13795b;
}

.settings-search {
    margin-bottom: .5rem;
}

.settings-search input[type="search"] {
    width: 100%;
    border: 1px solid #d9ded7;
    border-radius: 8px;
    padding: .5rem .7rem;
    background: #fff;
    color: #17211e;
}

.settings-search input[type="search"]:focus-visible {
    outline: 2px solid #13795b;
    outline-offset: 1px;
}

.settings-search-results {
    display: grid;
    gap: .25rem;
}

.settings-search-results__item {
    display: grid;
    gap: .1rem;
    padding: .5rem .7rem;
    border-radius: 8px;
    color: #33413d;
    text-decoration: none;
    font-weight: 650;
}

.settings-search-results__item:hover,
.settings-search-results__item:focus-visible {
    background: #edf4ef;
    color: #13795b;
}

.settings-search-results__route {
    color: #60736d;
    font-size: .78rem;
    font-weight: 600;
}

.settings-sidebar .empty-state {
    margin: .25rem 0;
}

/* :target covers full page loads with a fragment; the class covers pushState
   navigation, where :target does not update (set from kundaliniHubSettingsNav). */
.settings-panel:target,
.settings-panel.is-anchor-target {
    border-color: #13795b;
    box-shadow: 0 0 0 3px rgba(19, 121, 91, .18);
}

/* Anchor offset now comes from html { scroll-padding-top } in tokens.css, which
   covers every target rather than the two that happened to be remembered — and
   clears the whole header instead of falling 3.2rem short of it. */

.settings-overview {
    background: linear-gradient(135deg, #ffffff, #f4faf6);
}

.settings-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}

.settings-checklist__item {
    display: grid;
    gap: .4rem;
    min-width: 0;
    border: 1px solid #d9ded7;
    border-radius: 8px;
    padding: .85rem;
    background: #fff;
    color: #33413d;
    text-decoration: none;
}

.settings-checklist__item:hover,
.settings-checklist__item:focus-visible {
    border-color: #a7c6b5;
    box-shadow: 0 8px 20px rgba(23, 33, 30, .07);
}

.settings-checklist__item.success {
    border-color: #b9dfc8;
}

.settings-checklist__item.warning {
    border-color: #ead48a;
}

.settings-checklist__item.danger {
    border-color: #f0aaaa;
}

.settings-import-workflow {
    display: grid;
    gap: 1rem;
}

.settings-subsection {
    min-width: 0;
    border: 1px solid #e2e8e4;
    border-radius: 8px;
    padding: 1rem;
    background: #fbfcfa;
}

.settings-subsection h3 {
    margin: 0 0 .85rem;
    font-size: 1rem;
}

.settings-import-job {
    margin-top: .25rem;
}

.panel-status {
    margin: .75rem 0 0;
}

.panel-status:not(:last-child) {
    margin-bottom: .75rem;
}

@media (min-width: 1100px) {
    .settings-shell {
        grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    }

    .settings-sidebar {
        position: sticky;
        top: var(--app-sticky-top);
        z-index: 1;
    }
}

@media (min-width: 1200px) {
    .settings-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .settings-import-workflow {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.panel,
.message-row,
.table-wrap,
.setup-panel,
.stat-tile {
    background: #fff;
    border: 1px solid #d9ded7;
}

.panel {
    min-width: 0;
}

.panel.wide {
    grid-column: 1 / -1;
}

.panel h2 {
    margin: 0 0 1rem;
}

.panel:not(.live-composer) label {
    margin-bottom: .75rem;
    color: #22302c;
    font-size: .95rem;
    font-weight: 650;
}

/* Field grids. The markup has carried .form-grid and its modifiers since the
   settings, audience and setup panels were written, but no stylesheet ever
   defined them — so every one of these containers rendered as a plain block and
   the fields inside it stacked in a single column regardless of the modifier. */
.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .85rem .75rem;
    min-width: 0;
    /* Stands in for the bottom margin dropped from the last label below, so
       whatever follows the grid keeps its breathing room. */
    margin-bottom: .75rem;
}

/* The gap owns the spacing between fields; .panel label's own bottom margin
   would otherwise stack on top of it and space the rows unevenly. */
.form-grid > label {
    margin-bottom: 0;
}

/* A field that needs the whole row of a multi-column grid. */
.form-grid > .span-2 {
    grid-column: 1 / -1;
}

/* Columns only once there is room for them — minmax(0, 1fr) rather than 1fr so a
   long unbroken value cannot push the track wider than its share. */
@media (min-width: 768px) {
    .form-grid--two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Text fields use stacked labels. Labels containing native choice controls
   keep the layout supplied by choice-line/live-choice/switch-row instead of
   being forced into one grid row per child. This prevents the recurring
   centred checkbox/radio regression across all panels. */
.panel:not(.live-composer) label:not(:has(input[type="checkbox"], input[type="radio"])) {
    display: grid;
    gap: .35rem;
}

.panel:not(.live-composer) :where(input[type="checkbox"], input[type="radio"]) {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    margin: 0;
    align-self: center;
    accent-color: #13795b;
}

.panel:not(.live-composer) input:not([type="checkbox"]):not([type="radio"]),
.panel:not(.live-composer) select,
.panel:not(.live-composer) textarea,
.setup-panel input:not([type="checkbox"]):not([type="radio"]),
.setup-panel select,
.setup-panel textarea {
    width: 100%;
    min-height: 2.4rem;
    box-sizing: border-box;
    border: 1px solid #cfd8d2;
    border-radius: 6px;
    padding: .5rem .65rem;
    background: #fff;
    color: #17211e;
}

/* Ряд «поле + действие». Кнопка выравнивается по нижнему краю подписи, а он
   совпадает с полем только пока подпись не выросла: сплошное правило делает
   каждый label в панели вертикальной сеткой, поэтому подсказка внутри него
   утаскивала кнопку вниз на свою высоту. Это и был источник «съехавших»
   кнопок — ряд ломала правка в подписи, а не в самом ряду.

   Поэтому подсказка здесь живёт сестрой подписи и занимает собственную строку
   под всей шириной ряда: её появление или исчезновение на выравнивание больше
   не влияет. Колонки при необходимости переопределяет конкретный ряд. */
.field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: .5rem .75rem;
}

/* Вторая ветка селектора выигрывает у панельного «.panel:not(...) label»
   (равная специфичность, но позже в файле): без неё подпись внутри панели
   снова получала нижний отступ, и кнопка ряда съезжала ниже поля. */
.field-row > label,
.panel .field-row > label {
    margin-bottom: 0;
}

/* Кнопка ряда повторяет вертикальные отступы поля (.form-control): высоты
   совпадают, и выравниваются обе кромки, а не только нижняя. */
.field-row > .btn {
    padding-top: .5rem;
    padding-bottom: .5rem;
}

.field-row > :where(.field-help, .field-row__note, small, .alert) {
    grid-column: 1 / -1;
    margin: 0;
}

@media (max-width: 640px) {
    .field-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

.button-row,
.toolbar,
.quick-actions,
.settings-save-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1rem;
}

.publication-target-picker {
    flex: 1 0 100%;
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid #d9e2dd;
}

.publication-target-picker .choice-line {
    display: flex;
    align-items: center;
}

.btn {
    min-height: 2.4rem;
}

.btn-primary {
    border-color: #13795b;
    background-color: #13795b;
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: #0f654c;
    background-color: #0f654c;
    color: #fff;
}

.btn-primary:disabled,
.btn-primary.disabled {
    border-color: #13795b;
    background-color: #13795b;
    color: #fff;
}

.btn-outline {
    border-color: #9aaba3;
    background: #fff;
    color: #17211e;
}

.btn-outline:hover {
    border-color: #74877f;
    background: #f4f7f5;
    color: #17211e;
}

.btn-danger-outline {
    border-color: #e05252;
    background: #fff;
    color: #c83232;
}

.btn-danger-outline:hover,
.btn-danger-outline:focus {
    border-color: #b42318;
    background: #fff1f1;
    color: #b42318;
}

.btn-danger {
    border-color: #c83232;
    background: #c83232;
    color: #fff;
}

.btn-danger:hover,
.btn-danger:focus {
    border-color: #a62020;
    background: #a62020;
    color: #fff;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.alert {
    margin: 1rem 0;
    padding: .85rem 1rem;
    border-radius: 6px;
    line-height: 1.45;
}

.alert.info {
    border: 1px solid #a9d8e5;
    background: #d9f3fa;
    color: #06495a;
}

.alert.success {
    border: 1px solid #9fd4b4;
    background: #ddf5e7;
    color: #17633a;
}

.alert.warning {
    border: 1px solid #ead48a;
    background: #fff3c2;
    color: #594315;
}

.alert.neutral {
    border: 1px solid #d9ded7;
    background: #f6f8f5;
    color: #3f4b46;
}

.alert.error {
    border: 1px solid #f0aaaa;
    background: #ffe2e2;
    color: #a31919;
}

.status-line,
.muted {
    color: #5f6d68;
}

.status-box,
.empty-state {
    border: 1px solid #d9ded7;
    border-radius: 6px;
    padding: .85rem 1rem;
    color: #33413d;
    background: #fbfcfa;
}

.panel > :where(.button-row, .settings-save-row, .status-box, .empty-state):not(:last-child) {
    margin-bottom: .75rem;
}

.settings-subsection > :where(.button-row, .settings-save-row, .status-box, .empty-state):not(:last-child) {
    margin-bottom: .75rem;
}

.empty-state {
    border-style: dashed;
    text-align: center;
}

.empty-state.compact {
    padding: .65rem .8rem;
    text-align: left;
}

.settings-target-list {
    display: grid;
    gap: .5rem;
    margin-bottom: .75rem;
}

.settings-target-list.compact {
    margin-bottom: 0;
}

.settings-target-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border: 1px solid #d9ded7;
    border-radius: 6px;
    padding: .55rem .7rem;
    background: #fff;
}

.payment-route-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    align-items: start;
    gap: .75rem;
    margin-bottom: 1rem;
}

.payment-route-card {
    display: grid;
    min-width: 0;
    align-content: start;
    gap: .55rem;
}

.payment-route-card label {
    min-width: 0;
}

.payment-route-card :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    min-width: 0;
    max-width: 100%;
}

.payment-route-card__header {
    display: grid;
    gap: .45rem;
}

.payment-route-card__header select {
    width: 100%;
}

.job-grid,
.emoji-preview-grid {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .5rem 2rem;
    margin-bottom: .75rem;
}

.emoji-preview-grid p {
    margin: 0;
    white-space: pre-wrap;
}

.qa-bridge-preview {
    margin: .25rem 0 .85rem;
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.45;
}

.stat-tile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.stat-tile strong {
    font-size: 2rem;
}

.bot-status-overview {
    margin-bottom: 1rem;
}

.panel-heading-row,
.bot-status-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.panel-heading-row {
    margin-bottom: 1rem;
}

.panel-heading-row h2,
.bot-status-card h3 {
    margin: 0;
}

.bot-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.bot-status-card {
    min-width: 0;
    border: 1px solid #d9ded7;
    background: #fbfcfa;
}

.bot-status-card.success {
    border-color: #b9dfc8;
    background: #fbfffc;
}

.bot-status-card.warning {
    border-color: #ead48a;
    background: #fffaf0;
}

.bot-status-recovered {
    margin-top: .85rem;
}

.bot-status-recovered summary {
    color: #5f6d68;
    cursor: pointer;
    font-weight: 650;
}

.bot-status-recovered .alert {
    margin-bottom: 0;
}

.bot-status-details {
    margin-top: .85rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .25rem .6rem;
    font-size: .8rem;
    font-weight: 750;
    white-space: nowrap;
}

.status-pill.success {
    background: #ddf5e7;
    color: #17633a;
}

.status-pill.warning {
    background: #fff3c2;
    color: #594315;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.details-list {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .5rem 1rem;
    margin: 0;
}

.details-list dt {
    color: #5f6d68;
    font-weight: 650;
}

.details-list dd {
    margin: 0;
}

.panel .details-list + .muted {
    margin-top: .85rem;
}

.stat-tile.danger strong {
    color: #b42318;
}

.queue-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .85rem;
    margin: 1rem 0;
}

.queue-scope-note {
    margin-bottom: 1rem;
}

.queue-list {
    display: grid;
    gap: 1rem;
}

.automation-template-grid,
.automation-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.automation-template,
.automation-card {
    display: grid;
    align-content: start;
    gap: .75rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid #d9ded7;
    border-radius: 8px;
    background: #fff;
}

.automation-template {
    background: linear-gradient(135deg, #fff, #f3faf6);
}

.automation-template h2,
.automation-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

.automation-template p,
.automation-card p {
    margin: 0;
}

.automation-card__header,
.automation-card__footer,
.automation-editor-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.automation-card__route {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    color: #33413d;
    font-weight: 700;
}

.automation-card__arrow {
    color: #6f7d77;
}

.automation-editor-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 1rem;
    align-items: start;
}

.automation-flow {
    display: grid;
    gap: .75rem;
    min-width: 0;
}

.automation-node {
    min-width: 0;
    padding: 1rem;
    border: 1px solid #d9ded7;
    border-left: 4px solid #13795b;
    border-radius: 8px;
    background: #fff;
}

.automation-node--condition {
    border-left-color: #c18412;
}

.automation-node--action {
    border-left-color: #176b87;
}

.automation-node__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .85rem;
}

.automation-node__heading h2,
.automation-node__heading h3 {
    margin: 0;
    font-size: 1.05rem;
}

.automation-node__step {
    display: inline-flex;
    width: 1.8rem;
    height: 1.8rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #edf5ef;
    color: #0f6b4f;
    font-size: .8rem;
    font-weight: 800;
}

.automation-node__title {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.automation-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.automation-field,
.automation-fieldset {
    display: grid;
    gap: .35rem;
    min-width: 0;
    margin: 0;
    color: #22302c;
    font-size: .95rem;
    font-weight: 650;
}

.automation-field--wide,
.automation-fieldset {
    grid-column: 1 / -1;
}

.automation-field input:not([type="checkbox"]):not([type="radio"]),
.automation-field select,
.automation-field textarea {
    width: 100%;
    min-height: 2.4rem;
    box-sizing: border-box;
    border: 1px solid #cfd8d2;
    border-radius: 6px;
    padding: .5rem .65rem;
    background: #fff;
    color: #17211e;
}

.automation-fieldset {
    border: 0;
    padding: 0;
}

.automation-fieldset legend {
    margin-bottom: .35rem;
    font-size: .95rem;
}

.automation-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .45rem .75rem;
}

.automation-connector {
    width: 2px;
    height: 1.25rem;
    justify-self: center;
    background: #b9c8c0;
}

.automation-actions-list {
    display: grid;
    gap: .75rem;
}

.automation-condition-match {
    min-height: 2.2rem;
    max-width: 12rem;
    border: 1px solid #d6c39d;
    border-radius: 999px;
    padding: .35rem .7rem;
    background: #fffaf0;
    color: #694b11;
    font-weight: 700;
}

.automation-condition-list {
    display: grid;
    gap: .65rem;
}

.automation-condition-card {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(220px, 1.2fr) auto;
    align-items: end;
    gap: .65rem;
    padding: .75rem;
    border: 1px solid #ead9b5;
    border-radius: 6px;
    background: #fffdf8;
}

.automation-action-card {
    display: grid;
    gap: .75rem;
    padding: .85rem;
    border: 1px solid #dfe6e2;
}

.automation-inspector {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.automation-inspector .panel {
    margin: 0;
}

.automation-summary-list {
    display: grid;
    grid-template-columns: minmax(7rem, auto) minmax(0, 1fr);
    gap: .45rem .75rem;
    margin: 0;
}

.automation-summary-list dt {
    color: #5f6d68;
    font-weight: 650;
}

.automation-summary-list dd {
    margin: 0;
}

.automation-validation-list,
.automation-preview-list {
    display: grid;
    gap: .65rem;
    margin: 0;
    padding-left: 1.25rem;
}

.automation-preview-card {
    padding: .85rem;
    border: 1px solid #d9e2dd;
    border-radius: 6px;
    background: #f7faf8;
}

.automation-preview-card p,
.automation-preview-card pre {
    margin: .4rem 0 0;
    white-space: pre-wrap;
}

.automation-mobile-order-hint {
    display: none;
}

/* Automation v3: readable routes first, details on demand. */
.automation-breadcrumbs {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 1.1rem;
    color: #66736e;
    font-size: .9rem;
}

.automation-breadcrumbs a {
    color: #0f6b4f;
    font-weight: 700;
    text-decoration: none;
}

.automation-breadcrumb-current--mobile,
.automation-editor-version-badge {
    display: none;
}

.automation-page-heading {
    align-items: start;
    margin-bottom: 2.25rem;
}

.automation-page-heading .muted {
    max-width: 46rem;
    margin: .6rem 0 0;
}

.automation-create-button {
    min-width: 11.5rem;
    padding-inline: 1.25rem;
}

.automation-template-panel {
    margin-bottom: 1.25rem;
    border-color: #bcd7c9;
    background: linear-gradient(135deg, #fff, #f3faf6);
    box-shadow: 0 12px 30px rgba(23, 33, 30, .06);
}

.automation-overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
    gap: 1.25rem;
    align-items: start;
}

.automation-workflow-stack {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.automation-card--wide {
    gap: 1.25rem;
    padding: 1.45rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(23, 33, 30, .04);
}

.automation-card__identity,
.automation-card__title-row,
.automation-card__badges,
.automation-card__footer--wide,
.automation-card__actions,
.automation-card__last-run {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.automation-card__identity,
.automation-card__title-row,
.automation-card__footer--wide {
    justify-content: space-between;
}

.automation-card__title-row {
    flex-wrap: wrap;
}

.automation-card--wide h2 {
    font-size: 1.35rem;
    letter-spacing: -.015em;
}

.automation-card__badges {
    flex-wrap: wrap;
    margin-top: .75rem;
}

.automation-card__steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: stretch;
    gap: .75rem;
    padding-block: 1.25rem;
    border-block: 1px solid #e2e7e3;
}

.automation-card__step {
    display: grid;
    align-content: start;
    gap: .35rem;
    min-width: 0;
    padding: .9rem;
    border: 1px solid #dfe5e1;
    border-radius: 9px;
    background: #fff;
}

.automation-card__step-heading {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: #33413d;
    font-size: .9rem;
    font-weight: 750;
}

.automation-card__step-arrow {
    align-self: center;
    color: #60736d;
    font-size: 1.4rem;
}

.automation-card__footer--wide {
    flex-wrap: wrap;
}

.automation-card__last-run {
    min-width: 0;
    color: #53635d;
    font-size: .9rem;
}

.automation-run-indicator,
.automation-summary-dot {
    width: .75rem;
    height: .75rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #96a49e;
}

.automation-run-indicator.success,
.automation-summary-dot.success {
    background: #17845f;
}

.automation-run-indicator.warning,
.automation-summary-dot.warning {
    background: #d99a17;
}

.automation-summary-dot.info {
    background: #208db2;
}

.automation-overview-summary {
    display: grid;
    gap: 1.2rem;
    margin: 0;
    padding: 1.45rem;
    border-radius: 12px;
}

.automation-overview-summary h2 {
    margin: 0;
    font-size: 1.2rem;
}

.automation-overview-summary__counts {
    display: grid;
    gap: .9rem;
    margin: 0;
}

.automation-overview-summary__counts > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.automation-overview-summary__counts dt {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.automation-overview-summary__counts dd {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
}

.automation-overview-summary__latest {
    display: grid;
    gap: .3rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e6e2;
}

@media (min-width: 1100px) {
    .automation-overview-summary {
        position: sticky;
        top: var(--app-sticky-top);
    }
}

.automation-comment-ack-panel {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

.automation-comment-ack-variants {
    display: grid;
    gap: .6rem;
}

.automation-comment-ack-variant {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.automation-comment-ack-variant input {
    flex: 1;
    min-width: 0;
}

.automation-comment-ack-variant .btn {
    flex-shrink: 0;
}

@media (max-width: 960px) {
    .automation-overview-layout {
        grid-template-columns: 1fr;
    }

    .automation-overview-summary {
        order: -1;
    }

    .automation-card__steps {
        grid-template-columns: 1fr;
    }

    .automation-card__step-arrow {
        justify-self: center;
        transform: rotate(90deg);
    }
}

@media (max-width: 575.98px) {
    .automation-page-heading {
        margin-bottom: 1.25rem;
    }

    .automation-create-button,
    .automation-card__actions,
    .automation-card__actions .btn {
        width: 100%;
    }

    .automation-card--wide {
        padding: 1rem;
    }

    .automation-card__footer--wide,
    .automation-card__actions {
        align-items: stretch;
        flex-direction: column;
    }
}

.automation-editor-page {
    padding-bottom: 6.5rem;
}

.automation-editor-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.automation-editor-header h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 2.7rem);
    letter-spacing: -.025em;
}

.automation-editor-title-row,
.automation-editor-title-edit {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.automation-editor-title-row {
    flex-wrap: wrap;
}

.automation-editor-title-input {
    width: min(42rem, 70vw);
    min-width: 18rem;
    font-size: clamp(1.5rem, 3vw, 2.35rem);
    font-weight: 750;
    letter-spacing: -.025em;
}

.automation-editor-version-status {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: .7rem 0 0;
    color: #43534d;
}

.automation-status-dot {
    width: .72rem;
    height: .72rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #96a49e;
}

.automation-status-dot.success,
.automation-status-dot.active,
.automation-status-dot.manual {
    background: #17845f;
}

.automation-status-dot.warning,
.automation-status-dot.paused {
    background: #d99a17;
}

.automation-editor-tabs {
    display: flex;
    align-items: stretch;
    border: 1px solid #d7ddd9;
    border-radius: 8px;
    background: #fff;
}

.automation-editor-tab {
    display: inline-flex;
    min-height: 2.85rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-right: 1px solid #e1e6e2;
    padding: .55rem 1rem;
    background: transparent;
    color: #40504a;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.automation-editor-tab.active,
.automation-editor-tab:hover,
.automation-editor-tab:focus-visible {
    background: #f2f8f4;
    color: #0f6b4f;
}

.automation-editor-tab:focus-visible {
    outline: 2px solid #91c7ad;
    outline-offset: -2px;
}

.automation-editor-more {
    position: relative;
}

.automation-editor-more > summary {
    list-style: none;
}

.automation-editor-more > summary::-webkit-details-marker {
    display: none;
}

.automation-editor-more__menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + .4rem);
    right: 0;
    min-width: 13rem;
    padding: .65rem;
    border: 1px solid #d7ddd9;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(23, 33, 30, .14);
}

.automation-activation-success,
.automation-version-notice {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 1rem 0;
    padding: .9rem 1rem;
    border: 1px solid #a8d5bb;
    border-radius: 8px;
    background: linear-gradient(90deg, #eff9f2, #f8fcf9);
    color: #17633a;
}

.automation-version-notice {
    align-items: baseline;
    flex-wrap: wrap;
    border-color: #cbded3;
    color: #33413d;
}

.automation-success-icon {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #13795b;
    color: #fff;
}

.automation-banner-close,
.automation-dialog-close,
.automation-remove-button {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #53635d;
    cursor: pointer;
}

.automation-banner-close {
    margin-left: auto;
}

.automation-banner-close:hover,
.automation-dialog-close:hover,
.automation-remove-button:hover {
    background: #edf3ef;
    color: #17211e;
}

.automation-editor-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: .8rem;
    align-items: start;
    min-width: 0;
}

.automation-step-summary {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
    min-height: 23rem;
    border: 1px solid #d9ded7;
    border-radius: 9px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.automation-step-summary.is-selected {
    border-color: #13795b;
    box-shadow: 0 0 0 1px #13795b, 0 12px 28px rgba(19, 121, 91, .08);
}

.automation-step-summary__button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: .65rem;
    border: 0;
    padding: 1rem;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.automation-step-summary__button:focus-visible {
    outline: 2px solid #91c7ad;
    outline-offset: -4px;
    border-radius: 8px;
}

.automation-step-summary__copy {
    display: grid;
    min-width: 0;
    gap: .18rem;
}

.automation-step-summary__copy > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.automation-step-summary__chevron {
    display: none;
    margin-left: auto;
}

.automation-step-summary__details {
    display: grid;
    align-content: end;
    gap: .55rem;
    min-width: 0;
    padding: 1rem;
    border-top: 1px solid #e6eae7;
}

.automation-step-summary__details--form {
    align-content: start;
    gap: .8rem;
}

.automation-step-summary__details--form .automation-field {
    gap: .35rem;
    font-size: .82rem;
}

.automation-step-summary__details--form select,
.automation-step-summary__details--form input {
    min-height: 2.55rem;
    padding: .48rem .58rem;
    font-size: .86rem;
}

.automation-compact-field,
.automation-compact-action {
    display: grid;
    gap: .55rem;
}

.automation-compact-field > span:first-child {
    color: #33413d;
    font-size: .82rem;
    font-weight: 750;
}

.automation-compact-token-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.automation-compact-token {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    max-width: 100%;
    padding: .3rem .45rem;
    border: 1px solid #d9ded7;
    border-radius: 6px;
    background: #f8faf8;
    font-size: .76rem;
    line-height: 1.25;
}

.automation-compact-token--checked {
    border-color: #c8ded1;
    background: #eff8f2;
    color: #176b50;
}

.automation-compact-token--checked .oi {
    font-size: .64rem;
}

.automation-compact-action {
    padding: .7rem;
    border: 1px solid #cfe0d6;
    border-radius: 7px;
    background: linear-gradient(135deg, #fbfdfb, #eff7f2);
}

.automation-compact-action > strong {
    font-size: .82rem;
    line-height: 1.35;
}

.automation-card-edit-link {
    justify-self: start;
    border: 0;
    padding: .15rem 0;
    background: transparent;
    color: #0f6b4f;
    font-size: .83rem;
    font-weight: 750;
    cursor: pointer;
}

.automation-card-edit-link:hover,
.automation-card-edit-link:focus-visible {
    color: #084f3b;
    text-decoration: underline;
}

.automation-card-edit-link:focus-visible {
    outline: 2px solid #91c7ad;
    outline-offset: 3px;
    border-radius: 3px;
}

.automation-step-connector {
    align-self: center;
    color: #60736d;
    font-size: 1.1rem;
}

.automation-step-inspector {
    display: grid;
    grid-column: 1 / -1;
    align-content: start;
    gap: 1rem;
    min-width: 0;
    padding: 1.1rem;
    border: 1px solid #d9ded7;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 33, 30, .04);
}

.automation-step-inspector__header,
.automation-action-card__heading,
.automation-topic-picker__heading,
.automation-dry-run-panel__header,
.automation-dry-run-panel__actions,
.automation-activation-dialog__header,
.automation-activation-dialog__actions {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: .75rem;
}

.automation-step-inspector__header h2,
.automation-dry-run-panel h2,
.automation-activation-dialog h2 {
    margin: 0;
    font-size: 1.25rem;
}

.automation-inspector-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.automation-inspector-fields > .automation-field--wide,
.automation-inspector-fields > .automation-topic-picker,
.automation-inspector-fields > .automation-condition-list,
.automation-inspector-fields > .automation-fieldset,
.automation-inspector-fields > .automation-summary-list {
    grid-column: 1 / -1;
}

.automation-inspector-summary {
    display: grid;
    gap: .2rem;
    padding: .75rem;
    border: 1px solid #dfe7e2;
    border-radius: 7px;
    background: #f8faf8;
}

.automation-topic-picker {
    min-width: 0;
    margin: 0;
    border: 0;
    padding: 0;
}

.automation-topic-picker legend {
    margin-bottom: .55rem;
    font-weight: 750;
}

.automation-topic-picker__heading {
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: .65rem;
}

.automation-topic-picker__heading .btn {
    max-width: 100%;
    margin-left: auto;
    min-height: 2rem;
    padding: .3rem .6rem;
    font-size: .82rem;
    white-space: normal;
}

.automation-topic-picker__options {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.automation-topic-picker__options .automation-topic-chip {
    display: grid;
    flex: 1 1 11.5rem;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .35rem;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: .45rem .6rem;
    border: 1px solid #d9ded7;
    border-radius: 7px;
    background: #fff;
    color: #33413d;
    font-size: .84rem;
    font-weight: 650;
    cursor: pointer;
}

.automation-topic-chip > .choice-control {
    grid-column: 1;
    grid-row: 1;
}

.automation-topic-chip__content {
    display: grid;
    gap: .2rem;
    min-width: 0;
    grid-column: 2;
    grid-row: 1;
}

.automation-topic-chip__label {
    min-width: 0;
}

.automation-topic-chip.selected {
    border-color: #91c7ad;
    background: #edf7f1;
    color: #0f654c;
}

.automation-topic-chip__meta {
    color: #68766f;
    font-size: .72rem;
    font-weight: 500;
}

.automation-topic-chip__meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: .15rem .45rem;
}

.automation-topic-picker__selection,
.automation-topic-picker__empty {
    margin: .65rem 0 0;
    color: #5f6d68;
    font-size: .84rem;
}

.automation-topic-picker__empty {
    padding: .75rem;
    border: 1px dashed #cfd8d2;
    border-radius: 7px;
}

.automation-choice-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.automation-actions-list--inspector,
.automation-action-card {
    gap: .75rem;
}

.automation-action-card {
    border-color: #cfe0d6;
    border-radius: 8px;
    background: linear-gradient(135deg, #fbfdfb, #eff7f2);
}

.automation-remove-button {
    width: 1.9rem;
    height: 1.9rem;
    color: #a31919;
}

.automation-technical-settings {
    border-top: 1px solid #e1e6e2;
    padding-top: .85rem;
}

.automation-technical-settings summary {
    color: #0f6b4f;
    font-weight: 700;
    cursor: pointer;
}

.automation-technical-settings[open] summary {
    margin-bottom: .85rem;
}

.automation-validation-panel {
    padding: .8rem;
    border: 1px solid #ead48a;
    border-radius: 7px;
    background: #fff8dc;
    color: #594315;
}

.automation-safety-note {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1rem 0;
    padding: .85rem 1rem;
    border: 1px solid #d9e3de;
    border-radius: 8px;
    background: #fbfcfa;
    color: #52625c;
}

.automation-info-icon {
    display: inline-flex;
    width: 1.4rem;
    height: 1.4rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid #13795b;
    border-radius: 999px;
    color: #13795b;
    font-size: .8rem;
    font-weight: 800;
}

.automation-dry-run-panel {
    display: grid;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #d9ded7;
    border-radius: 10px;
    background: #fff;
}

.automation-dry-run-panel.success {
    border-color: #9fd4b4;
    box-shadow: inset 4px 0 0 #17845f;
}

.automation-dry-run-panel.warning {
    border-color: #ead48a;
    box-shadow: inset 4px 0 0 #d99a17;
}

.automation-dry-run-panel__header p {
    margin: .35rem 0 0;
}

.automation-dry-run-panel__body {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: 1rem;
}

.automation-dry-run-panel--side {
    grid-column: 1 / -1;
    min-width: 19rem;
    align-content: start;
    gap: .75rem;
    margin: 0;
    padding: .85rem;
    font-size: .84rem;
}

.automation-dry-run-panel--side .automation-dry-run-panel__header {
    display: grid;
    gap: .25rem;
}

.automation-dry-run-panel--side .automation-dry-run-panel__header time {
    color: #65736e;
    font-size: .75rem;
}

.automation-dry-run-panel--side .automation-dry-run-panel__body {
    grid-template-columns: 1fr;
    gap: .7rem;
}

.automation-dry-run-panel--side h3 {
    margin: 0;
    font-size: 1rem;
}

.automation-dry-run-panel--side .automation-checklist {
    gap: .4rem;
    margin: .5rem 0;
}

.automation-dry-run-panel--side .automation-route-preview {
    display: grid;
    gap: .35rem;
    margin-top: .5rem;
    padding: .65rem;
}

.automation-dry-run-panel--side .automation-route-preview .oi {
    transform: rotate(90deg);
}

.automation-dry-run-panel--side .automation-preview-card {
    padding: .65rem;
}

.automation-dry-run-panel--side .automation-preview-card pre {
    max-height: 5.5rem;
    overflow: auto;
}

.automation-dry-run-panel--side .automation-dry-run-panel__actions {
    display: grid;
}

.automation-checklist {
    display: grid;
    gap: .55rem;
    margin: .7rem 0;
    padding: 0;
    list-style: none;
}

.automation-checklist li {
    position: relative;
    padding-left: 1.45rem;
}

.automation-checklist li::before {
    position: absolute;
    left: 0;
    top: .1rem;
    content: "";
    width: .85rem;
    height: .85rem;
    border: 2px solid #96a49e;
    border-radius: 999px;
}

.automation-checklist li.success::before {
    border-color: #17845f;
    background: #17845f;
    box-shadow: inset 0 0 0 2px #fff;
}

.automation-checklist li.warning::before {
    border-color: #d99a17;
    background: #d99a17;
    box-shadow: inset 0 0 0 2px #fff;
}

.automation-route-preview,
.automation-activation-dialog__route {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem;
    border: 1px solid #dfe5e1;
    border-radius: 8px;
    background: #f9fbf9;
}

.automation-route-preview strong,
.automation-activation-dialog__route strong {
    min-width: 0;
}

.automation-dry-run-panel__actions,
.automation-activation-dialog__actions {
    justify-content: flex-end;
}

.automation-cutover-panel {
    margin: 1rem 0;
}

.automation-sticky-actions {
    position: sticky;
    z-index: 12;
    bottom: .75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: .85rem 1rem;
    border: 1px solid #d4ddd7;
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 14px 35px rgba(23, 33, 30, .14);
    backdrop-filter: blur(14px);
}

.automation-sticky-actions__status,
.automation-sticky-actions__buttons {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.automation-sticky-actions__status > span:last-child {
    display: grid;
    gap: .12rem;
}

.automation-sticky-actions__status small {
    color: #5f6d68;
}

.automation-sticky-actions__icon {
    display: inline-flex;
    width: 2.1rem;
    height: 2.1rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 2px solid #17845f;
    border-radius: 999px;
    color: #17845f;
}

.automation-sticky-actions__icon.neutral {
    border-color: #96a49e;
    color: #60736d;
}

.automation-activation-dialog {
    position: fixed;
    z-index: 2000;
    display: grid;
    gap: 1rem;
    width: min(100%, 34rem);
    max-height: calc(100vh - 2rem);
    margin: auto;
    overflow: auto;
    padding: 1.35rem;
    border: 1px solid #cdd8d2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(10, 20, 15, .3);
}

.automation-activation-dialog::backdrop {
    background: rgba(17, 25, 22, .62);
}

.automation-activation-dialog__header p {
    margin: .3rem 0 0;
    color: #5f6d68;
}

.automation-activation-dialog__notice {
    margin: 0;
    padding: .8rem;
    border: 1px solid #bcd9cb;
    border-radius: 8px;
    background: #f1f9f4;
    color: #285746;
}

@media (max-width: 767.98px) {
    .automation-editor-page {
        padding-bottom: calc(9rem + env(safe-area-inset-bottom));
    }

    .automation-editor-header {
        display: grid;
    }

    .automation-editor-title-edit {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .automation-editor-title-input {
        width: 100%;
        min-width: 0;
        flex-basis: 100%;
    }

    .automation-editor-version-status {
        align-items: flex-start;
        margin-top: .65rem;
        padding: .75rem .85rem;
        border: 1px solid #d9ded7;
        border-radius: 8px;
        background: #fff;
    }

    .automation-editor-version-status > span:nth-child(2) {
        flex: 1 1 auto;
    }

    .automation-editor-version-badge {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        padding: .25rem .45rem;
        border-radius: 6px;
        background: #edf5ef;
        color: #176b50;
        font-size: .78rem;
        font-weight: 750;
    }

    .automation-breadcrumb-current--desktop,
    .automation-editor-tabs {
        display: none;
    }

    .automation-breadcrumb-current--mobile {
        display: inline;
    }

    .automation-version-notice {
        display: none;
    }

    .automation-editor-stage {
        grid-template-columns: 1fr;
        gap: .65rem;
    }

    .automation-step-summary {
        min-height: 0;
    }

    .automation-step-summary--when {
        grid-row: 1;
    }

    .automation-step-connector--one {
        grid-row: 2;
    }

    .automation-step-summary--if {
        grid-row: 3;
    }

    .automation-step-connector--two {
        grid-row: 4;
    }

    .automation-step-summary--then {
        grid-row: 5;
    }

    .automation-step-inspector {
        grid-row: 6;
    }

    .automation-step-summary__details {
        display: none;
    }

    .automation-step-summary__chevron {
        display: inline-flex;
    }

    .automation-step-summary__copy > span {
        display: -webkit-box;
        overflow: hidden;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .automation-step-summary.is-selected .automation-step-summary__chevron {
        transform: rotate(-90deg);
    }

    .automation-step-connector {
        justify-self: center;
        transform: rotate(90deg);
    }

    .automation-step-inspector {
        grid-column: 1;
        border-color: #13795b;
        background: linear-gradient(135deg, #fff, #f2f8f4);
        box-shadow: 0 0 0 1px #13795b, 0 12px 28px rgba(19, 121, 91, .08);
    }

    .automation-step-summary.is-selected {
        box-shadow: 0 0 0 1px #13795b;
    }

    .automation-inspector-fields,
    .automation-dry-run-panel__body {
        grid-template-columns: 1fr;
    }

    .automation-choice-grid--compact {
        grid-template-columns: 1fr 1fr;
    }

    .automation-sticky-actions {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        align-items: stretch;
        flex-direction: column;
        margin: 0;
        padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
        border-width: 1px 0 0;
        border-radius: 0;
    }

    .automation-sticky-actions__status {
        display: none;
    }

    .automation-sticky-actions__buttons,
    .automation-sticky-actions__buttons .btn {
        width: 100%;
    }

    .automation-sticky-actions__buttons {
        align-items: stretch;
        flex-direction: column;
    }

    .automation-activation-dialog {
        width: 100%;
        max-height: 92vh;
        margin: auto 0 0;
        border-radius: 14px 14px 0 0;
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }
}

.queue-card {
    display: grid;
    gap: 1rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid #d9ded7;
    border-left: 4px solid #9aaba3;
    border-radius: 8px;
    background: #fff;
}

.journal-page-heading {
    margin-bottom: 1rem;
}

.journal-page-heading .muted {
    max-width: 50rem;
    margin: .45rem 0 0;
}

.journal-tabs {
    margin-bottom: 1.25rem;
}

.journal-run-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border: 1px solid #d9ded7;
    border-radius: 9px;
    background: #fff;
}

.journal-run-toolbar__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
}

.journal-filter-control {
    display: inline-flex;
    min-height: 2.4rem;
    align-items: center;
    gap: .45rem;
    margin: 0;
    padding: 0 .65rem;
    border: 1px solid #cfd8d2;
    border-radius: 7px;
    background: #fff;
    color: #52625c;
}

.journal-filter-control select,
.journal-filter-control input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #22302c;
}

.journal-filter-control:focus-within {
    border-color: #91c7ad;
    box-shadow: 0 0 0 2px rgba(19, 121, 91, .1);
}

.journal-run-refresh {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.journal-workflow-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    border: 1px solid #bcd9cb;
    border-radius: 8px;
    background: #f1f9f4;
    color: #285746;
}

.journal-workflow-filter a {
    color: #0f6b4f;
    font-weight: 700;
}

.journal-run-master-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(21rem, .9fr);
    gap: 1rem;
    align-items: start;
}

.journal-run-list-panel,
.journal-run-detail {
    min-width: 0;
    border: 1px solid #d9ded7;
    border-radius: 10px;
    background: #fff;
}

.journal-run-list-panel {
    overflow: hidden;
}

.journal-run-table {
    min-width: 52rem;
}

.journal-run-list-panel {
    overflow-x: auto;
}

.journal-run-table__header,
.journal-run-row {
    display: grid;
    grid-template-columns: minmax(9rem, 1.25fr) minmax(7rem, .85fr) minmax(9rem, 1.15fr) minmax(8rem, 1fr) minmax(7.5rem, .8fr) minmax(5rem, .55fr) 1.25rem;
    gap: .65rem;
    align-items: center;
}

.journal-run-table__header {
    padding: .85rem 1rem;
    border-bottom: 1px solid #dfe4e1;
    color: #66736e;
    font-size: .78rem;
    font-weight: 750;
}

.journal-run-row {
    position: relative;
    padding: .9rem 1rem;
    border-bottom: 1px solid #edf0ee;
    color: #22302c;
    text-decoration: none;
}

.journal-run-row:last-child {
    border-bottom: 0;
}

.journal-run-row:hover,
.journal-run-row:focus-visible {
    background: #f7faf8;
    color: #17211e;
}

.journal-run-row:focus-visible {
    outline: 2px solid #91c7ad;
    outline-offset: -2px;
}

.journal-run-row--selected {
    background: linear-gradient(90deg, #eff8f2, #f9fbfa);
    box-shadow: inset 3px 0 0 #13795b;
}

.journal-run-cell {
    display: grid;
    min-width: 0;
    gap: .16rem;
    font-size: .86rem;
}

.journal-run-cell strong,
.journal-run-cell span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.journal-run-cell > span:not(.status-pill),
.journal-run-cell--started,
.journal-run-cell--duration {
    color: #5f6d68;
}

.journal-run-row__chevron {
    color: #60736d;
}

.journal-run-detail {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.journal-run-detail__header,
.journal-provider-result__heading,
.journal-run-timeline__heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: .75rem;
}

.journal-run-detail__header h2,
.journal-provider-results h3 {
    margin: 0;
}

.journal-run-detail__header p {
    margin: .25rem 0 0;
}

.journal-run-detail__empty {
    margin: 0;
}

.journal-run-timeline {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.journal-run-timeline__item {
    position: relative;
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: .7rem;
    padding-bottom: 1rem;
}

.journal-run-timeline__item:not(:last-child)::before {
    position: absolute;
    top: 1.8rem;
    bottom: 0;
    left: .92rem;
    width: 2px;
    content: "";
    background: #d8e1dc;
}

.journal-run-timeline__marker {
    display: inline-flex;
    z-index: 1;
    width: 1.85rem;
    height: 1.85rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #aab7b1;
    border-radius: 999px;
    background: #fff;
    color: #60736d;
}

.journal-run-timeline__item.is-success .journal-run-timeline__marker {
    border-color: #17845f;
    color: #17845f;
}

.journal-run-timeline__item.danger .journal-run-timeline__marker,
.journal-run-timeline__item.is-danger .journal-run-timeline__marker {
    border-color: #c83232;
    color: #c83232;
}

.journal-run-timeline__item.running .journal-run-timeline__marker,
.journal-run-timeline__item.is-running .journal-run-timeline__marker {
    border-color: #208db2;
    color: #208db2;
}

.journal-run-timeline__item.warning .journal-run-timeline__marker,
.journal-run-timeline__item.is-warning .journal-run-timeline__marker {
    border-color: #d99a17;
    color: #b87d08;
}

.journal-run-timeline__content {
    display: grid;
    gap: .35rem;
    min-width: 0;
    padding-top: .15rem;
}

.journal-run-timeline__heading time {
    color: #66736e;
    font-size: .75rem;
    white-space: nowrap;
}

.journal-run-timeline__meta {
    color: #66736e;
    font-size: .78rem;
}

.journal-run-timeline__actions {
    justify-content: flex-start;
    margin-top: .35rem;
}

.journal-run-timeline__error {
    padding: .55rem .65rem;
    border: 1px solid #f0aaaa;
    border-radius: 6px;
    background: #fff1f1;
    color: #a31919;
    font-size: .82rem;
}

.journal-provider-results {
    display: grid;
    gap: .7rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e6e2;
}

.journal-provider-results > h3 {
    font-size: 1rem;
}

.journal-provider-result {
    display: grid;
    gap: .55rem;
    padding: .75rem;
    border: 1px solid #dfe5e1;
    border-radius: 8px;
    background: #fbfcfa;
}

.journal-provider-result__heading {
    align-items: center;
}

.journal-provider-result__heading > div {
    display: grid;
    min-width: 0;
    flex: 1;
}

.journal-provider-result__icon {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #17211e;
    color: #fff;
    font-size: .72rem;
    font-weight: 850;
}

.journal-provider-result__link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #0f6b4f;
    font-weight: 700;
}

.journal-provider-result__id {
    color: #66736e;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .76rem;
}

.journal-provider-result__details pre {
    max-height: 15rem;
    overflow: auto;
    white-space: pre-wrap;
}

.journal-run-detail__footer {
    display: grid;
    gap: .65rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e6e2;
}

.journal-run-detail__note {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .65rem .75rem;
    border: 1px solid #e1e6e2;
    border-radius: 7px;
    background: #f9fbf9;
    color: #53635d;
}

.journal-run-detail__note.success,
.journal-run-detail__note.is-success {
    border-color: #b9dfc8;
    background: #f1f9f4;
    color: #17633a;
}

.journal-run-detail__note.warning,
.journal-run-detail__note.is-warning {
    border-color: #ead48a;
    background: #fff8dc;
    color: #806014;
}

.journal-run-detail__note.is-danger {
    border-color: #f0aaaa;
    background: #fff1f1;
    color: #a31919;
}

.journal-run-detail__note.is-info {
    border-color: #b8dce7;
    background: #f0f9fb;
    color: #14566a;
}

@media (min-width: 1100px) {
    .journal-run-detail {
        position: sticky;
        top: var(--app-sticky-top);
        max-height: var(--app-sticky-max-h);
        overflow: auto;
    }
}

@media (max-width: 1050px) {
    .journal-run-master-detail {
        grid-template-columns: 1fr;
    }

    .journal-run-detail {
        order: 2;
    }
}

@media (max-width: 767.98px) {
    .journal-run-toolbar,
    .journal-workflow-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .journal-run-toolbar__filters,
    .journal-filter-control,
    .journal-run-refresh,
    .journal-filter-reset {
        width: 100%;
    }

    .journal-filter-control select,
    .journal-filter-control input {
        flex: 1;
    }

    .journal-run-list-panel {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .journal-run-table {
        display: grid;
        min-width: 0;
        gap: .65rem;
    }

    .journal-run-table__header {
        display: none;
    }

    .journal-run-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .55rem .75rem;
        padding: .9rem;
        border: 1px solid #d9ded7;
        border-radius: 9px;
        background: #fff;
    }

    .journal-run-cell--workflow,
    .journal-run-cell--trigger,
    .journal-run-cell--target,
    .journal-run-cell--started,
    .journal-run-cell--duration {
        grid-column: 1;
    }

    .journal-run-cell--status,
    .journal-run-row__chevron {
        grid-column: 2;
        grid-row: 1;
    }

    .journal-run-row__chevron {
        align-self: end;
    }

    .journal-run-detail__header,
    .journal-provider-result__heading,
    .journal-run-timeline__heading {
        align-items: start;
        flex-direction: column;
    }
}

.queue-card--failed {
    border-left-color: #b42318;
}

.queue-card--published {
    border-left-color: #17633a;
}

.queue-card--processing {
    border-left-color: #176b87;
}

.queue-card__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
}

/* fit-content caps the details column. An `auto` track claims its max-content
   size, so a single unbreakable provider id collapsed the message column to zero. */
.queue-card__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) fit-content(26rem);
    gap: 1rem;
}

.queue-card__title {
    min-width: 0;
}

.queue-card__title h2 {
    margin: .35rem 0 .25rem;
    font-size: 1.1rem;
}

.queue-card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-content: start;
    gap: .5rem;
}

.queue-card__message {
    min-width: 0;
}

.queue-card__label {
    margin-bottom: .35rem;
    color: #5f6d68;
    font-size: .8rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.queue-card__message p,
.queue-card__error pre,
.queue-card__details-block pre,
.publication-attempts pre {
    white-space: pre-wrap;
}

.publication-operations {
    display: grid;
    gap: .75rem;
    margin-bottom: 0;
}

.publication-operations__note {
    margin: .65rem 0 .85rem;
}

.publication-operations > li {
    padding-left: .25rem;
}

.publication-operation__heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .2rem;
}

.publication-operation__heading .status-pill {
    font-size: .75rem;
}

.queue-card__message p {
    margin: 0;
}

.queue-card__details {
    align-content: start;
    margin: 0;
}

.queue-card__error {
    border: 1px solid #f1b2b2;
    border-radius: 6px;
    padding: .75rem;
    background: #fff7f7;
    color: #6e1f1f;
}

.queue-card__error pre {
    margin: .5rem 0 0;
}

.queue-card__details-block summary {
    cursor: pointer;
    font-weight: 650;
}

.status-pill.danger {
    background: #ffe3e3;
    color: #b42318;
}

.status-pill.neutral {
    background: #eef2f0;
    color: #4b5b55;
}

.setup-panel {
    max-width: 520px;
}

.segmented {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    justify-content: flex-end;
}

.segmented a {
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    color: #344054;
    padding: .35rem .75rem;
    text-decoration: none;
}

.segmented a.active,
.segmented a:hover {
    background: #13795b;
    color: #fff;
}

.message-list {
    display: grid;
    gap: .85rem;
}

.message-row {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr);
    gap: .85rem;
    align-items: start;
}

.message-row__selector {
    margin-top: .25rem;
    justify-self: center;
}

.message-main {
    min-width: 0;
}

.message-content-grid {
    display: grid;
    gap: .75rem 1rem;
    min-width: 0;
}

.message-source-content {
    min-width: 0;
}

.message-main p {
    margin: .35rem 0 0;
    white-space: pre-wrap;
    line-height: 1.55;
}

.message-normalized-preview {
    margin-top: .75rem;
    border-left: 3px solid #13795b;
    border-radius: 6px;
    background: #eef8f3;
    padding: .65rem .85rem;
}

.message-normalized-preview__label {
    color: #13795b;
    font-size: .78rem;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.message-normalized-preview p {
    margin-top: .25rem;
}

.message-normalized-preview a {
    color: #229ed9;
    font-weight: 500;
    text-decoration: none;
}

.message-normalized-preview a:hover,
.message-normalized-preview a:focus {
    color: #168acd;
    text-decoration: underline;
    text-underline-offset: .15em;
}

@media (min-width: 768px) {
    .message-content-grid.has-max-preview {
        grid-template-columns: minmax(0, 1fr) minmax(18rem, .75fr);
        align-items: start;
    }

    .message-content-grid.has-max-preview .message-normalized-preview {
        margin-top: 0;
    }
}

.message-meta {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    color: #667085;
    font-size: .85rem;
    margin-bottom: .4rem;
}

.asset-strip {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    flex-wrap: wrap;
    margin-top: .75rem;
}

.asset-strip img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.telegram-url-replace {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
    margin-top: .85rem;
}

.telegram-url-replace input {
    flex: 1 1 18rem;
    min-width: 0;
    min-height: 2.4rem;
    box-sizing: border-box;
    border: 1px solid #cfd8d2;
    border-radius: 6px;
    padding: .5rem .65rem;
    background: #fff;
    color: #17211e;
}

.qa-asset-video {
    width: min(320px, 100%);
    max-height: 220px;
    border-radius: 12px;
    border: 1px solid #d9e2dd;
    background: #0f172a;
}

.qa-asset-audio-card {
    display: grid;
    gap: .5rem;
    width: min(420px, 100%);
    padding: .7rem .8rem;
    border: 1px solid #d9e2dd;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fbf9 100%);
    box-shadow: 0 10px 24px rgba(23, 33, 30, .06);
}

.qa-asset-audio-card__meta {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.qa-asset-audio-card__name {
    color: #23312d;
    font-weight: 650;
    line-height: 1.25;
}

.qa-asset-audio-card__details {
    color: #667085;
    font-size: .82rem;
}

.qa-asset-audio {
    width: 100%;
    min-width: min(280px, 100%);
}

.qa-asset-tgs-card {
    display: inline-grid;
    gap: .45rem;
    justify-items: center;
    width: min(180px, 100%);
    padding: .7rem;
    border: 1px solid #d9e2dd;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #f8fbf9 100%);
    box-shadow: 0 10px 24px rgba(23, 33, 30, .05);
}

.qa-asset-tgs-player {
    width: 140px;
    height: 140px;
    max-width: 100%;
    border-radius: 16px;
    background: #f2f7f4;
}

.qa-asset-tgs-fallback {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: #667085;
    font-size: .82rem;
    text-align: center;
}

.qa-asset-tgs-download {
    max-width: 100%;
    color: #23312d;
    font-size: .86rem;
    font-weight: 650;
    text-align: center;
    text-decoration: none;
}

.qa-asset-tgs-download:hover,
.qa-asset-tgs-download:focus {
    color: #13795b;
    text-decoration: underline;
}

.qa-asset-tgs-meta {
    color: #667085;
    font-size: .78rem;
    text-align: center;
}

.asset-file-link {
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .7rem;
    width: min(420px, 100%);
    max-width: 100%;
    padding: .7rem .8rem;
    border: 1px solid #d9e2dd;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fbf9 100%);
    color: #344054;
    font-size: .9rem;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(23, 33, 30, .05);
}

.asset-file-link__icon {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #e8f6f0;
    color: #17805f;
    flex: none;
}

.asset-file-link__icon svg {
    width: 1.2rem;
    height: 1.2rem;
    stroke-width: 1.8;
}

.asset-file-link__body {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.asset-file-link__name {
    color: #23312d;
    font-weight: 650;
    line-height: 1.25;
}

.asset-file-link__meta {
    color: #667085;
    font-size: .82rem;
}

.asset-file-link:hover,
.asset-file-link:focus {
    border-color: #18a77a;
    color: #146c94;
    box-shadow: 0 0 0 3px rgba(24, 167, 122, .14), 0 10px 24px rgba(23, 33, 30, .08);
}

.asset-file-link:hover .asset-file-link__icon,
.asset-file-link:focus .asset-file-link__icon {
    background: #d5f2e8;
    color: #0f6d51;
}

.qa-asset-preview {
    display: inline-flex;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.qa-asset-preview:hover img,
.qa-asset-preview:focus img {
    border-color: #229ed9;
    box-shadow: 0 0 0 3px rgba(34, 158, 217, .16);
}

.qa-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 2rem;
    background: rgba(15, 23, 42, .82);
}

.qa-lightbox[hidden] {
    display: none;
}

.qa-lightbox img {
    max-width: min(100%, 1100px);
    max-height: min(100%, 82vh);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
    object-fit: contain;
}

.qa-lightbox__close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: #17211e;
    font-size: 2rem;
    line-height: 1;
}

.qa-lightbox__close:hover,
.qa-lightbox__close:focus {
    background: #fff;
}

.qa-layout {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    align-items: start;
}

.qa-conversation-list {
    display: grid;
    gap: .75rem;
}

.qa-load-more {
    display: flex;
    justify-content: center;
    padding: .35rem 0 .75rem;
}

.qa-load-more-messages {
    padding: .25rem 0 0;
}

.qa-conversation-card {
    display: grid;
    gap: .35rem;
    border: 1px solid #d9ded7;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.qa-conversation-card.active,
.qa-conversation-card:hover {
    border-color: #13795b;
    box-shadow: 0 0 0 2px rgba(19, 121, 91, .08);
}

.qa-conversation-card.card-style-green-white {
    border-left: 4px solid #18a77a;
}

.qa-conversation-card.card-style-green-white.active,
.qa-conversation-card.card-style-green-white:hover {
    border-color: #13795b;
}

.qa-conversation-card.card-style-green {
    border-left: 4px solid #18a77a;
    background: #f6fef9;
}

.qa-conversation-card.card-style-green.active,
.qa-conversation-card.card-style-green:hover {
    border-color: #13795b;
    background: #ecfdf3;
}

.qa-conversation-card.card-style-blue {
    border-left: 4px solid #5b6ee1;
    background: #f7f8ff;
}

.qa-conversation-card.card-style-blue.active,
.qa-conversation-card.card-style-blue:hover {
    border-color: #5b6ee1;
    background: #f3f6ff;
}

.qa-conversation-card.card-style-blue-white {
    border-left: 4px solid #5b6ee1;
}

.qa-conversation-card.card-style-blue-white.active,
.qa-conversation-card.card-style-blue-white:hover {
    border-color: #5b6ee1;
    background: #f8faff;
}

.qa-conversation-card.card-style-warning {
    border-left: 4px solid #f59e0b;
    background: #fff8e1;
}

.qa-conversation-card.card-style-warning.active,
.qa-conversation-card.card-style-warning:hover {
    border-color: #d97706;
    background: #fff3c4;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, .16);
}

.qa-conversation-card.card-style-warning-light {
    border-left: 4px solid #fbbf24;
    background: #fffdf2;
}

.qa-conversation-card.card-style-warning-light.active,
.qa-conversation-card.card-style-warning-light:hover {
    border-color: #f59e0b;
    background: #fff8dc;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, .12);
}

.qa-conversation-card.closed {
    border-color: #c6cdd8;
    border-left: 4px solid #8e97a4;
    background: #eef2f7;
    background-image: repeating-linear-gradient(
        46deg,
        rgba(255, 255, 255, 0.55) 0,
        rgba(255, 255, 255, 0.55) 20px,
        rgba(255, 255, 255, 0) 20px,
        rgba(255, 255, 255, 0) 40px
    );
}

.qa-conversation-card.closed.active,
.qa-conversation-card.closed:hover {
    border-color: #98a2b3;
    background: #e7ebf0;
    background-image: repeating-linear-gradient(
        46deg,
        rgba(255, 255, 255, 0.48) 0,
        rgba(255, 255, 255, 0.48) 20px,
        rgba(255, 255, 255, 0) 20px,
        rgba(255, 255, 255, 0) 40px
    );
    box-shadow: 0 0 0 2px rgba(152, 162, 179, .14);
}

.qa-conversation-card__top,
.qa-conversation-card__preview {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .55rem;
    align-items: center;
}

.qa-conversation-card small {
    color: #667085;
    font-size: .82rem;
}

.qa-conversation-card p {
    flex: 1 1 min(12rem, 100%);
    min-width: 0;
    margin: .15rem 0;
    color: #344054;
}

.qa-conversation-card [data-qa-conversation-preview] {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.qa-conversation-direction {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: .13rem .45rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #475467;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.35;
    white-space: nowrap;
}

.qa-conversation-direction.last-incoming {
    background: #e8f6f0;
    color: #13795b;
}

.qa-conversation-direction.last-outgoing {
    background: #e7edff;
    color: #3f4fb6;
}

.qa-appearance-preview {
    display: grid;
    gap: .75rem;
    margin: .75rem 0 1rem;
}

.qa-appearance-preview .qa-conversation-card {
    pointer-events: none;
}

.qa-source {
    border-radius: 999px;
    padding: .15rem .5rem;
    background: #eef8f3;
    color: #13795b;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.qa-source.telegram {
    background: #eaf4ff;
    color: #1264a3;
}

.qa-source.web {
    background: #e8f5f8;
    color: #075d73;
}

.qa-card-unread {
    display: inline-flex;
    min-width: 1.35rem;
    height: 1.35rem;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    border-radius: 999px;
    background: #d92d20;
    color: #fff;
    font-size: .75rem;
    font-weight: 800;
}

.qa-realtime-notice[hidden] {
    display: none;
}

.qa-thread {
    min-width: 0;
}

/* Title, actions and the identity panel are siblings: wide screens place the
   panel in a right-hand column spanning both rows, phones flow everything into
   one wrapping row. */
.qa-thread-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr);
    gap: .6rem 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

.qa-thread-header > .qa-thread-title {
    grid-column: 1;
    grid-row: 1;
}

.qa-thread-header > .qa-thread-actions {
    grid-column: 1;
    grid-row: 2;
}

.qa-thread-header > .qa-thread-facts {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.qa-thread-header h2 {
    margin: 0;
}

.qa-thread-title {
    display: grid;
    align-content: start;
    gap: .45rem;
}

.qa-thread-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    margin-top: .25rem;
}

.qa-close-form,
.qa-delete-form {
    margin: 0;
}

.qa-close-form .btn,
.qa-delete-form .btn {
    min-height: 2rem;
    padding: .25rem .65rem;
}

.qa-delete-confirmation {
    max-width: 28rem;
    margin-top: .35rem;
    padding: .7rem .8rem;
    border: 1px solid #f0aaaa;
    border-radius: 8px;
    background: #fff7f7;
    color: #7a1d1d;
    line-height: 1.4;
}

.qa-delete-confirmation p {
    margin: .25rem 0 .6rem;
}

.qa-delete-confirmation__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.qa-delete-confirmation__actions .btn {
    min-height: 2rem;
    padding: .25rem .65rem;
}

.qa-message-list {
    display: grid;
    /* A long status or attachment must not size the implicit grid track to
       its min-content width and push every message under the customer panel. */
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
    margin-bottom: 1rem;
}

.qa-message {
    min-width: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .85rem;
    background: #fbfcfa;
}

.qa-message.outgoing {
    background: #eef8f3;
    border-color: #c6e6d6;
}

.qa-message p {
    margin: .35rem 0 0;
    white-space: pre-wrap;
    line-height: 1.55;
}

/* The thread can grow without turning long replies into screen-wide lines. */
.qa-message > p {
    max-width: 96ch;
}

.qa-routing-notice {
    display: block;
    margin-top: .65rem;
    border-radius: 8px;
    padding: .5rem .65rem;
    background: #fff3c2;
    color: #594315;
    font-size: .82rem;
    line-height: 1.5;
    white-space: normal;
}

.qa-page-context {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .2rem;
    margin-top: .7rem;
    border: 1px solid #dbe4df;
    border-radius: 10px;
    padding: .65rem .75rem;
    background: #f3f6f4;
    color: #52645b;
    font-size: .85rem;
}

.qa-delivery-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border-radius: 999px;
    padding: .12rem .5rem;
    background: #eef2f0;
    color: #56616d;
    font-size: .75rem;
    font-weight: 750;
    line-height: 1.2;
}

.qa-delivery-badge.delivered {
    background: rgba(19, 121, 91, .1);
    color: #13795b;
}

.qa-delivery-badge.queued,
.qa-delivery-badge.sending {
    background: #fff3c2;
    color: #8a5a00;
}

.qa-delivery-badge.failed {
    background: #ffe3e3;
    color: #b42318;
}

.qa-delivery-panel {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
    justify-content: space-between;
    margin-top: .7rem;
    border: 1px solid #f1b2b2;
    border-radius: 10px;
    padding: .65rem .75rem;
    background: #fff7f7;
    color: #7a1d1d;
}

.qa-delivery-panel__body {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.qa-delivery-panel__body strong {
    font-size: .9rem;
}

.qa-request-card {
    margin-top: .75rem;
    padding: .85rem 1rem;
    border: 1px solid #b7d9ca;
    border-radius: .8rem;
    background: #f3fbf7;
}

.qa-request-card__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .7rem;
}

.qa-request-card__heading strong {
    color: #175d43;
    font-size: 1rem;
}

.qa-request-card__heading span {
    color: #557164;
    font-size: .75rem;
}

.qa-request-card dl {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(6rem, auto) minmax(0, 1fr);
    gap: .35rem .75rem;
}

.qa-request-card dt {
    color: #557164;
    font-size: .8rem;
    font-weight: 700;
}

.qa-request-card dd {
    min-width: 0;
    margin: 0;
    display: grid;
    gap: .15rem;
}

.qa-request-card__task {
    white-space: pre-wrap;
}

@media (max-width: 600px) {
    .qa-request-card dl {
        grid-template-columns: 1fr;
        gap: .2rem;
    }

    .qa-request-card dd + dt {
        margin-top: .45rem;
    }
}

.qa-delivery-panel__error {
    color: #b42318;
    font-size: .82rem;
}

.qa-delivery-retry {
    margin: 0;
}

.qa-delivery-retry .btn {
    min-height: 1.9rem;
    padding: .2rem .65rem;
    border-color: #d92d20;
    background: #fff;
    color: #b42318;
    font-size: .8rem;
    font-weight: 750;
}

.qa-delivery-retry .btn:hover,
.qa-delivery-retry .btn:focus {
    border-color: #b42318;
    background: #ffe3e3;
    color: #7a1d1d;
}

/* Between 900px and 1100px .qa-thread is not sticky yet, so this offset is what
   keeps the reply box off the header rather than under it. Above 1100px the
   sticky parent takes over and this becomes inert. */
.qa-reply-form {
    position: sticky;
    top: var(--app-sticky-top);
    z-index: 2;
    display: grid;
    gap: .65rem;
    margin-bottom: 1rem;
    padding: .75rem;
    border: 1px solid #d9ded7;
    border-radius: 14px;
    background: rgba(247, 248, 245, .96);
    box-shadow: 0 8px 24px rgba(15, 35, 25, .08);
}

.visually-hidden,
.qa-reply-form label.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.qa-composer-shell {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: .35rem;
    align-items: end;
    min-height: 3.25rem;
    padding: .35rem;
    border: 1px solid #cfd8d2;
    border-radius: 8px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.qa-reply-target {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: 0 0 .45rem;
    padding: .55rem .7rem;
    border-left: 3px solid var(--accent, #0974d8);
    border-radius: .45rem;
    background: rgba(9, 116, 216, .08);
}

.qa-reply-target strong,
.qa-reply-target span {
    display: block;
}

.qa-reply-target span {
    margin-top: .15rem;
    color: var(--muted-text, #667782);
    font-size: .78rem;
}

.qa-message-reply-target {
    padding: .18rem .45rem;
    border: 1px solid rgba(9, 116, 216, .28);
    border-radius: 999px;
    color: #075ea8;
    background: transparent;
    font-size: .72rem;
}

.qa-message-reply-target.active {
    color: #fff;
    background: #0974d8;
}

.qa-composer-shell.is-dragging {
    border-color: #229ed9;
    background: #eef8ff;
    box-shadow: 0 0 0 3px rgba(34, 158, 217, .16);
}

.qa-composer-shell.is-dragging::after {
    content: attr(data-drop-message);
    position: absolute;
    inset: -.35rem;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(238, 248, 255, .92);
    color: #1264a3;
    font-weight: 800;
    pointer-events: none;
}

/* Win against generic .panel:not(.live-composer) textarea fields: a second
   border also caused a two-pixel scrollbar in an otherwise empty composer. */
.qa-composer textarea.qa-composer-input {
    width: 100%;
    min-height: 2.25rem;
    max-height: 10rem;
    resize: none;
    overflow-y: auto;
    box-sizing: border-box;
    border: 0;
    outline: 0;
    padding: .55rem .25rem;
    background: transparent;
    color: #17211e;
    line-height: 1.4;
}

.qa-composer-icon,
.qa-composer-send {
    display: inline-flex;
    width: 2.35rem;
    height: 2.35rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #98a2b3;
    line-height: 1;
}

.qa-composer-icon svg,
.qa-composer-send svg {
    width: 1.35rem;
    height: 1.35rem;
    stroke-width: 1.8;
}

#qaEmojiButton svg {
    width: 1.55rem;
    height: 1.55rem;
}

.qa-composer-icon:hover,
.qa-composer-icon:focus {
    background: #f0f2f5;
    color: #56616d;
}

.qa-composer-send {
    background: #13795b;
    color: #fff;
    font-size: 1rem;
}

.qa-composer-send:hover,
.qa-composer-send:focus {
    background: #0f654c;
}

.qa-selected-files {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
    color: #5f6d68;
    font-size: .85rem;
}

.qa-selected-files[hidden] {
    display: none;
}

.qa-selected-file {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 999px;
    padding: .2rem .55rem;
    background: #eef8f3;
    color: #13795b;
    font-weight: 700;
}

.qa-composer-hint {
    color: #667085;
    font-size: .8rem;
}

.qa-emoji-picker {
    position: absolute;
    top: calc(100% + .5rem);
    right: 2.95rem;
    z-index: 10;
    width: min(28rem, calc(100vw - 2rem));
    border: 1px solid #d9ded7;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 35, 25, .14);
    overflow: hidden;
}

.qa-emoji-picker[hidden] {
    display: none;
}

.qa-emoji-picker__header {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(12rem, 1fr);
    gap: .75rem;
    align-items: center;
    border-bottom: 1px solid #eef0ee;
    padding: .65rem .8rem .55rem;
    color: #229ed9;
    font-weight: 800;
}

.qa-emoji-picker__header strong {
    display: inline-flex;
    padding: .25rem .2rem .45rem;
    box-shadow: inset 0 -3px #229ed9;
}

/* Matches .panel label on specificity and comes later, so the margin reset wins
   without !important. Inside a panel the blanket rule still makes it a grid
   rather than a block — the search field is the only child in flow, so the box
   comes out identical either way. */
label.qa-emoji-search-label {
    display: block;
    margin: 0;
}

.qa-emoji-search {
    width: 100%;
    min-height: 2.15rem;
    border: 1px solid #d9ded7;
    border-radius: 999px;
    padding: .35rem .8rem;
    background: #f8faf8;
    color: #17211e;
    font-size: .9rem;
    font-weight: 500;
}

.qa-emoji-search:focus {
    border-color: #229ed9;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(34, 158, 217, .12);
}

.qa-emoji-empty {
    padding: 0 .85rem .85rem;
    color: #667085;
    font-size: .85rem;
}

.qa-emoji-empty[hidden],
.qa-emoji-option[hidden] {
    display: none;
}

.qa-emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(2.5rem, 1fr));
    gap: .25rem;
    max-height: 18rem;
    overflow-y: auto;
    padding: .75rem;
}

.qa-emoji-option {
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 1.65rem;
    line-height: 1;
    padding: .45rem;
}

.qa-emoji-option:hover,
.qa-emoji-option:focus {
    background: #f0f2f5;
}

.template-field {
    display: grid;
    gap: .35rem;
    margin-bottom: .75rem;
}

.panel .template-field > label {
    display: block;
    margin: 0;
}

.template-editor {
    position: relative;
    display: grid;
}

.template-editor textarea {
    padding-right: 3.1rem;
}

.template-emoji-button {
    position: absolute;
    right: .35rem;
    bottom: .35rem;
    color: #98a2b3;
}

.template-emoji-button svg {
    width: 1.35rem;
    height: 1.35rem;
}

.template-editor .qa-emoji-picker {
    top: calc(100% + .45rem);
    right: 0;
}

.table-wrap {
    overflow-x: auto;
    padding: .5rem;
}

label.choice-line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .5rem;
    align-items: start;
}

.choice-control {
    width: 1rem;
    height: 1rem;
    margin: .18rem 0 0;
    justify-self: start;
    flex: 0 0 auto;
    accent-color: #13795b;
}

.status-line {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.bot-log-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.bot-log-entry {
    display: grid;
    gap: .8rem;
    padding: 1rem;
    border: 1px solid #d9ded7;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(30, 55, 48, .05);
}

.bot-log-entry__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.bot-log-entry__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .65rem;
    margin: 0;
}

.bot-log-entry__meta div {
    min-width: 0;
}

.bot-log-entry__meta dt {
    color: #5f6d68;
    font-size: .75rem;
    font-weight: 750;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.bot-log-entry__meta dd {
    margin: .1rem 0 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .88rem;
}

.bot-log-text {
    margin: 0;
    padding: .75rem;
    border-radius: 14px;
    background: #f7faf7;
    white-space: pre-wrap;
}

.bot-log-emoji-ids {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    padding: .65rem .75rem;
    border: 1px solid #b7dfc6;
    border-radius: 14px;
    background: #effaf2;
}

.bot-log-emoji-ids span {
    color: #0f6b4f;
    font-weight: 800;
}

.bot-log-raw summary {
    cursor: pointer;
    color: #0f6b4f;
    font-weight: 700;
}

.bot-log-raw pre {
    max-height: 28rem;
    margin: .65rem 0 0;
    padding: .75rem;
    overflow: auto;
    border-radius: 14px;
    background: #111827;
    color: #e5e7eb;
    white-space: pre-wrap;
}

.bot-log-sentinel {
    display: flex;
    justify-content: center;
    padding: 1rem;
    color: #5f6d68;
}

.endpoint-card-grid {
    display: grid;
    margin: 1rem 0;
}

.endpoint-card {
    min-width: 0;
    border: 1px solid #dce8e1;
}

.disabled-integration-card {
    opacity: .78;
    background: #f7f8f7;
}

.settings-section-intro {
    background: linear-gradient(135deg, #f4fbf7, #f8fafc);
}

#blazor-error-ui {
    display: none;
}

/* Unified v3 application shell and operator surfaces. */
body > .app,
body > div {
    min-height: 100%;
}

/* .app-header above already makes the shell header sticky; a second rule here
   under a different selector meant edits to the named one appeared to do
   nothing. */

/* Owns the header height. Consumers read --app-header-h instead of repeating
   these numbers — keep the two in step (see wwwroot/css/tokens.css). */
.navbar {
    min-height: 4.2rem;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 1px 0 rgba(23, 33, 30, .08), 0 8px 28px rgba(23, 33, 30, .035);
    /* No backdrop-filter here: it would make the navbar a containing block for
       the fixed-position mobile nav drawer nested inside it. */
    backdrop-filter: none;
}

.navbar .nav-links a {
    position: relative;
    border-radius: 10px 10px 0 0;
    padding: .7rem .62rem;
}

.navbar .nav-links a.active::after {
    position: absolute;
    right: .55rem;
    bottom: -.5rem;
    left: .55rem;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: #13795b;
    content: "";
}

@media (max-width: 1199.98px) {
    .navbar {
        min-height: 3.75rem;
    }

    .navbar .nav-links a {
        border-radius: 12px;
    }

    .navbar .nav-links a.active::after {
        display: none;
    }

    .navbar .nav-links a.active {
        background: #e6f2ea;
    }
}

main.app-container {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.page-heading {
    align-items: flex-start;
    margin-bottom: 2rem;
}

.page-heading h1 {
    color: #17211e;
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -.04em;
}

.page-description {
    max-width: 48rem;
    margin: .65rem 0 0;
    color: #5f6d68;
    font-size: 1rem;
    line-height: 1.55;
}

.page-heading__actions,
.page-heading .quick-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .65rem;
    margin-top: .25rem;
}

.btn {
    border-radius: 8px;
    font-weight: 700;
}

.btn-quiet {
    border-color: transparent;
    background: transparent;
    color: #0f6b4f;
}

.btn-quiet:hover,
.btn-quiet:focus-visible {
    border-color: #cfe1d7;
    background: #edf5ef;
    color: #0f6b4f;
}

.panel,
.message-row,
.table-wrap,
.setup-panel,
.stat-tile {
    border-color: #dce3de;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(23, 33, 30, .035);
}

.panel {
    padding: 1.35rem;
}

.panel h2 {
    color: #17211e;
    font-size: 1.25rem;
    letter-spacing: -.015em;
}

.dashboard-stats {
    gap: .85rem;
    margin-bottom: 1.25rem;
}

.stat-tile {
    position: relative;
    min-height: 7rem;
    padding: 1.25rem;
    overflow: hidden;
}

.stat-tile::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: #8fc5ab;
    content: "";
}

.stat-tile:hover,
.stat-tile:focus-visible {
    border-color: #9bc8af;
    box-shadow: 0 12px 30px rgba(23, 92, 69, .09);
    color: inherit;
}

.stat-tile.danger::before {
    background: #d95555;
}

.bot-status-card {
    border-radius: 10px;
    padding: 1.15rem;
}

.bot-status-details--summary {
    grid-template-columns: minmax(8.5rem, max-content) minmax(0, 1fr);
}

.operational-details,
.endpoint-technical-details,
.compatibility-note,
.danger-zone {
    margin-top: 1rem;
    border-top: 1px solid #e1e7e3;
    padding-top: .8rem;
    color: #53635d;
}

:where(.operational-details, .endpoint-technical-details, .compatibility-note, .danger-zone) summary {
    color: #3b4c46;
    cursor: pointer;
    font-weight: 700;
}

.operational-details[open] summary,
.endpoint-technical-details[open] summary,
.compatibility-note[open] summary,
.danger-zone[open] summary {
    margin-bottom: .75rem;
}

.content-filter-bar {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dde4df;
}

.content-filter-bar .segmented {
    justify-content: flex-start;
}

.content-topic-filter {
    display: grid;
    min-width: min(25rem, 100%);
    gap: .25rem;
    color: #3b4c46;
    font-weight: 700;
}

.content-topic-filter select {
    min-width: 0;
}

.content-topic-filter small {
    max-width: 32rem;
    color: #66766f;
    font-weight: 500;
}

.segmented a {
    border-color: transparent;
    background: #eef2ef;
    font-weight: 700;
}

.segmented a.active,
.segmented a:hover {
    border-color: #13795b;
}

.content-command-panel {
    display: grid;
    gap: 1rem;
    margin-bottom: .25rem;
    padding: 1.35rem;
    border-color: #bcd7c9;
    background: linear-gradient(135deg, #fff, #f5faf7);
}

.message-technical-details {
    margin-top: .35rem;
    color: #66766f;
    font-size: .82rem;
}

.message-technical-details summary {
    width: fit-content;
    cursor: pointer;
    color: #53635d;
    font-weight: 700;
}

.message-technical-details[open] summary {
    margin-bottom: .35rem;
}

.message-technical-details div + div {
    margin-top: .2rem;
}

.content-command-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.content-command-panel__header h2,
.content-command-panel__header p {
    margin-bottom: 0;
}

.content-dispatch-grid {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: .9rem;
}

.publication-target-picker {
    display: grid;
    align-content: start;
    gap: .8rem;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, .9);
}

.publication-target-picker__heading {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
}

.publication-target-picker__heading > div {
    display: grid;
    gap: .15rem;
}

.publication-target-picker__heading span:last-child,
.publication-target-option small {
    display: block;
    color: #64736d;
    font-size: .82rem;
    font-weight: 500;
}

.step-number {
    display: inline-flex;
    width: 1.8rem;
    height: 1.8rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dff1e7;
    color: #0f6b4f;
    font-weight: 800;
}

.publication-target-options {
    display: grid;
    gap: .55rem;
}

.publication-target-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10rem, auto);
    gap: .65rem;
    align-items: center;
    border-bottom: 1px solid #edf1ee;
    padding-bottom: .55rem;
}

.publication-target-option:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.compact-actions {
    margin-top: 0;
}

.content-danger-zone {
    margin-top: 0;
}

.message-row {
    padding: 1.2rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.message-row:hover {
    border-color: #b8cec1;
    box-shadow: 0 12px 30px rgba(23, 33, 30, .065);
}

.support-page-heading {
    margin-bottom: 1.25rem;
}

.qa-layout {
    gap: 1.15rem;
}

.qa-conversation-list {
    max-height: calc(100vh - 9rem);
    overflow-y: auto;
    padding-right: .25rem;
}

.qa-conversation-card {
    border-radius: 10px;
    padding: .95rem;
}

.qa-thread {
    min-height: min(760px, calc(100vh - 9rem));
    border-radius: 12px;
}

.bot-log-settings-panel {
    margin-bottom: 1rem;
}

.settings-page-heading {
    margin-bottom: 1.35rem;
}

.settings-shell {
    gap: 1.25rem;
}

.settings-sidebar {
    border-radius: 12px;
    padding: .85rem;
}

.settings-nav a {
    border-radius: 8px;
    padding: .62rem .7rem;
}

.settings-nav a.active {
    box-shadow: inset 3px 0 0 #13795b;
}

.settings-overview,
.settings-section-intro {
    border-color: #bdd8ca;
}

.settings-checklist__item,
.settings-subsection {
    border-radius: 10px;
}

.endpoint-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
    gap: 1rem;
}

.endpoint-card {
    display: grid;
    align-content: start;
    gap: .15rem;
    padding: 1.15rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(23, 33, 30, .03);
}

.endpoint-card > * + * {
    margin-top: .55rem;
}

.endpoint-card__identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
    color: #53635d;
}

.platform-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .22rem .58rem;
    background: #edf2ef;
    color: #33413d;
    font-size: .78rem;
    font-weight: 800;
}

.platform-pill.telegram {
    background: #e5f5fc;
    color: #116d96;
}

.platform-pill.instagram {
    background: #f7eaf4;
    color: #8a356e;
}

.platform-pill.vk {
    background: #e8f1ff;
    color: #2863a8;
}

.platform-pill.max {
    background: #f0eaff;
    color: #5a3ca1;
}

.endpoint-name-editor {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) auto auto;
    gap: .45rem;
    flex: 1 1 100%;
}

.endpoint-name-editor input {
    min-width: 0;
}

.endpoint-rename-button {
    justify-self: start;
}

.endpoint-technical-details {
    font-size: .85rem;
}

.endpoint-technical-details div + div {
    margin-top: .35rem;
}

.compatibility-note {
    margin-bottom: 1rem;
    border: 1px solid #dce3de;
    border-radius: 10px;
    padding: .85rem 1rem;
    background: #f7f9f7;
}

.compatibility-note p:last-child {
    margin-bottom: 0;
}

.setup-page {
    display: grid;
    min-height: min(680px, calc(100vh - 10rem));
    place-items: center;
}

.setup-panel {
    width: min(100%, 31rem);
    margin: 1rem auto;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(23, 60, 47, .1);
}

.auth-panel__logo {
    display: block;
    margin-bottom: 1rem;
    border-radius: 18px;
    filter: drop-shadow(0 8px 18px rgba(19, 121, 91, .18));
}

.error-panel .btn {
    margin-top: .75rem;
}

@media (min-width: 1100px) {
    .qa-thread {
        position: sticky;
        top: var(--app-sticky-top);
    }
}

@media (max-width: 960px) {
    .content-dispatch-grid {
        grid-template-columns: 1fr;
    }

    .qa-conversation-list {
        max-height: none;
        overflow: visible;
    }

    .qa-thread {
        min-height: 30rem;
    }
}

@media (max-width: 575.98px) {
    .navbar .nav-links a.active::after {
        display: none;
    }

    main.app-container {
        padding-top: 1.25rem;
    }

    .page-heading {
        margin-bottom: 1.25rem;
    }

    .page-heading h1 {
        font-size: 2.15rem;
    }

    .page-heading__actions,
    .page-heading .quick-actions,
    .page-heading__actions .btn,
    .page-heading .quick-actions .btn {
        width: 100%;
    }

    .page-heading__actions,
    .page-heading .quick-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .content-filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .content-filter-bar .segmented {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: .2rem;
        scrollbar-width: none;
    }

    .content-filter-bar .segmented::-webkit-scrollbar {
        display: none;
    }

    .content-filter-bar .segmented a {
        flex: 0 0 auto;
    }

    .content-topic-filter {
        width: 100%;
        min-width: 0;
    }

    .content-command-panel__header,
    .publication-target-option {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .content-command-panel__header {
        flex-direction: column;
    }

    .endpoint-name-editor {
        grid-template-columns: 1fr 1fr;
    }

    .endpoint-name-editor input {
        grid-column: 1 / -1;
    }

    .setup-panel {
        padding: 1.35rem;
    }

    /* The nav itself scrolls sideways (not the sidebar), so the search field
       above it stays put while the route strip pans. min-width: 0 keeps the
       sidebar shrinkable as a grid item — without it the strip's content
       width blows the whole layout viewport past the screen. */
    .settings-sidebar {
        min-width: 0;
        max-width: 100%;
        padding: .45rem;
    }

    .settings-nav {
        display: flex;
        max-width: 100%;
        align-items: center;
        gap: .25rem;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .settings-nav::-webkit-scrollbar {
        display: none;
    }

    .settings-nav__group-title,
    .settings-nav__sections {
        display: none;
    }

    .settings-nav a {
        flex: 0 0 auto;
        padding: .55rem .7rem;
        white-space: nowrap;
    }

    .settings-nav a.active {
        box-shadow: inset 0 -3px 0 #13795b;
    }
}

@media (max-width: 960px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .segmented {
        justify-content: flex-start;
    }

    .queue-card__header,
    .queue-card__body {
        grid-template-columns: 1fr;
    }

    .queue-card__actions {
        justify-content: flex-start;
    }

    .automation-editor-shell,
    .automation-fields,
    .automation-condition-card {
        grid-template-columns: 1fr;
    }

    .automation-inspector {
        order: -1;
    }

    .automation-mobile-order-hint {
        display: block;
    }
}

@media (min-width: 1100px) {
    .automation-inspector {
        position: sticky;
        top: var(--app-sticky-top);
    }
}

/* ==========================================================================
   Рассылки и аудитории
   ========================================================================== */

.content-page-heading {
    align-items: flex-start;
    justify-content: space-between;
}

.content-page-heading .page-heading__actions {
    flex: 0 0 auto;
}

.panel-actions {
    align-items: center;
}

/* Плитки показателей ------------------------------------------------------ */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: .85rem;
    margin-bottom: 1.25rem;
}

.metric-tile {
    display: grid;
    align-content: start;
    gap: .2rem;
    min-width: 0;
    padding: .95rem 1rem;
    border: 1px solid #dce3de;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 33, 30, .035);
}

.metric-tile__label {
    color: #5f6d68;
    font-size: .82rem;
    font-weight: 700;
}

.metric-tile__value {
    color: #17211e;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.metric-tile__hint {
    color: #6f7d77;
    font-size: .8rem;
}

.metric-tile--accent {
    border-color: #bcd7c9;
    background: linear-gradient(135deg, #fff, #f2faf5);
}

.metric-tile--accent .metric-tile__value {
    color: #0f6b4f;
}

.metric-tile--attention {
    border-color: #ead48a;
    background: linear-gradient(135deg, #fff, #fffaef);
}

.metric-tile--attention .metric-tile__value {
    color: #8a6410;
}

.metric-tile--danger {
    border-color: #f0c2c2;
    background: linear-gradient(135deg, #fff, #fff6f6);
}

.metric-tile--danger .metric-tile__value {
    color: #b42318;
}

.metric-tile--quiet {
    background: #fbfcfa;
    box-shadow: none;
}

.metric-tile--quiet .metric-tile__value {
    font-size: 1.4rem;
}

a.metric-tile {
    color: inherit;
    text-decoration: none;
}

a.metric-tile:hover,
a.metric-tile:focus-visible {
    border-color: #91c7ad;
}

/* Вкладки страницы -------------------------------------------------------- */

.page-tabs {
    justify-content: flex-start;
    margin-bottom: 1.25rem;
}

.segmented button {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: .4rem .85rem;
    background: #eef2ef;
    color: #344054;
    font-weight: 700;
}

.segmented button:hover,
.segmented button.active {
    border-color: #13795b;
    background: #13795b;
    color: #fff;
}

.segmented__count {
    border-radius: 999px;
    padding: 0 .4rem;
    background: rgba(23, 33, 30, .1);
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
}

.segmented button.active .segmented__count,
.segmented a.active .segmented__count {
    background: rgba(255, 255, 255, .22);
}

.segmented__count--attention {
    background: #f0b429;
    color: #3b2c05;
}

/* Панель фильтров / инструментов ------------------------------------------ */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
    margin-bottom: 1rem;
}

.filter-bar .search-field {
    flex: 1 1 18rem;
    min-width: 0;
}

.audience-search {
    display: grid;
    gap: .4rem;
    margin-bottom: 1rem;
}

label.audience-search__label {
    margin: 0;
    color: #22302c;
    font-size: .95rem;
    font-weight: 700;
}

.audience-search__controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .65rem;
    align-items: stretch;
}

.panel .audience-search__controls input {
    min-height: 2.55rem;
}

.audience-search__submit {
    min-width: 6.5rem;
}

.panel .search-field label,
.search-field label {
    margin-bottom: .35rem;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: .4rem .85rem;
    margin-bottom: .75rem;
}

/* Чипы выбора ------------------------------------------------------------- */

.chip-set {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: .85rem;
}

.chip-toggle,
label.chip-toggle,
.panel .chip-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    border: 1px solid #d3dcd7;
    border-radius: 999px;
    padding: .35rem .8rem;
    background: #fff;
    color: #33413d;
    font-size: .9rem;
    font-weight: 650;
    cursor: pointer;
    user-select: none;
}

.chip-toggle:hover {
    border-color: #91c7ad;
}

.chip-toggle .choice-control,
.panel .chip-toggle .choice-control {
    width: 1rem;
    min-width: 0;
    height: 1rem;
    min-height: 0;
    flex: 0 0 auto;
    margin: 0;
    accent-color: #13795b;
}

.chip-toggle:has(input:checked) {
    border-color: #13795b;
    background: #edf5ef;
    color: #0f6b4f;
}

.chip-toggle--exclude:has(input:checked) {
    border-color: #e0a3a3;
    background: #fff2f2;
    color: #9b2c2c;
}

.chip-toggle input:focus-visible {
    outline: 2px solid #91c7ad;
    outline-offset: 2px;
}

.tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .15rem .55rem;
    background: #eef2ef;
    color: #44514c;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.tag--tg {
    background: #e2f1fb;
    color: #10557d;
}

.tag--max {
    background: #efe8fb;
    color: #533a8b;
}

.tag--email {
    background: #eef2ef;
    color: #44514c;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

/* Карточка кампании ------------------------------------------------------- */

.campaign-list {
    display: grid;
    gap: .85rem;
}

.campaign-card {
    display: grid;
    gap: .85rem;
    min-width: 0;
    padding: 1.15rem 1.25rem;
    border: 1px solid #dce3de;
    border-left: 4px solid #cfd8d2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 33, 30, .035);
}

.campaign-card--running {
    border-left-color: #13795b;
}

.campaign-card--scheduled {
    border-left-color: #2f80ed;
}

.campaign-card--paused {
    border-left-color: #f0b429;
}

.campaign-card--failed {
    border-left-color: #c83232;
}

.campaign-card--draft {
    border-left-color: #b6c2bc;
    background: #fbfcfa;
}

.campaign-card--selected {
    border-color: #91c7ad;
    box-shadow: 0 0 0 3px rgba(19, 121, 91, .12);
}

.campaign-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.campaign-card__title {
    min-width: 0;
}

.campaign-card__title h3 {
    margin: 0;
    color: #17211e;
    font-size: 1.1rem;
    letter-spacing: -.015em;
}

.campaign-card__meta {
    margin: .25rem 0 0;
    color: #6f7d77;
    font-size: .84rem;
}

.campaign-card__excerpt {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #4b5a54;
    font-size: .9rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.campaign-progress {
    display: grid;
    gap: .35rem;
}

.campaign-progress__bar {
    height: .5rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e8ede9;
}

.campaign-progress__bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #13795b;
}

.campaign-progress__bar span.is-paused {
    background: #f0b429;
}

.campaign-progress__legend {
    margin: 0;
    color: #5f6d68;
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
}

.metric-row {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.6rem;
    margin: 0;
}

.metric-row > div {
    min-width: 0;
}

.metric-row dt {
    color: #6f7d77;
    font-size: .78rem;
    font-weight: 650;
}

.metric-row dd {
    margin: 0;
    color: #17211e;
    font-size: 1.05rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.metric-row dd.is-danger {
    color: #b42318;
}

.metric-row dd.is-muted {
    color: #8a958f;
}

.campaign-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding-top: .15rem;
}

.btn-quiet.is-danger {
    color: #b42318;
}

.btn-quiet.is-danger:hover,
.btn-quiet.is-danger:focus-visible {
    border-color: #f0c2c2;
    background: #fff2f2;
    color: #b42318;
}

/* Конструктор рассылки ---------------------------------------------------- */

.composer {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.composer__main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.composer__rail {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

@media (min-width: 1100px) {
    .composer {
        grid-template-columns: minmax(0, 1fr) 21.5rem;
    }

    .composer__rail {
        position: sticky;
        top: var(--app-sticky-top);
    }
}

.step-heading {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 1rem;
}

.step-heading__index {
    display: inline-flex;
    width: 1.6rem;
    height: 1.6rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #13795b;
    color: #fff;
    font-size: .85rem;
    font-weight: 800;
}

.step-heading h2 {
    margin: 0;
}

.step-heading__hint {
    margin-left: auto;
    color: #6f7d77;
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
}

.step-heading__hint.is-over {
    color: #b42318;
    font-weight: 700;
}

.field-hint {
    margin: -.5rem 0 .85rem;
    color: #6f7d77;
    font-size: .84rem;
    line-height: 1.5;
}

/* Предпросмотр сообщения -------------------------------------------------- */

.tg-preview {
    padding: 1rem;
    border-radius: 12px;
    background: #cfe0d3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='8' cy='8' r='1.5' fill='%23ffffff' opacity='.35'/%3E%3Ccircle cx='28' cy='24' r='1.5' fill='%23ffffff' opacity='.35'/%3E%3C/svg%3E");
}

.tg-preview__bubble {
    max-width: 100%;
    padding: .6rem .75rem;
    border-radius: 12px 12px 12px 4px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(23, 33, 30, .18);
    color: #17211e;
    font-size: .9rem;
    line-height: 1.45;
}

.tg-preview__asset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    height: 5.5rem;
    margin-bottom: .5rem;
    border-radius: 8px;
    background: #eef2ef;
    color: #5f6d68;
    font-size: .8rem;
    font-weight: 650;
}

.tg-preview__image {
    display: block;
    width: 100%;
    max-height: 22rem;
    margin-bottom: .5rem;
    border-radius: 8px;
    background: #eef2ef;
    object-fit: contain;
}

.tg-preview__text {
    margin: 0;
    white-space: pre-wrap;
}

.tg-preview__text em {
    font-style: italic;
}

.tg-preview__placeholder {
    color: #8a958f;
}

.tg-preview__var {
    border-radius: 4px;
    padding: 0 .2rem;
    background: #e6f1ea;
    color: #0f6b4f;
    font-weight: 650;
}

.tg-preview__button {
    margin-top: .5rem;
    padding: .45rem;
    border-radius: 8px;
    background: #eef4f8;
    color: #2f80ed;
    font-size: .85rem;
    font-weight: 650;
    text-align: center;
}

.tg-preview__time {
    display: block;
    margin-top: .2rem;
    color: #9aa5a0;
    font-size: .72rem;
    text-align: right;
}

.broadcast-source {
    margin-top: 1rem;
    border-top: 1px solid #e1e7e3;
    padding-top: 1rem;
}

.broadcast-source summary {
    cursor: pointer;
}

.broadcast-source__text {
    max-height: 28rem;
    margin: .85rem 0 0;
    overflow: auto;
    border: 1px solid #dce3de;
    border-radius: 8px;
    padding: .85rem;
    background: #f7f9f7;
    color: #27332f;
    font: inherit;
    line-height: 1.5;
    white-space: pre-wrap;
}

.broadcast-source__meta {
    display: grid;
    gap: .5rem;
    margin: .85rem 0 0;
}

.broadcast-source__meta div {
    display: grid;
    grid-template-columns: minmax(7rem, auto) 1fr;
    gap: .75rem;
}

.broadcast-source__meta dt {
    color: #6f7d77;
    font-weight: 650;
}

.broadcast-source__meta dd {
    min-width: 0;
    margin: 0;
}

/* Панель запуска ---------------------------------------------------------- */

.launch-panel {
    border-color: #bcd7c9;
    background: linear-gradient(135deg, #fff, #f4faf7);
}

.launch-reach {
    display: grid;
    gap: .1rem;
    margin-bottom: .85rem;
    padding: .85rem 1rem;
    border: 1px solid #cfe1d7;
    border-radius: 10px;
    background: #fff;
}

.launch-reach strong {
    color: #0f6b4f;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.launch-reach span {
    color: #5f6d68;
    font-size: .85rem;
}

.checklist {
    display: grid;
    gap: .4rem;
    margin: 0 0 .85rem;
    padding: 0;
    list-style: none;
}

.checklist li {
    display: grid;
    grid-template-columns: 1.15rem minmax(0, 1fr);
    gap: .5rem;
    align-items: start;
    color: #5f6d68;
    font-size: .88rem;
    line-height: 1.4;
}

.checklist li::before {
    content: "○";
    color: #a9b4ae;
    font-size: .95rem;
    line-height: 1.3;
    text-align: center;
}

.checklist li.is-done {
    color: #33413d;
}

.checklist li.is-done::before {
    content: "✓";
    color: #13795b;
    font-weight: 800;
}

.checklist li.is-blocked::before {
    content: "!";
    color: #b42318;
    font-weight: 800;
}

.checklist li.is-blocked {
    color: #8a3a34;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.launch-divider {
    margin: .85rem 0;
    border: 0;
    border-top: 1px solid #dce3de;
}

/* Разбор охвата ----------------------------------------------------------- */

.reach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: .5rem;
    margin-bottom: 1rem;
}

.reach-item {
    display: grid;
    gap: .1rem;
    padding: .65rem .75rem;
    border: 1px solid #e4eae6;
    border-radius: 10px;
    background: #fbfcfa;
}

.reach-item strong {
    color: #17211e;
    font-size: 1.25rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.reach-item span {
    color: #6f7d77;
    font-size: .8rem;
    line-height: 1.35;
}

.reach-item--muted strong {
    color: #8a958f;
}

.reach-item--attention {
    border-color: #ead48a;
    background: #fffaef;
}

.reach-item--attention strong {
    color: #8a6410;
}

.reach-item--included {
    border-color: #bcd7c9;
    background: #f2faf5;
}

.reach-item--included strong {
    color: #0f6b4f;
}

/* Карточка кандидата на проверку ------------------------------------------ */

.candidate-filter-panel {
    margin-bottom: 1rem;
}

.candidate-filter-bar {
    margin-bottom: .35rem;
}

.candidate-filter-field {
    flex: 0 1 13rem;
    min-width: 11rem;
}

.candidate-filter-panel label {
    margin-bottom: 0;
}

.candidate-filter-summary {
    margin: 0;
    color: #5f6d68;
    font-size: .88rem;
    font-variant-numeric: tabular-nums;
}

.candidate-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 34rem), 1fr));
    align-items: start;
    gap: .85rem;
}

.candidate-card {
    display: grid;
    gap: .55rem;
    min-width: 0;
    padding: .9rem 1rem;
    border: 1px solid #dce3de;
    border-left: 4px solid #f0b429;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 33, 30, .035);
}

.candidate-card--blocked {
    border-left-color: #c83232;
}

.candidate-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.candidate-card__meta {
    margin: 0 0 0 auto;
    color: #6f7d77;
    font-size: .82rem;
}

.candidate-card__value {
    margin: 0;
    color: #17211e;
    font-size: 1.05rem;
    font-weight: 750;
}

.candidate-card__context {
    margin: 0;
    color: #5f6d68;
    font-size: .84rem;
    line-height: 1.4;
}

.candidate-card__details {
    margin: 0;
    color: #6f7d77;
    font-size: .8rem;
    line-height: 1.4;
}

.candidate-card__identity {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    min-width: 0;
    padding: .55rem .65rem;
    border-radius: 8px;
    background: #f6f8f6;
}

.candidate-card__identity > div {
    display: grid;
    gap: .12rem;
    min-width: 0;
}

.candidate-card__identity span {
    color: #65736e;
    font-size: .78rem;
}

.candidate-card__identity a {
    flex: 0 0 auto;
    color: #0f6b4f;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
}

.candidate-card__identity a:hover,
.candidate-card__identity a:focus-visible {
    text-decoration: underline;
}

.candidate-card__resolve {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: .75rem;
    padding: .65rem;
    border: 1px solid #e4eae6;
    border-radius: 10px;
    background: #fbfcfa;
}

.candidate-card label,
.ops-card label {
    display: grid;
    gap: .35rem;
    margin-bottom: .75rem;
    color: #22302c;
    font-size: .95rem;
    font-weight: 650;
}

.candidate-card input:not([type="checkbox"]):not([type="radio"]),
.candidate-card select,
.ops-card input:not([type="checkbox"]):not([type="radio"]),
.ops-card select {
    width: 100%;
    min-height: 2.4rem;
    box-sizing: border-box;
    border: 1px solid #cfd8d2;
    border-radius: 6px;
    padding: .5rem .65rem;
    background: #fff;
    color: #17211e;
}

.candidate-card__resolve label {
    margin-bottom: 0;
}

.candidate-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.candidate-email-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: .5rem;
}

.candidate-email-option,
.candidate-card label.candidate-email-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .55rem;
    min-width: 0;
    margin: 0;
    padding: .6rem .65rem;
    border: 1px solid #dce3de;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.candidate-email-option:hover {
    border-color: #91c7ad;
    background: #f7fbf8;
}

.candidate-email-option--selected,
.candidate-card label.candidate-email-option--selected {
    border-color: #13795b;
    background: #f0f8f3;
    box-shadow: 0 0 0 1px #13795b;
}

.candidate-email-option input {
    margin: .18rem 0 0;
}

.candidate-email-option__body {
    display: grid;
    gap: .32rem;
    min-width: 0;
}

.candidate-email-option__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem .5rem;
}

.candidate-email-option__head strong {
    font-size: .86rem;
}

.candidate-email-option__head small {
    color: #7b8984;
    font-size: .7rem;
    white-space: nowrap;
}

.candidate-email-option__excerpt {
    color: #596862;
    font-size: .76rem;
    font-weight: 400;
    line-height: 1.38;
}

.candidate-card label.candidate-email-merge {
    grid-template-columns: auto minmax(0, 1fr);
    margin: 0;
    padding: .55rem .65rem;
    border: 1px dashed #b8cbc1;
    border-radius: 8px;
    background: #f7faf8;
    cursor: pointer;
}

.candidate-email-merge > span {
    display: grid;
    gap: .15rem;
}

.candidate-email-merge strong {
    font-size: .83rem;
}

.candidate-email-merge small {
    color: #65736e;
    font-size: .74rem;
    font-weight: 400;
    line-height: 1.35;
}

.candidate-card__raw {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    margin-left: auto;
    font-size: .84rem;
}

.candidate-card__raw[open] {
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
}

.candidate-card__raw summary {
    width: fit-content;
    color: #53635d;
    cursor: pointer;
    font-weight: 700;
}

.candidate-card__raw pre {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: .5rem 0 0;
    padding: .65rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    border-radius: 8px;
    background: #f2f5f3;
    color: #33413d;
    font-size: .8rem;
}

/* Обслуживание аудиторий -------------------------------------------------- */

.ops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    gap: 1rem;
}

.ops-card {
    display: grid;
    align-content: start;
    gap: .6rem;
    min-width: 0;
    padding: 1.15rem 1.25rem;
    border: 1px solid #dce3de;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 33, 30, .035);
}

.ops-card h3 {
    margin: 0;
    color: #17211e;
    font-size: 1.02rem;
}

.ops-card p {
    margin: 0;
    color: #5f6d68;
    font-size: .88rem;
    line-height: 1.5;
}

.ops-card .button-row {
    margin-top: .25rem;
}

.ops-card--primary {
    border-color: #bcd7c9;
    background: linear-gradient(135deg, #fff, #f4faf7);
}

.ops-steps {
    display: grid;
    gap: .35rem;
    margin: 0;
    padding: 0;
    counter-reset: ops;
    list-style: none;
}

.ops-steps li {
    display: grid;
    grid-template-columns: 1.35rem minmax(0, 1fr);
    gap: .5rem;
    align-items: start;
    color: #5f6d68;
    font-size: .86rem;
    line-height: 1.45;
}

.ops-steps li::before {
    counter-increment: ops;
    content: counter(ops);
    display: inline-flex;
    width: 1.35rem;
    height: 1.35rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef2ef;
    color: #44514c;
    font-size: .75rem;
    font-weight: 800;
}

.ops-steps li.is-done::before {
    background: #13795b;
    color: #fff;
    content: "✓";
}

.ops-steps li.is-done {
    color: #33413d;
}

/* Таблицы: плотность и переносы ------------------------------------------- */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table--resizable {
    min-width: 100%;
    table-layout: fixed;
}

.data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid #dce3de;
    background: #f7faf8;
    color: #53635d;
    font-size: .78rem;
    font-weight: 750;
    letter-spacing: .02em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table th[data-column-key] {
    padding: 0;
}

.data-table__heading,
.data-table__sort {
    display: flex;
    width: 100%;
    min-height: 2.55rem;
    box-sizing: border-box;
    align-items: center;
    gap: .35rem;
    padding: .6rem 1.15rem .6rem .75rem;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: inherit;
    text-transform: inherit;
}

.data-table__sort {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.data-table__sort:hover,
.data-table__sort:focus-visible {
    background: #edf5ef;
    color: #0f6b4f;
}

.data-table__sort:focus-visible {
    outline: 2px solid #7eb99d;
    outline-offset: -2px;
}

.data-table__sort-indicator {
    color: #13795b;
    font-size: 1rem;
    line-height: 1;
}

.data-table th.num .data-table__heading,
.data-table th.num .data-table__sort {
    justify-content: flex-end;
}

.data-table__resize-handle {
    position: absolute;
    z-index: 3;
    top: 0;
    right: -.35rem;
    bottom: 0;
    width: .7rem;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: col-resize;
    touch-action: none;
}

.data-table__resize-handle::after {
    position: absolute;
    top: .45rem;
    right: .32rem;
    bottom: .45rem;
    width: 2px;
    border-radius: 999px;
    background: transparent;
    content: "";
}

.data-table th:hover .data-table__resize-handle::after,
.data-table__resize-handle:hover::after,
.data-table__resize-handle:focus-visible::after {
    background: #8ab9a2;
}

.data-table__resize-handle:focus-visible {
    outline: 2px solid #13795b;
    outline-offset: -2px;
}

body.is-resizing-data-table,
body.is-resizing-data-table * {
    cursor: col-resize !important;
    user-select: none !important;
}

.data-table th,
.data-table td {
    padding: .6rem .75rem;
    vertical-align: top;
}

.data-table tbody tr + tr td {
    border-top: 1px solid #eaefec;
}

.data-table tbody tr:hover td {
    background: #fafcfa;
}

.data-table .num {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.data-table .nowrap {
    white-space: nowrap;
}

.cell-title {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.cell-title strong {
    color: #17211e;
    font-weight: 700;
}

.cell-title small,
.cell-sub {
    color: #7a857f;
    font-size: .78rem;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .82rem;
}

.table-scroll {
    max-height: 30rem;
    overflow: auto;
    border: 1px solid #dce3de;
    border-radius: 12px;
    background: #fff;
}

.table-scroll table {
    margin: 0;
}

.table-scroll--customers {
    max-height: min(38rem, calc(100vh - 15rem));
}

.data-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem .75rem;
    margin: 0 0 .55rem;
    color: #69766f;
    font-size: .8rem;
}

.data-table-toolbar--compact {
    margin-top: .25rem;
}

.data-table-toolbar .btn {
    flex: 0 0 auto;
}

.audience-customer-table .cell-title strong {
    overflow-wrap: break-word;
    word-break: normal;
}

.audience-program-tags .tag {
    max-width: 100%;
    white-space: normal;
}

.preferred-name-editor {
    display: grid;
    gap: .3rem;
}

.preferred-name-editor__field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .4rem;
    align-items: center;
}

.panel .preferred-name-editor input {
    min-width: 0;
    min-height: 2.1rem;
    padding: .35rem .5rem;
}

.preferred-name-editor__field .btn {
    min-width: 6.75rem;
    white-space: nowrap;
    word-break: normal;
}

.preferred-name-editor small {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
    color: #77837d;
    font-size: .74rem;
}

.preferred-name-editor .status-pill {
    padding: .08rem .4rem;
    font-size: .68rem;
}

@media (max-width: 767.98px) {
    .audience-search__controls {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .audience-search__controls .btn-quiet {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .data-table-toolbar {
        align-items: flex-start;
    }
}

/* Пагинация --------------------------------------------------------------- */

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 1rem;
}

.pager__status {
    color: #5f6d68;
    font-size: .88rem;
    font-variant-numeric: tabular-nums;
}

.pager__controls {
    display: flex;
    gap: .5rem;
}

/* Статусные пилюли: дополнительные тона ----------------------------------- */

.status-pill.info {
    background: #d9f3fa;
    color: #06495a;
}

.status-pill.accent {
    background: #e6f1ea;
    color: #0f6b4f;
}

.status-pill--dot::before {
    content: "";
    width: .45rem;
    height: .45rem;
    margin-right: .4rem;
    border-radius: 999px;
    background: currentColor;
}

@media (max-width: 720px) {
    .campaign-card,
    .candidate-card,
    .ops-card {
        padding: 1rem;
    }

    .metric-grid {
        grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    }

    .campaign-card__actions .btn,
    .candidate-card__actions .btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .candidate-card__meta {
        margin-left: 0;
        flex-basis: 100%;
    }

    .candidate-card__identity {
        display: grid;
    }

    .candidate-filter-field {
        flex: 1 1 100%;
    }
}

/* Settings → Пользователи */
.user-accounts-panel .user-account-list {
    display: grid;
    gap: .75rem;
}

.user-account-card {
    display: grid;
    gap: .75rem;
    padding: .9rem 1rem;
    border: 1px solid #dfe7e2;
    border-radius: 14px;
    background: #fbfdfb;
}

.user-account-card.is-disabled {
    border-color: #e6e0d6;
    background: #faf8f4;
    opacity: .85;
}

.user-account-card__main {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.user-account-card__avatar {
    display: inline-flex;
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #0f6b4f;
    color: #fff;
    font-weight: 700;
}

.user-account-card__identity {
    display: grid;
    min-width: 0;
    gap: .2rem;
}

.user-account-card__email {
    overflow: hidden;
    color: #6f7d77;
    font-size: .85rem;
    text-overflow: ellipsis;
}

.user-account-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .15rem;
}

.user-account-card__actions {
    flex-wrap: wrap;
}

.user-account-card__editor,
.user-account-card__confirm {
    display: grid;
    gap: .75rem;
    padding-top: .75rem;
    border-top: 1px dashed #dfe7e2;
}

.user-account-card__confirm {
    border-top-color: #f0aaaa;
    color: #7a1d1d;
}

.user-account-card__confirm p {
    margin: 0;
}

.user-account-card__password {
    padding-top: .5rem;
    border-top: 1px dashed #dfe7e2;
}

.user-account-create {
    display: grid;
    gap: .75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e8ede9;
}

.user-account-create h3 {
    margin: 0;
    font-size: 1.05rem;
}

@media (max-width: 767.98px) {
    .user-account-card__actions .btn {
        flex: 1 1 8rem;
    }
}

/* ---------------------------------------------------------------------------
   Support chat on phones and tablets.
   Below 900px the conversation list and the thread become two screens instead
   of two columns: /qa shows the list, /qa?conversationId=... shows the thread
   with a back link. Above it nothing changes.
   ------------------------------------------------------------------------- */
.qa-thread-back {
    display: none;
    align-items: center;
    gap: .3rem;
    align-self: start;
    margin-bottom: .35rem;
    padding: .5rem .75rem .5rem .5rem;
    border-radius: 999px;
    background: #f2f5f2;
    color: #0f6b4f;
    font-weight: 650;
    text-decoration: none;
}

.qa-thread-back:hover,
.qa-thread-back:focus-visible {
    background: #e6f2ea;
    color: #0b5540;
    text-decoration: none;
}

.qa-thread-back span {
    font-size: 1.25rem;
    line-height: 1;
}

.qa-thread-facts > summary {
    display: none;
}

/* Thread action labels shrink on phones so close/delete/details fit one row. */
.qa-action-label--short {
    display: none;
}

@media (max-width: 899.98px) {
    .qa-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .qa-layout[data-qa-view="thread"] .qa-conversation-list {
        display: none;
    }

    .qa-layout[data-qa-view="list"] .qa-thread {
        display: none;
    }

    .qa-thread {
        display: flex;
        min-height: 0;
        flex-direction: column;
        padding: .85rem;
    }

    .qa-thread-back {
        display: inline-flex;
    }

    /* One wrapping row: title, then the action buttons with the collapsed
       identity toggle sitting beside them instead of on its own line. */
    .qa-thread-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .5rem;
        margin-bottom: .65rem;
    }

    .qa-thread-header > .qa-thread-title {
        flex: 1 1 100%;
    }

    .qa-thread-header > .qa-thread-actions {
        flex: 0 1 auto;
    }

    .qa-thread-header > .qa-thread-facts {
        flex: 0 1 auto;
        min-width: 0;
    }

    /* Expanded facts take the full width on their own line. */
    .qa-thread-header > .qa-thread-facts[open] {
        flex: 1 1 100%;
    }

    .qa-thread-header h2 {
        font-size: 1.3rem;
    }

    .qa-thread-actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: .5rem;
    }

    .qa-thread-actions .btn {
        min-height: 2.5rem;
        padding-right: .7rem;
        padding-left: .7rem;
    }

    .qa-action-label {
        display: none;
    }

    .qa-action-label--short {
        display: inline;
    }

    .qa-delete-confirmation {
        flex: 1 1 100%;
    }

    /* Collapsed identity panel: qa-composer.js closes it on first render so the
       composer stays within thumb reach. */
    /* Styled like the neighbouring outline buttons so the row reads as one set. */
    .qa-thread-facts > summary {
        display: inline-flex;
        min-height: 2.5rem;
        align-items: center;
        gap: .4rem;
        padding: .35rem .75rem;
        border: 1px solid #cfdcd4;
        border-radius: 8px;
        background: #f8faf8;
        color: #33413d;
        font-size: .9rem;
        font-weight: 650;
        white-space: nowrap;
        cursor: pointer;
        list-style: none;
    }

    .qa-thread-facts[open] > summary {
        margin-bottom: .1rem;
    }

    .qa-thread-facts > summary::-webkit-details-marker {
        display: none;
    }

    .qa-thread-facts > summary::after {
        color: #6f7d77;
        content: "▾";
    }

    .qa-thread-facts[open] > summary::after {
        content: "▴";
    }

    .qa-thread-facts .details-list {
        margin-top: .5rem;
        font-size: .88rem;
    }

    /* Newest-first list keeps the reply box next to the latest message; sticking
       it under the app header keeps it reachable while reading history. */
    .qa-thread .qa-composer {
        position: sticky;
        /* Flush against the header, not offset from it — the point is to keep
           the reply box reachable, so no gap here. 3.75rem was the header
           height at this width, correct only by coincidence. */
        top: var(--app-header-h);
        z-index: 3;
        margin: 0 -.85rem;
        padding: .5rem .85rem .6rem;
        background: #fff;
        box-shadow: 0 8px 16px -12px rgba(23, 33, 30, .5);
    }

    .qa-composer-input {
        font-size: 16px; /* Prevents iOS Safari from zooming on focus. */
    }

    .qa-composer-icon,
    .qa-composer-send {
        min-width: 2.75rem;
        min-height: 2.75rem;
    }

    .qa-composer-hint {
        display: none;
    }

    .qa-conversation-list {
        gap: .55rem;
    }

    .qa-conversation-card {
        padding: .85rem .9rem;
    }

    .qa-message {
        padding: .75rem;
    }

    .qa-message-list {
        gap: .6rem;
    }

    .support-page-heading .page-description {
        display: none;
    }

    .support-page-heading h1 {
        font-size: 1.75rem;
    }

    .support-page-heading .page-heading__actions {
        flex-wrap: wrap;
        gap: .5rem;
    }

    .qa-delete-confirmation {
        max-width: none;
    }
}

/* Phone-sized reply metadata: keep the author readable and let the rest wrap. */
@media (max-width: 575.98px) {
    .qa-message .message-meta {
        gap: .3rem .5rem;
        font-size: .75rem;
    }

    .qa-message-author {
        font-weight: 700;
    }

    .qa-thread-actions .btn {
        flex: 1 1 9rem;
    }
}

/* Per-message delete inside a support answer. */
.qa-message-delete {
    appearance: none;
    padding: .1rem .45rem;
    border: 1px solid #f0c4c0;
    border-radius: 999px;
    background: #fff;
    color: #a8342a;
    font: inherit;
    font-size: .75rem;
    font-weight: 650;
    line-height: 1.5;
    cursor: pointer;
}

.qa-message-delete:hover,
.qa-message-delete:focus-visible {
    background: #fdeeec;
    border-color: #e39b95;
}

.qa-message-delete-confirm {
    display: grid;
    gap: .5rem;
    margin: .5rem 0;
    padding: .7rem .8rem;
    border: 1px solid #f0aaaa;
    border-radius: 8px;
    background: #fff7f7;
    color: #7a1d1d;
    line-height: 1.4;
}

.qa-message-delete-confirm p {
    margin: 0;
}

.qa-message-delete-confirm__error {
    font-weight: 650;
}

.qa-message-delete-confirm .button-row {
    flex-wrap: wrap;
    gap: .5rem;
}

/* Withdrawn answers stay in the operator thread as muted, clearly marked cards:
   the customer no longer sees them, but the history has to keep making sense. */
.qa-message.is-deleted {
    border-color: #d9dfdb;
    border-style: dashed;
    background: #f2f4f2;
    color: #6f7d77;
}

.qa-message.is-deleted p,
.qa-message.is-deleted .message-meta {
    color: #6f7d77;
}

.qa-message.is-deleted .qa-message-author {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.qa-message.is-deleted .asset-strip,
.qa-message.is-deleted .qa-delivery-panel {
    opacity: .6;
}

.qa-message-deleted-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .1rem .5rem;
    border-radius: 999px;
    background: #59635f;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* Inline editor for a support answer. */
.qa-message-action {
    appearance: none;
    padding: .1rem .45rem;
    border: 1px solid #cfdcd4;
    border-radius: 999px;
    background: #fff;
    color: #0f6b4f;
    font: inherit;
    font-size: .75rem;
    font-weight: 650;
    line-height: 1.5;
    cursor: pointer;
}

.qa-message-action:hover,
.qa-message-action:focus-visible {
    background: #edf5ef;
    border-color: #91c7ad;
}

.qa-message-editor {
    display: grid;
    gap: .5rem;
    margin: .5rem 0;
    padding: .7rem .8rem;
    border: 1px solid #cfdcd4;
    border-radius: 8px;
    background: #fbfdfb;
}

.qa-message-editor__input {
    width: 100%;
    padding: .5rem .6rem;
    border: 1px solid #dbe4de;
    border-radius: 8px;
    font: inherit;
    line-height: 1.45;
    resize: vertical;
}

.qa-message-editor__error {
    margin: 0;
    color: #a8342a;
    font-weight: 650;
}

.qa-message-editor p.muted {
    margin: 0;
    font-size: .8rem;
}

.user-account-role-picker {
    display: grid;
    min-width: 0;
    gap: .4rem;
    margin: 0;
    padding: .65rem .75rem .75rem;
    border: 1px solid #d8e3dc;
    border-radius: .65rem;
    background: #fff;
}

.user-account-role-picker legend {
    padding: 0 .25rem;
    color: #52635a;
    font-size: .82rem;
    font-weight: 700;
}

.user-account-role-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    cursor: pointer;
}

.user-account-role-option span {
    line-height: 1.25;
}

.user-account-role-picker:disabled {
    opacity: .65;
}

.user-account-role-picker:disabled .user-account-role-option {
    cursor: default;
}

.live-completed-duplicate,
.live-commerce {
    margin: 1rem 0;
}

.live-completed-duplicate__list,
.live-commerce__links {
    display: grid;
    gap: .75rem;
    margin: 1rem 0;
}

.live-completed-card,
.live-commerce-template,
.live-commerce__created,
.live-commerce__links article {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem;
    border: 1px solid #dce3df;
    border-radius: .8rem;
    background: #f8faf8;
}

.live-completed-card img,
.live-commerce-template img {
    width: 160px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: .55rem;
}

.live-completed-card__body,
.live-commerce-template > div,
.live-commerce__created > div,
.live-commerce__links article {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .3rem;
}

.live-commerce__wizard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}

.live-commerce__catalog-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}

.live-commerce__results {
    display: grid;
    gap: .4rem;
    margin: .75rem 0;
    max-height: 22rem;
    overflow-y: auto;
    padding-right: .25rem;
}

.live-commerce-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .5rem .6rem;
    border: 1px solid #dce3df;
    border-radius: .7rem;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.live-commerce-option:hover:not(:disabled) {
    border-color: #b8c9c1;
    background: #f8faf8;
}

.live-commerce-option.is-selected {
    border-color: #2f7d63;
    background: #eef6f2;
}

.live-commerce-option:disabled {
    cursor: default;
    opacity: .65;
}

.live-commerce-option img {
    width: 96px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: .45rem;
    flex: none;
}

.live-commerce-option__body {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
}

.live-commerce__shortener {
    margin-top: 1rem;
}

.live-commerce__created-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .5rem;
}

.live-commerce__cover-edit,
.live-product-cover {
    display: grid;
    gap: .85rem;
}

.live-commerce__cover-edit {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #cfe0da;
    border-radius: .8rem;
    background: #f7fbf9;
}

.live-product-cover {
    padding: .9rem;
    border: 1px solid #dce3df;
    border-radius: .8rem;
    background: #fff;
}

.live-product-cover__heading h4,
.live-product-cover__heading p {
    margin: 0;
}

.live-product-cover__heading p {
    margin-top: .2rem;
}

.live-product-cover__choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.live-product-cover__choice {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    align-items: center;
    gap: .7rem;
    min-width: 0;
    padding: .55rem;
    border: 1px solid #d7e2dd;
    border-radius: .7rem;
    background: #fff;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.live-product-cover__choice:hover:not(:disabled),
.live-product-cover__choice:focus-visible {
    border-color: #2f7d63;
    background: #eef6f2;
}

.live-product-cover__choice:disabled {
    opacity: .58;
    cursor: default;
}

.live-product-cover__choice img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: .45rem;
}

.live-product-cover__choice span {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.live-product-cover__choice small {
    color: #5f6d68;
}

.live-product-cover .live-field {
    margin: 0;
}

.live-product-cover__preview {
    margin: 0;
}

.live-product-cover__preview img {
    aspect-ratio: 1;
}

@media (max-width: 720px) {
    .live-completed-card,
    .live-commerce-template,
    .live-commerce__created {
        align-items: stretch;
        flex-direction: column;
    }

    .live-completed-card img,
    .live-commerce-template img {
        width: 100%;
    }

    .live-commerce__created-actions,
    .live-commerce__created-actions .btn {
        width: 100%;
    }

    .live-product-cover__choices {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Kundalini Teachers application controls inside the shared QA thread. */
.kt-application-card{margin:0 0 1rem;padding:1rem;border:1px solid color-mix(in srgb,#b58a42 45%,var(--border-color,#dfe4e8));border-radius:14px;background:linear-gradient(145deg,#fffdf8,#f7f2e8);color:#142a40;box-shadow:0 10px 28px rgba(14,39,62,.07)}
.kt-application-card__header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:.7rem}.kt-application-card__header .eyebrow{display:block;color:#956a25;font-size:.68rem;font-weight:700;letter-spacing:.13em;text-transform:uppercase}.kt-application-card__header h3{margin:.15rem 0 0;font-family:Georgia,serif;font-size:1.45rem;font-weight:500}.kt-automation{flex:none;border-radius:99px;padding:.3rem .6rem;font-size:.7rem;font-weight:700}.kt-automation.active{background:#ddf2e7;color:#236449}.kt-automation.paused{background:#f3e8d3;color:#78541c}
.kt-application-card__details{border-top:1px solid rgba(20,42,64,.12);padding:.65rem 0}.kt-application-card__details summary{cursor:pointer;font-weight:700;color:#244865}.kt-application-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.65rem;margin-top:.75rem}.kt-application-form label{display:grid;gap:.25rem;color:#526678;font-size:.74rem}.kt-application-form input,.kt-application-form select,.kt-application-form textarea,.kt-application-actions input,.kt-quote-row input,.kt-quote-row select{width:100%;min-width:0;border:1px solid #cad3da;border-radius:7px;background:white;color:#142a40;padding:.55rem .65rem;font:inherit}.kt-application-form .kt-wide{grid-column:1/-1}.kt-application-form .kt-consent{display:flex;grid-template-columns:auto 1fr;align-items:center}.kt-consent input{width:auto}.kt-application-card .button-row{display:flex;gap:.5rem;flex-wrap:wrap}
.kt-quote-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem;margin:.7rem 0}.kt-quote-summary span{display:grid;padding:.55rem;border-radius:8px;background:rgba(255,255,255,.72);color:#617284;font-size:.72rem}.kt-quote-summary strong{color:#142a40;font-size:1rem}.kt-quote-row{display:grid;grid-template-columns:130px 1fr 1.7fr 110px 34px;gap:.4rem;margin:.4rem 0}.kt-quote-editor>.button-row{margin-top:.7rem}.kt-application-actions{display:grid;grid-template-columns:minmax(160px,1fr) repeat(4,auto);gap:.45rem;padding-top:.7rem;border-top:1px solid rgba(20,42,64,.12)}.kt-public-links{display:flex;gap:1rem;margin-top:.7rem}.kt-public-links a{color:#8d6424;font-size:.78rem}.kt-application-card__footer{display:flex;justify-content:space-between;align-items:center;gap:.7rem;margin-top:.8rem;color:#70808e;font-size:.7rem}
@media(max-width:900px){.kt-application-card{margin-inline:.65rem}.kt-application-form{grid-template-columns:1fr 1fr}.kt-quote-row{grid-template-columns:1fr 1fr}.kt-quote-row input:nth-of-type(2){grid-column:1/-1}.kt-application-actions{grid-template-columns:1fr 1fr}.kt-application-actions input{grid-column:1/-1}.kt-quote-summary{grid-template-columns:1fr}.kt-application-card__footer{align-items:flex-start;flex-direction:column}}
@media(max-width:560px){.kt-application-form{grid-template-columns:1fr}.kt-application-form .kt-wide{grid-column:1}.kt-application-actions{grid-template-columns:1fr}.kt-application-card__header{align-items:flex-start;flex-direction:column}.kt-public-links{flex-direction:column;gap:.35rem}}

/* Customer 360 is a separate, collapsible support surface. */
.qa-customer-panel { min-width: 0; align-self: start; }
.qa-customer-panel .status-pill { max-width: 100%; white-space: normal; }
.qa-customer-panel details > summary, .qa-routing-panel > summary { cursor: pointer; padding: .6rem 0; }
.qa-customer-panel details + details { border-top: 1px solid var(--border-color, #dbe4df); margin-top: .7rem; }
.qa-customer-panel .qa-customer-record { display: grid; gap: .25rem; padding: .65rem 0; border-bottom: 1px solid #e5ebe7; }
.qa-customer-record small, .qa-customer-candidate small { color: #64766f; }
.qa-customer-facts { display: grid; grid-template-columns: auto 1fr; gap: .4rem .7rem; }
.qa-customer-facts dd { margin: 0; }
.qa-customer-search { display: grid; gap: .5rem; margin: .7rem 0; }
.qa-customer-candidate { display: grid; gap: .2rem; padding: .65rem; width: 100%; margin: .4rem 0; text-align: left; background: #f7faf8; border: 1px solid #dbe4df; border-radius: .65rem; cursor: pointer; }
.qa-routing-panel { background: #f4f8f5; border: 1px solid #dbe4df; border-radius: .7rem; padding: .5rem .85rem; margin-bottom: 1rem; }
.qa-training-management { margin-bottom: 1rem; }
@media (min-width: 1280px) {
    /* Bounded sidebars, flexible conversation: extra desktop space belongs to
       the work area rather than growing three equally oversized columns. */
    .qa-layout {
        --qa-list-width: clamp(260px, 18vw, 360px);
        --qa-customer-width: clamp(300px, 20vw, 380px);
        grid-template-columns: var(--qa-list-width) minmax(0, 1fr);
    }

    .qa-layout--customer:has(.qa-customer-panel) {
        grid-template-columns: var(--qa-list-width) minmax(0, 1fr) var(--qa-customer-width);
    }

    .qa-layout--customer:has(.qa-customer-panel > details:not([open])) {
        grid-template-columns: var(--qa-list-width) minmax(0, 1fr) 120px;
    }

    .qa-thread-header {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    }
}
@media (min-width: 900px) and (max-width: 1279.98px) {
    .qa-layout--customer:has(.qa-customer-panel) .qa-conversation-list { grid-column: 1; grid-row: 1 / 3; }
    .qa-layout--customer .qa-customer-panel { grid-column: 2; grid-row: 1; }
    .qa-layout--customer:has(.qa-customer-panel) .qa-thread { grid-column: 2; grid-row: 2; }
}
@media (max-width: 899.98px) {
    .qa-layout--customer[data-qa-view="list"] .qa-customer-panel { display: none; }
    .qa-layout--customer .qa-customer-panel { grid-column: 1; grid-row: 1; }
    .qa-layout--customer[data-qa-view="thread"] .qa-thread { grid-row: 2; }
}

/* Critical account state is always above the page, never inside technical details. */
.account-health {
    border: 1px solid #d4ded9;
    border-left: 5px solid #648276;
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 22px;
    background: #f7faf8;
    scroll-margin-top: 100px;
}
.account-health--danger { border-color: #e6b3ae; border-left-color: #be3026; background: #fff4f2; }
.account-health--warning { border-color: #e3c56f; border-left-color: #a37210; background: #fff9e8; }
.account-health__heading, .account-health__identity { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.account-health h2 { font-size: 1.25rem; margin: 0 0 5px; }
.account-health p { margin: 0; }
.account-health__heading > div { flex: 1 1 300px; }
.account-health__issues { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; padding: 0; margin: 14px 0; list-style: none; }
.account-health__issues li { background: #ffffffb8; border: 1px solid #ead1cd; border-radius: 10px; padding: 12px 14px; min-width: 0; }
.account-health__identity { justify-content: flex-start; }
.account-health__error { font-size: .92rem; padding: 8px 0; }
.account-health__issues a { display: inline-block; margin-top: 6px; font-weight: 650; }
.account-health__monitor-warning { padding-top: 10px; color: #805508; }
.account-health__meta { display: flex; gap: 6px 20px; flex-wrap: wrap; margin-top: 10px; font-size: .82rem; color: #5d675f; }
@media (max-width: 600px) {
    .account-health { padding: 14px; }
    .account-health__heading .btn { width: 100%; }
}

/* Full provider directory: independent from marketing audiences and customer matching. */
.student-directory-freshness { display: grid; gap: .4rem; margin-bottom: 1rem; }
.student-directory-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.student-directory-filters label:last-child { grid-column: 1 / -1; }
.student-directory-table { table-layout: fixed; }
.student-directory-table th:first-child { width: 25%; }
.student-directory-table th:nth-child(2) { width: 30%; }
.student-directory-table td { vertical-align: top; padding: .85rem .75rem; }
.student-directory-detail { display: block; }
.student-directory-enrollment + .student-directory-enrollment { margin-top: .8rem; }
.student-directory-pagination { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; }
.student-directory-print { display: none; }
@media (max-width: 700px) {
    .student-directory-filters { grid-template-columns: minmax(0, 1fr); }
    .student-directory-table-wrap { overflow: visible; }
    .student-directory-table thead { display: none; }
    .student-directory-table tbody, .student-directory-table tr, .student-directory-table td { display: block; width: 100%; }
    .student-directory-table tr { border: 1px solid #dce3de; border-radius: .65rem; margin-bottom: .8rem; padding: .35rem; }
    .student-directory-table td { border: 0; padding: .5rem; }
    .student-directory-table td::before { content: attr(data-label); display: block; color: #53635d; font-size: .8rem; margin-bottom: .3rem; }
}
@media print {
    body:has(.student-directory) .app-header,
    body:has(.student-directory) .app-footer,
    body:has(.student-directory) .account-health { display: none; }
    .student-directory:has(.student-directory-print) .student-directory-live { display: none; }
    .student-directory-print { display: block; color: #000; page: student-roster; }
    body:has(.student-directory) main.app-container { max-width: none; padding: 0; }
    .student-directory-print table { width: 100%; border-collapse: collapse; font-size: 10pt; }
    .student-directory-print th, .student-directory-print td { border: 1px solid #777; padding: 5px; vertical-align: top; }
    .student-directory-print thead { display: table-header-group; }
    .student-directory-print tr { break-inside: avoid; }
    .student-directory-check { width: 15%; }
}

@page student-roster { size: A4; margin: 12mm; }
