.modal-backdrop.project-tools-mode{align-items:center;padding:24px}
.project-tools-mode .modal{width:min(1040px,calc(100vw - 48px));max-width:1040px;max-height:calc(100dvh - 48px);overflow:auto}
.project-tools-mode .modal-input{display:block;width:100%;box-sizing:border-box;margin:7px 0 16px}
.project-tools-mode label,.project-tools-mode legend{font-size:12px;color:var(--ui-secondary)}
.project-tools-mode textarea{resize:vertical;min-height:65px}
.project-tools-intro,.project-tools-hint{color:var(--ui-secondary);font-size:12px;line-height:1.7}
.template-picker-mode .modal{height:min(850px,calc(100dvh - 48px));display:flex;flex-direction:column}
.template-picker-mode .modal-header{flex:none}
.template-picker-mode #modalBody{display:flex;flex-direction:column;gap:12px;flex:1;min-height:0;overflow:hidden}
.template-tabs{display:flex;gap:8px;flex:none;border-bottom:1px solid var(--ui-border);padding-bottom:12px}
.project-tools-mode [data-template-plan=basic]{--template-color:var(--plan-basic-color);--template-tint:var(--plan-basic-tint)}
.project-tools-mode [data-template-plan=plus]{--template-color:var(--plan-plus-color);--template-tint:var(--plan-plus-tint);--plan-lock-wash:#234c79}
.project-tools-mode [data-template-plan=pro]{--template-color:var(--plan-pro-color);--template-tint:var(--plan-pro-tint);--plan-lock-wash:#6c522b}
.template-tabs button{padding:9px 16px;border:1px solid transparent;border-radius:8px;background:var(--template-tint);color:var(--template-color);font-size:13px}
.template-tabs button[aria-selected=true]{border-color:var(--template-color)}
.template-tabs button[data-template-locked=true]{opacity:.62}
.template-tabs button[data-template-locked=true]:is(:hover,:focus-visible){opacity:.9}
.template-locked-preview{display:grid;flex:1;min-height:0;overflow:hidden;border:1px solid var(--template-tint);border-radius:12px;isolation:isolate;--plan-lock-color:var(--template-color);--plan-lock-tint:var(--template-tint)}
.template-locked-gallery,.template-preview-overlay{grid-area:1/1;min-width:0;min-height:0}
.template-locked-gallery{display:flex;flex-direction:column;overflow:hidden;padding:10px}
.template-panel{flex:1;min-height:0;overflow:auto}
.template-panel:has(.template-browser){display:flex;flex-direction:column;overflow:hidden}
.template-browser{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:18px;min-height:0;flex:1}
.template-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:12px;overflow:auto;min-height:0;padding:3px}
.template-option{min-width:0}.template-option[hidden]{display:none}
.template-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%;height:100%;padding:12px;border:1px solid var(--ui-border-strong);border-radius:12px;background:var(--ui-surface);color:var(--ui-text);text-align:left;min-width:0}
.template-card[aria-pressed=true]{border-color:var(--ui-accent);background:var(--ui-accent-bg);box-shadow:inset 0 0 0 1px var(--ui-accent)}
.template-card strong{font-size:14px;overflow-wrap:anywhere;line-height:1.4}
.template-card>span{font-size:12px;line-height:1.5;color:var(--ui-secondary)}
.template-card small{font-size:11px;color:var(--ui-muted)}
.template-create-card{min-height:194px;align-items:center;justify-content:center;text-align:center;border-style:dashed;border-color:var(--template-color);background:var(--template-tint)}
.template-create-card strong,.template-create-card>.template-create-plus{color:var(--template-color)}
.template-create-card>.template-create-plus{font-size:32px;line-height:1}
.template-create-card:hover{border-style:solid}
.template-mini{width:100%;aspect-ratio:16/9;display:block;flex:none;margin-bottom:4px}
.template-mini svg{width:100%;height:100%;display:block;stroke:none}
.template-mini text{stroke:none;font-weight:400}
.template-selected-preview{display:block;border:1px solid var(--ui-border);border-radius:10px;padding:16px;background:#ffffff03;overflow:auto;margin:0;min-width:0}
.template-selected-preview strong{font-size:15px;line-height:1.4}.template-selected-preview h4{font-size:11px;margin:16px 0 4px;color:var(--ui-secondary)}
.template-selected-preview p,.template-selected-preview li{font-size:12px;line-height:1.65;color:var(--ui-secondary)}
.template-selected-preview ul{padding-left:18px}.template-first-action{border-left:2px solid var(--ui-accent);padding:1px 0 1px 12px;margin:16px 0}.template-first-action h4{margin-top:4px;color:var(--ui-accent)}
.template-name-step{max-width:700px;margin:12px auto}.template-name-step>.text-link{display:block;margin-bottom:24px}.template-name-step .template-selected-preview{margin-top:20px}
.template-content-choice{border:1px solid var(--ui-border);border-radius:10px;margin:18px 0;padding:16px}.template-content-choice p{font-size:12px}.template-content-choice label{display:flex;align-items:center;gap:8px;color:var(--ui-text)}
.template-private-warning{color:#e6bd7c!important}.template-replace-choice{display:block;margin:18px 0}.template-replace-choice strong{display:block;margin:8px 0 0 22px}
.template-card-actions{display:flex;justify-content:flex-end;gap:16px;padding:10px 6px}.template-option:has(.template-card-actions) .template-card{height:calc(100% - 42px)}
.template-library-warning{font-size:11px;color:#e6bd7c;line-height:1.5;margin:0}
.project-tool-actions{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0 26px}
#projectToolsError{color:#efa3a3;font-size:12px;min-height:18px;margin:0;flex:none}
.project-tools-mode .modal-actions{flex:none;margin-top:12px;background:var(--ui-surface,#292929)}
.template-picker-mode .modal-actions{margin-top:auto}
@media(max-width:900px){.template-browser{grid-template-columns:minmax(0,1fr) 240px}.template-picker{grid-template-columns:1fr}}
@media(max-width:650px){.modal-backdrop.project-tools-mode{padding:12px}.project-tools-mode .modal{width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:18px}.template-picker-mode .modal{height:calc(100dvh - 24px)}.template-browser{display:block;overflow:auto}.template-picker{overflow:visible;grid-template-columns:1fr}.template-selected-preview{margin-top:16px}.template-tabs{gap:2px}.template-tabs button{padding:9px 10px}.template-picker-mode .modal-header{margin-bottom:12px}}

@media(max-width:650px){.template-browser{display:flex;flex-direction:column;overflow:hidden}.template-browser .template-picker{flex:1;min-height:0;overflow:auto}.template-browser>.template-selected-preview{order:-1;flex:none;max-height:190px;margin:0 0 12px;padding:12px}.template-browser>.template-selected-preview .template-audience,.template-browser>.template-selected-preview ul{display:none}.template-browser>.template-selected-preview p{margin:5px 0;line-height:1.45}.template-browser>.template-selected-preview .template-first-action{margin:8px 0 0}}

.template-purpose-title{display:flex;align-items:center;gap:10px}.template-purpose-icon{width:25px;height:25px;flex:0 0 25px;color:var(--accent,#78A9D2)}
