/* Template discovery uses the site's existing dark palette and typography. */
.template-quick-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.template-quick-card{display:flex;justify-content:space-between;align-items:center;gap:8px;text-align:left;min-width:0;min-height:52px;padding:12px;border:1px solid #393943;border-radius:10px;background:#19191f;color:#f2f2f5;font:inherit;cursor:pointer}
.template-quick-card strong{font-size:13px;font-weight:500;line-height:1.5}.template-quick-card span{color:#d6a7bd}.template-quick-card:hover{border-color:#7f6877;background:#212027}.template-quick-card:focus-visible{outline:2px solid #efacc4;outline-offset:3px}
.template-catalog-page{margin:0;background:#111114;color:#f2f2f5;font-family:system-ui,-apple-system,"Segoe UI","Microsoft JhengHei",sans-serif;font-size:14px;line-height:1.6;color-scheme:dark}.template-catalog-page *{box-sizing:border-box}.template-catalog-page a{color:inherit;text-decoration:none}.template-catalog-page a:hover{text-decoration:underline}.catalog-skip{position:fixed;top:-80px;left:16px;padding:12px;z-index:20;background:#f2f2f5;color:#19191f!important}.catalog-skip:focus{top:12px}
.template-catalog-header{max-width:1280px;margin:auto;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:20px 32px;border-bottom:1px solid #ffffff12}.catalog-brand{font-size:30px;font-weight:750;letter-spacing:-2px}.catalog-brand span{font-size:10px;letter-spacing:2px;margin-left:8px;color:#b4b1bd}.template-catalog-header nav{display:flex;flex-wrap:wrap;gap:8px 20px;font-size:13px}.template-catalog-header nav a{display:flex;align-items:center;min-height:44px}
.template-catalog-main{max-width:1184px;margin:0 auto;padding:44px 32px 32px}.template-catalog-heading{max-width:720px;margin-bottom:30px}.template-catalog-heading h1{font-size:clamp(28px,3vw,38px);font-weight:600;letter-spacing:-.04em;line-height:1.3;margin:0 0 14px}.template-catalog-heading p{font-size:15px;line-height:1.8;color:#c5c5ce;margin:8px 0}.template-catalog-heading [data-template-draft-note]{font-size:13px;color:#b7a3b1}.template-catalog-note{margin:26px 0 0;max-width:850px;color:#b3b3c0;font-size:12px;line-height:1.8}.template-catalog-footer{max-width:1184px;margin:auto;padding:20px 32px 30px;display:flex;justify-content:space-between;gap:20px;font-size:12px;color:#aaa6b2}.template-catalog-footer a{min-height:44px;display:flex;align-items:center}.template-catalog-page :focus-visible{outline:2px solid #efacc4;outline-offset:4px}
@media(max-width:1050px){.template-quick-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.template-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.template-catalog-header{align-items:flex-start;padding:14px 20px;gap:12px}.template-catalog-header nav{justify-content:flex-end;gap:0 14px;max-width:240px;font-size:12px}.template-catalog-main{padding:28px 20px}.template-catalog-heading{margin-bottom:22px}.template-catalog-footer{padding:10px 20px 24px;align-items:center}.template-quick-card{min-height:48px}}
.template-toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,200px);gap:16px;margin:20px 0 10px}
.template-toolbar label,.template-apply-options>label{display:grid;gap:8px;font-size:13px;color:#c5c5ce}
.template-toolbar input,.template-toolbar select,.template-apply-options select{box-sizing:border-box;width:100%;min-height:44px;padding:10px 12px;border:1px solid #4b4b57;border-radius:10px;background:#18181e;color:#f2f2f5;font:inherit}
.template-toolbar input::placeholder{color:#a8a8b6}.template-count{font-size:12px;color:#acacb8;margin:12px 0}
.template-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.template-card{display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:12px;min-width:0;min-height:185px;padding:22px;border:1px solid #393943;border-radius:14px;background:#19191f;color:#f2f2f5;cursor:pointer;font:inherit;transition:border-color .15s,background .15s}
.template-card:hover{border-color:#7f6877;background:#212027}.template-card strong{font-size:19px;line-height:1.4}.template-card-type{font-size:11px;letter-spacing:.04em;color:#b3b3c0}.template-card-description{font-size:13px;line-height:1.7;color:#c5c5ce}.template-card-link{margin-top:auto;width:100%;display:flex;justify-content:space-between;font-size:12px;color:#f5becf;padding-top:6px}
.template-empty{padding:24px;text-align:center;color:#c5c5ce}.template-empty[hidden]{display:none}.template-empty button{min-height:44px;padding:8px 16px;border:1px solid #66616a;border-radius:9px;background:#24242c;color:#f2f2f5;cursor:pointer}
.template-dialog{box-sizing:border-box;width:min(900px,calc(100% - 32px));max-height:calc(100dvh - 40px);padding:0;border:1px solid #4b454f;border-radius:20px;background:#19191f;color:#f2f2f5;overflow:auto;box-shadow:0 28px 90px #0008;font-family:inherit}
.template-dialog::backdrop{background:#08080ccc;backdrop-filter:blur(3px)}.template-dialog form{margin:0;display:block}.template-detail-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding:28px 30px 22px;border-bottom:1px solid #36333c}.template-detail-heading span{color:#f5becf;font-size:12px}.template-detail-heading h2{font-size:28px;line-height:1.4;margin:8px 0}.template-detail-heading p{font-size:14px;line-height:1.7;color:#c5c5ce;margin:0}
.template-close{flex-shrink:0;min-height:44px;padding:8px 14px;background:#28262e;color:#efedf4;border:1px solid #58505c;border-radius:9px;font:inherit;cursor:pointer}
.template-detail-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.9fr);gap:30px;padding:26px 30px}.template-guide section+section{margin-top:24px}.template-dialog h3{font-size:14px;margin:0 0 8px;color:#f2f2f5}.template-guide p,.template-outline p{font-size:13px;line-height:1.8;color:#c5c5ce;margin:0;overflow-wrap:anywhere}.template-outline{padding:22px;border-radius:12px;background:#121216;border:1px solid #35323d;align-self:start}.template-outline pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;font-size:14px;line-height:2.2;margin:18px 0 24px}
.template-apply-options{padding:0 30px 24px;display:grid;grid-template-columns:minmax(160px,.7fr) minmax(0,1.3fr);gap:24px;align-items:start}.template-apply-options fieldset{margin:0;padding:0;border:0;font-size:13px}.template-apply-options legend{margin-bottom:8px;color:#c5c5ce}.template-apply-options fieldset label{display:flex;align-items:center;min-height:44px;gap:8px}.template-apply-options input{width:auto;min-height:auto;accent-color:#f2aac5}.template-apply-options p{font-size:13px;line-height:1.8;color:#c5c5ce;margin:24px 0 0}
.template-detail-footer{position:sticky;bottom:0;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#19191f;padding:18px 30px;border-top:1px solid #45404b}.template-detail-footer span{font-size:12px;color:#c5c5ce}.template-use{min-height:46px;padding:10px 26px;white-space:nowrap;border:1px solid transparent;border-radius:10px;background:#efacc4;color:#23141b;font:inherit;font-weight:700;cursor:pointer}.template-use:active{background:#f5bed2}.template-error{margin:0;padding:0 30px 20px;color:#ffb3be;font-size:13px}
.template-dialog :focus-visible,.template-toolbar :focus-visible,.template-grid :focus-visible,.template-empty :focus-visible{outline:2px solid #efacc4;outline-offset:4px}.template-dialog h2:focus{outline:none}
@media(max-width:1000px){.template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.template-toolbar{grid-template-columns:1fr}.template-grid{grid-template-columns:1fr}.template-card{min-height:160px;padding:20px}.template-dialog{width:calc(100% - 20px);max-height:calc(100dvh - 24px);border-radius:16px}.template-detail-heading{padding:20px;gap:12px}.template-detail-heading h2{font-size:23px}.template-detail-body{grid-template-columns:1fr;padding:22px 20px;gap:22px}.template-apply-options{grid-template-columns:1fr;padding:0 20px 22px;gap:18px}.template-detail-footer{padding:14px 20px}.template-error{padding:0 20px 20px}}
@media(prefers-reduced-motion:reduce){.template-card{transition:none}}

/* Separate sibling controls keep the card detail action keyboard accessible. */
.template-saved-card{min-width:0;display:flex;flex-direction:column;border:1px solid #393943;border-radius:14px;overflow:hidden;background:#19191f}.template-saved-card .template-card{width:100%;flex:1;border:0;border-radius:0}.template-save{min-height:44px;margin:0 14px 14px;align-self:flex-start;padding:8px 14px;border:1px solid #58505c;border-radius:9px;background:#24242c;color:#eee;font:inherit;cursor:pointer}.template-save[aria-pressed=true]{color:#f5becf;border-color:#aa7c8e}.template-save:disabled{opacity:.55;cursor:default}.template-favorites-bar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:24px 0}.template-favorites-bar p{flex:1;min-width:160px;color:#c5c5ce;font-size:13px;line-height:1.7;margin:0}.template-favorites-bar label{display:flex;align-items:center;gap:8px;min-height:44px;cursor:pointer}.template-favorites-bar button,.template-favorites-bar a{min-height:44px;box-sizing:border-box;padding:10px 14px;border:1px solid #58505c;border-radius:9px;background:#24242c;color:#eee;font:inherit;text-decoration:none;cursor:pointer}.template-favorites-bar [hidden]{display:none}.template-favorites-bar :focus-visible{outline:2px solid #efacc4;outline-offset:4px}.template-favorites-bar input{accent-color:#efacc4}.template-favorites-bar button:disabled{opacity:.6;cursor:default}
