/*
 * Каркас рабочего пространства Гермеса: боковая панель, шапка телефона, чат, композер,
 * окно настроек и общие элементы разделов. Подключается после hermes-home.css.
 * Все цвета — только из токенов app.css, иначе светлая тема их не увидит.
 */

.hermes-dashboard {
    --hermes-sidebar-width: 16.25rem;
    --hermes-column: 48rem;
    --hermes-mobile-header-height: 3.25rem;
    --hermes-hover: rgb(var(--hermes-ink-rgb) / calc(0.06 * var(--hermes-line-a)));
    --hermes-active: rgb(var(--hermes-ink-rgb) / calc(0.095 * var(--hermes-line-a)));
    min-height: 100dvh;
    background: var(--hermes-panel);
}

.hermes-dashboard::before {
    background: var(--hermes-panel);
}

/* ---------- кнопки-иконки, сегменты, мелкие общие элементы ---------- */

.hermes-dashboard .button--compact {
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 650;
}

.hermes-dashboard .button:hover:not(:disabled) {
    transform: none;
}

.hermes-dashboard .icon-button {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 0.5rem;
    color: var(--hermes-dim);
    background: transparent;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
}

.hermes-dashboard .icon-button:hover:not(:disabled) {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .icon-button:disabled {
    opacity: 0.45;
    cursor: default;
}

.hermes-dashboard .icon-button svg,
.hermes-dashboard .workspace-topbar__button svg,
.hermes-dashboard .settings-icon-button svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hermes-dashboard .icon-button__spin {
    animation: hermes-spin 0.9s linear infinite;
}

@keyframes hermes-spin {
    to { transform: rotate(1turn); }
}

.hermes-dashboard .segmented {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 0.125rem;
    padding: 0.1875rem;
    border-radius: 0.625rem;
    background: var(--hermes-bg-2);
}

.hermes-dashboard .segmented__option {
    min-height: 1.875rem;
    padding: 0.25rem 0.875rem;
    border: 0;
    border-radius: 0.4375rem;
    color: var(--hermes-dim);
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.hermes-dashboard .segmented__option:hover {
    color: var(--hermes-text);
}

.hermes-dashboard .segmented__option--active {
    color: var(--hermes-text);
    background: var(--hermes-panel-raised);
    box-shadow: 0 1px 2px rgb(var(--hermes-shadow-rgb) / calc(0.18 * var(--hermes-shadow-a)));
}

.hermes-dashboard :is(.icon-button, .segmented__option, .workspace-nav__item, .session-link, .account-button, .account-menu__item, .settings-navigation__item, .workspace-topbar__button, .settings-icon-button, .chat-older, .starter-prompts button, .message-thinking > summary, .composer-shell__icon-button, .message-attachment):focus-visible {
    outline: 2px solid var(--hermes-accent);
    outline-offset: 2px;
}

/* ---------- каркас ---------- */

.hermes-dashboard .workspace-console {
    display: grid;
    grid-template-columns: var(--hermes-sidebar-width) minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.hermes-dashboard .workspace-main {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--hermes-panel);
}

.hermes-dashboard .workspace-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.hermes-dashboard .workspace-content > .panel:not(.panel--chat) {
    width: 100%;
    padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 2.5rem;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.hermes-dashboard .workspace-content > .panel--chat {
    flex: 1 1 auto;
    min-height: 0;
}

/* ---------- боковая панель ---------- */

.hermes-dashboard .workspace-nav {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 0.625rem 0.5rem 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--hermes-bg);
    border-right: 1px solid var(--hermes-line);
    scrollbar-width: thin;
    scrollbar-color: var(--hermes-line) transparent;
}

.hermes-dashboard .workspace-nav__top {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 2.5rem;
    padding: 0 0.5rem 0 0.625rem;
    margin-bottom: 0.5rem;
}

.hermes-dashboard .workspace-nav__mark {
    flex: 0 0 auto;
    width: 1.375rem;
    height: 1.375rem;
    fill: var(--hermes-text);
}

.hermes-dashboard .workspace-nav__mark-spark {
    fill: var(--hermes-accent-2);
}

.hermes-dashboard .workspace-nav__workspace {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--hermes-text);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hermes-dashboard .workspace-nav__close {
    display: none;
}

.hermes-dashboard .workspace-nav__items {
    display: grid;
    gap: 0.0625rem;
}

.hermes-dashboard .workspace-nav__item,
.hermes-dashboard .session-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    min-height: 2.25rem;
    padding: 0.375rem 0.625rem;
    border: 0;
    border-radius: 0.5rem;
    color: var(--hermes-muted);
    background: transparent;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 550;
    text-align: left;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.hermes-dashboard .workspace-nav__item:hover:not(:disabled),
.hermes-dashboard .session-link:hover {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .workspace-nav__item--active,
.hermes-dashboard .session-link--active {
    color: var(--hermes-text);
    background: var(--hermes-active);
}

.hermes-dashboard .workspace-nav__item:disabled {
    opacity: 0.5;
    cursor: default;
}

.hermes-dashboard .workspace-nav__item--new {
    color: var(--hermes-text);
    font-weight: 650;
}

.hermes-dashboard .workspace-nav__item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hermes-dashboard .workspace-nav__icon {
    flex: 0 0 auto;
    width: 1.125rem;
    height: 1.125rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hermes-dashboard .workspace-nav__sessions {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    /* На низком экране список не схлопывается в ноль: прокручивается вся панель. */
    min-height: min(12rem, 40dvh);
    margin: 1rem 0 0.5rem;
}

.hermes-dashboard .workspace-nav__sessions-header {
    padding: 0 0.625rem 0.375rem;
}

.hermes-dashboard .workspace-nav__sessions-header h2 {
    margin: 0;
    color: var(--hermes-soft);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.4;
}

.hermes-dashboard .workspace-nav__search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0.25rem 0.375rem;
    padding: 0 0.5rem;
    border-radius: 0.5rem;
    color: var(--hermes-soft);
    background: var(--hermes-hover);
}

.hermes-dashboard .workspace-nav__search svg,
.hermes-dashboard .settings-search svg,
.hermes-dashboard .files-search svg {
    flex: 0 0 auto;
    width: 0.95rem;
    height: 0.95rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.hermes-dashboard .workspace-nav__search input,
.hermes-dashboard .settings-search input,
.hermes-dashboard .files-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 2rem;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--hermes-text);
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
}

.hermes-dashboard .workspace-nav__search:focus-within,
.hermes-dashboard .settings-search:focus-within,
.hermes-dashboard .files-search:focus-within {
    box-shadow: 0 0 0 2px rgb(var(--hermes-accent-rgb) / 0.45);
}

.hermes-dashboard .workspace-nav__sessions-empty {
    margin: 0;
    padding: 0.25rem 0.625rem;
    color: var(--hermes-soft);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.hermes-dashboard .session-list {
    display: grid;
    /* Колонка не шире панели: длинное название обрезается многоточием, а не двигает список вбок. */
    grid-template-columns: minmax(0, 1fr);
    overflow-x: hidden;
    align-content: start;
    gap: 0.0625rem;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--hermes-line) transparent;
}

.hermes-dashboard .session-link {
    display: block;
    min-height: 2.125rem;
    padding-block: 0.4375rem;
    overflow: hidden;
    font-weight: 450;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Строка диалога: название и кнопка действий, которая появляется при наведении и фокусе. */
.hermes-dashboard .session-row {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 0.5rem;
}

.hermes-dashboard .session-row .session-link {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 2rem;
}

.hermes-dashboard .session-row__more {
    position: absolute;
    right: 0.25rem;
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 0.375rem;
    color: var(--hermes-muted);
    background: transparent;
    cursor: pointer;
    opacity: 0;
    transition: opacity 120ms ease, background 120ms ease;
}

.hermes-dashboard .session-row:hover .session-row__more,
.hermes-dashboard .session-row--active .session-row__more,
.hermes-dashboard .session-row__more:focus-visible,
.hermes-dashboard .session-row__more:popover-open,
.hermes-dashboard .session-row:has(.session-menu:popover-open) .session-row__more {
    opacity: 1;
}

.hermes-dashboard .session-row__more:hover:not(:disabled) {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .session-row__more svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: currentColor;
}

.hermes-dashboard .session-row--busy {
    opacity: 0.55;
}

.hermes-dashboard .session-menu {
    position: fixed;
    inset: auto;
    top: 30%;
    left: 0.5rem;
    width: max-content;
    min-width: 13rem;
    max-width: calc(100vw - 1rem);
    margin: 0;
    padding: 0.375rem;
    border: 1px solid var(--hermes-line);
    border-radius: 0.75rem;
    color: var(--hermes-text);
    background: var(--hermes-panel-strong);
    box-shadow: 0 12px 32px rgb(var(--hermes-shadow-rgb) / calc(0.32 * var(--hermes-shadow-a)));
}

@supports (position-anchor: --hermes-session-0) {
    .hermes-dashboard .session-menu {
        top: anchor(bottom);
        left: auto;
        right: anchor(right);
        margin-top: 0.25rem;
        position-try-fallbacks: flip-block;
    }
}

.hermes-dashboard .session-menu__hint {
    margin: 0;
    padding: 0.375rem 0.625rem;
    color: var(--hermes-soft);
    font-size: 0.75rem;
    line-height: 1.4;
}

.hermes-dashboard .session-rename {
    flex: 1 1 auto;
    min-width: 0;
}

.hermes-dashboard .session-rename__input {
    width: 100%;
    min-height: 2.125rem;
    padding: 0.375rem 0.625rem;
    border: 1px solid rgb(var(--hermes-accent-rgb) / 0.6);
    border-radius: 0.5rem;
    color: var(--hermes-text);
    background: var(--hermes-bg-2);
    font: inherit;
    font-size: 0.875rem;
    outline: none;
}

.hermes-dashboard .session-confirm {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    background: rgb(var(--hermes-danger-rgb) / 0.1);
    font-size: 0.8125rem;
}

/* Вопрос отдельной строкой, обе кнопки под ним рядом: в узкой панели они не разъезжаются. */
.hermes-dashboard .session-confirm span {
    flex: 1 0 100%;
}

.hermes-dashboard .session-confirm button {
    padding: 0.25rem 0.5rem;
    border: 0;
    border-radius: 0.375rem;
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
}

.hermes-dashboard .session-confirm__delete {
    color: #fff;
    background: rgb(var(--hermes-danger-rgb) / 0.9);
}

.hermes-dashboard .session-confirm__cancel {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

@media (hover: none) {
    .hermes-dashboard .session-row__more {
        opacity: 1;
    }
}

.hermes-dashboard .workspace-nav__account {
    position: sticky;
    bottom: 0;
    z-index: 1;
    padding: 0.5rem 0;
    margin-top: auto;
    border-top: 1px solid var(--hermes-line);
    background: var(--hermes-bg);
}

.hermes-dashboard .account-button {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 0;
    border-radius: 0.625rem;
    color: var(--hermes-text);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    anchor-name: --hermes-account;
}

.hermes-dashboard .account-button:hover {
    background: var(--hermes-hover);
}

.hermes-dashboard .account-button__avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: var(--hermes-accent-ink);
    background: var(--hermes-accent);
    font-size: 0.8125rem;
    font-weight: 700;
}

.hermes-dashboard .account-button__text {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
}

.hermes-dashboard .account-button__text strong,
.hermes-dashboard .account-button__text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hermes-dashboard .account-button__text strong {
    font-size: 0.8125rem;
    font-weight: 650;
    line-height: 1.3;
}

.hermes-dashboard .account-button__text small {
    color: var(--hermes-soft);
    font-size: 0.75rem;
    line-height: 1.3;
}

.hermes-dashboard .account-button__chevron {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: var(--hermes-soft);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: rotate(180deg);
}

/* Меню аккаунта — нативный popover: верхний слой, Escape и клик мимо закрывают его сами. */
.hermes-dashboard .account-menu {
    position: fixed;
    inset: auto auto 4.25rem 0.5rem;
    width: calc(var(--hermes-sidebar-width) - 1rem);
    max-height: min(26rem, 70dvh);
    margin: 0;
    padding: 0.375rem;
    overflow-y: auto;
    border: 1px solid var(--hermes-line);
    border-radius: 0.75rem;
    color: var(--hermes-text);
    background: var(--hermes-panel-strong);
    box-shadow: 0 12px 32px rgb(var(--hermes-shadow-rgb) / calc(0.32 * var(--hermes-shadow-a)));
}

@supports (position-anchor: --hermes-account) {
    .hermes-dashboard .account-menu {
        position-anchor: --hermes-account;
        inset: auto auto anchor(top) anchor(left);
        width: anchor-size(width);
        margin-bottom: 0.375rem;
    }
}

.hermes-dashboard .account-menu__label {
    margin: 0;
    padding: 0.375rem 0.625rem 0.25rem;
    color: var(--hermes-soft);
    font-size: 0.75rem;
    font-weight: 600;
}

.hermes-dashboard .account-menu hr {
    height: 1px;
    margin: 0.375rem 0.25rem;
    border: 0;
    background: var(--hermes-line);
}

.hermes-dashboard .account-menu__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    min-height: 2.25rem;
    padding: 0.375rem 0.625rem;
    border: 0;
    border-radius: 0.5rem;
    color: var(--hermes-text);
    background: transparent;
    font: inherit;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
}

.hermes-dashboard .account-menu__item:hover:not(:disabled) {
    background: var(--hermes-hover);
}

.hermes-dashboard .account-menu__item:disabled {
    opacity: 0.5;
    cursor: default;
}

.hermes-dashboard .account-menu__item span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hermes-dashboard .account-menu__item svg {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hermes-dashboard .account-menu__item--danger {
    color: var(--hermes-danger-ink);
}

.hermes-dashboard .account-menu__check {
    color: var(--hermes-accent-2);
}

.hermes-dashboard .workspace-nav__scrim {
    display: none;
}

/* ---------- шапка телефона и полосы уведомлений ---------- */

.hermes-dashboard .workspace-topbar {
    display: none;
}

.hermes-dashboard .workspace-notice {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem clamp(1rem, 3vw, 2.5rem);
    color: var(--hermes-text);
    font-size: 0.8125rem;
    line-height: 1.45;
    background: rgb(var(--hermes-warn-rgb) / 0.12);
    border-bottom: 1px solid rgb(var(--hermes-warn-rgb) / 0.25);
}

.hermes-dashboard .support-access {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.625rem clamp(1rem, 3vw, 2.5rem);
    border-bottom: 1px solid var(--hermes-line);
    background: var(--hermes-bg-2);
}

.hermes-dashboard .support-access__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.625rem;
    min-width: 0;
    font-size: 0.8125rem;
}

.hermes-dashboard .support-access__summary > span:last-child {
    color: var(--hermes-soft);
}

.hermes-dashboard .support-access__switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hermes-dashboard .support-access__switch select,
.hermes-dashboard .settings-row select,
.hermes-dashboard .settings-row input,
.hermes-dashboard .channel-config input {
    min-height: 2.375rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgb(var(--hermes-ink-rgb) / calc(0.14 * var(--hermes-line-a)));
    border-radius: 0.625rem;
    color: var(--hermes-text);
    background: var(--hermes-bg-2);
    font: inherit;
    font-size: 0.875rem;
}

.hermes-dashboard .settings-row select:focus-visible,
.hermes-dashboard .settings-row input:focus-visible,
.hermes-dashboard .channel-config input:focus-visible,
.hermes-dashboard .support-access__switch select:focus-visible {
    outline: 2px solid rgb(var(--hermes-accent-rgb) / 0.6);
    outline-offset: 1px;
}

.hermes-dashboard .workspace-toast {
    position: absolute;
    z-index: 20;
    top: 0.75rem;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: max-content;
    max-width: min(34rem, calc(100% - 2rem));
    padding: 0.5rem 0.5rem 0.5rem 0.875rem;
    border: 1px solid var(--hermes-line);
    border-radius: 0.75rem;
    color: var(--hermes-text);
    background: var(--hermes-panel-strong);
    box-shadow: 0 10px 28px rgb(var(--hermes-shadow-rgb) / calc(0.3 * var(--hermes-shadow-a)));
    font-size: 0.8125rem;
    line-height: 1.45;
    transform: translateX(-50%);
    animation: hermes-toast-in 180ms ease-out;
}

.hermes-dashboard .workspace-toast--success {
    border-color: rgb(var(--hermes-success-rgb) / 0.4);
}

.hermes-dashboard .workspace-toast--danger {
    border-color: rgb(var(--hermes-danger-rgb) / 0.45);
}

.hermes-dashboard .workspace-toast--warning {
    border-color: rgb(var(--hermes-warn-rgb) / 0.45);
}

.hermes-dashboard .workspace-toast button {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 0.375rem;
    color: var(--hermes-soft);
    background: transparent;
    cursor: pointer;
}

.hermes-dashboard .workspace-toast button:hover {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .workspace-toast svg {
    width: 0.9rem;
    height: 0.9rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

@keyframes hermes-toast-in {
    from { opacity: 0; transform: translate(-50%, -0.375rem); }
}

/* ---------- заголовки разделов ---------- */

.hermes-dashboard .panel__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.hermes-dashboard .panel__header h2 {
    margin-right: auto;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.hermes-dashboard .panel__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.hermes-dashboard .settings-muted {
    margin: 0;
    color: var(--hermes-soft);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* ---------- чат ---------- */

.hermes-dashboard .panel--chat {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.hermes-dashboard .chat-banner {
    width: min(100% - 2rem, var(--hermes-column));
    margin: 0.75rem auto 0;
    font-size: 0.8125rem;
}

.hermes-dashboard .chat-state {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.625rem;
    width: min(100% - 2rem, 28rem);
    min-height: 100%;
    margin: 0 auto;
    padding: 2rem 0;
    text-align: center;
}

.hermes-dashboard .chat-state h3 {
    font-size: 1.125rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.hermes-dashboard .chat-state p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
}

.hermes-dashboard .chat-state .button-row {
    justify-content: center;
    margin-top: 0.375rem;
}

.hermes-dashboard .access-notice__icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.25rem;
    border-radius: 50%;
    background: rgb(var(--hermes-warn-rgb) / 0.14);
}

.hermes-dashboard .access-notice__icon::before {
    color: var(--hermes-warn-ink);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    content: "!";
}

.hermes-dashboard .workspace-preparing__steps {
    display: grid;
    gap: 0.375rem;
    width: min(100%, 22rem);
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.hermes-dashboard .workspace-preparing__step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.625rem;
    color: var(--hermes-soft);
    font-size: 0.875rem;
    font-weight: 600;
}

.hermes-dashboard .workspace-preparing__step--active {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .workspace-preparing__step--complete {
    color: var(--hermes-muted);
}

.hermes-dashboard .workspace-preparing__marker {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid var(--hermes-line);
    border-radius: 50%;
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
}

.hermes-dashboard .workspace-preparing__step--complete .workspace-preparing__marker {
    color: var(--hermes-success-ink);
    border-color: rgb(var(--hermes-success-rgb) / 0.4);
}

.hermes-dashboard .workspace-preparing__spinner {
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: workspace-preparing-spin 0.9s linear infinite;
}

.hermes-dashboard .workspace-preparing__reason {
    max-width: 22rem;
    margin-top: 0.5rem !important;
    color: var(--hermes-soft);
}

.hermes-dashboard .chat-main {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    flex: 1 1 auto;
    min-height: 0;
}

.hermes-dashboard .chat-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.hermes-dashboard .chat-thread {
    grid-row: 1;
    grid-column: 1;
    min-height: 0;
    padding: 1.75rem 1rem 1.5rem;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--hermes-line) transparent;
}

.hermes-dashboard .chat-column {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    width: min(100%, var(--hermes-column));
    margin: 0 auto;
}

/* Пустой новый диалог: приветствие, композер и подсказки — одной группой по центру. */
.hermes-dashboard .chat-main--intro {
    grid-template-rows: auto auto;
    align-content: center;
    padding-bottom: 10vh;
}

.hermes-dashboard .chat-main--intro .chat-thread {
    overflow: visible;
    padding-bottom: 1.25rem;
}

.hermes-dashboard .chat-intro {
    margin: 0;
    color: var(--hermes-text);
    font-size: clamp(1.5rem, 2.4vw, 1.875rem);
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-align: center;
}

.hermes-dashboard .chat-empty {
    margin: 2rem 0 0;
    color: var(--hermes-soft);
    font-size: 0.875rem;
    text-align: center;
}

.hermes-dashboard .chat-older {
    align-self: center;
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--hermes-line);
    border-radius: 999px;
    color: var(--hermes-dim);
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
}

.hermes-dashboard .chat-older:hover:not(:disabled) {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .chat-loading {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 0;
}

.hermes-dashboard .chat-loading span {
    display: block;
    width: 100%;
    height: 0.875rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--hermes-hover), var(--hermes-active), var(--hermes-hover));
    animation: shimmer 1.4s ease-in-out infinite;
}

.hermes-dashboard .chat-loading span:nth-child(2) {
    width: 72%;
    animation-delay: 120ms;
}

.hermes-dashboard .chat-loading span:nth-child(3) {
    width: 86%;
    animation-delay: 240ms;
}

.hermes-dashboard .chat-loading p {
    color: var(--hermes-soft);
    font-size: 0.8125rem;
}

/* Сообщения */
.hermes-dashboard .message-bubble {
    position: relative;
    display: grid;
    gap: 0.625rem;
    min-width: 0;
    color: var(--hermes-text);
}

.hermes-dashboard .message-bubble > p {
    margin: 0;
    color: inherit;
    font-size: 0.9375rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.hermes-dashboard .message-bubble--user {
    align-self: flex-end;
    max-width: min(85%, 36rem);
    padding: 0.625rem 1rem;
    border-radius: 1.25rem;
    background: var(--hermes-bubble-user);
}

.hermes-dashboard .message-bubble--assistant {
    align-self: stretch;
}

.hermes-dashboard .message-bubble--error {
    align-self: flex-start;
    max-width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid rgb(var(--hermes-danger-rgb) / 0.32);
    border-radius: 0.75rem;
    color: var(--hermes-danger-ink);
    background: rgb(var(--hermes-danger-rgb) / 0.08);
}

.hermes-dashboard .message-bubble--error .message-markdown {
    color: inherit;
    font-size: 0.875rem;
}

.hermes-dashboard .message-time {
    position: absolute;
    bottom: -1.375rem;
    left: 0;
    color: var(--hermes-soft);
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
}

.hermes-dashboard .message-bubble--user .message-time {
    right: 0.25rem;
    left: auto;
}

@media (hover: hover) {
    .hermes-dashboard .message-bubble:hover .message-time {
        opacity: 1;
    }
}

.hermes-dashboard .message-bubble:focus-within .message-time {
    opacity: 1;
}

/* Markdown в ответе: внутри .panel заголовки иначе раздувает общий стиль страницы. */
.hermes-dashboard .message-markdown :is(h1, h2, h3, h4, h5, h6) {
    letter-spacing: -0.01em;
    line-height: 1.3;
    text-wrap: pretty;
}

.hermes-dashboard .message-markdown h1 { font-size: 1.25rem; }
.hermes-dashboard .message-markdown h2 { font-size: 1.125rem; }
.hermes-dashboard .message-markdown h3 { font-size: 1rem; }
.hermes-dashboard .message-markdown :is(h4, h5, h6) { font-size: 0.9375rem; }

.hermes-dashboard .message-markdown p {
    color: inherit;
    line-height: 1.65;
}

/* Ход работы */
.hermes-dashboard .message-thinking {
    align-self: flex-start;
    max-width: 100%;
    margin-bottom: -1.125rem;
    color: var(--hermes-soft);
}

.hermes-dashboard .message-thinking > summary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.hermes-dashboard .message-thinking > summary::-webkit-details-marker {
    display: none;
}

.hermes-dashboard .message-thinking > summary:hover,
.hermes-dashboard .message-thinking[open] > summary {
    color: var(--hermes-dim);
}

.hermes-dashboard .message-thinking__count::before {
    margin-right: 0.375rem;
    content: "·";
}

.hermes-dashboard .message-thinking__caret {
    width: 0.4rem;
    height: 0.4rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-0.1rem) rotate(45deg);
    transition: transform 160ms ease;
}

.hermes-dashboard .message-thinking[open] .message-thinking__caret {
    transform: translateY(0.1rem) rotate(-135deg);
}

.hermes-dashboard .message-thinking__body {
    display: grid;
    gap: 0.75rem;
    margin: 0.5rem 0 1.25rem;
    padding: 0.125rem 0 0.125rem 0.875rem;
    border-left: 2px solid var(--hermes-line);
}

.hermes-dashboard .message-thinking__step {
    display: grid;
    gap: 0.125rem;
}

.hermes-dashboard .message-thinking__step .message-markdown {
    font-size: 0.875rem;
}

.hermes-dashboard .message-thinking__time {
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
}

/* Вложения */
.hermes-dashboard .message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
}

.hermes-dashboard .message-attachment {
    min-width: 0;
    border: 1px solid var(--hermes-line);
    border-radius: 0.75rem;
    color: inherit;
    background: var(--hermes-panel-soft);
    text-decoration: none;
    overflow: hidden;
    transition: background 160ms ease, border-color 160ms ease;
}

.hermes-dashboard a.message-attachment:hover {
    border-color: rgb(var(--hermes-ink-rgb) / calc(0.2 * var(--hermes-line-a)));
    background: var(--hermes-panel-raised);
}

.hermes-dashboard .message-attachment--file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: min(100%, 20rem);
    padding: 0.625rem 0.75rem;
}

.hermes-dashboard .message-attachment__file-icon {
    position: relative;
    flex: 0 0 auto;
    width: 2rem;
    height: 2.25rem;
    border-radius: 0.375rem;
    background: rgb(var(--hermes-accent-rgb) / 0.18);
}

.hermes-dashboard .message-attachment__file-icon::after {
    position: absolute;
    inset: 0.55rem 0.6rem;
    border: 1.5px solid var(--hermes-accent-2);
    border-radius: 0.125rem;
    content: "";
}

.hermes-dashboard .message-attachment__body {
    display: grid;
    flex: 1 1 auto;
    gap: 0.0625rem;
    min-width: 0;
}

.hermes-dashboard .message-attachment__body strong {
    overflow: hidden;
    font-size: 0.8125rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hermes-dashboard .message-attachment__body small {
    color: var(--hermes-soft);
    font-size: 0.75rem;
    line-height: 1.3;
}

.hermes-dashboard .message-attachment__download {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: var(--hermes-dim);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hermes-dashboard .message-attachment--unavailable {
    color: var(--hermes-muted);
}

.hermes-dashboard .message-attachment--image {
    display: grid;
    width: min(100%, 26rem);
}

.hermes-dashboard .message-attachment--image img {
    display: block;
    width: 100%;
    max-height: 22rem;
    object-fit: contain;
    background: var(--hermes-image-bg);
}

.hermes-dashboard .message-attachment__caption {
    padding: 0.5rem 0.75rem;
    color: var(--hermes-muted);
    font-size: 0.8125rem;
}

.hermes-dashboard .message-bubble--user .message-attachment {
    background: var(--hermes-panel-raised);
}

.hermes-dashboard .agent-progress {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 0.625rem;
    color: var(--hermes-dim);
    font-size: 0.875rem;
}

.hermes-dashboard .agent-progress__watch {
    margin-left: 0.25rem;
}

.hermes-dashboard .agent-progress__pulse {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    background: var(--hermes-text);
    animation: hermes-breathe 1.4s ease-in-out infinite;
}

@keyframes hermes-breathe {
    50% { opacity: 0.35; transform: scale(0.8); }
}

.hermes-dashboard .chat-jump-button {
    z-index: 4;
    grid-row: 1;
    grid-column: 1;
    align-self: end;
    justify-self: center;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-bottom: 0.75rem;
    padding: 0;
    border: 1px solid var(--hermes-line);
    border-radius: 50%;
    color: var(--hermes-text);
    background: var(--hermes-panel-strong);
    box-shadow: 0 4px 14px rgb(var(--hermes-shadow-rgb) / calc(0.3 * var(--hermes-shadow-a)));
    cursor: pointer;
}

.hermes-dashboard .chat-jump-button:hover {
    background: var(--hermes-panel-raised);
}

.hermes-dashboard .chat-jump-button__icon {
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-0.125rem) rotate(45deg);
}

.hermes-dashboard .chat-drop-indicator {
    position: absolute;
    inset: 0.75rem;
    z-index: 6;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.375rem;
    padding: 1.5rem;
    border: 1.5px dashed rgb(var(--hermes-accent-rgb) / 0.6);
    border-radius: 1rem;
    color: var(--hermes-text);
    background: rgb(var(--hermes-panel-rgb) / 0.94);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
}

.hermes-dashboard .chat-main--drop-active .chat-drop-indicator {
    opacity: 1;
}

.hermes-dashboard .chat-drop-indicator strong {
    font-size: 1.125rem;
}

.hermes-dashboard .chat-drop-indicator small {
    color: var(--hermes-muted);
    font-size: 0.8125rem;
}

.hermes-dashboard .chat-drop-indicator__icon {
    position: relative;
    width: 2.25rem;
    height: 2.25rem;
    margin-bottom: 0.25rem;
    border-radius: 0.75rem;
    background: rgb(var(--hermes-accent-rgb) / 0.18);
}

.hermes-dashboard .chat-drop-indicator__icon::before,
.hermes-dashboard .chat-drop-indicator__icon::after {
    position: absolute;
    content: "";
}

.hermes-dashboard .chat-drop-indicator__icon::before {
    inset: 0.6rem 1.05rem 0.55rem;
    border-left: 2px solid currentColor;
}

.hermes-dashboard .chat-drop-indicator__icon::after {
    top: 0.62rem;
    left: 0.81rem;
    width: 0.62rem;
    height: 0.62rem;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
    transform: rotate(45deg);
}

/* Композер */
.hermes-dashboard .composer-shell {
    grid-row: 2;
    display: grid;
    gap: 0.5rem;
    width: min(100% - 2rem, var(--hermes-column));
    margin: 0 auto;
    padding: 0 0 1rem;
}

.hermes-dashboard .composer-shell .field-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.hermes-dashboard .composer-shell__surface {
    display: grid;
    gap: 0.375rem;
    padding: 0.375rem;
    border: 1px solid rgb(var(--hermes-ink-rgb) / calc(0.12 * var(--hermes-line-a)));
    border-radius: 1.5rem;
    background: var(--hermes-panel-strong);
    box-shadow: 0 2px 10px rgb(var(--hermes-shadow-rgb) / calc(0.12 * var(--hermes-shadow-a)));
    transition: border-color 160ms ease;
}

.hermes-dashboard .composer-shell__surface:focus-within {
    border-color: rgb(var(--hermes-ink-rgb) / calc(0.24 * var(--hermes-line-a)));
}

.hermes-dashboard .composer-shell__bar {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
    min-width: 0;
}

.hermes-dashboard .composer-shell__input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 2.5rem;
    max-height: min(16rem, 40vh);
    padding: 0.5625rem 0.25rem;
    border: 0;
    outline: 0;
    color: var(--hermes-text);
    background: transparent;
    font: inherit;
    font-size: 0.9375rem;
    line-height: 1.5;
    resize: none;
    overflow-y: auto;
}

.hermes-dashboard .composer-shell__input::placeholder {
    overflow: hidden;
    color: var(--hermes-soft);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hermes-dashboard .composer-shell__icon-button {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--hermes-dim);
    background: transparent;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
}

.hermes-dashboard .composer-shell__icon-button:hover:not(:disabled) {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .composer-shell__icon-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.hermes-dashboard .composer-shell__send-icon,
.hermes-dashboard .composer-shell__stop-icon {
    display: block;
    width: 1.2rem;
    height: 1.2rem;
}

.hermes-dashboard .composer-shell__send-button,
.hermes-dashboard .composer-shell__stop-button {
    width: 2.25rem;
    height: 2.25rem;
    margin: 0.125rem;
    color: var(--hermes-inverse-ink);
    background: var(--hermes-inverse-bg);
}

.hermes-dashboard .composer-shell__send-button:hover:not(:disabled),
.hermes-dashboard .composer-shell__stop-button:hover:not(:disabled) {
    color: var(--hermes-inverse-ink);
    background: var(--hermes-inverse-bg-hi);
}

.hermes-dashboard .composer-shell__send-button:disabled {
    color: var(--hermes-disabled-ink);
    background: var(--hermes-disabled-bg);
    opacity: 1;
}

.hermes-dashboard .composer-shell__voice-icon {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Крестик отмены записи — маленький круг на месте скрепки. */
.hermes-dashboard .composer-shell__voice-cancel {
    width: 1.75rem;
    height: 1.75rem;
    margin: 0.375rem;
    background: var(--hermes-hover);
}

.hermes-dashboard .composer-shell__voice-cancel svg {
    display: block;
    width: 0.95rem;
    height: 0.95rem;
}

.hermes-dashboard .composer-shell__voice-button--recording {
    color: var(--hermes-rec-ink);
    background: rgb(var(--hermes-rec-bg-rgb) / 0.34);
    animation: voice-recording-pulse 1.2s ease-in-out infinite;
}

.hermes-dashboard .composer-shell__voice-button--recording:hover:not(:disabled) {
    color: var(--hermes-rec-ink-hi);
    background: rgb(var(--hermes-rec-bg-rgb) / 0.42);
}

.hermes-dashboard .composer-shell__voice-status,
.hermes-dashboard .composer-shell__file-error {
    margin: 0;
    padding-inline: 1rem;
    font-size: 0.75rem;
    line-height: 1.45;
}

.hermes-dashboard .composer-shell__voice-status {
    color: var(--hermes-accent-2);
}

.hermes-dashboard .composer-shell__file-error {
    color: var(--hermes-danger-ink);
}

.hermes-dashboard .composer-shell__attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.25rem 0.25rem 0;
}

.hermes-dashboard .composer-shell__attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    max-width: min(100%, 18rem);
    min-height: 2rem;
    padding: 0.25rem 0.25rem 0.25rem 0.625rem;
    border-radius: 0.625rem;
    color: var(--hermes-text);
    background: var(--hermes-panel-raised);
    font-size: 0.75rem;
}

.hermes-dashboard .composer-shell__attachment span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hermes-dashboard .composer-shell__attachment small {
    color: var(--hermes-soft);
    font-size: 0.6875rem;
    white-space: nowrap;
}

.hermes-dashboard .composer-shell__attachment button {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 1.375rem;
    height: 1.375rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: inherit;
    background: transparent;
    cursor: pointer;
    line-height: 1;
}

.hermes-dashboard .composer-shell__attachment button:hover:not(:disabled) {
    background: var(--hermes-hover);
}

.hermes-dashboard .composer-notice {
    display: block;
    padding: 0.5rem 0.875rem;
    border-radius: 0.75rem;
    color: var(--hermes-text);
    background: rgb(var(--hermes-warn-rgb) / 0.1);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.hermes-dashboard .composer-notice--blocked {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: rgb(var(--hermes-danger-rgb) / 0.1);
}

.hermes-dashboard .composer-notice > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    list-style: none;
    cursor: pointer;
}

.hermes-dashboard .composer-notice > summary::-webkit-details-marker {
    display: none;
}

.hermes-dashboard .composer-notice__more {
    flex: 0 0 auto;
    color: var(--hermes-dim);
    font-size: 0.75rem;
}

.hermes-dashboard .composer-notice[open] .composer-notice__more {
    display: none;
}

.hermes-dashboard .composer-notice p {
    margin: 0.375rem 0 0.125rem;
    color: var(--hermes-muted);
    font-size: 0.8125rem;
}

.hermes-dashboard .composer-notice-wrap {
    position: relative;
}

.hermes-dashboard .composer-notice--dismissable > summary {
    padding-right: 1.75rem;
}

.hermes-dashboard .composer-notice__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hermes-dashboard .composer-notice__actions:empty {
    display: none;
}

.hermes-dashboard .composer-notice__close {
    position: absolute;
    top: 0.3125rem;
    right: 0.375rem;
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: 0.375rem;
    color: var(--hermes-dim);
    background: transparent;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
}

.hermes-dashboard .composer-notice__close:hover {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .starter-prompts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.hermes-dashboard .starter-prompts button {
    padding: 0.4375rem 0.875rem;
    border: 1px solid var(--hermes-line);
    border-radius: 999px;
    color: var(--hermes-muted);
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.hermes-dashboard .starter-prompts button:hover {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

/* ---------- окно настроек ---------- */

.hermes-dashboard .settings-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background: var(--hermes-scrim);
    animation: hermes-fade-in 140ms ease-out;
}

@keyframes hermes-fade-in {
    from { opacity: 0; }
}

.hermes-dashboard .settings-dialog {
    display: flex;
    flex-direction: column;
    width: min(54rem, 100%);
    height: min(40rem, 100%);
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--hermes-line);
    border-radius: 1rem;
    background: var(--hermes-panel);
    box-shadow: 0 24px 64px rgb(var(--hermes-shadow-rgb) / calc(0.4 * var(--hermes-shadow-a)));
    outline: 0;
}

.hermes-dashboard .settings-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3.5rem;
    padding: 0.5rem 0.75rem 0.5rem 1.25rem;
    border-bottom: 1px solid var(--hermes-line);
}

.hermes-dashboard .settings-header h1 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hermes-dashboard .settings-header__section,
.hermes-dashboard .settings-header__back {
    display: none !important;
}

.hermes-dashboard .settings-icon-button {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 0.5rem;
    color: var(--hermes-dim);
    background: transparent;
    cursor: pointer;
}

.hermes-dashboard .settings-icon-button:hover {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .settings-layout {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
}

.hermes-dashboard .settings-navigation {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-height: 0;
    padding: 0.75rem 0.5rem;
    overflow-y: auto;
    border-right: 1px solid var(--hermes-line);
    background: var(--hermes-bg);
}

.hermes-dashboard .settings-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0.125rem 0.5rem;
    padding: 0 0.625rem;
    border-radius: 0.5rem;
    color: var(--hermes-soft);
    background: var(--hermes-hover);
}

.hermes-dashboard .settings-navigation__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    min-height: 2.25rem;
    padding: 0.375rem 0.625rem;
    border: 0;
    border-radius: 0.5rem;
    color: var(--hermes-muted);
    background: transparent;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 550;
    text-align: left;
    cursor: pointer;
}

.hermes-dashboard .settings-navigation__item:hover {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .settings-navigation__item--active {
    color: var(--hermes-text);
    background: var(--hermes-active);
}

.hermes-dashboard .settings-navigation__item span {
    flex: 1 1 auto;
}

.hermes-dashboard .settings-navigation__item svg {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hermes-dashboard .settings-navigation__chevron {
    display: none;
}

.hermes-dashboard .settings-results {
    display: grid;
    gap: 0.125rem;
}

.hermes-dashboard .settings-results > a,
.hermes-dashboard .settings-results > button {
    display: grid;
    gap: 0.125rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 0;
    border-radius: 0.5rem;
    color: var(--hermes-text);
    background: transparent;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.hermes-dashboard .settings-results > a:hover,
.hermes-dashboard .settings-results > button:hover:not(:disabled) {
    background: var(--hermes-hover);
}

.hermes-dashboard .settings-results strong {
    font-size: 0.8125rem;
    font-weight: 600;
}

.hermes-dashboard .settings-results small,
.hermes-dashboard .settings-results__empty,
.hermes-dashboard .settings-results p {
    margin: 0;
    color: var(--hermes-soft);
    font-size: 0.75rem;
    line-height: 1.4;
}

.hermes-dashboard .settings-results__empty {
    padding: 0.5rem 0.625rem;
}

.hermes-dashboard .settings-content {
    min-width: 0;
    min-height: 0;
    padding: 1.25rem 1.75rem 2rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.hermes-dashboard .settings-content__title {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.hermes-dashboard .settings-content .panel {
    gap: 0.75rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.hermes-dashboard .settings-content .inline-banner {
    margin: 0 0 0.75rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
}

.hermes-dashboard .settings-content > .button + .inline-banner {
    margin-top: 0.75rem;
}

.hermes-dashboard .settings-group-title {
    margin: 1rem 0 0.125rem;
    color: var(--hermes-dim);
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.3;
}

.hermes-dashboard .settings-form > .settings-group-title:first-child,
.hermes-dashboard .settings-form > .panel__toolbar + .settings-group-title {
    margin-top: 0.25rem;
}

/* Профиль */
.hermes-dashboard .settings-row {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    align-items: start;
    gap: 0.5rem 1.25rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--hermes-line);
}

.hermes-dashboard .settings-row:first-of-type {
    padding-top: 0;
}

.hermes-dashboard .settings-row__label {
    padding-top: 0.5rem;
    color: var(--hermes-text);
    font-size: 0.875rem;
    font-weight: 600;
}

.hermes-dashboard .settings-row__control {
    display: grid;
    gap: 0.375rem;
    min-width: 0;
}

.hermes-dashboard .settings-row__control > input,
.hermes-dashboard .settings-row__control > select {
    width: min(100%, 24rem);
}

.hermes-dashboard .settings-row__control > .segmented {
    justify-self: start;
}

.hermes-dashboard .settings-row__control small {
    color: var(--hermes-soft);
    font-size: 0.75rem;
    line-height: 1.45;
}

.hermes-dashboard .settings-form__actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.5rem;
}

/* Подключения */
.hermes-dashboard .connection-list,
.hermes-dashboard .skill-list,
.hermes-dashboard .settings-links {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--hermes-line);
    border-radius: 0.75rem;
}

.hermes-dashboard .connection,
.hermes-dashboard .skill-row,
.hermes-dashboard .settings-links > a {
    min-width: 0;
}

.hermes-dashboard .connection + .connection,
.hermes-dashboard .skill-row + .skill-row,
.hermes-dashboard .settings-links > a + a {
    border-top: 1px solid var(--hermes-line);
}

.hermes-dashboard .connection__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
    padding: 0.625rem 0.875rem;
}

.hermes-dashboard summary.connection__row {
    list-style: none;
    cursor: pointer;
}

.hermes-dashboard summary.connection__row::-webkit-details-marker {
    display: none;
}

.hermes-dashboard summary.connection__row:hover {
    background: var(--hermes-hover);
}

.hermes-dashboard .connection__icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    color: var(--hermes-text);
    background: var(--hermes-panel-raised);
    font-size: 0.8125rem;
    font-weight: 700;
}

.hermes-dashboard .connection__icon--telegram {
    color: #fff;
    background: #2aabee;
}

.hermes-dashboard .connection__text {
    display: grid;
    flex: 1 1 auto;
    gap: 0.0625rem;
    min-width: 0;
}

.hermes-dashboard .connection__text strong {
    font-size: 0.875rem;
    font-weight: 650;
}

.hermes-dashboard .connection__text small {
    overflow: hidden;
    color: var(--hermes-soft);
    font-size: 0.75rem;
    line-height: 1.4;
    text-overflow: ellipsis;
}

.hermes-dashboard .connection__chevron {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: var(--hermes-soft);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 160ms ease;
}

.hermes-dashboard .connection--config[open] .connection__chevron {
    transform: rotate(180deg);
}

.hermes-dashboard .connection > :not(.connection__row) {
    margin: 0 0.875rem 0.875rem;
}

.hermes-dashboard .connection__hint {
    color: var(--hermes-soft);
    font-size: 0.75rem;
}

.hermes-dashboard a.connection__hint {
    display: block;
    color: var(--hermes-accent-2);
}

.hermes-dashboard .connection .code-card {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--hermes-line);
    border-radius: 0.625rem;
    font-size: 0.8125rem;
}

.hermes-dashboard .connection .code-card .button {
    justify-self: start;
}

/* Команда привязки: одна строка для отправки боту и кнопка копирования рядом. */
.hermes-dashboard .link-command__hint {
    margin: 0;
    color: var(--hermes-muted);
}

.hermes-dashboard .link-command {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.25rem 0.25rem 0.75rem;
    border: 1px solid var(--hermes-line);
    border-radius: 0.5rem;
    background: var(--hermes-panel-strong);
}

.hermes-dashboard .link-command code {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    user-select: all;
}

.hermes-dashboard .connection .channel-config {
    margin-top: 0;
}

/* Возможности */
.hermes-dashboard .skill-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.75rem 0.875rem;
}

.hermes-dashboard .skill-row--disabled .skill-row__main {
    opacity: 0.6;
}

.hermes-dashboard .skill-row__main {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
}

.hermes-dashboard .skill-row__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.hermes-dashboard .skill-row__title strong {
    font-size: 0.875rem;
    font-weight: 650;
}

.hermes-dashboard .skill-row__title .status-pill {
    min-height: 1.25rem;
    padding: 0 0.375rem;
    border-radius: 0.375rem;
}

.hermes-dashboard .skill-row__main p {
    margin: 0;
    color: var(--hermes-soft);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.hermes-dashboard .skill-row__warning {
    color: var(--hermes-warn-ink) !important;
}

.hermes-dashboard .skill-row__actions {
    display: flex;
    gap: 0.25rem;
}

.hermes-dashboard .skill-row__confirmation {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    background: rgb(var(--hermes-danger-rgb) / 0.08);
    font-size: 0.8125rem;
}

/* Пространство */
.hermes-dashboard .plan-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    padding: 1rem 1.125rem;
    border-radius: 0.75rem;
    background: var(--hermes-bg-2);
}

.hermes-dashboard .plan-summary div {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
}

.hermes-dashboard .plan-summary dt {
    color: var(--hermes-soft);
    font-size: 0.75rem;
}

.hermes-dashboard .plan-summary dd {
    margin: 0;
    overflow: hidden;
    color: var(--hermes-text);
    font-size: 0.9375rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hermes-dashboard .plan-summary .plan-summary__wide {
    grid-column: 1 / -1;
}

.hermes-dashboard .plan-summary__wide dd {
    white-space: normal;
}

/* Полоса расхода кредитов */
.hermes-dashboard .credit-meter {
    display: grid;
    gap: 0.375rem;
    width: 100%;
}

.hermes-dashboard .credit-meter--compact {
    margin-top: 0.3rem;
}

.hermes-dashboard .credit-meter__track {
    display: block;
    height: 0.375rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(var(--hermes-ink-rgb) / calc(0.1 * var(--hermes-line-a)));
}

.hermes-dashboard .credit-meter--compact .credit-meter__track {
    height: 0.25rem;
}

.hermes-dashboard .credit-meter__fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: rgb(var(--hermes-accent-rgb) / 0.85);
    transition: width 320ms ease, background 200ms ease;
}

.hermes-dashboard .credit-meter--low .credit-meter__fill {
    background: rgb(var(--hermes-warn-rgb) / 0.95);
}

.hermes-dashboard .credit-meter--empty .credit-meter__fill {
    background: rgb(var(--hermes-danger-rgb) / 0.9);
}

.hermes-dashboard .credit-meter__caption {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 550;
}

.hermes-dashboard .credit-meter__reset {
    color: var(--hermes-soft);
    font-size: 0.75rem;
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    .hermes-dashboard .credit-meter__fill {
        transition: none;
    }
}

.hermes-dashboard .settings-links > a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.875rem;
    color: var(--hermes-text);
    text-decoration: none;
}

.hermes-dashboard .settings-links > a:hover {
    background: var(--hermes-hover);
}

.hermes-dashboard .settings-links > a > span {
    display: grid;
    flex: 1 1 auto;
    gap: 0.0625rem;
    min-width: 0;
}

.hermes-dashboard .settings-links strong {
    font-size: 0.875rem;
    font-weight: 600;
}

.hermes-dashboard .settings-links small {
    color: var(--hermes-soft);
    font-size: 0.75rem;
    line-height: 1.4;
}

.hermes-dashboard .settings-links svg {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: var(--hermes-soft);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hermes-dashboard .settings-links + .settings-muted {
    margin-top: 0.625rem;
}

/* Интеграции */
.hermes-dashboard .connection__icon--google {
    color: #fff;
    background: #4285f4;
}

.hermes-dashboard .integration-services {
    display: grid;
    margin: 0 0.875rem 0.75rem;
    padding: 0;
    list-style: none;
}

.hermes-dashboard .integration-service {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.8125rem;
}

.hermes-dashboard .integration-service + .integration-service {
    border-top: 1px solid var(--hermes-line);
}

.hermes-dashboard .integration-service__mark {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 50%;
    color: var(--hermes-soft);
    background: var(--hermes-hover);
    font-size: 0.75rem;
    font-weight: 700;
}

.hermes-dashboard .integration-service--granted .integration-service__mark {
    color: var(--hermes-success-ink);
    background: var(--hermes-success-bg);
}

.hermes-dashboard .integration-service__text {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
}

.hermes-dashboard .integration-service__text strong {
    font-weight: 600;
}

.hermes-dashboard .integration-service__text small,
.hermes-dashboard .integration-service__state {
    color: var(--hermes-soft);
    font-size: 0.75rem;
}

.hermes-dashboard .integration-service--granted .integration-service__state {
    color: var(--hermes-success-ink);
}

.hermes-dashboard .integration-hint {
    margin: 0 0.875rem 0.75rem;
    color: var(--hermes-soft);
    font-size: 0.75rem;
}

.hermes-dashboard .integration-card > .button-row,
.hermes-dashboard .integration-card > small {
    margin: 0 0.875rem 0.875rem;
}

.hermes-dashboard .integrations-panel > .settings-muted:last-child {
    margin-top: 0.25rem;
}

/* Задачи: пустые колонки не спорят с заполненными */
.hermes-dashboard .work-column:has(.work-column__empty) > header {
    opacity: 0.6;
}

/* ---------- разделы: файлы, публикации, терминал ---------- */

.hermes-dashboard .files-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.hermes-dashboard .files-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: min(100%, 20rem);
    margin-left: auto;
    padding: 0 0.625rem;
    border-radius: 0.5rem;
    color: var(--hermes-soft);
    background: var(--hermes-bg-2);
}

.hermes-dashboard .files-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    color: var(--hermes-soft);
    font-size: 0.875rem;
}

.hermes-dashboard .files-breadcrumbs button {
    padding: 0.125rem 0.375rem;
    border: 0;
    border-radius: 0.375rem;
    color: var(--hermes-muted);
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.hermes-dashboard .files-breadcrumbs button:hover {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .files-breadcrumbs button:last-child {
    color: var(--hermes-text);
    font-weight: 600;
}

.hermes-dashboard .files-name svg {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: var(--hermes-soft);
    stroke-width: 1.7;
    stroke-linejoin: round;
}

.hermes-dashboard .files-download {
    width: 2rem;
    height: 2rem;
}

.hermes-dashboard .site-list {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--hermes-line);
    border-radius: 0.75rem;
}

.hermes-dashboard .site-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    padding: 0.875rem 1rem;
}

.hermes-dashboard .site-row + .site-row {
    border-top: 1px solid var(--hermes-line);
}

.hermes-dashboard .site-row--disabled .site-row__main {
    opacity: 0.6;
}

.hermes-dashboard .site-row__main {
    display: grid;
    flex: 1 1 20rem;
    gap: 0.1875rem;
    min-width: 0;
}

.hermes-dashboard .site-row__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.hermes-dashboard .site-row__title strong {
    font-size: 0.9375rem;
    font-weight: 650;
}

.hermes-dashboard .site-row__main p {
    margin: 0;
    color: var(--hermes-muted);
    font-size: 0.8125rem;
}

.hermes-dashboard .site-row__main small {
    overflow: hidden;
    color: var(--hermes-soft);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hermes-dashboard .site-row__main small a {
    color: var(--hermes-accent-2);
}

.hermes-dashboard .site-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.hermes-dashboard .terminal-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 100%;
}

.hermes-dashboard .terminal-panel .terminal-surface {
    flex: 1 1 auto;
    min-height: 22rem;
}

.hermes-dashboard .terminal-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--hermes-soft);
    font-size: 0.8125rem;
}

.hermes-dashboard .terminal-status::before {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--hermes-dot-idle);
    content: "";
}

.hermes-dashboard .terminal-status--online::before {
    background: var(--hermes-online);
}

.hermes-dashboard .terminal-help {
    color: var(--hermes-soft);
    font-size: 0.8125rem;
}

.hermes-dashboard .terminal-help summary {
    width: max-content;
    cursor: pointer;
}

.hermes-dashboard .terminal-help p {
    max-width: 48rem;
    margin: 0.375rem 0 0;
    color: var(--hermes-soft);
    font-size: 0.8125rem;
}

/* ---------- телефон ---------- */

@media (max-width: 760px) {
    .hermes-dashboard {
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .hermes-dashboard .workspace-console {
        display: block;
    }

    .hermes-dashboard .workspace-main {
        height: 100dvh;
    }

    .hermes-dashboard .workspace-topbar {
        display: grid;
        flex: 0 0 auto;
        grid-template-columns: 2.75rem minmax(0, 1fr) auto 2.75rem;
        align-items: center;
        gap: 0.25rem;
        height: calc(var(--hermes-mobile-header-height) + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) 0.375rem 0;
        background: var(--hermes-panel);
    }

    .hermes-dashboard .workspace-topbar__button {
        display: grid;
        place-items: center;
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        border: 0;
        border-radius: 0.625rem;
        color: var(--hermes-text);
        background: transparent;
        cursor: pointer;
    }

    .hermes-dashboard .workspace-topbar__button svg {
        width: 1.35rem;
        height: 1.35rem;
    }

    .hermes-dashboard .workspace-topbar__button:active:not(:disabled) {
        background: var(--hermes-hover);
    }

    .hermes-dashboard .workspace-topbar__button:disabled {
        opacity: 0.4;
    }

    .hermes-dashboard .workspace-topbar__title {
        min-width: 0;
        overflow: hidden;
        color: var(--hermes-text);
        font-size: 1rem;
        font-weight: 650;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hermes-dashboard .workspace-nav {
        position: fixed;
        z-index: 50;
        inset: 0 auto 0 0;
        width: min(85vw, 20rem);
        height: 100dvh;
        padding: calc(0.5rem + env(safe-area-inset-top)) 0.5rem 0;
        visibility: hidden;
        border-right: 0;
        box-shadow: 1rem 0 3rem rgb(var(--hermes-shadow-rgb) / calc(0.35 * var(--hermes-shadow-a)));
        transform: translateX(-100%);
        transition: transform 220ms cubic-bezier(0.2, 0.75, 0.25, 1), visibility 220ms;
    }

    .hermes-dashboard .workspace-nav--open {
        visibility: visible;
        transform: translateX(0);
    }

    .hermes-dashboard .workspace-nav__close {
        display: grid;
        flex: 0 0 auto;
        place-items: center;
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
        border: 0;
        border-radius: 0.5rem;
        color: var(--hermes-dim);
        background: transparent;
        cursor: pointer;
    }

    .hermes-dashboard .workspace-nav__close svg {
        width: 1.25rem;
        height: 1.25rem;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
    }

    .hermes-dashboard .workspace-nav__item,
    .hermes-dashboard .session-link {
        min-height: 2.75rem;
        font-size: 0.9375rem;
    }

    .hermes-dashboard .workspace-nav__search input {
        height: 2.5rem;
        font-size: 1rem;
    }

    .hermes-dashboard .account-menu {
        inset: auto auto calc(4.5rem + env(safe-area-inset-bottom)) 0.5rem;
        width: calc(min(85vw, 20rem) - 1rem);
    }

    .hermes-dashboard .account-menu__item {
        min-height: 2.75rem;
        font-size: 0.9375rem;
    }

    .hermes-dashboard .workspace-nav__account {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }

    .hermes-dashboard .workspace-nav__scrim {
        position: fixed;
        z-index: 45;
        inset: 0;
        display: block;
        padding: 0;
        border: 0;
        background: var(--hermes-scrim);
        opacity: 0;
        pointer-events: none;
        transition: opacity 200ms ease;
    }

    .hermes-dashboard .workspace-nav__scrim--visible {
        opacity: 1;
        pointer-events: auto;
    }

    .hermes-dashboard .workspace-content > .panel:not(.panel--chat) {
        padding: 0.75rem 1rem 2rem;
    }

    .hermes-dashboard .workspace-content > .panel > .panel__header h2 {
        display: none;
    }

    .hermes-dashboard .workspace-notice,
    .hermes-dashboard .support-access {
        padding-inline: 1rem;
    }

    .hermes-dashboard .chat-thread {
        padding: 1rem 1rem 1.25rem;
    }

    .hermes-dashboard .chat-column {
        gap: 1.5rem;
    }

    .hermes-dashboard .chat-main--intro {
        grid-template-rows: minmax(0, 1fr) auto;
        align-content: stretch;
        padding-bottom: 0;
    }

    .hermes-dashboard .chat-main--intro .chat-thread {
        display: grid;
        align-items: center;
        overflow: hidden;
    }

    .hermes-dashboard .message-bubble--user {
        max-width: 88%;
    }

    .hermes-dashboard .message-time {
        display: none;
    }

    .hermes-dashboard .composer-shell {
        width: calc(100% - 1rem);
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }

    .hermes-dashboard .composer-shell__input {
        font-size: 1rem;
    }

    .hermes-dashboard .starter-prompts {
        flex-wrap: nowrap;
        justify-content: flex-start;
        margin: 0 -0.5rem;
        padding: 0 0.5rem 0.25rem;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .hermes-dashboard .starter-prompts button {
        flex: 0 0 auto;
    }

    /* Задачи на телефоне — колонки списком сверху вниз, пустые не показываем. */
    .hermes-dashboard .work-board {
        grid-template-columns: 1fr;
        overflow-x: visible;
    }

    .hermes-dashboard .work-column {
        min-height: 0;
    }

    .hermes-dashboard .work-column:has(.work-column__empty) {
        display: none;
    }

    .hermes-dashboard .integration-service__state {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    /* Настройки: полноэкранный лист — список разделов, затем раздел с «Назад». */
    .hermes-dashboard .settings-backdrop {
        padding: 0;
    }

    .hermes-dashboard .settings-dialog {
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 0;
    }

    .hermes-dashboard .settings-header {
        min-height: calc(3.25rem + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) 0.375rem 0 1rem;
    }

    .hermes-dashboard .settings-dialog--detail .settings-header {
        padding-left: 0.375rem;
    }

    .hermes-dashboard .settings-dialog--detail .settings-header__back,
    .hermes-dashboard .settings-dialog--detail .settings-header__section {
        display: grid !important;
    }

    .hermes-dashboard .settings-dialog--detail .settings-header__section {
        display: inline !important;
    }

    .hermes-dashboard .settings-dialog--detail .settings-header__root {
        display: none;
    }

    .hermes-dashboard .settings-layout {
        display: block;
        overflow: hidden;
    }

    .hermes-dashboard .settings-navigation {
        height: 100%;
        padding: 0.75rem;
        border-right: 0;
        background: var(--hermes-panel);
    }

    .hermes-dashboard .settings-navigation__item {
        min-height: 3rem;
        font-size: 1rem;
    }

    .hermes-dashboard .settings-navigation__item--active:not(:hover) {
        background: transparent;
    }

    .hermes-dashboard .settings-navigation__chevron {
        display: block;
        stroke: var(--hermes-soft) !important;
    }

    .hermes-dashboard .settings-search input {
        height: 2.5rem;
        font-size: 1rem;
    }

    .hermes-dashboard .settings-content {
        display: none;
        height: 100%;
        padding: 1rem 1rem calc(2rem + env(safe-area-inset-bottom));
    }

    .hermes-dashboard .settings-dialog--detail .settings-navigation {
        display: none;
    }

    .hermes-dashboard .settings-dialog--detail .settings-content {
        display: block;
    }

    .hermes-dashboard .settings-content__title {
        display: none;
    }

    .hermes-dashboard .settings-row {
        grid-template-columns: 1fr;
        gap: 0.375rem;
    }

    .hermes-dashboard .settings-row__label {
        padding-top: 0;
    }

    .hermes-dashboard .settings-row__control > input,
    .hermes-dashboard .settings-row__control > select {
        width: 100%;
        font-size: 1rem;
    }

    .hermes-dashboard .settings-form__actions .button {
        width: 100%;
    }

    .hermes-dashboard .skill-row {
        grid-template-columns: 1fr;
    }

    .hermes-dashboard .files-search {
        width: 100%;
        margin-left: 0;
    }

    .hermes-dashboard .files-search input {
        height: 2.5rem;
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hermes-dashboard .workspace-nav,
    .hermes-dashboard .workspace-nav__scrim,
    .hermes-dashboard .workspace-toast,
    .hermes-dashboard .settings-backdrop {
        transition: none;
        animation: none;
    }

    .hermes-dashboard .agent-progress__pulse,
    .hermes-dashboard .icon-button__spin,
    .hermes-dashboard .composer-shell__voice-button--recording,
    .hermes-dashboard .workspace-preparing__spinner {
        animation: none;
    }
}

/* Оплата рядом с остатком кредитов, без перехода в панель управления. */
.hermes-dashboard .workspace-nav__payment {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--hermes-line);
    border-radius: 8px;
    background: transparent;
    color: var(--hermes-text);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.hermes-dashboard .workspace-nav__payment:hover { background: var(--hermes-panel); }

/* ------------------------------------------------------------------
   Лента: разделители дней, действия с сообщением, Markdown-блоки.
   ------------------------------------------------------------------ */

.hermes-dashboard .chat-day {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0 -0.5rem;
    color: var(--hermes-soft);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.hermes-dashboard .chat-day::before,
.hermes-dashboard .chat-day::after {
    flex: 1;
    height: 1px;
    background: var(--hermes-line);
    content: "";
}

/* Время сообщения переезжает в строку действий, когда она есть. */
.hermes-dashboard .message-bubble:has(+ .message-actions) .message-time {
    display: none;
}

.hermes-dashboard .message-actions {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    min-height: 1.875rem;
    margin-top: -1.5rem;
    opacity: 0;
    transition: opacity 140ms ease;
}

.hermes-dashboard .message-actions--user {
    justify-content: flex-end;
}

.hermes-dashboard .message-actions__time {
    margin: 0 0.375rem;
    color: var(--hermes-soft);
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
}

.hermes-dashboard .message-actions--assistant .message-actions__time,
.hermes-dashboard .message-actions--error .message-actions__time,
.hermes-dashboard .message-actions--stopped .message-actions__time {
    order: 10;
}

/* Последний ответ и сообщения на сенсорных экранах держат кнопки на виду, как в ChatGPT и Claude. */
.hermes-dashboard .message-actions--last,
.hermes-dashboard .message-actions--error,
.hermes-dashboard .message-actions:focus-within,
.hermes-dashboard .message-bubble:hover + .message-actions,
.hermes-dashboard .message-actions:hover {
    opacity: 1;
}

@media (hover: none) {
    .hermes-dashboard .message-actions {
        opacity: 1;
    }
}

.hermes-dashboard .message-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-width: 1.875rem;
    height: 1.875rem;
    padding: 0 0.375rem;
    border: 0;
    border-radius: 0.5rem;
    color: var(--hermes-soft);
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.hermes-dashboard .message-action:hover {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .message-action:focus-visible {
    outline: 2px solid rgb(var(--hermes-accent-rgb) / 0.7);
    outline-offset: 1px;
}

.hermes-dashboard .message-action--done {
    color: var(--hermes-success-ink);
}

.hermes-dashboard .message-action--labeled {
    padding: 0 0.625rem 0 0.5rem;
    border: 1px solid rgb(var(--hermes-danger-rgb) / 0.32);
    color: var(--hermes-danger-ink);
}

.hermes-dashboard .message-action svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Markdown: код, таблицы, цитаты. */
.hermes-dashboard .message-markdown :not(pre) > code {
    padding: 0.1em 0.375em;
    border-radius: 0.375rem;
    background: var(--hermes-active);
    font-size: 0.875em;
    overflow-wrap: anywhere;
}

.hermes-dashboard .message-markdown pre {
    position: relative;
    margin: 0.75rem 0;
    border: 1px solid var(--hermes-line);
    border-radius: 0.75rem;
    background: var(--hermes-code-bg);
    overflow: hidden;
}

.hermes-dashboard .message-markdown pre > code {
    display: block;
    padding: 0.875rem 1rem;
    overflow-x: auto;
    color: var(--hermes-code-ink);
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: pre;
    tab-size: 4;
}

.hermes-dashboard .code-block__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0.375rem 0.25rem 1rem;
    border-bottom: 1px solid var(--hermes-line);
    color: var(--hermes-soft);
    background: var(--hermes-code-bar);
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 0.75rem;
    white-space: normal;
    user-select: none;
}

.hermes-dashboard .code-block__language {
    font-weight: 600;
    text-transform: lowercase;
}

.hermes-dashboard .code-block__copy {
    padding: 0.25rem 0.5rem;
    border: 0;
    border-radius: 0.375rem;
    color: var(--hermes-soft);
    background: transparent;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.hermes-dashboard .code-block__copy:hover {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .code-block__copy--done {
    color: var(--hermes-success-ink);
}

.hermes-dashboard .message-markdown table {
    display: block;
    max-width: 100%;
    margin: 0.75rem 0;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.hermes-dashboard .message-markdown :is(th, td) {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--hermes-line);
    text-align: left;
    vertical-align: top;
}

.hermes-dashboard .message-markdown th {
    background: var(--hermes-hover);
    font-weight: 700;
}

.hermes-dashboard .message-markdown blockquote {
    margin: 0.75rem 0;
    padding: 0.125rem 0 0.125rem 1rem;
    border-left: 3px solid var(--hermes-line-strong);
    color: var(--hermes-muted);
}

.hermes-dashboard .message-markdown hr {
    margin: 1.25rem 0;
    border: 0;
    border-top: 1px solid var(--hermes-line);
}

.hermes-dashboard .message-markdown div.math {
    margin: 0.75rem 0;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Подсветка highlight.js — палитра в цветах темы. */
.hermes-dashboard {
    --hermes-code-bg: #121214;
    --hermes-code-bar: #1a1a1d;
    --hermes-code-ink: #e6e1e5;
    --hl-keyword: #c792ea;
    --hl-string: #a5d6a7;
    --hl-number: #f2b880;
    --hl-comment: #7f7a85;
    --hl-title: #82aaff;
    --hl-attr: #ffcb6b;
    --hl-meta: #89ddff;
    --hl-deletion: #f28b82;
}

:root[data-hermes-theme="light"] .hermes-dashboard {
    --hermes-code-bg: #f7f6fa;
    --hermes-code-bar: #efedf3;
    --hermes-code-ink: #26222c;
    --hl-keyword: #8b3fb8;
    --hl-string: #2f7d32;
    --hl-number: #b45309;
    --hl-comment: #7a7482;
    --hl-title: #1d5fc2;
    --hl-attr: #9a6700;
    --hl-meta: #0f6f8f;
    --hl-deletion: #b42318;
}

.hermes-dashboard .hljs-keyword,
.hermes-dashboard .hljs-selector-tag,
.hermes-dashboard .hljs-literal,
.hermes-dashboard .hljs-built_in,
.hermes-dashboard .hljs-type { color: var(--hl-keyword); }
.hermes-dashboard .hljs-string,
.hermes-dashboard .hljs-regexp,
.hermes-dashboard .hljs-addition,
.hermes-dashboard .hljs-template-tag { color: var(--hl-string); }
.hermes-dashboard .hljs-number,
.hermes-dashboard .hljs-symbol,
.hermes-dashboard .hljs-bullet { color: var(--hl-number); }
.hermes-dashboard .hljs-comment,
.hermes-dashboard .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hermes-dashboard .hljs-title,
.hermes-dashboard .hljs-section,
.hermes-dashboard .hljs-name { color: var(--hl-title); }
.hermes-dashboard .hljs-attr,
.hermes-dashboard .hljs-attribute,
.hermes-dashboard .hljs-variable,
.hermes-dashboard .hljs-property,
.hermes-dashboard .hljs-params { color: var(--hl-attr); }
.hermes-dashboard .hljs-meta,
.hermes-dashboard .hljs-selector-class,
.hermes-dashboard .hljs-selector-id,
.hermes-dashboard .hljs-tag { color: var(--hl-meta); }
.hermes-dashboard .hljs-deletion { color: var(--hl-deletion); }
.hermes-dashboard .hljs-emphasis { font-style: italic; }
.hermes-dashboard .hljs-strong { font-weight: 700; }

/* Группы списка диалогов: закреплённые, затем по дате последней активности. */
.hermes-dashboard .session-group {
    margin: 0.75rem 0 0.125rem;
    padding: 0 0.625rem;
    color: var(--hermes-soft);
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.02em;
}

.hermes-dashboard .session-group:first-child {
    margin-top: 0.25rem;
}

/* Значок канала у диалогов из мессенджеров. */
.hermes-dashboard .session-badge {
    display: inline-block;
    margin-right: 0.375rem;
    padding: 0 0.3125rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1rem;
    vertical-align: 0.0625rem;
    color: var(--hermes-muted);
    background: var(--hermes-hover);
}

.hermes-dashboard .session-badge--telegram {
    color: #2aabee;
    background: rgb(42 171 238 / 0.14);
}

.hermes-dashboard .session-badge--vk {
    color: #4c8dff;
    background: rgb(76 141 255 / 0.14);
}

.hermes-dashboard .session-badge--max {
    color: #a07cff;
    background: rgb(160 124 255 / 0.14);
}

.hermes-dashboard .workspace-nav__search-hint {
    flex: 0 0 auto;
    padding: 0 0.3125rem;
    border: 1px solid var(--hermes-line);
    border-radius: 0.25rem;
    color: var(--hermes-soft);
    font: inherit;
    font-size: 0.625rem;
    line-height: 1rem;
}

.hermes-dashboard .workspace-nav__search:focus-within .workspace-nav__search-hint {
    display: none;
}

@media (hover: none), (max-width: 760px) {
    .hermes-dashboard .workspace-nav__search-hint {
        display: none;
    }
}

/* Метка после кнопки «Стоп»: обрывок ответа не выдаёт себя за законченный. */
.hermes-dashboard .message-bubble--stopped {
    align-self: flex-start;
    padding: 0.125rem 0;
    color: var(--hermes-soft);
    font-size: 0.8125rem;
    font-style: italic;
}

.hermes-dashboard .message-bubble--stopped .message-markdown,
.hermes-dashboard .message-bubble--stopped .message-markdown p {
    margin: 0;
    color: inherit;
    font-size: inherit;
}

.hermes-dashboard .message-bubble--stopped .message-time {
    display: none;
}

/* ---------- шапка десктопа и сворачиваемая боковая панель (как в ChatGPT и Claude) ---------- */

.hermes-dashboard .workspace-nav__collapse {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 0.5rem;
    color: var(--hermes-soft);
    background: transparent;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}

.hermes-dashboard .workspace-nav__collapse:hover {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .workspace-nav__collapse svg,
.hermes-dashboard .workspace-topbar__button--desktop svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (min-width: 761px) {
    .hermes-dashboard .workspace-console {
        transition: grid-template-columns 220ms cubic-bezier(0.2, 0.75, 0.25, 1);
    }

    .hermes-dashboard .workspace-console--nav-collapsed {
        grid-template-columns: 0 minmax(0, 1fr);
    }

    .hermes-dashboard .workspace-console--nav-collapsed .workspace-nav {
        visibility: hidden;
        padding-inline: 0;
        overflow: hidden;
        border-right: 0;
    }

    .hermes-dashboard .workspace-topbar {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 0.25rem;
        height: 3.25rem;
        padding: 0 0.75rem;
        background: var(--hermes-panel);
    }


    .hermes-dashboard .workspace-topbar__button {
        display: grid;
        place-items: center;
        width: 2.25rem;
        height: 2.25rem;
        padding: 0;
        border: 0;
        border-radius: 0.5rem;
        color: var(--hermes-muted);
        background: transparent;
        cursor: pointer;
        transition: background 120ms ease, color 120ms ease;
    }

    .hermes-dashboard .workspace-topbar__button:hover:not(:disabled) {
        color: var(--hermes-text);
        background: var(--hermes-hover);
    }

    .hermes-dashboard .workspace-topbar__button:disabled {
        opacity: 0.4;
        cursor: default;
    }

    /* После общего правила кнопки: иначе display: grid вернёт телефонные кнопки на десктоп. */
    .hermes-dashboard .workspace-topbar--mobile-only,
    .hermes-dashboard .workspace-topbar__button--mobile,
    .hermes-dashboard .workspace-topbar__new {
        display: none;
    }

    .hermes-dashboard .workspace-topbar--nav-collapsed .workspace-topbar__new {
        display: grid;
        order: 1;
    }

    .hermes-dashboard .workspace-topbar__new svg {
        width: 1.15rem;
        height: 1.15rem;
    }

    .hermes-dashboard .workspace-topbar__title {
        order: 2;
        min-width: 0;
        padding-inline: 0.5rem;
        overflow: hidden;
        color: var(--hermes-text);
        font-size: 0.9375rem;
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 760px) {
    .hermes-dashboard .workspace-nav__collapse,
    .hermes-dashboard .workspace-topbar__button--desktop {
        display: none;
    }
}

/* ---------- полировка содержимого ответа ---------- */

.hermes-dashboard .message-markdown .katex-display {
    margin: 0.875rem 0;
    padding: 0.25rem 0;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Таблица в рамке со скруглением и прокруткой вбок, как в ChatGPT. */
.hermes-dashboard .message-markdown table {
    width: max-content;
    max-width: 100%;
    border: 1px solid var(--hermes-line);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.75rem;
}

.hermes-dashboard .message-markdown :is(th, td) {
    border: 0;
    border-bottom: 1px solid var(--hermes-line);
}

.hermes-dashboard .message-markdown :is(th, td) + :is(th, td) {
    border-left: 1px solid var(--hermes-line);
}

.hermes-dashboard .message-markdown tr:last-child > td {
    border-bottom: 0;
}

.hermes-dashboard .message-markdown tbody tr:hover > td {
    background: var(--hermes-hover);
}


/* Карточка выбранного файла: плитка типа, имя и размер. */
.hermes-dashboard .composer-shell__attachment {
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.3125rem 0.3125rem 0.3125rem 0.3125rem;
    border: 1px solid var(--hermes-line);
    border-radius: 0.75rem;
}

.hermes-dashboard .composer-file__kind {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 0.5rem;
    color: #fff;
    background: #6b6b75;
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.hermes-dashboard .composer-file__kind--image { background: #7c5cff; }
.hermes-dashboard .composer-file__kind--pdf { background: #e5484d; }
.hermes-dashboard .composer-file__kind--table { background: #2f9e5b; }
.hermes-dashboard .composer-file__kind--doc { background: #3b82f6; }
.hermes-dashboard .composer-file__kind--slides { background: #e8833a; }
.hermes-dashboard .composer-file__kind--archive { background: #a07a3c; }
.hermes-dashboard .composer-file__kind--code { background: #4b5563; }

.hermes-dashboard .composer-file__body {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.hermes-dashboard .composer-file__name {
    font-weight: 600;
}

/* ---------- волна 2: шаги агента, уточнение по ходу, цена ответа ---------- */

.hermes-dashboard .tool-steps {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
}

.hermes-dashboard .tool-steps--live {
    align-self: stretch;
    max-width: 100%;
    margin-top: -0.5rem;
    padding-left: 1.25rem;
}

.hermes-dashboard .tool-steps--history {
    margin-top: 0.375rem;
}

.hermes-dashboard .tool-steps__more {
    color: var(--hermes-soft);
    font-size: 0.75rem;
}

.hermes-dashboard .tool-step {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    min-width: 0;
    color: var(--hermes-dim);
}

.hermes-dashboard .tool-step__mark {
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--hermes-soft);
    transform: translateY(-0.05rem);
}

.hermes-dashboard .tool-step--running .tool-step__mark {
    background: var(--hermes-text);
    animation: hermes-breathe 1.4s ease-in-out infinite;
}

.hermes-dashboard .tool-step--done .tool-step__mark {
    background: rgb(var(--hermes-success-rgb));
}

.hermes-dashboard .tool-step--failed .tool-step__mark {
    background: rgb(var(--hermes-danger-rgb));
}

.hermes-dashboard .tool-step__name {
    flex: none;
    color: var(--hermes-text);
    font-weight: 600;
}

.hermes-dashboard .tool-step__label {
    flex: 1 1 12rem;
    min-width: 0;
    overflow: hidden;
    color: var(--hermes-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hermes-dashboard .tool-step__result {
    flex-basis: 100%;
    padding-left: 1rem;
}

.hermes-dashboard .tool-step__result > summary {
    color: var(--hermes-soft);
    font-size: 0.75rem;
    cursor: pointer;
}

.hermes-dashboard .tool-step__result pre {
    max-height: 12rem;
    margin: 0.25rem 0 0;
    padding: 0.5rem 0.625rem;
    overflow: auto;
    border-radius: 0.5rem;
    background: var(--hermes-hover);
    color: var(--hermes-dim);
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.hermes-dashboard .agent-notify {
    display: flex;
    flex-wrap: wrap;
    align-self: flex-start;
    align-items: center;
    gap: 0.5rem 0.75rem;
    color: var(--hermes-soft);
    font-size: 0.8125rem;
}

/* Режим доступа агента в настройках. */
.hermes-dashboard .access-mode-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hermes-dashboard .access-mode-option {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--hermes-line);
    border-radius: 0.75rem;
    background: transparent;
    color: var(--hermes-text);
    text-align: left;
    cursor: pointer;
}

.hermes-dashboard .access-mode-option:hover:not(:disabled) {
    background: var(--hermes-hover);
}

.hermes-dashboard .access-mode-option--active {
    border-color: rgb(var(--hermes-accent-rgb) / 0.7);
    background: rgb(var(--hermes-accent-rgb) / 0.08);
}

.hermes-dashboard .access-mode-option__mark {
    flex: none;
    width: 1rem;
    height: 1rem;
    margin-top: 0.1875rem;
    border: 1.5px solid var(--hermes-muted);
    border-radius: 50%;
}

.hermes-dashboard .access-mode-option--active .access-mode-option__mark {
    border-color: rgb(var(--hermes-accent-rgb));
    box-shadow: inset 0 0 0 3px var(--hermes-panel), inset 0 0 0 8px rgb(var(--hermes-accent-rgb));
}

.hermes-dashboard .access-mode-option__text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hermes-dashboard .access-mode-option__text small {
    color: var(--hermes-soft);
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* Запрос разрешения агента: ход ждёт ответа человека. */
.hermes-dashboard .approval-card {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    align-self: stretch;
    max-width: var(--hermes-column);
    padding: 0.875rem 1rem;
    border: 1px solid rgb(var(--hermes-warn-rgb) / 0.45);
    border-radius: 0.875rem;
    background: rgb(var(--hermes-warn-rgb) / 0.08);
    color: var(--hermes-text);
}

.hermes-dashboard .approval-card__header {
    display: flex;
    gap: 0.625rem;
    align-items: flex-start;
}

.hermes-dashboard .approval-card__icon {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    fill: none;
    stroke: rgb(var(--hermes-warn-rgb));
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hermes-dashboard .approval-card h3 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.hermes-dashboard .approval-card__header p {
    margin: 0.125rem 0 0;
    color: var(--hermes-soft);
    font-size: 0.875rem;
}

.hermes-dashboard .approval-card__command {
    margin: 0;
    max-height: 12rem;
    overflow: auto;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--hermes-code-bg);
    color: var(--hermes-code-ink);
    font-size: 0.8125rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.hermes-dashboard .approval-card__reason {
    margin: 0;
    color: var(--hermes-soft);
    font-size: 0.8125rem;
}

.hermes-dashboard .approval-card__reason span {
    color: var(--hermes-text);
}

.hermes-dashboard .approval-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.625rem;
}

.hermes-dashboard .approval-card__timer {
    color: var(--hermes-muted);
    font-size: 0.75rem;
}

.hermes-dashboard .message-bubble--steer {
    align-self: flex-end;
    max-width: min(85%, 36rem);
    padding: 0.5rem 0.875rem;
    border: 1px dashed var(--hermes-line);
    border-radius: 1.25rem;
    color: var(--hermes-dim);
}

.hermes-dashboard .message-bubble__tag {
    display: block;
    margin-bottom: 0.125rem;
    color: var(--hermes-soft);
    font-size: 0.6875rem;
    font-weight: 600;
}

.hermes-dashboard .message-bubble--steer .message-time {
    display: none;
}

.hermes-dashboard .message-actions__cost {
    margin: 0 0.375rem;
    color: var(--hermes-soft);
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
}

.hermes-dashboard .composer-shell__steer-button {
    margin-right: 0.25rem;
}

@media (prefers-reduced-motion: reduce) {
    .hermes-dashboard .tool-step--running .tool-step__mark {
        animation: none;
    }
}

/* «Ещё» в навигации: троеточие толще обычного штриха, иначе точки теряются. */
.hermes-dashboard .workspace-nav__icon--dots {
    stroke-width: 2.8;
}

/* Кнопка-лупа в шапке панели: поиск по диалогам открывается по нажатию, как в ChatGPT. */
.hermes-dashboard .workspace-nav__search-toggle {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 0.5rem;
    color: var(--hermes-soft);
    background: transparent;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}

.hermes-dashboard .workspace-nav__search-toggle:hover,
.hermes-dashboard .workspace-nav__search-toggle--active {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .workspace-nav__search-toggle svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hermes-dashboard .workspace-nav__search-toggle:focus-visible {
    outline: 2px solid var(--hermes-accent);
    outline-offset: 2px;
}

/* Скрепка: рисуется целиком внутри рамки 24×24, чтобы края не обрезались. */
.hermes-dashboard .composer-shell__attach-icon {
    display: block;
    width: 1.3rem;
    height: 1.3rem;
    overflow: visible;
}

/* ---------- действия с диалогом в шапке: временный чат, «Поделиться», выгрузка, уведомления ---------- */

.hermes-dashboard .workspace-topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    min-width: 0;
}

.hermes-dashboard .workspace-topbar__actions:empty {
    display: none;
}

.hermes-dashboard .workspace-topbar__button {
    position: relative;
}

.hermes-dashboard .workspace-topbar__temporary--on {
    color: var(--hermes-accent-hi);
    background: rgb(var(--hermes-accent-rgb) / 0.14);
}

.hermes-dashboard .workspace-topbar__label {
    display: none;
}

.hermes-dashboard .workspace-topbar__badge {
    position: absolute;
    top: 0.2rem;
    right: 0.15rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: 0.5rem;
    color: #fff;
    background: rgb(var(--hermes-danger-rgb));
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
    pointer-events: none;
}

.hermes-dashboard .workspace-topbar__menu-anchor {
    position: relative;
}

.hermes-dashboard .workspace-topbar__menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.hermes-dashboard .workspace-topbar__menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    z-index: 41;
    display: grid;
    min-width: 13rem;
    padding: 0.375rem;
    border: 1px solid var(--hermes-line);
    border-radius: 0.75rem;
    background: var(--hermes-panel-strong);
    box-shadow: 0 12px 32px rgb(var(--hermes-shadow-rgb) / calc(0.32 * var(--hermes-shadow-a)));
}

.hermes-dashboard .workspace-topbar__menu button {
    padding: 0.55rem 0.75rem;
    border: 0;
    border-radius: 0.5rem;
    color: var(--hermes-text);
    background: transparent;
    font: inherit;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
}

.hermes-dashboard .workspace-topbar__menu button:hover:not(:disabled) {
    background: var(--hermes-hover);
}

.hermes-dashboard .workspace-topbar__menu button:disabled {
    opacity: 0.5;
    cursor: default;
}

@media (min-width: 761px) {
    .hermes-dashboard .workspace-topbar__actions {
        order: 3;
        margin-left: auto;
    }

    .hermes-dashboard .workspace-topbar__share {
        display: inline-flex;
        gap: 0.375rem;
        width: auto;
        padding: 0 0.625rem;
    }

    .hermes-dashboard .workspace-topbar__label {
        display: inline;
        font: inherit;
        font-size: 0.875rem;
        font-weight: 550;
    }

    /* На десктопе «Поделиться» уже есть кнопкой рядом. */
    .hermes-dashboard .workspace-topbar__menu .workspace-topbar__menu-share {
        display: none;
    }
}

@media (max-width: 760px) {
    /* На телефоне место дорого: «Поделиться» живёт в меню «⋯». */
    .hermes-dashboard .workspace-topbar__share {
        display: none;
    }

    .hermes-dashboard .workspace-topbar__actions .workspace-topbar__button {
        width: 2.5rem;
    }
}

/* ---------- временный чат ---------- */

.hermes-dashboard .chat-intro--temporary {
    display: grid;
    gap: 0.5rem;
    justify-items: center;
}

.hermes-dashboard .chat-intro--temporary h2 {
    margin: 0;
    font: inherit;
}

.hermes-dashboard .chat-intro--temporary p {
    max-width: 30rem;
    margin: 0;
    color: var(--hermes-soft);
    font-size: 0.9375rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.5;
}

/* ---------- центр уведомлений ---------- */

.hermes-dashboard .notification-center__backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
}

.hermes-dashboard .notification-center {
    position: fixed;
    top: 3.5rem;
    right: 0.75rem;
    z-index: 56;
    display: flex;
    flex-direction: column;
    width: min(24rem, calc(100vw - 1.5rem));
    max-height: min(32rem, calc(100dvh - 5rem));
    overflow: hidden;
    border: 1px solid var(--hermes-line);
    border-radius: 0.875rem;
    color: var(--hermes-text);
    background: var(--hermes-panel-strong);
    box-shadow: 0 18px 48px rgb(var(--hermes-shadow-rgb) / calc(0.36 * var(--hermes-shadow-a)));
    animation: hermes-fade-in 120ms ease-out;
}

.hermes-dashboard .notification-center__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    border-bottom: 1px solid var(--hermes-line);
}

.hermes-dashboard .notification-center__header h2 {
    flex: 1 1 auto;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 650;
}

.hermes-dashboard .notification-center__link {
    padding: 0.25rem 0.5rem;
    border: 0;
    border-radius: 0.375rem;
    color: var(--hermes-accent-2);
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
}

.hermes-dashboard .notification-center__link:hover {
    background: var(--hermes-hover);
}

.hermes-dashboard .notification-center__empty {
    margin: 0;
    padding: 1.5rem 1.25rem;
    color: var(--hermes-soft);
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: center;
}

.hermes-dashboard .notification-center__list {
    margin: 0;
    padding: 0.25rem;
    overflow-y: auto;
    list-style: none;
}

.hermes-dashboard .notification-item {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 0;
    border-radius: 0.625rem;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.hermes-dashboard .notification-item:hover {
    background: var(--hermes-hover);
}

.hermes-dashboard .notification-item__icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: var(--hermes-accent-hi);
    background: rgb(var(--hermes-accent-rgb) / 0.14);
}

.hermes-dashboard .notification-item__icon--maintenance,
.hermes-dashboard .notification-item__icon--billing {
    color: var(--hermes-text);
    background: rgb(var(--hermes-warn-rgb) / 0.18);
}

.hermes-dashboard .notification-item__icon svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hermes-dashboard .notification-item__body {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.hermes-dashboard .notification-item__body strong {
    font-size: 0.875rem;
    font-weight: 550;
    line-height: 1.35;
}

.hermes-dashboard .notification-item--unread .notification-item__body strong {
    font-weight: 700;
}

.hermes-dashboard .notification-item--unread .notification-item__body strong::before {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    margin-right: 0.375rem;
    border-radius: 50%;
    background: var(--hermes-accent);
    vertical-align: 0.1em;
    content: "";
}

.hermes-dashboard .notification-item__text {
    display: -webkit-box;
    overflow: hidden;
    color: var(--hermes-muted);
    font-size: 0.8125rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.hermes-dashboard .notification-item__body small {
    color: var(--hermes-soft);
    font-size: 0.75rem;
}

.hermes-dashboard .notification-center__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-top: 1px solid var(--hermes-line);
    color: var(--hermes-muted);
    font-size: 0.8125rem;
}

@media (max-width: 760px) {
    .hermes-dashboard .notification-center {
        top: calc(var(--hermes-mobile-header-height) + env(safe-area-inset-top) + 0.25rem);
        right: 0.5rem;
        width: calc(100vw - 1rem);
    }
}

/* ---------- окно «Поделиться» ---------- */

.hermes-dashboard .share-dialog {
    width: min(32rem, 100%);
}

.hermes-dashboard .share-dialog__link {
    display: flex;
    gap: 0.5rem;
}

.hermes-dashboard .share-dialog__link input {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.875rem;
}

.hermes-dashboard .share-dialog__link .button {
    flex: 0 0 auto;
}

.hermes-dashboard .share-dialog__meta,
.hermes-dashboard .share-dialog__state {
    margin: 0;
    color: var(--hermes-soft);
    font-size: 0.8125rem;
    line-height: 1.45;
}

@media (max-width: 760px) {
    .hermes-dashboard .share-dialog {
        height: auto;
    }
}

/* ---------- голосовой разговор ---------- */

.hermes-dashboard .composer-shell__voice-mode-button {
    margin-left: 0.125rem;
}

.hermes-dashboard .voice-mode {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 1.25rem;
    padding: calc(1.25rem + env(safe-area-inset-top)) 1.5rem calc(1.5rem + env(safe-area-inset-bottom));
    color: var(--hermes-text);
    background:
        radial-gradient(circle at 50% -12%, rgb(var(--hermes-accent-rgb) / 0.24), transparent 36rem),
        var(--hermes-bg);
    outline: 0;
    animation: hermes-fade-in 160ms ease-out;
}

.hermes-dashboard .voice-mode__body,
.hermes-dashboard .voice-mode__controls {
    width: min(100%, 72rem);
    margin: 0 auto;
}

.hermes-dashboard .voice-mode__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
    gap: 1.5rem;
    min-height: 0;
}

.hermes-dashboard .voice-mode__stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    min-height: 0;
    text-align: center;
}

/* Сферу рисует hermes-voice-orb.js на canvas; цвета фаз — тройки RGB отсюда, громкость (--voice-level) пишет hermes-chat.js. */
.hermes-dashboard .voice-mode__orb {
    --voice-level: 0;
    --voice-orb-listen: 150 144 190;
    --voice-orb-hear: 178 168 236;
    --voice-orb-work: 214 160 92;
    --voice-orb-speak: 160 128 245;
    --voice-orb-mute: 105 103 112;
    --voice-orb-bars: 240 238 248;
    position: relative;
    flex: none;
    width: clamp(11rem, 34vh, 16rem);
    aspect-ratio: 1;
    transition: width 220ms ease;
}

.hermes-dashboard .voice-mode__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hermes-dashboard .voice-mode__status {
    margin: 0;
    font-size: clamp(1.375rem, 2.6vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

/* Подпись для скринридера остаётся, глазам хватает сферы. */
.hermes-dashboard .voice-mode__status--quiet {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.hermes-dashboard .voice-mode__sheet-handle,
.hermes-dashboard .voice-mode__peek {
    display: none;
}

.hermes-dashboard .voice-mode__notice {
    max-width: 32rem;
    margin: 0;
    color: var(--hermes-accent-2);
    font-size: 0.875rem;
}

.hermes-dashboard .voice-mode__panel {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    min-height: 0;
    padding: 1.125rem;
    border: 1px solid var(--hermes-line);
    border-radius: 1.375rem;
    background:
        linear-gradient(145deg, rgb(var(--hermes-ink-rgb) / 0.035), transparent 45%),
        var(--hermes-panel);
    box-shadow: 0 24px 80px rgb(0 0 0 / 0.18);
}

.hermes-dashboard .voice-mode__panel-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    color: var(--hermes-muted);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hermes-dashboard .voice-mode__voice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.hermes-dashboard .voice-mode__voice select {
    max-width: 11rem;
    min-height: 2.125rem;
    padding: 0 0.625rem;
    border: 1px solid var(--hermes-line);
    border-radius: 0.6875rem;
    color: var(--hermes-text);
    background: var(--hermes-panel-raised);
    font: inherit;
}

/* column-reverse: лента сама держится у последней реплики, пока её не прокрутили вверх. */
.hermes-dashboard .voice-mode__transcript {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column-reverse;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
}

.hermes-dashboard .voice-mode__transcript-inner {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.hermes-dashboard .voice-mode__empty {
    margin: 0;
    color: var(--hermes-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

.hermes-dashboard .voice-mode__bubble {
    max-width: 88%;
    padding: 0.6875rem 0.8125rem;
    border-radius: 0.875rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    animation: voice-bubble-in 180ms ease-out;
}

/* Переносы строк — только у самой реплики: пробелы разметки вокруг неё не в счёт. */
.hermes-dashboard .voice-mode__bubble > span {
    white-space: pre-wrap;
}

.hermes-dashboard .voice-mode__bubble small {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--hermes-muted);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hermes-dashboard .voice-mode__bubble--user {
    align-self: flex-end;
    background: rgb(var(--hermes-accent-rgb) / 0.2);
}

.hermes-dashboard .voice-mode__bubble--assistant {
    align-self: flex-start;
    background: var(--hermes-panel-raised);
}

.hermes-dashboard .voice-mode__bubble--task {
    align-self: stretch;
    max-width: none;
    border: 1px solid rgb(var(--hermes-accent-rgb) / 0.7);
}

.hermes-dashboard .voice-mode__bubble--task small {
    color: var(--hermes-accent-hi);
}

/* Ответ Гермеса целиком: таблицам, графикам и блокам hermes-ui нужна вся ширина ленты. */
.hermes-dashboard .voice-mode__bubble--answer {
    align-self: stretch;
    max-width: none;
    min-width: 0;
    background: var(--hermes-panel-raised);
    overflow-wrap: normal;
}

.hermes-dashboard .voice-mode__bubble--answer .message-markdown {
    min-width: 0;
    overflow-x: auto;
}

.hermes-dashboard .voice-mode__files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.hermes-dashboard .voice-mode__file {
    max-width: 100%;
    padding: 0.25rem 0.625rem;
    overflow: hidden;
    color: var(--hermes-text);
    border: 1px solid var(--hermes-line);
    border-radius: 999px;
    font-size: 0.8125rem;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hermes-dashboard .voice-mode__image,
.hermes-dashboard .voice-mode__video {
    display: block;
    flex: 1 1 100%;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--hermes-line);
    border-radius: 0.75rem;
    background: var(--hermes-image-bg);
}

.hermes-dashboard .voice-mode__image img,
.hermes-dashboard .voice-mode__video {
    width: 100%;
    max-height: 22rem;
    object-fit: contain;
}

.hermes-dashboard .voice-mode__image img {
    display: block;
}

.hermes-dashboard .voice-mode__file:hover {
    border-color: rgb(var(--hermes-accent-rgb) / 0.6);
}

/*
 * Панель «Разговор» расширяется ручкой на левом краю (js/hermes-voice-panel.js): от 26rem до 56rem,
 * сфере слева всегда остаётся место. Сетка растёт вместе с панелью, а не отнимает ширину у сферы.
 */
.hermes-dashboard .voice-mode__body {
    width: min(100%, calc(46rem + var(--voice-panel-width, 26rem)));
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--voice-panel-width, 26rem));
}

.hermes-dashboard .voice-mode__panel {
    position: relative;
}

.hermes-dashboard .voice-mode__resize {
    position: absolute;
    top: 1.25rem;
    bottom: 1.25rem;
    left: -0.875rem;
    z-index: 1;
    width: 0.75rem;
    border-radius: 999px;
    cursor: col-resize;
    touch-action: none;
}

.hermes-dashboard .voice-mode__resize::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.25rem;
    height: 2.75rem;
    border-radius: 999px;
    background: var(--hermes-line);
    transform: translate(-50%, -50%);
    transition: background 120ms ease, height 120ms ease;
}

.hermes-dashboard .voice-mode__resize:hover::after,
.hermes-dashboard .voice-mode__resize:focus-visible::after,
.hermes-dashboard .voice-mode--resizing .voice-mode__resize::after {
    height: 4.5rem;
    background: rgb(var(--hermes-accent-rgb) / 0.8);
}

.hermes-dashboard .voice-mode__resize:focus-visible {
    outline: 0;
}

.hermes-dashboard .voice-mode--resizing {
    cursor: col-resize;
    user-select: none;
}

/* Под сферой панель и так во всю ширину: тянуть нечего. */
@media (max-width: 900px) {
    .hermes-dashboard .voice-mode__resize {
        display: none;
    }
}

@keyframes voice-bubble-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.hermes-dashboard .voice-mode__steps {
    display: grid;
    gap: 0.25rem;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.hermes-dashboard .voice-mode__step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: var(--hermes-soft);
    font-size: 0.8125rem;
}

.hermes-dashboard .voice-mode__step--running {
    color: var(--hermes-muted);
}

.hermes-dashboard .voice-mode__step-mark {
    flex: none;
}

.hermes-dashboard .voice-mode__step-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hermes-dashboard .voice-mode__controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.625rem;
}

.hermes-dashboard .voice-mode__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0 1rem;
    border: 1px solid var(--hermes-line);
    border-radius: 999px;
    color: var(--hermes-text);
    background: var(--hermes-panel-raised);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.hermes-dashboard .voice-mode__pill:hover {
    border-color: rgb(var(--hermes-accent-rgb) / 0.7);
}

.hermes-dashboard .voice-mode__pill--off {
    color: rgb(var(--hermes-danger-rgb));
    border-color: rgb(var(--hermes-danger-rgb) / 0.55);
}

.hermes-dashboard .voice-mode__pill--end {
    border-color: transparent;
    color: #fff;
    background: rgb(var(--hermes-danger-rgb) / 0.9);
}

.hermes-dashboard .voice-mode__pill--end:hover {
    border-color: transparent;
    background: rgb(var(--hermes-danger-rgb));
}

.hermes-dashboard .voice-mode__pill svg {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 900px) {
    .hermes-dashboard .voice-mode__body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        gap: 1rem;
    }

    .hermes-dashboard .voice-mode__orb {
        width: clamp(8.5rem, 24vh, 12rem);
    }

    .hermes-dashboard .voice-mode__stage {
        gap: 0.875rem;
    }

    .hermes-dashboard .voice-mode__panel {
        min-height: 10rem;
    }
}

/* На телефоне кнопки — круглые иконки: подписи остаются в aria-label и title. */
@media (max-width: 600px) {
    .hermes-dashboard .voice-mode {
        gap: 1rem;
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .hermes-dashboard .voice-mode__panel {
        padding: 0.875rem;
        border-radius: 1.125rem;
    }

    .hermes-dashboard .voice-mode__pill {
        justify-content: center;
        width: 3.25rem;
        height: 3.25rem;
        padding: 0;
    }

    .hermes-dashboard .voice-mode__pill span {
        display: none;
    }

    .hermes-dashboard .voice-mode__pill svg {
        width: 1.375rem;
        height: 1.375rem;
    }

    .hermes-dashboard .voice-mode__controls {
        gap: 0.875rem;
    }

    /* Шторка разговора: свёрнута до последней реплики, наполовину или на весь экран. */
    .hermes-dashboard .voice-mode__panel {
        gap: 0.625rem;
        min-height: 0;
        padding-top: 0.375rem;
    }

    .hermes-dashboard .voice-mode__sheet-handle {
        display: grid;
        place-items: center;
        width: 100%;
        height: 1.25rem;
        margin-bottom: -0.25rem;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
        touch-action: none;
    }

    .hermes-dashboard .voice-mode__sheet-handle span {
        width: 2.25rem;
        height: 0.25rem;
        border-radius: 999px;
        background: var(--hermes-line);
    }

    .hermes-dashboard .voice-mode--sheet-collapsed .voice-mode__body {
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .hermes-dashboard .voice-mode--sheet-collapsed .voice-mode__panel-head,
    .hermes-dashboard .voice-mode--sheet-collapsed .voice-mode__transcript {
        display: none;
    }

    .hermes-dashboard .voice-mode__peek {
        display: grid;
        gap: 0.125rem;
        width: 100%;
        padding: 0;
        border: 0;
        color: var(--hermes-text);
        background: transparent;
        font: inherit;
        text-align: left;
        cursor: pointer;
        touch-action: none;
    }

    .hermes-dashboard .voice-mode__peek small {
        color: var(--hermes-muted);
        font-size: 0.6875rem;
    }

    .hermes-dashboard .voice-mode__peek span {
        display: -webkit-box;
        overflow: hidden;
        font-size: 0.9375rem;
        line-height: 1.4;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .hermes-dashboard .voice-mode__peek .voice-mode__peek-empty {
        color: var(--hermes-muted);
    }

    .hermes-dashboard .voice-mode--sheet-collapsed .voice-mode__orb {
        width: clamp(11rem, 32vh, 15rem);
    }

    .hermes-dashboard .voice-mode--sheet-half .voice-mode__orb {
        width: 8.5rem;
    }

    /* На весь экран сфера сжимается в шапку; тап по ней сворачивает шторку. */
    .hermes-dashboard .voice-mode--sheet-full .voice-mode__stage {
        gap: 0.5rem;
    }

    .hermes-dashboard .voice-mode--sheet-full .voice-mode__orb {
        width: 3rem;
        cursor: pointer;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hermes-dashboard .voice-mode,
    .hermes-dashboard .voice-mode * {
        animation: none !important;
        transition: none !important;
    }
}

/* Баннер техработ прибит сверху: лента уведомлений открывается под ним. */
html.nanoagent-maintenance-active .hermes-dashboard .notification-center {
    top: calc(3.5rem + var(--nanoagent-maintenance-notice-height, 0px));
    max-height: calc(100dvh - 5rem - var(--nanoagent-maintenance-notice-height, 0px));
}

@media (max-width: 760px) {
    html.nanoagent-maintenance-active .hermes-dashboard .notification-center {
        top: calc(var(--hermes-mobile-header-height) + env(safe-area-inset-top) + 0.25rem + var(--nanoagent-maintenance-notice-height, 0px));
    }
}

/* ---------- бот пространства внутри карточки мессенджера ---------- */

.hermes-dashboard .connection__bot {
    display: grid;
    gap: 0.625rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--hermes-line);
}

.hermes-dashboard .connection__bot-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--hermes-soft);
}

.hermes-dashboard .connection__link {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    color: var(--hermes-accent-2);
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
}

.hermes-dashboard .connection__link:disabled {
    cursor: default;
    opacity: 0.5;
}

.hermes-dashboard .connection__bot-setup > summary {
    color: var(--hermes-accent);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.hermes-dashboard .connection__bot-setup[open] > summary {
    margin-bottom: 0.75rem;
}

/* ---------- основная кнопка: доступна или нет — видно сразу ---------- */

/* Выключенная основная кнопка не залита акцентом: иначе в тёмной теме её не отличить от доступной. */
.hermes-dashboard .button--primary:disabled {
    color: var(--hermes-dim);
    border-color: transparent;
    background: rgb(var(--hermes-accent-rgb) / 0.16);
    box-shadow: none;
    opacity: 1;
}

/* В тёмной теме наведение на доступную кнопку заметно ярче. */
:root:not([data-hermes-theme="light"]) .hermes-dashboard .button--primary:hover:not(:disabled) {
    filter: brightness(1.18);
}

/* На телефоне в одну строку с кнопками полю остаётся ~100px: подсказка переносится, текст набирать тесно.
   Поле уходит отдельной строкой на всю ширину, кнопки — строкой ниже, отправка прижата вправо. */
@media (max-width: 520px) {
    .hermes-dashboard .composer-shell__bar {
        flex-wrap: wrap;
        row-gap: 0;
    }

    .hermes-dashboard .composer-shell__input {
        order: -1;
        flex: 1 0 100%;
        padding-inline: 0.5rem;
    }

    .hermes-dashboard .composer-shell__input + * {
        margin-left: auto;
    }
}
