/* A case template (AI-2032): what it asks of the customer as rows on thin glass, each with its name, its meaning,
   whether it is required and its place; a document holds its checks. Unsaved changes wait in a bar at the bottom. */
.case-template__loading {
    padding: 24px 0;
}

.case-template__status-help {
    margin-top: 6px;
}

.case-template-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 12px;
    border-radius: var(--ui-radius);
    background: var(--ui-glass-thin);
}

.case-template-item--nested {
    padding: 10px;
    background: var(--ui-glass);
}

.case-template-item__fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.case-template-item__actions {
    display: flex;
    align-items: flex-start;
    gap: 2px;
}

.case-template-item__children {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 12px;
    border-left: 2px solid var(--ui-divider);
}

.case-template__savebar {
    position: sticky;
    bottom: 16px;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 12px 16px;
    border-radius: var(--ui-radius-lg);
    background: var(--ui-glass-strong);
    -webkit-backdrop-filter: var(--ui-glass-filter-strong);
    backdrop-filter: var(--ui-glass-filter-strong);
    box-shadow: var(--ui-shadow-raised);
}

/* On a phone the actions sit under the fields, so the fields keep the width. */
@media (max-width: 600px) {
    .case-template-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .case-template-item__actions {
        justify-content: flex-end;
    }
}
