/* Templates follows the How To library; details stay centered, not in a side drawer. */
/* Native modal supplies focus containment and Escape. Its height follows content. */
#appShell.ui-workspace #paneTemplates dialog.template-reader{position:fixed;inset:0;margin:auto;width:510px;max-width:calc(100vw - 32px);height:fit-content;min-height:0;max-height:calc(100dvh - 40px);padding:0;border:1px solid var(--ui-line);border-radius:17px;background:var(--ui-surface-solid);color:var(--ui-ink);box-shadow:0 24px 90px #0a192933;overflow:hidden}
#appShell.ui-workspace #paneTemplates dialog.template-reader[open]{display:flex;flex-direction:column}
#appShell.ui-workspace #paneTemplates dialog.template-reader::backdrop{background:#1624374d;backdrop-filter:blur(2px)}
#appShell.ui-workspace[data-ui-theme="dark"] #paneTemplates dialog.template-reader::backdrop{background:#0008}
#appShell.ui-workspace #paneTemplates .template-reader-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:23px 25px 20px;border-bottom:1px solid var(--ui-line);flex:none}
#appShell.ui-workspace #paneTemplates .template-reader-head h2{font-size:20px;letter-spacing:-.6px;line-height:1.4;margin:8px 0 0;overflow-wrap:anywhere}
#appShell.ui-workspace #paneTemplates .template-close{display:grid;place-items:center;flex:none;width:34px;height:34px;padding:0;border:1px solid var(--ui-line);border-radius:8px;background:var(--ui-surface);color:var(--ui-ink);box-shadow:none}
#appShell.ui-workspace #paneTemplates .template-reader-body{flex:0 1 auto;min-height:0;padding:23px 25px;overflow:auto;overscroll-behavior:contain}
#appShell.ui-workspace #paneTemplates .template-reader-body>p:first-child{margin:0;color:var(--ui-ink-secondary);font-size:12px;line-height:1.85}
#appShell.ui-workspace #paneTemplates .template-reader-body h3{font-size:12px;margin:24px 0 12px}
#appShell.ui-workspace #paneTemplates .template-fields{display:flex;flex-wrap:wrap;gap:7px}
#appShell.ui-workspace #paneTemplates .template-field{border:1px solid var(--ui-line);border-radius:6px;padding:5px 9px;font-size:10px;background:var(--ui-surface-muted)}
#appShell.ui-workspace #paneTemplates .template-steps{list-style:none;counter-reset:template-step;padding:0;display:grid;gap:14px;margin:12px 0}
#appShell.ui-workspace #paneTemplates .template-steps li{counter-increment:template-step;display:flex;gap:11px;font-size:11px;color:var(--ui-ink-secondary);line-height:1.8}
#appShell.ui-workspace #paneTemplates .template-steps li::before{content:counter(template-step);width:23px;height:23px;border-radius:50%;background:var(--ui-blue-soft);color:var(--ui-blue);flex:none;text-align:center;line-height:23px;font-size:10px}
#appShell.ui-workspace #paneTemplates .template-steps strong{display:block;color:var(--ui-ink);font-size:11px;margin-bottom:2px}
#appShell.ui-workspace #paneTemplates .template-note{border:1px solid var(--ui-line);border-radius:8px;padding:12px 14px;background:var(--ui-surface-muted);font-size:10px;color:var(--ui-ink-secondary);line-height:1.8;margin-top:20px}
#appShell.ui-workspace #paneTemplates .template-reader-body>.template-text-button{margin-top:18px}
#appShell.ui-workspace #paneTemplates .template-download-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:18px 25px;border-top:1px solid var(--ui-line);background:var(--ui-surface-solid);flex:none}
#appShell.ui-workspace #paneTemplates .template-download-footer small{font-size:10px;color:var(--ui-ink-secondary)}
#appShell.ui-workspace #paneTemplates .template-download-footer a.template-download{display:inline-flex;width:auto;align-items:center;justify-content:center;gap:8px;background:#1671ec;color:#fff;border:1px solid #1671ec;border-radius:8px;padding:10px 14px;font-size:11px;font-weight:700;text-decoration:none;white-space:normal}
#appShell.ui-workspace #paneTemplates .template-download-footer .template-icon{width:15px;height:15px}
@media(max-width:600px){
  #appShell.ui-workspace #paneTemplates dialog.template-reader{inset:0;margin:auto;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}
  #appShell.ui-workspace #paneTemplates :is(.template-reader-head,.template-reader-body){padding:20px}
  #appShell.ui-workspace #paneTemplates .template-download-footer{padding:16px 20px;flex-wrap:wrap}
}
@media(pointer:coarse){
  #appShell.ui-workspace #paneTemplates .template-close{width:44px;height:44px}
  #appShell.ui-workspace #paneTemplates .template-download-footer a.template-download{min-height:44px}
}
#appShell.ui-workspace #paneTemplates .template-library{display:grid;grid-template-columns:190px minmax(0,1fr);gap:30px;align-items:start}
#appShell.ui-workspace #paneTemplates :is(.template-topics,.template-main){min-width:0}
#appShell.ui-workspace #paneTemplates .template-icon{width:19px;height:19px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#appShell.ui-workspace #paneTemplates .template-search{display:flex;align-items:center;gap:9px;border:1px solid var(--ui-line);border-radius:8px;background:var(--ui-surface);padding:9px 11px;margin:0 0 25px}
#appShell.ui-workspace #paneTemplates .template-search .template-icon{width:15px;height:15px;color:var(--ui-ink-secondary)}
#appShell.ui-workspace #paneTemplates .template-search input{width:100%;min-width:0;min-height:0;border:0;box-shadow:none;background:none;color:var(--ui-ink);font-size:11px;padding:0}
#appShell.ui-workspace #paneTemplates .template-kicker{text-transform:uppercase;letter-spacing:1.2px;font-size:9px;font-weight:700;color:var(--ui-ink-secondary)}
#appShell.ui-workspace #paneTemplates .template-categories{display:grid;gap:4px;margin:13px 0 25px}
#appShell.ui-workspace #paneTemplates .template-category{display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;background:none;border:0;border-radius:7px;box-shadow:none;padding:9px 11px;font-size:11px;color:var(--ui-ink-secondary)}
#appShell.ui-workspace #paneTemplates .template-category span{font-size:10px}
#appShell.ui-workspace #paneTemplates .template-category[aria-pressed="true"]{background:var(--ui-blue-soft);color:var(--ui-blue)}
#appShell.ui-workspace #paneTemplates .template-side-note{border-top:1px solid var(--ui-line);padding:20px 10px 0}
#appShell.ui-workspace #paneTemplates .template-side-note .template-icon{color:var(--ui-blue);margin-bottom:6px}
#appShell.ui-workspace #paneTemplates .template-side-note strong{display:block;font-size:11px}
#appShell.ui-workspace #paneTemplates .template-side-note p{font-size:10px;color:var(--ui-ink-secondary);line-height:1.8;margin:6px 0 9px}
#appShell.ui-workspace #paneTemplates .template-text-button{border:0;padding:0;background:none;box-shadow:none;color:var(--ui-blue);font-size:11px;white-space:normal;text-align:left}
#appShell.ui-workspace #paneTemplates .template-text-button:hover{text-decoration:underline}
#appShell.ui-workspace #paneTemplates .template-list-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 17px;min-height:35px}
#appShell.ui-workspace #paneTemplates .template-list-heading h3{font-size:15px;letter-spacing:-.25px;margin:0}
#appShell.ui-workspace #paneTemplates .template-list-heading>span{font-size:10px;color:var(--ui-ink-secondary)}
#appShell.ui-workspace #paneTemplates .template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
#appShell.ui-workspace #paneTemplates .template-card{display:grid;align-content:start;gap:12px;padding:21px 22px;border:1px solid var(--ui-line);border-radius:11px;background:var(--ui-surface);color:var(--ui-ink);box-shadow:none;text-align:left;white-space:normal;min-width:0;height:100%;font-weight:400;line-height:1.6}
#appShell.ui-workspace #paneTemplates .template-card:hover{border-color:var(--ui-blue);background:var(--ui-surface-muted)}
#appShell.ui-workspace #paneTemplates :is(.template-card-top,.template-card-bottom){display:flex;justify-content:space-between;align-items:center;gap:12px}
#appShell.ui-workspace #paneTemplates .template-card-top>.template-icon{color:var(--ui-blue);width:21px;height:21px}
#appShell.ui-workspace #paneTemplates .template-card-top small{font-size:10px;color:var(--ui-ink-secondary)}
#appShell.ui-workspace #paneTemplates .template-card>strong{font-size:13px;font-weight:650;letter-spacing:-.15px}
#appShell.ui-workspace #paneTemplates .template-description{font-size:11px;line-height:1.8;color:var(--ui-ink-secondary);min-height:40px;max-width:330px}
#appShell.ui-workspace #paneTemplates .template-card-bottom{margin-top:3px}
#appShell.ui-workspace #paneTemplates .template-card-bottom small{display:flex;align-items:center;gap:7px;font-size:9px;color:var(--ui-ink-secondary)}
#appShell.ui-workspace #paneTemplates .template-card .template-format{font-size:8px;font-weight:700;letter-spacing:.4px;border:1px solid var(--ui-line);border-radius:4px;padding:1px 5px;line-height:1.8;background:none;color:var(--ui-ink-secondary)}
#appShell.ui-workspace #paneTemplates .template-card-action{display:inline-flex;align-items:center;gap:7px;font-size:10px;color:var(--ui-blue)}
#appShell.ui-workspace #paneTemplates .template-card-action .template-icon{width:15px;height:15px}
#appShell.ui-workspace #paneTemplates .template-library-footer{border-top:1px solid var(--ui-line);display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding-top:18px;margin-top:22px;color:var(--ui-ink-secondary);font-size:11px}
#appShell.ui-workspace #paneTemplates .template-empty{border:1px dashed var(--ui-line);border-radius:11px;text-align:center;padding:55px 20px}
#appShell.ui-workspace #paneTemplates .template-empty h3{font-size:15px}
#appShell.ui-workspace #paneTemplates .template-empty p{color:var(--ui-ink-secondary);font-size:12px}
#appShell.ui-workspace #paneTemplates :is(button,a,input):focus-visible{outline:2px solid var(--ui-blue);outline-offset:4px}
@media(max-width:1100px){
  #appShell.ui-workspace #paneTemplates .template-library{grid-template-columns:165px minmax(0,1fr);gap:22px}
  #appShell.ui-workspace #paneTemplates .template-card{padding:18px}
}
@media(max-width:800px){
  #appShell.ui-workspace #paneTemplates .template-library{grid-template-columns:minmax(0,1fr);gap:24px}
  #appShell.ui-workspace #paneTemplates .template-categories{display:flex;flex-wrap:wrap;margin:10px 0 0}
  #appShell.ui-workspace #paneTemplates .template-search{margin-bottom:15px;max-width:320px}
  #appShell.ui-workspace #paneTemplates .template-side-note{padding:15px 0 0;margin-top:15px}
}
@media(max-width:600px){
  #appShell.ui-workspace #paneTemplates .template-grid{grid-template-columns:minmax(0,1fr)}
  #appShell.ui-workspace #paneTemplates .template-description{min-height:0}
}
@media(pointer:coarse){
  #appShell.ui-workspace #paneTemplates :is(.template-category,.template-text-button){min-height:44px}
}
