/* NUAR QR 1.2.1: visible per-category template library and readable Clean Light. */
.nuar-template-library{margin:16px 0 18px;padding:16px;border:1px solid var(--line);border-radius:16px;background:rgba(125,145,167,.055);overflow:hidden}
.nuar-template-heading{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:4px}
.nuar-template-heading strong{font:700 18px/1.35 var(--f)}
.nuar-template-heading span{font:600 11px var(--mono);letter-spacing:.3px;color:var(--muted)}
.nuar-template-hint{margin:4px 0 12px;font:12px/1.55 var(--f);color:var(--muted)}
.nuar-template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.nuar-template-item{min-width:0;appearance:none;text-align:left;display:flex;flex-direction:column;gap:7px;border:2px solid transparent;border-radius:12px;padding:9px;background:var(--tile-bg,#fff);color:var(--tile-ink,#172335);cursor:pointer;transition:border-color .15s,transform .15s;overflow:hidden}
.nuar-template-item[aria-pressed="true"]{border-color:var(--tile-accent,#446dc2);outline:2px solid var(--tile-accent,#446dc2);outline-offset:1px}
.nuar-template-item:focus-visible{outline:3px solid #4982ff;outline-offset:2px}
.nuar-template-item:active{transform:scale(.985)}
.nuar-template-sample{height:95px;width:100%;display:flex;align-items:center;justify-content:space-around;gap:7px;border:1px solid var(--tile-accent,#a9a9a9);border-radius:8px;position:relative;padding:8px;background:var(--tile-bg,#fff);overflow:hidden}
.nuar-template-sample[data-frame="1"]{border-radius:2px;border-width:3px}
.nuar-template-sample[data-frame="2"]{border-radius:20px;border-style:dashed}
.nuar-template-sample[data-frame="3"]{border-bottom-width:8px}
.nuar-template-sample[data-frame="4"]{border-top-width:8px}
.nuar-template-sample[data-frame="5"]{border-left-width:9px}
.nuar-template-sample[data-frame="6"]{border-right-width:9px}
.nuar-template-sample[data-frame="7"]{border-radius:30px 3px 30px 3px}
.nuar-template-sample[data-frame="8"]{border:3px double var(--tile-accent,#a9a9a9)}
.nuar-template-sample[data-frame="9"]{border-radius:4px;box-shadow:inset 0 0 0 4px var(--tile-bg,#fff),inset 0 0 0 6px var(--tile-accent,#a9a9a9)}
.nuar-template-sample-qr{flex:0 0 62px;height:62px;border:2px dashed var(--tile-accent,#b2b2b2);border-radius:5px;display:grid;place-items:center;background:#fff;color:#57677e;font:800 11px/1 Arial,sans-serif;opacity:.94}
.nuar-template-sample-qr::before{content:"QR";letter-spacing:1.4px}

.nuar-template-sample-side{min-width:0;display:flex;flex-direction:column;gap:3px;overflow:hidden}
.nuar-template-sample-symbol{font-size:19px;line-height:1.2;color:var(--tile-accent)}
.nuar-template-sample-category{font:700 9px/1.3 var(--f);word-break:break-word}
.nuar-template-sample-flag{font:600 8px/1.25 var(--f);opacity:.7}
.nuar-template-item-title{font:700 12px/1.35 var(--f)}
.nuar-template-item-num{font:600 10px var(--mono);opacity:.72}
.nuar-template-controls{display:grid;grid-template-columns:1fr;gap:7px;margin-top:15px}
.nuar-template-controls label{font:700 12px/1.35 var(--f);color:var(--text)}
.nuar-template-controls select,.nuar-template-controls input{width:100%;min-width:0;box-sizing:border-box;font-size:14px;line-height:1.4;border:1px solid var(--line);padding:12px;border-radius:9px;color:var(--text);background:rgba(128,140,152,.12)}
.nuar-qr-design-preview{padding:9px 0;font:12px/1.4 var(--f);color:var(--muted)}
@media(min-width:620px){.nuar-template-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.nuar-template-sample{height:105px}.nuar-template-sample-qr{flex-basis:46px;height:46px}.nuar-template-sample-side{font-size:10px}}
@media(max-width:350px){.nuar-template-grid{gap:7px}.nuar-template-item{padding:7px}.nuar-template-sample{height:80px}.nuar-template-sample-qr{flex-basis:50px;height:50px}}
/* Fix dark-only assets/controls when Clean Light is selected. */
body[data-nuar-theme="light"]{color:#172335!important;--text:#172335;--muted:#526277;--line:#bac5d5;--mint:#1c6959;--gold:#315d98}
body[data-nuar-theme="light"] .brandword{filter:brightness(0)!important;mix-blend-mode:normal!important;opacity:.94!important}
body[data-nuar-theme="light"] .hero .badge{background:#e8eef5!important;border:1px solid #aebccf!important;color:#29425a!important;white-space:normal;line-height:1.4;max-width:100%;box-sizing:border-box}
body[data-nuar-theme="light"] .hero .badge i{background:#397b68;box-shadow:none}
body[data-nuar-theme="light"] .hero .subtitle{color:#475b73!important}
body[data-nuar-theme="light"] .noir-lamp{display:none!important}
body[data-nuar-theme="light"] .installbtn{color:#263a51!important;border-color:#9faec3!important;background:#fff!important}
body[data-nuar-theme="light"] .syncstate,body[data-nuar-theme="light"] .footer{color:#46586c!important}
body[data-nuar-theme="light"] .userbar,body[data-nuar-theme="light"] .userbar button{color:#24374f!important}
body[data-nuar-theme="light"] .glow{opacity:.14}
body[data-nuar-theme="light"] .feat{box-shadow:0 5px 14px rgba(32,52,79,.10)!important}
body[data-nuar-theme="light"] .action.ghost,body[data-nuar-theme="light"] .action.secondary{color:#203753!important}
body[data-nuar-theme="light"] .nuar-template-library{background:#f7f9fc!important}
body[data-nuar-theme="light"] .nuar-template-controls input,body[data-nuar-theme="light"] .nuar-template-controls select{color:#172335;background:#fff;border-color:#9eafc3}
body[data-nuar-theme="light"] .nuar-theme-picker button{background:#fff;color:#26394e}

body[data-nuar-theme="light"] #nb-entry{background:#fff!important;color:#172335!important;border:1.5px solid #617b9c!important;box-shadow:0 4px 14px rgba(34,67,99,.11)!important;font-weight:800!important}
body[data-nuar-theme="light"] #nb-test-label{color:#526277!important}
body[data-nuar-theme="light"] .nuar-template-item{color:var(--tile-ink,#172335)!important}
body[data-nuar-theme="light"] .nuar-template-item .nuar-template-item-title{color:var(--tile-ink,#172335)!important}

/* The ordinary QR remains deliberately plain and independent of the template gallery. */
#simpleQrCanvas{background:#fff!important;border:0!important;box-shadow:none!important;display:flex;justify-content:center;align-items:center;padding:16px!important;max-width:100%;margin:auto}
#simpleQrCanvas canvas,#simpleQrCanvas img{max-width:100%;height:auto}
#simpleQrHistory .hist-main{flex:1;min-width:0;padding:0;border:0;background:transparent;text-align:left;color:inherit;cursor:pointer}
#simpleQrHistory .hist-primary{overflow-wrap:anywhere}
body[data-nuar-theme="light"] #simpleQrText{background:#fff!important;color:#172335!important;border:1px solid #9caabe}

/* Compact, comfortable category navigation inside the separate Templates service. */
#templatesPane #plainModes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:14px}
#templatesPane #plainModes .modechip{min-width:0;min-height:44px;border-radius:10px;text-align:center;padding:10px 5px;white-space:normal;font:700 12px/1.25 var(--f);letter-spacing:0;text-transform:none}
#templatesPane #plainModes .modechip.active{outline:2px solid var(--mint);outline-offset:1px}
body[data-nuar-theme="light"] #templatesPane #plainModes .modechip{color:#203750!important;background:#fff!important;border-color:#9caec6!important}
body[data-nuar-theme="light"] #templatesPane #plainModes .modechip.active{color:#fff!important;background:#294a75!important;border-color:#294a75!important;outline-color:#294a75}
@media(min-width:640px){#templatesPane #plainModes{grid-template-columns:repeat(5,minmax(0,1fr))}}

/* Footer: agreed concise notice stays readable in all three themes. */
.nuar-legal-brief{max-width:700px;margin:10px auto 0;font:600 12px/1.55 var(--f);letter-spacing:0;color:var(--muted);text-align:center}
.nuar-footer-links{max-width:760px;margin:12px auto 0;gap:8px 14px}
.nuar-footer-links a{font:600 12px/1.45 var(--f);overflow-wrap:anywhere;text-underline-offset:3px}
body[data-nuar-theme="light"] .nuar-legal-brief{color:#40556c!important}
body[data-nuar-theme="light"] .nuar-footer-links a{color:#284e81!important}
body[data-nuar-theme="classic"] .nuar-legal-brief{color:#c0cadd!important}
body[data-nuar-theme="gold"] .nuar-legal-brief{color:#c1bcb3!important}
body[data-nuar-theme="gold"] .nuar-footer-links a{color:#d6c4a4!important}
