/*
 * Шаблоны агента: раздел настроек «Шаблоны агента» и окно установки шаблона по ссылке.
 * Подключается после hermes-projects.css (использует его поля и диалог), цвета только из токенов.
 */

.hermes-dashboard .templates-panel__toolbar {
    display: flex;
    margin: 0.75rem 0;
}

.hermes-dashboard .templates-list {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 0.75rem;
    padding: 0;
    list-style: none;
}

.hermes-dashboard .templates-card {
    display: grid;
    gap: 0.625rem;
    padding: 0.875rem;
    border: 1px solid var(--hermes-line);
    border-radius: 12px;
    background: rgb(var(--hermes-bg-2-rgb) / 0.5);
}

.hermes-dashboard .templates-card--off {
    opacity: 0.75;
}

.hermes-dashboard .templates-card__head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.hermes-dashboard .templates-card__emoji {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    background: rgb(var(--hermes-accent-rgb) / 0.12);
    font-size: 1.3rem;
}

.hermes-dashboard .templates-card__title {
    display: grid;
    min-width: 0;
}

.hermes-dashboard .templates-card__title strong {
    overflow-wrap: anywhere;
}

.hermes-dashboard .templates-card__title small {
    color: var(--hermes-soft);
}

.hermes-dashboard .templates-card__link {
    display: flex;
    gap: 0.5rem;
    min-width: 0;
}

.hermes-dashboard .templates-card__link input,
.hermes-dashboard .templates-select {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 2.5rem;
    padding: 0.5rem 0.65rem;
    color: var(--hermes-text);
    border: 1px solid var(--hermes-line);
    border-radius: 10px;
    background: rgb(var(--hermes-bg-2-rgb) / 0.72);
    font: inherit;
}

.hermes-dashboard .templates-select {
    width: 100%;
}

.hermes-dashboard .templates-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hermes-dashboard .templates-dialog {
    max-height: calc(100dvh - 1.5rem);
}

.hermes-dashboard .templates-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.25rem 0;
    overflow-wrap: anywhere;
}

.hermes-dashboard .templates-check input {
    flex: 0 0 auto;
    width: 1.1rem;
    min-height: 0;
    margin-top: 0.2rem;
}

.hermes-dashboard .templates-findings {
    display: grid;
    gap: 0.5rem;
    padding-bottom: 1rem;
}

.hermes-dashboard .templates-findings .inline-banner {
    margin: 0;
}

.hermes-dashboard .templates-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hermes-dashboard .templates-color,
.hermes-dashboard .templates-hero {
    --tpl-c1: #2a5bd7;
    --tpl-c2: #3f6ae0;
}

.hermes-dashboard .templates-color--green, .hermes-dashboard .templates-hero--green { --tpl-c1: #13704a; --tpl-c2: #1f8559; }
.hermes-dashboard .templates-color--violet, .hermes-dashboard .templates-hero--violet { --tpl-c1: #6a3fd1; --tpl-c2: #7c52e0; }
.hermes-dashboard .templates-color--orange, .hermes-dashboard .templates-hero--orange { --tpl-c1: #a8500c; --tpl-c2: #b4590f; }
.hermes-dashboard .templates-color--rose, .hermes-dashboard .templates-hero--rose { --tpl-c1: #c22a5f; --tpl-c2: #d23d72; }
.hermes-dashboard .templates-color--slate, .hermes-dashboard .templates-hero--slate { --tpl-c1: #3b4658; --tpl-c2: #546179; }

.hermes-dashboard .templates-color {
    width: 2.25rem;
    height: 2.25rem;
    border: 2px solid transparent;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tpl-c1), var(--tpl-c2));
    cursor: pointer;
}

.hermes-dashboard .templates-color--active {
    border-color: var(--hermes-text);
    outline: 2px solid var(--hermes-bg);
    outline-offset: -4px;
}

.hermes-dashboard .templates-hero {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--tpl-c1), var(--tpl-c2));
}

.hermes-dashboard .templates-hero__emoji {
    font-size: 2rem;
    line-height: 1.1;
}

.hermes-dashboard .templates-hero strong {
    font-size: 1.15rem;
    overflow-wrap: anywhere;
}

.hermes-dashboard .templates-hero span,
.hermes-dashboard .templates-hero small {
    overflow-wrap: anywhere;
}

.hermes-dashboard .templates-hero small {
    overflow-wrap: anywhere;
}

.hermes-dashboard .templates-description {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.hermes-dashboard .templates-changes {
    display: grid;
    gap: 0.375rem;
    margin: 0;
    padding-left: 1.1rem;
    overflow-wrap: anywhere;
}

.hermes-dashboard .templates-skills > summary {
    cursor: pointer;
    font-weight: 600;
}

.hermes-dashboard .templates-instructions {
    margin: 0.5rem 0 0;
    padding: 0.75rem;
    max-height: 14rem;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border: 1px solid var(--hermes-line);
    border-radius: 10px;
    background: rgb(var(--hermes-bg-2-rgb) / 0.72);
    font: 0.8125rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 480px) {
    .hermes-dashboard .templates-card__link {
        flex-direction: column;
    }
}
