.user-template-section-heading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 700;
}

.user-template-section-heading small {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    padding: 0 5px;
    border-radius: 5px;
    color: var(--gray-500);
    background: var(--gray-100);
    font-size: 10px;
}

.user-template-section-heading em {
    margin-left: auto;
    color: var(--gray-400);
    font-size: 10px;
    font-style: normal;
    font-weight: 500;
}

.user-template-section-heading.team {
    margin-top: 10px;
    border-top-color: rgba(59, 130, 246, .22);
    color: #2563eb;
}

.template-categories .category-btn[data-category="_team"] {
    color: #1d4ed8;
    background: #eff6ff;
}

.template-categories .category-btn[data-category="_team"]:hover,
.template-categories .category-btn[data-category="_team"].active {
    color: #fff;
    background: #2563eb;
}

.user-template-section-empty {
    grid-column: 1 / -1;
    padding: 14px 2px 4px;
    color: var(--gray-400);
    font-size: 12px;
}

.team-shared-template-card {
    border-color: rgba(59, 130, 246, .28);
}

.team-shared-template-card:hover {
    border-color: rgba(37, 99, 235, .58);
}

.user-template-team-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 160px;
    margin-left: auto;
    padding: 5px 7px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 6px;
    color: #fff;
    background: rgba(37, 99, 235, .78);
    backdrop-filter: blur(6px);
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-team-template-category-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 4px;
    padding: 8px 0 2px;
    border-top: 1px solid rgba(59, 130, 246, .16);
}

.home-team-template-category-bar button {
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid #dbe5f6;
    border-radius: 7px;
    color: #5270a7;
    background: #f8fbff;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 650;
}

.home-team-template-category-bar button:hover,
.home-team-template-category-bar button.active {
    border-color: #86a8e8;
    color: #1d4ed8;
    background: #eff6ff;
}

.home-team-template-category-bar button i { margin-right: 5px; font-size: 10px; }
.home-team-template-category-bar button small { margin-left: 4px; color: #91a4c8; font-size: 9px; }
.home-team-template-category-add { border-style: dashed !important; }

.home-team-template-actions {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 5;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity .16s ease;
}

.team-shared-template-card:hover .home-team-template-actions,
.home-team-template-actions:focus-within { opacity: 1; }
.home-team-template-actions button { width: 29px; height: 29px; border: 0; border-radius: 7px; color: #475467; background: rgba(255,255,255,.94); box-shadow: 0 3px 10px rgba(15,23,42,.16); cursor: pointer; }
.home-team-template-actions button:hover { color: #1d4ed8; background: #eff6ff; }
.home-team-template-actions button:last-child:hover { color: #dc2626; background: #fef2f2; }
.user-template-capability.team-category { border-color: rgba(147,197,253,.38); }

.home-team-template-modal { position: fixed; inset: 0; z-index: 5100; display: grid; place-items: center; padding: 20px; background: rgba(15,23,42,.46); backdrop-filter: blur(10px); animation: home-team-template-fade-in .16s ease-out; }
.home-team-template-dialog { display: flex; width: min(900px, 100%); max-height: min(820px, calc(100dvh - 32px)); overflow: hidden; flex-direction: column; border: 1px solid rgba(148,163,184,.45); border-radius: 18px; background: #fff; box-shadow: 0 30px 90px rgba(15,23,42,.28), 0 6px 24px rgba(15,23,42,.1); animation: home-team-template-dialog-in .18s ease-out; }
.home-team-template-dialog header { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 28px 20px; border-bottom: 1px solid #eaecf0; background: #fbfcfe; }
.home-team-template-dialog header > div { min-width: 0; }
.home-team-template-dialog header span { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border: 1px solid #dbeafe; border-radius: 6px; color: #2563eb; background: #eff6ff; font-size: 10px; font-weight: 750; letter-spacing: .02em; }
.home-team-template-dialog h2 { margin: 9px 0 0; color: #101828; font-size: 22px; font-weight: 760; letter-spacing: -.02em; }
.home-team-template-dialog header p { max-width: 560px; margin: 7px 0 0; color: #667085; font-size: 11px; line-height: 1.55; }
.home-team-template-dialog header button { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid #e4e7ec; border-radius: 9px; color: #667085; background: #fff; cursor: pointer; }
.home-team-template-dialog header button:hover { border-color: #cbd5e1; color: #1d4ed8; background: #eff6ff; }
.home-team-template-dialog form { display: grid; min-height: 0; grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr); align-items: start; gap: 24px; overflow: auto; padding: 24px 28px 0; }
.home-team-template-form-grid { display: grid; min-width: 0; grid-column: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 15px; }
.home-team-template-panel-heading { display: grid; grid-column: 1 / -1; gap: 4px; padding-bottom: 2px; }
.home-team-template-panel-heading > span { color: #1f2937; font-size: 13px; font-weight: 760; }
.home-team-template-panel-heading > small { color: #98a2b3; font-size: 10px; font-weight: 500; line-height: 1.45; }
.home-team-template-form-grid .full { grid-column: 1 / -1; }
.home-team-template-dialog label { display: grid; gap: 7px; min-width: 0; color: #344054; font-size: 11px; font-weight: 750; }
.home-team-template-dialog input, .home-team-template-dialog select, .home-team-template-dialog textarea { box-sizing: border-box; width: 100%; padding: 10px 11px; border: 1px solid #dce2ea; border-radius: 9px; color: #101828; background: #fbfcfe; font: inherit; font-size: 13px; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.home-team-template-dialog input, .home-team-template-dialog select { min-height: 42px; }
.home-team-template-dialog textarea { resize: vertical; line-height: 1.6; }
.home-team-template-dialog input:hover, .home-team-template-dialog select:hover, .home-team-template-dialog textarea:hover { border-color: #cbd5e1; background: #fff; }
.home-team-template-dialog input:focus, .home-team-template-dialog select:focus, .home-team-template-dialog textarea:focus { outline: 0; border-color: #6990df; background: #fff; box-shadow: 0 0 0 3px rgba(105,144,223,.14); }
.home-team-template-dialog #homeTeamTemplatePrompt { min-height: 180px; }
.home-team-template-dialog #homeTeamTemplateParameters { min-height: 112px; color: #334155; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.home-team-template-form-grid label small { color: #98a2b3; font-size: 10px; font-weight: 500; line-height: 1.5; }
.home-team-template-media-grid { display: grid; min-width: 0; grid-column: 2; grid-template-columns: 1fr; align-content: start; gap: 14px; }
.home-team-template-media-field { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 14px; border: 1px solid #e4e7ec; border-radius: 11px; background: #f8fafc; }
.home-team-template-field-heading { display: grid; gap: 3px; }
.home-team-template-field-heading > span { color: #344054; font-size: 12px; font-weight: 750; }
.home-team-template-field-heading > small { color: #98a2b3; font-size: 10px; font-weight: 500; line-height: 1.45; }
.home-team-template-cover-preview { position: relative; display: grid; min-height: 152px; aspect-ratio: 16 / 9; place-items: center; overflow: hidden; border: 1px solid #e4e7ec; border-radius: 8px; background: #eef2f7; }
.home-team-template-cover-preview img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.home-team-template-cover-preview > span { position: absolute; right: 6px; bottom: 6px; padding: 3px 6px; border-radius: 4px; color: #fff; background: rgba(15,23,42,.7); font-size: 9px; }
.home-team-template-media-empty { display: grid; min-height: 118px; place-items: center; gap: 6px; color: #98a2b3; font-size: 11px; text-align: center; }
.home-team-template-media-empty i { color: #94a3b8; font-size: 22px; }
.home-team-template-file-picker { position: relative; display: inline-flex !important; min-height: 34px; align-items: center; justify-content: center; gap: 7px; padding: 0 9px; border: 1px dashed #b9c3d1; border-radius: 6px; color: #475467 !important; background: #fff; cursor: pointer; font-size: 11px !important; font-weight: 650 !important; }
.home-team-template-file-picker:hover { border-color: #6990df; color: #1d4ed8 !important; background: #eff6ff; }
.home-team-template-file-picker input { position: absolute; width: 1px !important; height: 1px; padding: 0 !important; overflow: hidden; opacity: 0; pointer-events: none; }
.home-team-template-media-remove { justify-self: start; min-height: 28px; padding: 0 8px; border: 1px solid #fecaca; border-radius: 6px; color: #b91c1c; background: #fff; cursor: pointer; font: inherit; font-size: 10px; }
.home-team-template-media-remove:hover { background: #fef2f2; }
.home-team-template-reference-preview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; min-height: 112px; align-content: start; }
.home-team-template-reference-item { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid #e4e7ec; border-radius: 6px; background: #eef2f7; }
.home-team-template-reference-item img { width: 100%; height: 100%; object-fit: cover; }
.home-team-template-reference-item > span { position: absolute; bottom: 4px; left: 4px; min-width: 17px; padding: 2px 4px; border-radius: 4px; color: #fff; background: rgba(15,23,42,.7); font-size: 9px; text-align: center; }
.home-team-template-reference-item button { position: absolute; top: 4px; right: 4px; display: grid; width: 22px; height: 22px; place-items: center; border: 0; border-radius: 5px; color: #fff; background: rgba(15,23,42,.75); cursor: pointer; }
.home-team-template-reference-item button:hover { background: #dc2626; }
.home-team-template-reference-empty { grid-column: 1 / -1; min-height: 112px; border: 1px dashed #d0d5dd; border-radius: 7px; }
.home-team-template-dialog footer { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 9px; grid-column: 1 / -1; margin: 0 -28px; padding: 16px 28px; border-top: 1px solid #eaecf0; background: rgba(255,255,255,.96); box-shadow: 0 -8px 22px rgba(15,23,42,.05); }
.home-team-template-cancel, .home-team-template-submit { min-height: 40px; padding: 0 16px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.home-team-template-cancel { border: 1px solid #d0d5dd; color: #475467; background: #fff; }
.home-team-template-submit { border: 1px solid #2563eb; color: #fff; background: #2563eb; }
.home-team-template-submit:hover { background: #1d4ed8; }
.home-team-template-submit:disabled { opacity: .62; cursor: wait; }

/* The category flow is a focused, single-field dialog rather than a full asset editor. */
.home-team-category-dialog { width: min(480px, 100%); }
.home-team-category-dialog form { grid-template-columns: 1fr; gap: 18px; overflow: visible; padding-top: 22px; }
.home-team-category-dialog footer { margin-left: -28px; margin-right: -28px; }

@keyframes home-team-template-fade-in {
    from { opacity: 0; }
}

@keyframes home-team-template-dialog-in {
    from { opacity: 0; transform: translateY(8px) scale(.99); }
}

@media (prefers-reduced-motion: reduce) {
    .home-team-template-modal, .home-team-template-dialog { animation: none; }
}

@media (max-width: 640px) {
    .user-template-section-heading em { display: none; }
    .user-template-team-badge { max-width: 120px; }
    .home-team-template-actions { opacity: 1; }
    .home-team-template-modal { padding: 10px; }
    .home-team-template-dialog { max-height: calc(100dvh - 20px); border-radius: 14px; }
    .home-team-template-dialog header { padding: 19px 17px 16px; }
    .home-team-template-dialog h2 { font-size: 19px; }
    .home-team-template-dialog form { grid-template-columns: 1fr; gap: 18px; padding: 18px 17px 0; }
    .home-team-template-form-grid, .home-team-template-media-grid { grid-template-columns: 1fr; }
    .home-team-template-form-grid .full { grid-column: auto; }
    .home-team-template-form-grid, .home-team-template-media-grid { grid-column: 1; }
    .home-team-template-reference-preview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .home-team-template-dialog footer { margin: 0 -17px; padding: 13px 17px; }
}

@media (max-width: 720px) {
    .home-team-template-dialog form { grid-template-columns: 1fr; }
    .home-team-template-form-grid, .home-team-template-media-grid { grid-column: 1; }
}

/* Lightweight organization controls inside My Templates. */
.user-templates-toolbar {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-bottom: 2px;
}

.user-template-toolbar-spacer { flex: 1 1 18px; }

.user-template-collections-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    margin: 0 0 3px;
    padding: 8px 0 2px;
    border-top: 1px solid #eef0f3;
}

.user-template-collections-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 3px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}

.user-template-collections-label i { color: #98a2b3; }

.user-template-collection-chip {
    display: inline-flex;
    align-items: stretch;
    min-height: 30px;
    overflow: hidden;
    border: 1px solid #e4e7ec;
    border-radius: 7px;
    background: #fff;
}

.user-template-collection-chip.active {
    border-color: #b7c8f5;
    background: #f1f5ff;
}

.user-template-collection-chip > button:first-child {
    min-width: 0;
    max-width: 190px;
    padding: 0 8px;
    border: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    color: #475467;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
}

.user-template-collection-chip.active > button:first-child { color: #1d4ed8; }
.user-template-collection-chip > button:first-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-template-collection-chip > button:first-child i { color: #98a2b3; font-size: 10px; }
.user-template-collection-chip > button:first-child small { color: #98a2b3; font-size: 9px; }

.user-template-collection-action {
    width: 25px;
    padding: 0;
    border: 0;
    border-left: 1px solid #edf0f4;
    color: #98a2b3;
    background: transparent;
    cursor: pointer;
    font-size: 10px;
}

.user-template-collection-action:hover { color: #1d4ed8; background: #eaf0ff; }
.user-template-collection-action[data-collection-action="delete"]:hover { color: #dc2626; background: #fef2f2; }

.user-template-new-collection {
    min-height: 30px;
    padding: 0 9px;
    border: 1px dashed #cbd5e1;
    border-radius: 7px;
    color: #667085;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 650;
}

.user-template-new-collection:hover { color: #1d4ed8; border-color: #8aa8ed; background: #f7f9ff; }

.team-template-primary-heading { margin-top: 0; padding-top: 0; border-top: 0; }
.team-template-empty { min-height: 110px; display: grid; place-items: center; border: 1px dashed #dbe5f6; border-radius: 10px; color: #6b84b5; background: #f8fbff; }

.user-template-collection-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(4px);
}

.user-template-collection-dialog {
    width: min(440px, 100%);
    padding: 22px;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    color: #101828;
    background: #fff;
    box-shadow: 0 24px 70px rgba(16, 24, 40, .24);
}

.user-template-collection-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.user-template-dialog-eyebrow { display: inline-flex; align-items: center; gap: 6px; color: #667085; font-size: 10px; font-weight: 700; }
.user-template-collection-dialog h3 { margin: 5px 0 0; font-size: 18px; }
.user-template-dialog-close { width: 30px; height: 30px; border: 0; border-radius: 7px; color: #667085; background: #f2f4f7; cursor: pointer; }
.user-template-dialog-close:hover { color: #101828; background: #eaecf0; }
.user-template-collection-dialog-copy { margin: 14px 0 18px; color: #667085; font-size: 12px; line-height: 1.6; }
.user-template-collection-dialog label { display: grid; gap: 7px; color: #344054; font-size: 12px; font-weight: 650; }
.user-template-collection-dialog input { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 8px; outline: 0; color: #101828; background: #fff; font: inherit; }
.user-template-collection-dialog input:focus { border-color: #7f9ce8; box-shadow: 0 0 0 3px rgba(127, 156, 232, .14); }
.user-template-collection-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.user-template-dialog-cancel, .user-template-dialog-submit { min-height: 36px; padding: 0 13px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.user-template-dialog-cancel { border: 1px solid #d0d5dd; color: #475467; background: #fff; }
.user-template-dialog-submit { border: 1px solid #2563eb; color: #fff; background: #2563eb; }
.user-template-dialog-submit:hover { background: #1d4ed8; }
.user-template-dialog-submit:disabled { opacity: .6; cursor: wait; }

.user-template-view-switch {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 3px;
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    background: #f6f7f9;
}

.user-template-view-switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    color: #667085;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.user-template-view-switch button:hover { color: #1f2937; }

.user-template-view-switch button.active {
    color: #101828;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}

.user-template-view-switch small {
    min-width: 17px;
    padding: 1px 4px;
    border-radius: 4px;
    color: #667085;
    background: #eaecf0;
    font-size: 9px;
    line-height: 15px;
}

.user-template-select {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 128px;
    min-height: 36px;
    border: 1px solid #d9dde5;
    border-radius: 7px;
    color: #667085;
    background: #fff;
}

.user-template-select > i {
    position: absolute;
    left: 10px;
    z-index: 1;
    font-size: 11px;
    pointer-events: none;
}

.user-template-select select {
    width: 100%;
    min-height: 34px;
    padding: 0 28px 0 29px;
    border: 0;
    outline: 0;
    color: #344054;
    background: transparent;
    font-size: 11px;
    cursor: pointer;
}

.user-template-loading {
    grid-column: 1 / -1;
    display: grid;
    min-height: 120px;
    place-items: center;
    color: #98a2b3;
}

.user-tpl-favorite.active { color: #b7791f !important; background: #fffbeb !important; }

.user-template-capability.collection {
    max-width: 128px;
    overflow: hidden;
    border-color: rgba(255, 255, 255, .34);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.utpl-collection-input { position: relative; }

.utpl-collection-input > i {
    position: absolute;
    top: 50%;
    left: 12px;
    color: #98a2b3;
    font-size: 12px;
    transform: translateY(-50%);
    pointer-events: none;
}

.utpl-collection-input input { padding-left: 34px !important; }

@media (max-width: 760px) {
    .user-template-toolbar-spacer { display: none; }
    .user-templates-toolbar .user-tpl-create-btn { order: 1; }
    .user-template-view-switch { order: 2; flex: 1 1 auto; }
    .user-template-view-switch button { flex: 1; padding-inline: 7px; }
    .user-template-select { order: 3; flex: 1 1 calc(50% - 4px); min-width: 0; }
    .user-template-collections-label { width: 100%; margin-bottom: 1px; }
}

@media (max-width: 420px) {
    .user-templates-toolbar .user-tpl-create-btn { width: 100%; justify-content: center; }
    .user-template-view-switch { width: 100%; }
    .user-template-view-switch button { min-width: 0; }
    .user-template-view-switch button i { display: none; }
}

/* Team template editor v2: a calm workspace with one scrollable content area. */
.home-team-template-dialog {
    width: min(1040px, 100%);
    max-height: min(900px, calc(100dvh - 48px));
    border-radius: 20px;
    background: #f7f8fa;
}

.home-team-template-dialog header {
    padding: 22px 30px 20px;
    background: #fff;
}

.home-team-template-dialog h2 { font-size: 21px; letter-spacing: -.01em; }
.home-team-template-dialog header p { color: #667085; }

.home-team-template-dialog form {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    padding: 0;
}

.home-team-template-editor-body {
    display: grid;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 28px;
    overflow: auto;
    padding: 26px 30px 30px;
    scrollbar-gutter: stable;
}

.home-team-template-form-grid,
.home-team-template-media-grid {
    grid-column: auto;
}

.home-team-template-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.home-team-template-panel-heading {
    gap: 5px;
    margin-bottom: 1px;
    padding-bottom: 11px;
    border-bottom: 1px solid #eaecf0;
}

.home-team-template-panel-heading > span { font-size: 14px; }
.home-team-template-panel-heading > small { font-size: 11px; }

.home-team-template-dialog label { gap: 8px; font-size: 11px; }
.home-team-template-dialog input,
.home-team-template-dialog select,
.home-team-template-dialog textarea {
    border-radius: 10px;
    background: #fff;
}

.home-team-template-dialog input,
.home-team-template-dialog select { min-height: 44px; }
.home-team-template-dialog #homeTeamTemplatePrompt { min-height: 154px; }
.home-team-template-dialog #homeTeamTemplateParameters { min-height: 132px; font-size: 12px; }
.home-team-template-model-field small { color: #98a2b3; font-size: 10px; font-weight: 500; line-height: 1.45; }

.home-team-template-field { display: grid; min-width: 0; gap: 8px; }
.home-team-template-prompt-heading,
.home-team-template-parameters-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.home-team-template-prompt-heading label,
.home-team-template-parameters-heading strong {
    display: block;
    color: #344054;
    font-size: 11px;
    font-weight: 750;
}
.home-team-template-prompt-heading button {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    color: #1d4ed8;
    background: #eff6ff;
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
}
.home-team-template-prompt-heading button:hover:not(:disabled) { border-color: #93c5fd; background: #dbeafe; }
.home-team-template-prompt-heading button:disabled { border-color: #e4e7ec; color: #98a2b3; background: #f9fafb; cursor: not-allowed; }
.home-team-template-selection {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    margin-top: -2px;
    color: #98a2b3;
    font-size: 10px;
    line-height: 1.45;
}
.home-team-template-selection i { flex: 0 0 auto; font-size: 9px; }
.home-team-template-selection span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-team-template-selection.has-selection { color: #1d4ed8; }
.home-team-template-param-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, .65fr) auto;
    align-items: end;
    gap: 12px;
    padding: 12px 0;
    border-block: 1px solid #dbeafe;
}
.home-team-template-param-composer[hidden] { display: none; }
.home-team-template-param-composer > div:first-child { display: grid; min-width: 0; gap: 4px; }
.home-team-template-param-composer small { color: #98a2b3; font-size: 9px; font-weight: 600; }
.home-team-template-param-composer strong { overflow: hidden; color: #1d4ed8; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.home-team-template-param-composer label { gap: 5px; font-size: 9px; }
.home-team-template-param-composer input { min-height: 36px; padding-block: 7px; }
.home-team-template-param-composer-actions { display: flex; gap: 6px; }
.home-team-template-param-composer-actions button,
.home-team-template-parameter-json-body button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    color: #475467;
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.home-team-template-param-composer-actions button:last-child { border-color: #2563eb; color: #fff; background: #2563eb; }
.home-team-template-param-composer-actions button:hover:first-child,
.home-team-template-parameter-json-body button:hover { background: #f8fafc; }
.home-team-template-param-composer-actions button:hover:last-child { background: #1d4ed8; }
.home-team-template-parameters-heading > div { display: flex; align-items: center; gap: 7px; }
.home-team-template-parameters-heading small {
    display: inline-grid;
    min-width: 18px;
    min-height: 18px;
    place-items: center;
    border-radius: 5px;
    color: #475467;
    background: #eef2f6;
    font-size: 9px;
}
.home-team-template-parameters-heading small:empty { display: none; }
.home-team-template-parameter-list { display: grid; gap: 0; border-top: 1px solid #eaecf0; }
.home-team-template-parameter-row {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(92px, auto) 14px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid #eaecf0;
}
.home-team-template-parameter-row code { overflow: hidden; color: #1d4ed8; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.home-team-template-parameter-row > i { color: #c0c7d1; font-size: 8px; }
.home-team-template-parameter-row input { min-height: 36px; padding: 7px 9px; font-size: 11px; }
.home-team-template-parameter-row button {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    color: #98a2b3;
    background: transparent;
    cursor: pointer;
}
.home-team-template-parameter-row button:hover { color: #b42318; background: #fef3f2; }
.home-team-template-parameter-empty { display: flex; min-height: 48px; align-items: center; gap: 8px; border-bottom: 1px solid #eaecf0; color: #98a2b3; font-size: 10px; }
.home-team-template-parameter-json { margin-top: 1px; }
.home-team-template-parameter-json summary { display: inline-flex; align-items: center; gap: 6px; color: #667085; cursor: pointer; font-size: 10px; font-weight: 650; list-style: none; }
.home-team-template-parameter-json summary::-webkit-details-marker { display: none; }
.home-team-template-parameter-json summary::after { content: '\f107'; font-family: 'Font Awesome 5 Free'; font-size: 9px; font-weight: 900; transition: transform .15s ease; }
.home-team-template-parameter-json[open] summary::after { transform: rotate(180deg); }
.home-team-template-parameter-json-body { display: grid; justify-items: end; gap: 8px; padding-top: 9px; }
.home-team-template-parameter-json-body button { min-height: 32px; }

.home-team-template-media-grid { gap: 16px; }
.home-team-template-media-field {
    gap: 12px;
    padding: 16px;
    border-radius: 13px;
    border-color: #e4e7ec;
    background: #fff;
}

.home-team-template-field-heading > span { font-size: 12px; }
.home-team-template-field-heading > small { font-size: 10px; }
.home-team-template-cover-preview { min-height: 166px; border-radius: 9px; }
.home-team-template-reference-preview { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; min-height: 108px; }
.home-team-template-reference-item { border-radius: 8px; }
.home-team-template-file-picker { width: 100%; box-sizing: border-box; min-height: 38px; }

.home-team-template-dialog footer {
    flex: 0 0 auto;
    grid-column: auto;
    margin: 0;
    padding: 15px 30px;
    border-top-color: #e4e7ec;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -8px 20px rgba(15, 23, 42, .04);
}

.home-team-template-cancel,
.home-team-template-submit { min-height: 42px; padding-inline: 18px; }

.home-team-category-dialog form {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: 1fr;
    gap: 18px;
    overflow: visible;
    padding: 22px 30px 0;
}

.home-team-category-dialog footer {
    margin: 0 -30px;
    padding: 15px 30px;
}

@media (max-width: 860px) {
    .home-team-template-dialog { max-height: calc(100dvh - 30px); }
    .home-team-template-editor-body { grid-template-columns: 1fr; gap: 24px; }
    .home-team-template-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .home-team-template-modal { padding: 8px; }
    .home-team-template-dialog { max-height: calc(100dvh - 16px); border-radius: 15px; }
    .home-team-template-dialog header { padding: 18px 18px 16px; }
    .home-team-template-dialog h2 { font-size: 19px; }
    .home-team-template-editor-body { gap: 20px; padding: 20px 18px 24px; }
    .home-team-template-form-grid,
    .home-team-template-media-grid { grid-template-columns: 1fr; }
    .home-team-template-param-composer { grid-template-columns: 1fr; align-items: stretch; }
    .home-team-template-param-composer-actions { justify-content: flex-end; }
    .home-team-template-parameter-row { grid-template-columns: minmax(72px, auto) 12px minmax(0, 1fr) 30px; }
    .home-team-template-dialog footer { padding: 12px 18px; }
    .home-team-category-dialog form { padding: 20px 18px 0; }
    .home-team-category-dialog footer { margin: 0 -18px; padding: 12px 18px; }
}
