/* Match Asset Library's full canvas and compact 58px toolbar. */
body.portal-page #panel-template-learning.active{display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden;padding:0;gap:0}
#client-admin-template-learning-controls{display:flex;flex:1;min-height:0;min-width:0;height:100%}
.template-learning{--tl-border:var(--skin-border,#dfe2e8);--tl-surface:var(--skin-surface,#fff);--tl-muted:var(--skin-muted,#718094);--tl-text:var(--skin-text,#26323d);--tl-accent:var(--skin-accent,#e03a00);box-sizing:border-box;display:flex;flex:1;flex-direction:column;position:relative;min-width:0;min-height:0;width:100%;height:calc(100dvh - 160px);margin:0;padding:0;background:var(--tl-surface);color:var(--tl-text);font:13px/1.4 var(--cc-font-alt,Montserrat),Arial,sans-serif;overflow:hidden}
.template-learning *{box-sizing:border-box}
.template-learning [hidden],.tl-dialog [hidden]{display:none!important}
.template-learning .btn,.tl-dialog .btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:none;min-height:34px;margin:0;padding:7px 10px;border:1px solid var(--skin-border,#dfe2e8);border-radius:var(--skin-radius,8px);background:var(--skin-surface,#fff);color:var(--skin-text,#26323d);box-shadow:none;font:inherit;line-height:1.4;cursor:pointer}
.template-learning .btn:hover,.tl-dialog .btn:hover{background:var(--skin-surface-muted,#f5f6f8)}
.template-learning .btn-accent,.tl-dialog .btn-accent{background:var(--skin-text,#26323d);border-color:var(--skin-text,#26323d);color:var(--skin-surface,#fff)}
.template-learning button:disabled{opacity:.45;cursor:default}
.template-learning button[aria-pressed=true]{color:var(--tl-accent);border-color:var(--tl-accent);background:var(--skin-surface-muted,#fff3ee)}
.tl-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.tl-icon{display:inline-flex;width:20px;height:20px;flex:none;align-items:center;justify-content:center}
.tl-icon svg{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.template-learning .tl-icon-button{width:38px;height:38px;min-height:38px;padding:8px}
.tl-topbar{display:flex;align-items:center;gap:8px;flex:none;min-height:58px;padding:8px 12px;border-bottom:1px solid var(--tl-border);background:var(--tl-surface);z-index:4}
.tl-gallery-controls,.tl-review-controls,.tl-navigation,.tl-pagination{display:flex;align-items:center;gap:6px;min-width:0;flex:none;margin:0;padding:0}
.tl-gallery-controls{flex:1}.tl-review-controls{flex:1;overflow-x:auto;scrollbar-width:thin}.tl-navigation{margin-left:auto}
.tl-navigation button{position:relative}
.tl-navigation button[data-count]:not([data-count=""])::after{content:attr(data-count);position:absolute;right:-3px;top:-4px;border-radius:10px;background:var(--tl-accent);color:white;min-width:15px;font-size:10px;line-height:15px;text-align:center;padding:0 3px}
.tl-pagination{margin-left:auto;white-space:nowrap}.tl-page-count{font-size:11px;color:var(--tl-muted);padding:0 5px}
.tl-topbar .tl-field{font-size:0;gap:0;margin:0;min-width:0;flex:none}
.tl-topbar .tl-field>input,.tl-topbar .tl-field>select{font-size:13px;height:38px;padding:8px 10px;max-width:170px}
.tl-topbar .tl-field.tl-search{flex:1;min-width:110px}.tl-topbar .tl-search input{width:100%;max-width:none}
.tl-topbar .tl-field:has(input[type=checkbox]){font-size:11px;flex-direction:row;align-items:center;gap:4px;max-width:92px}
.tl-topbar .tl-toolbar{flex-wrap:nowrap;gap:6px;margin:0}
.tl-topbar h4{font-size:13px;min-width:100px;max-width:220px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tl-content{display:flex;flex:1;flex-direction:column;gap:0;min-height:0;min-width:0;overflow:hidden}
.tl-status{flex:none;font-size:12px;line-height:1.4;margin:0;padding:6px 12px;color:var(--skin-success,#21714c);background:var(--skin-surface-muted,#f6f8fa);border-bottom:1px solid var(--tl-border);max-height:60px;overflow:auto}
.tl-status:empty{display:none}.tl-status.tl-error{color:var(--skin-danger,#af2832)}
.tl-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:minmax(0,1fr);gap:8px;flex:1;min-height:0;padding:0;overflow:hidden}
.tl-card{display:flex;flex-direction:column;min-height:0;min-width:0;height:100%;padding:0;border:1px solid var(--tl-border);border-radius:var(--skin-radius,7px);overflow:hidden;background:var(--tl-surface)}
.tl-card:focus-within{border-color:var(--tl-accent)}
.tl-card-body{display:flex;position:relative;flex:1;min-height:0;min-width:0}
.tl-card-viewport{flex:1;min-width:0;min-height:0;overflow:auto;scrollbar-width:thin;overscroll-behavior:contain}
.tl-card-viewport img{display:block;max-width:none;height:auto;user-select:none}
.tl-card-rail{display:flex;flex:none;flex-direction:column;align-items:center;gap:3px;width:40px;max-height:100%;padding:5px 3px;border-left:1px solid var(--tl-border);overflow-y:auto;scrollbar-width:thin}
.template-learning .tl-card-rail button{width:32px;height:34px;min-height:34px;padding:5px;border:0;background:var(--tl-surface);font-size:10px}
.template-learning .tl-card-rail button:first-child{color:var(--tl-accent);background:var(--skin-surface-muted,#fff3ee)}
.tl-card-rail .tl-icon{width:17px;height:17px}
.tl-card-caption{flex:none;height:34px;min-width:0;border-top:1px solid var(--tl-border);display:flex;align-items:center;justify-content:center;padding:3px 8px}
.template-learning .tl-card-caption button{display:block;min-height:0;padding:0;border:0;max-width:100%;background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}
.tl-card-state{color:var(--tl-accent);margin-right:7px;font-size:15px}
.tl-empty{grid-column:1/-1;align-self:center;text-align:center;padding:16px;color:var(--tl-muted)}
.tl-advanced{position:absolute;right:12px;top:56px;z-index:8;width:310px;max-width:calc(100% - 24px);padding:14px;background:var(--tl-surface);border:1px solid var(--tl-border);border-radius:var(--skin-radius,10px);box-shadow:0 8px 24px #0002}
.tl-advanced>.btn{width:100%;justify-content:flex-start;margin-top:8px}.tl-summary{font-size:12px;color:var(--tl-muted);margin:8px 0}
.tl-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0}.tl-toolbar>strong{flex:1}
.tl-review-stage{display:flex;flex:1;min-height:0;min-width:0;gap:8px;padding:6px 8px 0}
.tl-comparison{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;flex:1;min-width:0;min-height:0}
.tl-comparison>section{display:flex;flex-direction:column;min-width:0;min-height:0;border:1px solid var(--tl-border);border-radius:var(--skin-radius,7px);overflow:hidden;background:var(--skin-surface-muted,#f7f8fa)}
.tl-comparison h4,.tl-preview-heading{flex:none;min-height:34px;margin:0;padding:6px 10px;font-size:13px;background:var(--tl-surface);border-bottom:1px solid var(--tl-border)}
.tl-preview-heading .tl-field{font-size:0;margin:0;gap:0}.tl-preview-heading select{font-size:12px;padding:0;border:0;background:transparent;max-width:100%}
.tl-preview-heading .tl-field select{font:12px/1.4 var(--cc-font-alt,Montserrat),Arial,sans-serif;padding:0;border:0;background:transparent;width:100%}
.template-learning .btn-accent:hover,.tl-dialog .btn-accent:hover{background:var(--skin-text,#26323d);color:var(--skin-surface,#fff)}
.tl-viewport{flex:1;min-height:0;min-width:0;overflow:auto;position:relative;scrollbar-width:thin;overscroll-behavior:contain}
.tl-viewport iframe{border:0;display:block;background:white}.tl-source{position:relative}.tl-source img{display:block;max-width:none;user-select:none}
.tl-area{position:absolute;border:2px solid var(--tl-accent);background:#ff3c0815;pointer-events:none}.tl-select-area{cursor:crosshair;touch-action:none}
.tl-review-rail{display:flex;flex:none;flex-direction:column;gap:4px;align-items:center;width:57px;padding:5px 3px;border:1px solid var(--tl-border);border-radius:var(--skin-radius,8px);overflow-y:auto;scrollbar-width:thin}
.template-learning .tl-review-rail button{border:0;width:47px;min-height:40px;height:auto;flex-direction:column;padding:6px 3px;gap:3px}.tl-icon-label{font-size:9px}
.tl-inspector{display:flex;flex-direction:column;flex:0 1 340px;min-width:240px;min-height:0;overflow:auto;scrollbar-width:thin;padding:12px;border:1px solid var(--tl-border);border-radius:var(--skin-radius,8px);background:var(--tl-surface)}
.tl-inspector-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:8px}.tl-inspector h4{font-size:14px;margin:8px 0}.tl-inspector>section>.btn{margin:4px 3px 4px 0}
.tl-workbench{flex:none;max-height:210px;overflow:auto;scrollbar-width:thin;margin:6px 8px 8px;padding:10px 12px;border:1px solid var(--tl-border);border-radius:var(--skin-radius,8px);background:var(--tl-surface)}
.tl-workbench h4{font-size:13px;margin:0 0 5px}.tl-workbench p{font-size:12px;margin:4px 0}
.tl-workbench .tl-toolbar{position:sticky;top:-10px;background:var(--tl-surface);z-index:1;margin:4px 0;padding:4px 0}.tl-workbench .tl-toolbar .tl-field{flex-direction:row;align-items:center;font-size:12px}.tl-workbench .tl-toolbar .btn-accent{margin-left:auto}
.tl-change-row{display:grid;grid-template-columns:minmax(100px,1fr) minmax(100px,2fr) auto;gap:10px;align-items:center;padding:6px 8px;margin-top:4px;border:1px solid var(--tl-border);border-radius:6px}
.tl-change-row:has(input:checked){border-color:var(--tl-accent);background:var(--skin-surface-muted,#fff5ee)}
.tl-change-row .tl-field{flex-direction:row;align-items:center;flex-wrap:wrap;gap:6px;margin:0}.tl-change-row input{order:-1;flex:none}
.tl-change-value{font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:70px;overflow:auto}.tl-eyebrow,.tl-help{font-size:11px;color:var(--tl-muted)}
.tl-field{display:flex;flex-direction:column;gap:5px;font-size:12px;margin:8px 0;font-weight:400;min-width:0}
.tl-field input,.tl-field textarea,.tl-field select{box-sizing:border-box;border:1px solid var(--skin-border,#dfe2e8);border-radius:var(--skin-radius,6px);padding:7px;background:var(--skin-surface,#fff);color:var(--skin-text,#26323d);max-width:100%;font:inherit}
.tl-field input[type=checkbox]{align-self:center;width:16px;height:16px;accent-color:var(--skin-accent,#e03a00)}.tl-field textarea{width:100%;resize:vertical}
.tl-style-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 8px}.tl-tool-tabs{display:flex;gap:4px;flex-wrap:wrap;margin:8px 0}
.template-learning .tl-tool-tabs button{padding:5px 7px;font-size:11px;min-height:30px}
.tl-save-row{display:flex;align-items:end;flex-wrap:wrap;gap:8px;margin-top:10px;border-top:1px solid var(--tl-border);padding-top:8px}.tl-save-row .tl-field{flex:1;min-width:120px}
.tl-secondary{flex:1;min-height:0;overflow:auto;padding:20px}
.tl-feedback,.tl-job,.tl-match{border:1px solid var(--skin-border,#dfe2e8);border-radius:var(--skin-radius,8px);padding:12px;background:var(--skin-surface,#fff);margin:10px 0}
.tl-feedback button,.tl-job button{margin:6px 6px 0 0!important}.tl-feedback p,.tl-job p{overflow-wrap:anywhere}
.template-learning details{margin:10px 0}.template-learning summary{cursor:pointer;font-weight:500}.template-learning pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:250px;overflow:auto;font-size:12px}
.tl-dialog{width:min(780px,90vw);max-height:85vh;overflow:auto;border:1px solid var(--skin-border,#dfe2e8);border-radius:var(--skin-radius,12px);padding:24px;color:var(--skin-text,#26323d);background:var(--skin-surface,#fff);font:13px/1.45 var(--cc-font-alt,Montserrat),Arial,sans-serif}
.tl-dialog::backdrop{background:#0007}.tl-dialog .tl-close{float:right}.tl-dialog>h3{padding-right:70px}.tl-dialog button{margin:8px!important}.tl-dialog .tl-field select[multiple]{min-height:130px}.tl-dialog pre{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:1100px){.tl-topbar{flex-wrap:wrap;gap:6px;padding:6px 8px}.tl-gallery-controls{flex:1 1 55%}.tl-review-controls{flex-basis:100%}.tl-topbar .tl-field>select{max-width:145px}.tl-inspector{min-width:220px;flex-basis:260px}.tl-card-rail{width:34px}.tl-card-rail .tl-icon-button{width:28px}}
@media(max-width:700px){.tl-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}.tl-gallery-controls{flex-basis:100%;flex-wrap:wrap}.tl-topbar .tl-field>select{max-width:135px}.tl-review-stage{position:relative}.tl-inspector{position:absolute;right:68px;top:6px;bottom:0;width:calc(100% - 78px);min-width:0;z-index:3;box-shadow:0 4px 12px #0002}.tl-comparison{gap:4px}.tl-comparison h4{font-size:11px;padding:6px}.tl-review-rail{width:48px}.template-learning .tl-review-rail button{width:40px}.tl-change-row{grid-template-columns:minmax(0,1fr) auto}.tl-change-value{grid-column:1/-1;grid-row:2}.tl-workbench{max-height:175px}.tl-advanced{top:110px}.template-learning{height:calc(100dvh - 80px)}}

/* Keep both comparison origins and available heights identical at every portal scale. */
.template-learning .tl-comparison>section>h4,.template-learning .tl-preview-heading{height:48px;min-height:48px;max-height:48px;display:flex;align-items:center;padding:6px 14px;flex:0 0 48px}
.template-learning .tl-preview-heading .tl-field{width:100%;min-height:0}
.template-learning .tl-preview-heading .tl-field select{height:32px;min-height:0;margin:0}
.template-learning .tl-card-viewport img{width:100%;max-width:100%;height:auto}
.tl-review-stage{padding-bottom:8px}
.tl-loading{background:linear-gradient(100deg,var(--skin-surface-muted,#f3f4f6) 25%,var(--skin-surface,#fff) 45%,var(--skin-surface-muted,#f3f4f6) 65%);background-size:250% 100%;animation:tl-loading 1.5s ease-in-out infinite}
@keyframes tl-loading{to{background-position:-150% 0}}
@media(prefers-reduced-motion:reduce){.tl-loading{animation:none}}
.tl-inspector .tl-change-row{grid-template-columns:minmax(0,1fr) auto}
.tl-inspector .tl-change-value{grid-column:1/-1;grid-row:2}

.template-learning .tl-comparison>section>h4{font-weight:400}
.tl-picture-loading{position:absolute;inset:0;display:grid;place-content:center;min-height:100px;pointer-events:none;z-index:1;background:var(--skin-surface-muted,#f7f8fa)}
.tl-picture-loading .tl-icon{width:52px;height:52px;color:var(--tl-muted);animation:tl-picture-pulse 1.2s ease-in-out infinite}
.tl-content,.tl-card-viewport{position:relative}
@keyframes tl-picture-pulse{0%,100%{opacity:.35;transform:translateY(3px) scale(.94)}50%{opacity:1;transform:translateY(-3px) scale(1)}}
.template-learning .tl-sync-toggle input{appearance:none;width:38px;height:22px;min-width:38px;border:0;border-radius:20px;background:#9ba3ad;position:relative;cursor:pointer;margin:0}
.template-learning .tl-sync-toggle input:checked{background:var(--tl-accent)}
.tl-sync-toggle input:before{content:'';position:absolute;width:16px;height:16px;top:3px;left:3px;border-radius:50%;background:white;transition:transform .15s}
.tl-sync-toggle input:checked:before{transform:translateX(16px)}
.tl-source-dialog{width:min(1000px,95vw);height:90vh;overflow:auto}.tl-source-dialog>img{display:block;width:100%;height:auto}
@media(prefers-reduced-motion:reduce){.tl-picture-loading .tl-icon{animation:none}.tl-sync-toggle input:before{transition:none}}

/* Shared reference popups and native-resolution source viewer. */
.tl-dialog {padding:0 20px 20px;box-sizing:border-box;box-shadow:0 16px 48px #0003;}
.tl-dialog-heading {position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;background:var(--skin-surface,#fff);border-bottom:1px solid var(--skin-border,#dfe2e8);}
.tl-dialog-heading h3 {margin:0;font-size:16px;font-weight:600;}
.tl-dialog .tl-dialog-heading button {margin:0!important;width:36px;height:36px;padding:7px;}
.tl-dialog button:disabled {opacity:.45;cursor:default;}
.tl-reference-details {display:grid;grid-template-columns:minmax(110px,1fr) 2fr;gap:12px;padding:12px 0;}
.tl-reference-details dt {color:var(--skin-muted,#718094);}.tl-reference-details dd {margin:0;overflow-wrap:anywhere;}
.tl-source-dialog[open] {display:flex;flex-direction:column;width:95vw;height:90vh;max-height:90vh;overflow:hidden;}
.tl-source-viewport {flex:1;min-height:0;overflow:auto;margin-top:12px;}
.tl-source-viewport img {display:block;max-width:none;max-height:none;object-fit:initial;}
.template-learning .tl-card-rail .tl-approved {color:#18783e;border-color:#18783e;}
.template-learning .tl-card-rail .tl-unapproved {color:#bf3030;border-color:#bf3030;}
.template-learning .tl-advanced>.tl-icon-button {width:100%;height:auto;justify-content:flex-start;}

/* Refined controls shared by reference, comparison, learning and job screens. */
.template-learning { --tl-border:#e3e7ee; --tl-muted:#718096; background:#f8f9fc; }
.template-learning .tl-topbar { background:#fff; padding:9px 14px; gap:12px; }
.template-learning .tl-navigation { padding-left:12px; border-left:1px solid var(--tl-border); }
.template-learning .tl-icon-button,.tl-dialog .tl-icon-button { border:1px solid transparent; border-radius:11px; background:#f2f5f9; color:#526176; transition:background .15s,color .15s,box-shadow .15s; }
.template-learning .tl-icon-button:hover,.tl-dialog .tl-icon-button:hover { background:#e9eef6; color:#263e61; box-shadow:0 2px 5px #22324c0c; }
.template-learning .tl-icon { width:19px;height:19px; }
.template-learning .tl-icon svg,.tl-dialog .tl-icon svg { stroke-width:1.65; }
.template-learning .tl-icon-button[aria-pressed=true] { background:var(--skin-accent-soft,#fff0e9); color:var(--tl-accent); border-color:transparent; box-shadow:inset 3px 0 var(--tl-accent); }
.template-learning .tl-review-rail { border-radius:14px; padding:8px; gap:8px; background:#fff; border:1px solid var(--tl-border); }
.template-learning .tl-review-rail button { border-radius:10px; }
.template-learning .tl-inspector { border-radius:14px; border-color:var(--tl-border); box-shadow:0 3px 14px #26344d06; }
.template-learning .tl-inspector-heading { padding:14px 16px; border-bottom:1px solid var(--tl-border); }
.template-learning .tl-comparison>section,.template-learning .tl-card { border-radius:12px; border-color:var(--tl-border); }
.template-learning .tl-review-summary { display:flex; flex-wrap:wrap; gap:8px; padding:4px 0 18px; margin-bottom:18px; border-bottom:1px solid var(--tl-border); }
.template-learning .tl-state-badge { border-radius:20px; padding:5px 10px; background:#f0f3f7; color:#5d6b7e; font-size:11px; font-weight:600; }
.template-learning .tl-state-badge.is-approved { background:#e5f5ed; color:#21764e; }
.template-learning .tl-review-note { flex-basis:100%; margin:4px 0 0; font-size:12px; line-height:1.6; color:var(--tl-muted); }
.template-learning .tl-review-actions>.btn { display:flex; width:100%; justify-content:flex-start; margin:8px 0; padding:11px 13px; border-radius:10px; }
.template-learning .tl-review-actions>.tl-completed-action { opacity:1; background:#eef7f1; border-color:#d2e9db; color:#39734e; }
.template-learning .tl-review-actions>.tl-completed-action::before { content:'\2713'; font-weight:700; }
.tl-dialog .tl-field { gap:7px; margin:16px 0; font-size:12px; font-weight:600; }
.tl-dialog input,.tl-dialog select { border:1px solid #dce2eb; border-radius:9px; padding:10px; font:inherit; }
.tl-dialog select[multiple] { min-height:140px; }
.tl-dialog-error { padding:10px 12px; border-radius:8px; color:#a32d36; background:#fff0f1; font-size:12px; }
.tl-dialog>.btn-accent { margin-top:8px; border-radius:10px; min-height:42px; }
.template-learning button:focus-visible,.tl-dialog button:focus-visible { outline:2px solid var(--skin-accent,#e03a00); outline-offset:3px; }
@media(prefers-reduced-motion:reduce) { .template-learning .tl-icon-button,.tl-dialog .tl-icon-button { transition:none; } }

/* Everyday review has two named actions; detailed controls are opt-in. */
.tl-more-tools{flex:none;width:110px;overflow:auto;font-size:12px}
.tl-more-tools>summary{cursor:pointer;padding:12px 8px;border-radius:9px;background:white}
.tl-more-tools .tl-review-rail{width:auto;margin-top:8px;align-items:stretch}
.template-learning .tl-more-tools .tl-review-rail button{width:100%;align-items:flex-start}
.tl-more-tools .tl-field{max-width:100%;margin-top:12px}
.tl-more-tools select{max-width:100%}
.tl-fix-progress{padding:10px 16px;margin:0;background:#eef4ff;font-size:13px}
.tl-card-more{font-size:10px;width:100%;text-align:center}.tl-card-more summary{cursor:pointer;padding:8px 0}
.template-learning .tl-card-caption{display:flex;flex-direction:column;gap:4px;height:68px}
.template-learning .tl-card-caption>.tl-icon-button{width:100%;height:34px;justify-content:center;gap:6px}
.template-learning .tl-card-caption>.tl-icon-button .tl-icon-label{font-size:12px}
.tl-dialog input[type=checkbox]{width:18px;height:18px;accent-color:var(--tl-accent,#c43313)}
.tl-dialog label:has(input[type=checkbox]){display:flex;flex-direction:row-reverse;justify-content:flex-end;align-items:center}
@media(max-width:700px){.tl-more-tools{width:85px}.tl-inspector{right:98px}}

/* Consistent action colors and immediate operation feedback across Learning. */
.template-learning .btn-accent,.tl-dialog .btn-accent,
.template-learning .btn-accent:hover,.tl-dialog .btn-accent:hover {
  background:var(--skin-accent,#df3500);border-color:var(--skin-accent,#df3500);color:#fff;
}
.template-learning .btn-secondary:not(.tl-icon-button):not(.btn-accent),.tl-dialog .btn-secondary:not(.tl-icon-button):not(.btn-accent) {
  color:var(--skin-accent,#df3500);border-color:var(--skin-accent,#df3500);background:var(--skin-accent-soft,#fff2ec);
}
.template-learning .tl-icon-button,.tl-dialog .tl-icon-button {color:var(--skin-accent,#df3500);background:var(--skin-accent-soft,#fff2ec);}
.template-learning .btn:disabled,.tl-dialog .btn:disabled {background:#f0f2f5;border-color:#e1e5eb;color:#78818e;opacity:1;cursor:default;box-shadow:none;}
.template-learning .tl-review-rail,.template-learning .tl-card-rail,.tl-more-tools {box-sizing:border-box;min-width:0;}
.template-learning .tl-review-rail {width:65px;flex-shrink:0;}
.template-learning .tl-review-rail button,.template-learning .tl-card-rail button {box-sizing:border-box;min-width:0;max-width:100%;flex-shrink:0;}
.template-learning .tl-more-tools .tl-review-rail {width:100%;padding:5px;}
.template-learning .tl-more-tools .tl-review-rail button {height:auto;white-space:normal;overflow-wrap:anywhere;padding:6px 3px;gap:3px;}
.tl-more-tools .tl-icon-label {min-width:0;}
.tl-operation-progress {display:flex;align-items:center;gap:12px;padding:18px;margin:16px 0;background:var(--skin-accent-soft,#fff2ec);border-radius:10px;color:var(--skin-text,#26323d);}
.tl-operation-progress::before,.template-learning button[aria-busy=true]::before,.tl-dialog button[aria-busy=true]::before {
  content:'';display:inline-block;flex:none;width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:tl-operation-spin .8s linear infinite;
}
.tl-operation-progress[hidden] {display:none;}
@keyframes tl-operation-spin {to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.tl-operation-progress::before,.template-learning button[aria-busy=true]::before,.tl-dialog button[aria-busy=true]::before{animation:none}}

.template-learning .tl-review-actions>.tl-completed-action:disabled {background:#eef7f1;border-color:#d2e9db;color:#39734e;}

.tl-fix-error{margin:6px 0;overflow-wrap:anywhere;max-height:100px;overflow:auto}
/* Conversational fixing: persistent assistant, with optional tools inside its header. */
.template-learning[data-workspace=review] .tl-navigation{display:none}
.template-learning .tl-chat-panel{flex:0 0 34%;min-width:320px;padding:0;overflow:hidden;position:relative;right:auto;top:auto;bottom:auto;width:auto;box-shadow:none}
.template-learning .tl-chat-panel .tl-inspector-heading{display:flex;flex-wrap:wrap;gap:4px;padding:18px 20px 12px;margin:0;border:0;flex:none}
.tl-chat-panel .tl-inspector-heading strong{font-size:18px;flex:1 1 100%}
.tl-chat-panel .tl-inspector-heading p{margin:0;font-size:12px}
.template-learning .tl-chat-options{display:flex;align-items:flex-start;gap:8px;padding:0 16px 12px;border-bottom:1px solid var(--tl-border);flex:none;max-height:40%;overflow:auto}
.template-learning .tl-chat-options>details{width:auto;flex:1;min-width:0;font-size:12px;margin:0}
.template-learning .tl-chat-options>details>summary{padding:10px;border:1px solid var(--tl-border);border-radius:8px;cursor:pointer;white-space:nowrap;background:white}
.template-learning .tl-chat-options:has(>details[open]){flex-wrap:wrap}
.template-learning .tl-chat-options>details[open]{flex-basis:100%;order:1}
.template-learning .tl-chat-options .tl-review-rail{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
.template-learning .tl-chat-options .tl-review-rail button{flex-direction:row;align-items:center;justify-content:flex-start;padding:9px}
.template-learning .tl-chat-options .tl-field{font-size:12px}
.template-learning .tl-chat-body{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.tl-chat-log{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:16px;scrollbar-width:thin}
.tl-chat-message{max-width:94%;width:fit-content;margin:0 0 16px;padding:12px 14px;border-radius:12px;background:#f3f5f8;font-size:13px;line-height:1.55;overflow-wrap:anywhere}
.tl-chat-message p{margin:0 0 8px;white-space:pre-wrap}.tl-chat-message p:last-child{margin-bottom:0}
.tl-chat-message.user{margin-left:auto;background:var(--skin-accent-soft,#fff0e9)}
.tl-chat-message.tl-chat-success{background:#edf7f0;border:1px solid #b9dec4}
.tl-chat-message strong{display:block;font-size:12px;margin:6px 0}
.template-learning .tl-chat-message .btn{margin-top:8px;font-size:12px;min-height:30px}
.tl-chat-message details{margin-top:10px;font-size:11px}.tl-chat-message details summary{cursor:pointer}.tl-chat-message details p{padding-top:8px}
.tl-chat-working::before{content:'';display:inline-block;width:10px;height:10px;margin-right:8px;border-radius:50%;background:var(--tl-accent)}
.tl-chat-composer{flex:none;border-top:1px solid var(--tl-border);padding:12px 16px;display:flex;flex-wrap:wrap;align-items:center;gap:8px;background:white}
.tl-chat-target{font-size:11px;color:var(--tl-muted);margin:0;flex:1;min-width:0;overflow-wrap:anywhere}
.template-learning .tl-chat-input{flex:1 1 100%;margin:0;font-size:0;gap:0;order:2}
.template-learning .tl-chat-input textarea{width:100%;resize:vertical;min-height:66px;max-height:130px;font-size:13px;line-height:1.5;padding:12px;border:1px solid var(--tl-border);border-radius:10px}
.template-learning .tl-chat-composer .tl-clear-selection{font-size:11px;border:0;background:transparent;padding:0;min-height:24px}
.template-learning .tl-chat-send{order:3;margin-left:auto;min-height:36px}
.tl-chat-composer>.tl-help{order:4;flex-basis:100%;font-size:10px;margin:0}
.tl-chat-panel>section:not(.tl-chat-body){overflow:auto;padding:16px;min-height:0}
@media(max-width:1100px){.template-learning .tl-chat-panel{min-width:290px;flex-basis:36%}}
@media(max-width:760px){.template-learning .tl-review-stage{flex-direction:column;overflow:auto}.template-learning .tl-comparison{flex:none;height:40vh;min-height:220px}.template-learning .tl-chat-panel{position:relative;flex:none;width:100%;min-width:0;height:65vh;min-height:430px}.template-learning .tl-chat-options>details>summary{white-space:normal}.template-learning .tl-review-controls h4{min-width:60px;max-width:130px}}
/* Keep the conversation spacious and the template title readable. */
.template-learning .tl-review-controls{flex:1;min-width:0}
.template-learning .tl-review-controls>.tl-toolbar{width:100%;flex-wrap:nowrap}
.template-learning .tl-review-controls h4{flex:1;min-width:0;max-width:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tl-view-actions{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none}
.template-learning .tl-chat-panel{flex-basis:42%}
.template-learning .tl-chat-panel .tl-inspector-heading{padding:12px 14px;gap:10px;border-bottom:1px solid var(--tl-border);align-items:center}
.template-learning .tl-chat-panel .tl-inspector-heading strong{flex:1 0 auto;font-size:18px;white-space:nowrap}
.template-learning .tl-chat-options{padding:0;gap:8px;border:0;max-height:none;overflow:visible;flex:0 0 auto;align-items:center}
.template-learning .tl-chat-options>details{flex:none;overflow:visible}
.template-learning .tl-chat-options>details>summary{padding:8px 10px;border:1px solid var(--tl-border);border-radius:8px;background:white;font-size:12px;white-space:nowrap}
.template-learning .tl-chat-options:has(>details[open]){flex:1 1 100%;max-height:35vh;overflow:auto;align-items:flex-start}
.template-learning .tl-chat-options>details[open]{flex:1 1 100%}
.tl-chat-log{padding:18px}
.template-learning .tl-chat-message{font-size:14px;max-width:90%}
.template-learning .tl-chat-composer{padding:10px 14px;gap:6px 10px}
.template-learning .tl-chat-input{flex:1 1 65%;order:2}
.template-learning .tl-chat-input textarea{min-height:58px;max-height:110px;padding:9px 12px;resize:none}
.template-learning .tl-chat-target{flex-basis:100%}
.template-learning .tl-chat-send{order:2;min-height:40px;margin:0}
.template-learning .tl-html-panel{position:relative}
.tl-html-updating{position:absolute;inset:54px 0 0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center;background:rgba(255,255,255,.82);color:#283443;backdrop-filter:blur(1px)}
.tl-html-updating[hidden]{display:none}
.tl-html-updating strong{font-size:16px}.tl-html-updating span{font-size:12px;max-width:260px}
.tl-html-updating::before{content:'';width:24px;height:24px;border:3px solid #efd5ca;border-right-color:var(--tl-accent,#df3500);border-radius:50%;animation:tl-operation-spin .8s linear infinite}
@media(prefers-reduced-motion:reduce){.tl-html-updating::before{animation:none}}
@media(max-width:1100px){.template-learning .tl-chat-panel{flex-basis:40%;min-width:290px}.template-learning .tl-chat-send{font-size:12px;padding:8px}}
@media(max-width:760px){.template-learning .tl-chat-panel{flex:none;min-width:0}.template-learning .tl-review-controls>.tl-toolbar{flex-wrap:wrap}.tl-view-actions{margin-left:auto}.template-learning .tl-review-controls h4{min-width:100px}.template-learning .tl-chat-input{flex-basis:60%}}

.template-learning .tl-chat-options .tl-review-rail button{white-space:normal;overflow-wrap:anywhere}
