/* Free tools */
.tool-page .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.tool-h2{font-size:1.25rem;margin:1.6rem 0 .6rem}
.tool-box{background:var(--surface,#fff);border:1px solid var(--line,#dde3e0);border-radius:16px;padding:1.1rem;margin:1rem 0}
.tool-box textarea,.tool-box input,.tool-box select{width:100%;box-sizing:border-box;font:inherit;padding:.65rem .75rem;border:1px solid var(--line-strong,#c5cfcb);border-radius:10px;background:#fff;color:inherit}
.tool-box textarea{resize:vertical;min-height:8rem}
.tool-box .field{margin:0 0 .8rem}.tool-box label{display:block;font-weight:600;margin-bottom:.25rem}
.tool-row{display:grid;gap:.8rem;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.tool-actions{display:flex;flex-wrap:wrap;gap:.6rem;margin:1rem 0 .3rem}
.tool-actions .btn,.tool-actions form{margin:0}
.stat-grid{display:grid;gap:.6rem;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));margin:1rem 0}
.stat{background:#f1f6f4;border-radius:12px;padding:.7rem;text-align:center}
.stat b{display:block;font-size:1.35rem;line-height:1.2}.stat span{font-size:.8rem;color:#5a696c}
.tool-lock{display:flex;gap:.9rem;align-items:flex-start;background:#fff7e0;border:1px solid #f0d9a0;border-radius:14px;padding:1rem;margin:1rem 0}
.tool-lock-ico{font-size:1.6rem}.tool-lock p{margin:.3rem 0}
.tool-lock-inline{background:#fff7e0;border:1px solid #f0d9a0;border-radius:12px;padding:.7rem .9rem;margin:.7rem 0}
.tool-grid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));margin-top:1rem}
.tool-card{display:flex;flex-direction:column;gap:.3rem;padding:1rem;border:1px solid var(--line,#dde3e0);border-radius:14px;background:var(--surface,#fff);text-decoration:none;color:inherit;transition:transform .15s,box-shadow .15s}
.tool-card:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(22,37,42,.1)}
.tool-ico{font-size:1.6rem;line-height:1}
.tool-ico-img{width:44px;height:44px;object-fit:contain;display:block}
.tool-ico-sm{width:20px;height:20px;object-fit:contain;vertical-align:-4px}
.tools-strip{margin:2rem 0}
.tool-faq details{border:1px solid var(--line,#dde3e0);border-radius:12px;padding:.7rem .9rem;margin:.5rem 0;background:var(--surface,#fff)}
.tool-faq summary{cursor:pointer;font-weight:600}
.tool-related{padding-left:1.1rem}
.tpl-block{border-left:4px solid var(--brand-primary-dark,#00b892);padding:.2rem 0 .2rem .9rem;margin:1rem 0}
.tpl-h{margin:0 0 .3rem;font-size:1.05rem}.tpl-p{margin:.2rem 0}.tpl-tip{margin:.3rem 0 0}
.cite-out{background:#f1f6f4;border-radius:12px;padding:.8rem 1rem;margin:1rem 0}
.cite-line{padding-left:2rem;text-indent:-2rem;word-break:break-word}
.cite-list li{margin:.5rem 0;padding-left:.2rem;word-break:break-word}
.gpa-rows{display:grid;gap:.5rem;margin-bottom:.6rem}
.gpa-row{display:grid;grid-template-columns:1.6fr .8fr 1.2fr auto;gap:.4rem}
.gpa-row .g-del{border:0;background:#fde3e3;color:#a11d1d;border-radius:10px;width:40px;font-size:1.2rem;cursor:pointer}
@media (max-width:520px){.gpa-row{grid-template-columns:1fr 1fr auto}.gpa-row .g-name{grid-column:1/-1}}
html[data-theme="dark"] .tool-box,html[data-theme="dark"] .tool-card,html[data-theme="dark"] .tool-faq details{background:#161f22}

.s-results{display:grid;gap:.6rem}
.s-card{border:1px solid var(--line,#dde3e0);border-radius:12px;padding:.7rem .8rem;display:grid;gap:.25rem;justify-items:start}
.s-title{font-weight:600;word-break:break-word}
.s-badge{font-size:.72rem;background:#f1f6f4;border-radius:999px;padding:.1rem .55rem;color:#3d4f52}
.v-box{margin:1rem 0}.v-list{list-style:none;margin:.4rem 0;padding:0;display:grid;gap:.35rem}
.v-list li,.v-online{padding:.45rem .65rem;border-radius:10px;font-size:.92rem}
.v-err{background:#fde3e3;color:#7a1414}.v-warn{background:#fff7e0;color:#6b4e00}.v-ok{background:#e3f6ec;color:#0f5132}
html[data-theme="dark"] .s-card{background:#161f22}html[data-theme="dark"] .s-badge{background:#22302f;color:#cfe0dc}
html[data-theme="dark"] .v-err{background:#3b1717;color:#ffd0d0}html[data-theme="dark"] .v-warn{background:#3a3014;color:#ffe9a8}html[data-theme="dark"] .v-ok{background:#12301f;color:#bdeed3}

/* ---------- Citation generator ---------- */
.cg{--cg-line:var(--line,#dde3e0);--cg-soft:#f1f6f4;--cg-on:var(--brand-primary-dark,#00b892)}
.cg input[type=checkbox]{width:auto;min-width:1.1rem;height:1.1rem;padding:0;margin:0}
.cg-bar{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;justify-content:space-between;margin-bottom:.8rem}
.cg-proj{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center}
.cg-proj select{width:auto;max-width:14rem;min-height:36px;padding:.35rem .6rem}
.cg-cite-h{margin:.2rem 0 .3rem;font-style:italic;font-weight:600}
.cg-tabs{display:flex;flex-wrap:wrap;gap:.3rem;border-bottom:2px solid var(--cg-line)}
.cg-tab{border:0;background:transparent;padding:.55rem .8rem;font:inherit;font-weight:600;cursor:pointer;border-radius:10px 10px 0 0;border-bottom:3px solid transparent;margin-bottom:-2px;color:inherit}
.cg-tab:hover{background:var(--cg-soft)}
.cg-tab.is-on{border-bottom-color:var(--cg-on);background:var(--cg-soft)}
.cg-more{border:1px solid var(--cg-line);border-radius:12px;padding:.7rem;margin:.5rem 0;background:var(--surface,#fff);max-height:22rem;overflow:auto}
.cg-more-h{margin:0 0 .4rem;font-weight:600}
.cg-more-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:.2rem .6rem}
.cg-type{border:0;background:transparent;text-align:left;padding:.4rem .5rem;border-radius:8px;font:inherit;cursor:pointer;color:inherit}
.cg-type:hover,.cg-type:focus-visible{background:var(--cg-soft);color:var(--cg-on)}
.cg-input{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;margin:.7rem 0 .3rem}
.cg-input input[type=search]{flex:1 1 14rem;min-width:0}
.cg-icon{border:1px solid var(--line-strong,#c5cfcb);background:var(--surface,#fff);border-radius:999px;width:2.6rem;height:2.6rem;font-size:1.1rem;cursor:pointer;line-height:1}
.cg-icon:hover{background:var(--cg-soft)}
.cg-adv{margin:.2rem 0 .4rem}.cg-adv summary{cursor:pointer;color:var(--brand-primary-dark,#00b892);font-size:.92rem}
.cg-pre textarea{min-height:5rem}
.cg-row{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.3rem}
.cg-toolbar{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin:1.1rem 0 .4rem;position:relative}
.cg-toolbar select{width:auto;min-height:40px;padding:.4rem .6rem}
.cg-style{position:relative;flex:1 1 15rem;min-width:12rem}
.cg-stylebtn{width:100%;display:flex;justify-content:space-between;gap:.5rem;align-items:center;border:1px solid var(--line-strong,#c5cfcb);background:var(--surface,#fff);border-radius:10px;padding:.5rem .75rem;font:inherit;font-weight:600;cursor:pointer;color:inherit;min-height:40px}
.cg-stylelabel{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cg-stylepanel{position:absolute;z-index:30;left:0;right:0;top:calc(100% + 4px);background:var(--surface,#fff);border:1px solid var(--line-strong,#9aa8a6);border-radius:12px;box-shadow:0 10px 30px rgba(22,37,42,.2);padding:.5rem;min-width:min(22rem,86vw)}
.cg-stylepanel ul{list-style:none;margin:.4rem 0 0;padding:0;max-height:19rem;overflow:auto}
.cg-sh{font-size:.75rem;text-transform:uppercase;letter-spacing:.04em;color:#5a696c;padding:.45rem .5rem;background:var(--cg-soft);border-radius:6px;margin-top:.2rem;position:sticky;top:0}
.cg-si{padding:.5rem .6rem;border-radius:8px;cursor:pointer;outline-offset:-2px}
.cg-si:hover,.cg-si:focus-visible{background:var(--cg-soft)}
.cg-si.is-on{color:var(--cg-on);font-weight:600}
.cg-powered{margin:.4rem 0 0;font-size:.78rem;color:#5a696c;text-align:right}
.cg-paper{background:#fff;color:#16252a;border:1px solid var(--cg-line);border-radius:6px;padding:1.3rem 1.2rem;min-height:11rem;box-shadow:inset 0 0 0 1px rgba(0,0,0,.02);line-height:1.5}
.cg-paper-h{font-weight:400;font-size:1.35em;margin:.1rem 0 1rem;font-family:inherit}
.cg-entry{display:flex;gap:.6rem;padding:.55rem .3rem;border-radius:8px;align-items:flex-start}
.cg-entry.is-sel{background:#e7f6f1}
.cg-sel{padding-top:.3rem;cursor:pointer}
.cg-body{flex:1;min-width:0}
.cg-ref{word-break:break-word;padding-left:2em;text-indent:-2em}
.cg-entry.is-num .cg-ref{padding-left:0;text-indent:0}
.cg-ref .csl-left-margin{float:left;min-width:2.6em;padding-right:.4em}
.cg-ref .csl-right-inline{margin-left:2.6em}
.cg-ref .csl-block{display:block}
.cg-ann{margin:.3rem 0 0 2em;font-style:italic;font-size:.92em;color:#3d4f52}
.cg-eact{display:flex;flex-wrap:wrap;gap:.1rem .7rem;margin-top:.15rem;font-family:system-ui,sans-serif;font-size:.8rem;clear:both}
.cg-link{border:0;background:none;padding:.25rem 0;color:var(--brand-primary-dark,#00856a);cursor:pointer;font:inherit;font-size:.8rem;text-decoration:underline;text-underline-offset:2px}
.cg-del{color:#a11d1d}.cg-warn{color:#8a5a00}
.cg-foot{display:flex;flex-wrap:wrap;gap:.5rem .7rem;align-items:center;margin:.6rem 0}
.cg-all{display:flex;gap:.4rem;align-items:center;font-weight:400!important;margin:0!important;cursor:pointer}
.cg-spacer{flex:1}
.cg-actions{position:relative;align-items:flex-start}
.cg-dl{position:relative}
.cg-menu{position:absolute;z-index:30;left:0;top:calc(100% + 4px);min-width:15rem;background:var(--surface,#fff);border:1px solid var(--line-strong,#9aa8a6);border-radius:12px;box-shadow:0 10px 30px rgba(22,37,42,.2);padding:.3rem;display:grid}
.cg-menu[hidden]{display:none}
.cg-menu button{border:0;background:none;text-align:left;padding:.65rem .8rem;border-radius:8px;font:inherit;cursor:pointer;color:inherit}
.cg-menu button:hover,.cg-menu button:focus-visible{background:var(--cg-soft)}
.cg-note{margin-top:.5rem}
/* editor dialog (appended to <body>) */
body.cg-lock{overflow:hidden}
.cg-ov{position:fixed;inset:0;z-index:2000;background:rgba(10,20,22,.6);display:flex;align-items:center;justify-content:center;padding:.6rem}
.cg-dlg{background:#fff;color:#16252a;width:min(720px,100%);max-height:calc(100vh - 1.2rem);max-height:calc(100dvh - 1.2rem);border-radius:16px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.35)}
.cg-dlg input,.cg-dlg textarea,.cg-dlg select{width:100%;box-sizing:border-box;font:inherit;padding:.55rem .65rem;border:1px solid #c5cfcb;border-radius:10px;background:#fff;color:inherit}
.cg-dlg textarea{resize:vertical}
.cg-dh{display:flex;gap:.6rem;align-items:center;padding:.7rem .8rem;border-bottom:1px solid #dde3e0}
.cg-dh select{font-weight:600;border:0;background:#f1f6f4}
.cg-x{border:0;background:#f1f6f4;border-radius:999px;width:2.4rem;height:2.4rem;font-size:1.4rem;cursor:pointer;line-height:1}
.cg-form{padding:.8rem;overflow:auto;flex:1;min-height:6rem}
.cg-sec h4{margin:.4rem 0 .5rem;font-style:italic;color:#4a5a5e;font-weight:600}
.cg-group{margin-bottom:.7rem}.cg-rolelab{font-weight:600;font-size:.92rem;margin-bottom:.25rem}
.cg-name{display:grid;grid-template-columns:1fr 1fr auto;gap:.4rem;margin-bottom:.4rem;align-items:center}
.cg-name>input:only-of-type{grid-column:1 / 3}
.cg-ntools{display:flex;gap:.2rem}
.cg-mini{border:1px solid #c5cfcb;background:#fff;border-radius:8px;min-width:2.1rem;height:2.1rem;cursor:pointer;font-size:.85rem}
.cg-mini-del{background:#fde3e3;border-color:#f3b8b8}
.cg-addrole{display:flex;flex-wrap:wrap;gap:.2rem .7rem;align-items:center;margin-bottom:.6rem}
.cg-f{margin:0 0 .7rem}.cg-f label{display:block;font-weight:600;font-size:.92rem;margin-bottom:.2rem}
.cg-daterow{display:grid;grid-template-columns:5.5rem 1fr 4rem auto;gap:.4rem;align-items:center}
.cg-df{padding:.7rem .8rem;border-top:1px solid #dde3e0;background:#f7faf9;overflow:auto;max-height:46%}
.cg-pv{margin-bottom:.4rem}
.cg-pvref,.cg-pvin{background:#fff;border:1px solid #dde3e0;border-radius:10px;padding:.5rem .7rem;margin:.15rem 0 .4rem;word-break:break-word}
.cg-pvref .csl-left-margin{float:left;min-width:2.4em}.cg-pvref .csl-right-inline{margin-left:2.4em}
.cg-ckh{font-weight:600;margin:.3rem 0 .1rem;font-size:.92rem}
.cg-dlg .v-list{margin:.2rem 0}
.cg-dlg .tool-actions{margin:.6rem 0 0}
@media (max-width:560px){.cg-name{grid-template-columns:1fr 1fr}.cg-ntools{grid-column:1/-1}.cg-name>input:only-of-type{grid-column:1/-1}.cg-daterow{grid-template-columns:1fr 1fr 1fr}.cg-daterow .btn{grid-column:1/-1}.cg-dlg{max-height:100dvh;border-radius:12px}.cg-ov{padding:0;align-items:flex-end}.cg-paper{padding:1rem .7rem}}
html[data-theme="dark"] .cg{--cg-soft:#22302f}
html[data-theme="dark"] .cg-stylebtn,html[data-theme="dark"] .cg-icon,html[data-theme="dark"] .cg-stylepanel,html[data-theme="dark"] .cg-menu,html[data-theme="dark"] .cg-more{background:#161f22}
html[data-theme="dark"] .cg-sh,html[data-theme="dark"] .cg-powered{color:#a9bcb8}
html[data-theme="dark"] .cg-entry.is-sel{background:#1c3a33}
html[data-theme="dark"] .cg-link{color:#5fe0c3}html[data-theme="dark"] .cg-del{color:#ff9b9b}html[data-theme="dark"] .cg-warn{color:#ffd778}
.cg-entry.is-unl .cg-ref{opacity:.7}
/* citation generator: layout polish */
.cg .cg-input input[type=search]{flex:1 1 100%}
.cg .cg-input .btn{margin-left:auto}
.cg label.cg-all{display:flex;align-items:center;gap:.4rem;font-weight:400;margin:0;cursor:pointer}
.cg label.cg-sel{display:block;margin:0;font-weight:400}
.cg-dlg textarea{min-height:0;height:auto}
.cg-dlg label{display:block;margin:0 0 .2rem}
.cg-df{max-height:40%}
.cg-foot .btn{min-height:36px}
@media (min-width:640px){.cg .cg-input input[type=search]{flex:1 1 14rem}.cg .cg-input .btn{margin-left:0}.cg .cg-sbox{flex:1 1 14rem}}
/* AI content detector */
.ai-meta{margin:.4rem 0 0}
.ai-top{display:flex;gap:1.2rem;align-items:center;flex-wrap:wrap}
.ai-gauge{position:relative;width:132px;height:132px;flex:none}
.ai-gauge b{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:1.7rem}
.ai-summary{flex:1;min-width:220px}.ai-summary p{margin:.3rem 0}
.ai-legend{display:flex;flex-wrap:wrap;gap:.4rem 1.1rem;margin:1rem 0 .2rem}
.ai-sw{display:inline-block;width:.9rem;height:.9rem;border-radius:3px;vertical-align:-2px;margin-right:.3rem;border:1px solid rgba(0,0,0,.12)}
.ai-hi{background:#a8ecf0}.ai-mid{background:#d9f5f7}.ai-lo{background:transparent}
.ai-doc{border:1px solid var(--line,#dde3e0);border-radius:12px;padding:.8rem 1rem;max-height:26rem;overflow:auto;line-height:1.7}
.ai-doc p{margin:0 0 .8rem}
.ai-s{border-radius:4px;padding:.05rem .1rem;cursor:pointer;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.ai-s.ai-hi{background:#a8ecf0}.ai-s.ai-mid{background:#d9f5f7;box-shadow:inset 0 -2px 0 #7fd3da}.ai-s.ai-lo{background:transparent;cursor:default}
.ai-s:focus-visible{outline:2px solid #12a8b8;outline-offset:1px}
.ai-detail{margin:.6rem 0;padding:.5rem .7rem;background:#f1f6f4;border-radius:10px}
.ai-signals{display:grid;gap:.8rem;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.ai-sig-h{display:flex;justify-content:space-between;gap:.5rem}
.ai-bar{height:8px;border-radius:999px;background:#e6edea;overflow:hidden;margin:.3rem 0}
.ai-bar i{display:block;height:100%;background:#12a8b8;border-radius:999px}
.ai-sig p{margin:.2rem 0}
.ai-disclaimer{background:#fff7e0;border:1px solid #f0d9a0;border-radius:12px;padding:.7rem .9rem;margin:.8rem 0 0}
html[data-theme="dark"] .ai-s.ai-hi,html[data-theme="dark"] .ai-sw.ai-hi{background:#14595f;color:#fff}
html[data-theme="dark"] .ai-s.ai-mid,html[data-theme="dark"] .ai-sw.ai-mid{background:#0f3d41;box-shadow:inset 0 -2px 0 #2b8f98}
html[data-theme="dark"] .ai-detail{background:#22302f}html[data-theme="dark"] .ai-bar{background:#22302f}
html[data-theme="dark"] .ai-disclaimer{background:#3a3014;border-color:#6b5a1f}
@media print{
  body *{visibility:hidden}
  #ai-report,#ai-report *{visibility:visible}
  #ai-report{position:absolute;left:0;top:0;width:100%;border:0}
  #ai-report .tool-actions,#ai-report #tool-lock-msg{display:none}
  .ai-doc{max-height:none;overflow:visible}
  .ai-s.ai-hi{background:#a8ecf0!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .ai-s.ai-mid{background:#d9f5f7!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
}

.ai-tips{margin:.6rem 0}
.ai-tip{border:1px solid var(--line,#dde3e0);border-radius:12px;padding:.6rem .8rem;margin:.6rem 0}
.ai-tip blockquote{margin:0 0 .4rem;padding-left:.7rem;border-left:4px solid #7fd3da;font-style:italic}
.ai-tip ul{margin:.2rem 0 0;padding-left:1.1rem}
@media print{.ai-tips{display:none}}

/* ---------- Assignment planner ---------- */
.ap-msg{background:#fde3e3;color:#7a1414;border-radius:12px;padding:.6rem .8rem;margin:.4rem 0}
.ap-list{list-style:none;margin:.6rem 0;padding:0;display:grid;gap:.6rem}
.ap-item{border:1px solid var(--line,#dde3e0);border-left:5px solid #9aa8a6;border-radius:12px;padding:.7rem .85rem;display:grid;gap:.25rem;background:var(--surface,#fff)}
.ap-p-high{border-left-color:#d64545}.ap-p-medium{border-left-color:#e0a21a}.ap-p-low{border-left-color:#2e9e6b}
.ap-top{display:flex;flex-wrap:wrap;gap:.4rem .7rem;align-items:center;justify-content:space-between}
.ap-name{word-break:break-word}
.ap-badge{font-size:.72rem;border-radius:999px;padding:.1rem .55rem;white-space:nowrap}
.ap-b-high{background:#fde3e3;color:#7a1414}.ap-b-medium{background:#fff7e0;color:#6b4e00}.ap-b-low{background:#e3f6ec;color:#0f5132}
.ap-meta{font-size:.9rem;color:#5a696c}
.ap-due{font-weight:600;font-size:.9rem}
.ap-overdue .ap-due{color:#b42318}.ap-today .ap-due{color:#b54708}.ap-soon .ap-due{color:#8a6100}
.ap-notes{margin:.2rem 0 0;font-size:.92rem;word-break:break-word;white-space:pre-wrap}
.ap-done .ap-name{text-decoration:line-through;opacity:.7}.ap-done{opacity:.85}
.ap-act{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.35rem}
.ap-act select{width:auto;min-width:9rem;padding:.35rem .5rem;font:inherit;border:1px solid var(--line-strong,#c5cfcb);border-radius:10px}
.ap-del{border:0;background:#fde3e3;color:#a11d1d;border-radius:10px;min-height:36px;padding:.4rem .85rem;font:inherit;font-size:.9rem;cursor:pointer}
.ap-empty{padding:.6rem 0}
#ap-cancel[hidden]{display:none}
html[data-theme="dark"] .ap-item{background:#161f22}
html[data-theme="dark"] .ap-meta{color:#9fb3ae}
html[data-theme="dark"] .ap-msg,html[data-theme="dark"] .ap-b-high,html[data-theme="dark"] .ap-del{background:#3b1717;color:#ffd0d0}
html[data-theme="dark"] .ap-b-medium{background:#3a3014;color:#ffe9a8}
html[data-theme="dark"] .ap-b-low{background:#12301f;color:#bdeed3}
html[data-theme="dark"] .ap-overdue .ap-due{color:#ff9b93}html[data-theme="dark"] .ap-today .ap-due{color:#ffbb6b}html[data-theme="dark"] .ap-soon .ap-due{color:#f0d27a}

/* ---------- Assignment planner: view toggle + calendar ---------- */
.ap-toolbar{display:flex;flex-wrap:wrap;gap:.6rem 1rem;align-items:flex-end;justify-content:space-between;margin-bottom:.5rem}
.ap-views{display:flex;gap:.4rem}
.ap-toolbar .ap-filterfield{margin:0}.ap-toolbar select{width:auto;min-width:10rem}
html[data-theme] button.ap-vbtn.ap-on{background:var(--brand-primary,#00ffcc);color:var(--brand-ink,#10211f);border-color:var(--brand-primary,#00ffcc)}
#ap-add-day[hidden]{display:none}
.ap-cal-nav{display:flex;align-items:center;gap:.5rem;margin:.6rem 0}
.ap-mtitle{flex:1;text-align:center;font-weight:700}
.ap-weekdays,.ap-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}
.ap-weekdays span{font-size:.72rem;font-weight:600;text-align:center;color:#5a696c;padding:.2rem 0}
.ap-cell{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;min-height:52px;padding:.25rem .1rem;border:1px solid var(--line,#dde3e0);border-radius:10px;background:var(--surface,#fff);color:inherit;font:inherit;font-size:.85rem;cursor:pointer}
.ap-cell:hover{background:#f1f6f4}
.ap-out{opacity:.45}
.ap-dnum{display:inline-flex;align-items:center;justify-content:center;min-width:1.5rem;height:1.5rem;border-radius:999px;line-height:1}
.ap-now .ap-dnum{background:var(--brand-primary,#00ffcc);color:var(--brand-ink,#10211f);font-weight:700}
.ap-sel{outline:2px solid var(--brand-primary-dark,#00b892);outline-offset:-2px}
.ap-late{border-color:#d64545}
.ap-dots{display:flex;flex-wrap:wrap;gap:3px;justify-content:center;margin-top:.2rem}
.ap-dot{display:inline-block;width:8px;height:8px;border-radius:50%;vertical-align:middle}
.ap-dot-high{background:#d64545}.ap-dot-medium{background:#e0a21a}.ap-dot-low{background:#2e9e6b}.ap-dot-done{background:#9aa8a6}
.ap-more{font-size:.65rem;color:#5a696c}
.ap-legend{margin:.6rem 0 0}
.ap-dayhead{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;justify-content:space-between;margin:.8rem 0 .2rem}
@media (min-width:640px){.ap-cell{min-height:74px}}
html[data-theme="dark"] .ap-cell{background:#161f22;color:#e4eeeb;border-color:#26353a}
html[data-theme="dark"] .ap-cell:hover{background:#1c2a2e}
html[data-theme="dark"] .ap-late{border-color:#ff9b93}
html[data-theme="dark"] .ap-weekdays span,html[data-theme="dark"] .ap-more{color:#9fb2ad}

/* ---- NFC tag reader ---- */
.nfc-top{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap}
.nfc-pulse{width:14px;height:14px;border-radius:50%;background:#9aa8a4;flex:none}
.nfc-pulse.on{background:#1f9d62;animation:nfcp 1.4s ease-out infinite}
@keyframes nfcp{0%{box-shadow:0 0 0 0 rgba(31,157,98,.55)}100%{box-shadow:0 0 0 12px rgba(31,157,98,0)}}
@media (prefers-reduced-motion:reduce){.nfc-pulse.on{animation:none}}
.nfc-status{margin:.6rem 0;color:#5a696c}.nfc-status.nfc-ok{color:#1b7a4e}.nfc-status.nfc-err,.nfc-err{color:#b3261e}
.nfc-warn{background:#fff4e0;border:1px solid #f0c987;color:#6b4300;border-radius:10px;padding:.6rem .8rem;margin:.5rem 0}
.nfc-scan{border:1px solid var(--line,#dde3e0);border-radius:14px;padding:.9rem;margin:.9rem 0}
.nfc-scan-h{margin:0 0 .5rem;font-size:1rem}
.nfc-dl{display:grid;grid-template-columns:max-content 1fr;gap:.2rem .8rem;margin:.4rem 0}
.nfc-dl dt{font-weight:600;color:#5a696c}.nfc-dl dd{margin:0;word-break:break-all}
.nfc-rec{background:#f1f6f4;border-radius:12px;padding:.7rem;margin:.6rem 0}
.nfc-rec-h{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}
.nfc-badge{background:#1f6f5c;color:#fff;border-radius:999px;padding:.1rem .6rem;font-size:.8rem;font-weight:600}
.nfc-val{margin:.4rem 0;white-space:pre-wrap;word-break:break-word}
.nfc-pre,.nfc-hex{display:block;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.82rem;white-space:pre-wrap;word-break:break-all}
.nfc-pre{background:#fff;border-radius:8px;padding:.5rem;margin:.4rem 0}
.nfc-kids{border-left:3px solid #c5d3ce;margin:.5rem 0 .2rem .3rem;padding-left:.6rem}
.nfc-raw{margin-top:.4rem}
.nfc-hist{list-style:none;padding:0;margin:0}
.nfc-h-item{display:grid;grid-template-columns:1fr auto;gap:.1rem .6rem;align-items:center;padding:.5rem 0;border-bottom:1px solid var(--line,#dde3e0)}
.nfc-h-time{grid-column:1/-1}.nfc-h-sum{word-break:break-word}
.nfc-hexbox{margin-top:1rem}
html[data-theme="dark"] .nfc-rec{background:#1d2a2d}html[data-theme="dark"] .nfc-pre{background:#161f22}
html[data-theme="dark"] .nfc-warn{background:#3a2d12;border-color:#7a5a1c;color:#f3d9a4}
html[data-theme="dark"] .nfc-status,html[data-theme="dark"] .nfc-dl dt{color:#a9b8b5}

/* citation generator: prominent search box (default "any source" mode) */
.cg .cg-sbox{position:relative;flex:1 1 100%;min-width:0}
.cg .cg-sbox input[type=search]{width:100%;box-sizing:border-box;min-height:3.1rem;padding:.7rem .9rem .7rem 2.7rem;font-size:1.02rem;border:2px solid var(--cg-on);border-radius:14px;box-shadow:0 0 0 4px rgba(0,184,146,.12)}
.cg .cg-sbox input[type=search]:focus{outline:0;box-shadow:0 0 0 4px rgba(0,184,146,.3)}
.cg .cg-sicon{position:absolute;left:.9rem;top:50%;transform:translateY(-50%);font-size:1.15rem;pointer-events:none;line-height:1}
.cg .cg-go{min-height:3.1rem;padding-left:1.4rem;padding-right:1.4rem;font-weight:700}
.cg-type-any{font-weight:700;color:var(--cg-on);grid-column:1/-1}

/* ---------- Citation generator: "Check my paper" mode ---------- */
.cc-entry{display:flex;flex-wrap:wrap;gap:.6rem .9rem;align-items:center;justify-content:space-between;margin:1.1rem 0 .4rem;padding:.8rem .9rem;border:1px solid var(--cg-line,#dde3e0);border-radius:14px;background:var(--cg-soft,#f1f6f4)}
.cc-entry-t{display:grid;gap:.1rem;flex:1 1 14rem;min-width:0}
.cc-entry .btn{flex:1 1 100%}
.cc[hidden]{display:none}
.cc{margin-top:.6rem}
.cc-in{display:grid;gap:.6rem;margin:.6rem 0}
.cc-file{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
.cc-file input[type=file]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.cc-file label.btn{margin:0;cursor:pointer}
#cc-text{width:100%;box-sizing:border-box;min-height:9rem;font:inherit;padding:.6rem .7rem;border:1px solid var(--line-strong,#c5cfcb);border-radius:12px;resize:vertical}
.cc-style select{width:100%;max-width:100%;min-height:44px}
.cc .tool-actions{margin:.2rem 0 0}
.cc-prog{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin:.5rem 0}
.cc-prog progress{flex:1 1 100%;width:100%;height:10px}
.cc-prog[hidden]{display:none}
.cc-warn{color:#8a5a00}.cc-ok{color:#1b7a4e}
.cc-out{margin-top:.8rem}
.cc-sum{border:1px solid var(--cg-line,#dde3e0);border-radius:14px;padding:.8rem}
.cc-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem;text-align:center}
.cc-stat b{display:block;font-size:1.6rem;line-height:1.1}.cc-stat span{font-size:.8rem;color:#5a696c}
.cc-chips{display:flex;flex-wrap:wrap;gap:.35rem;margin:.7rem 0 .3rem}
.cc-chip{border:1px solid var(--line-strong,#c5cfcb);background:var(--surface,#fff);color:inherit;border-radius:999px;padding:.35rem .7rem;font:inherit;font-size:.85rem;cursor:pointer;min-height:36px}
.cc-chip.is-zero{opacity:.55}.cc-chip.is-on{background:var(--cg-on,#00b892);color:#fff;border-color:var(--cg-on,#00b892);opacity:1}
.cc-src{margin:.3rem 0 0}
.cc-note,.cc-disc,.cc-fail{border-radius:12px;padding:.6rem .8rem;margin:.6rem 0}
.cc-note{background:#fff7e0;border:1px solid #f0d9a0}
.cc-disc{background:#eef6ff;border:1px solid #bcd6f2;font-size:.92rem}
.cc-fail{background:#fde3e3;border:1px solid #f3b8b8;color:#7a1414}.cc-fail[hidden]{display:none}
.cc-fail p{margin:0 0 .5rem}
.cc-tools,.cc-chg{border:1px solid var(--cg-line,#dde3e0);border-radius:14px;padding:.7rem .8rem;margin:.6rem 0}
.cc-chg[hidden]{display:none}
.cc-h3{margin:0 0 .2rem;font-size:1rem}
.cc-row,.cc-act{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.5rem}
.cc-row .btn,.cc-act .btn{min-height:40px}
.cc-chg-l{margin:.4rem 0 0;padding-left:1.1rem}.cc-find{text-decoration:line-through;opacity:.75;word-break:break-word}
.cc-grp{margin:.7rem 0;border-top:1px solid var(--cg-line,#dde3e0);padding-top:.5rem}
.cc-grp>summary{cursor:pointer;display:flex;gap:.6rem;align-items:center;padding:.3rem 0;min-height:40px}
.cc-gn{font-size:.85rem;color:#5a696c}
.cc-badge{border-radius:999px;padding:.15rem .65rem;font-size:.8rem;font-weight:700;background:#e6edea}
.cc-b-notfound{background:#fde3e3;color:#7a1414}.cc-b-missing{background:#ffe9d2;color:#7a3a00}.cc-b-uncited{background:#fff3c4;color:#5c4600}
.cc-b-mismatch{background:#f3e3fb;color:#4f1d6b}.cc-b-format{background:#e0ecff;color:#173f7a}.cc-b-nocite{background:#e3f6ec;color:#0f5132}
.cc-card{border:1px solid var(--cg-line,#dde3e0);border-left:5px solid #9aa8a6;border-radius:12px;padding:.7rem .8rem;margin:.6rem 0;background:var(--surface,#fff);overflow-wrap:anywhere}
.cc-t-notfound{border-left-color:#d64545}.cc-t-missing{border-left-color:#e07a1a}.cc-t-uncited{border-left-color:#e0b81a}
.cc-t-mismatch{border-left-color:#9b59c6}.cc-t-format{border-left-color:#3b78d6}.cc-t-nocite{border-left-color:#2e9e6b}
.cc-card.is-done{opacity:.7;padding:.45rem .8rem}
.cc-ch{margin-bottom:.3rem}
.cc-ref,.cc-cite{margin:.2rem 0;font-size:.92rem}
.cc-claim{margin:.2rem 0;padding-left:.7rem;border-left:4px solid #7fd3da;font-style:italic}
.cc-why{margin:.4rem 0}.cc-hint{margin:.3rem 0;font-weight:600;font-size:.92rem}
.cc-diffs{display:grid;gap:.4rem;margin:.4rem 0}.cc-drow{display:grid;gap:.1rem;background:#f1f6f4;border-radius:8px;padding:.4rem .6rem;font-size:.9rem}
.cc-cols{display:grid;gap:.5rem;margin:.4rem 0}
.cc-col{background:#f1f6f4;border-radius:10px;padding:.5rem .7rem}
.cc-cl{display:block;font-size:.8rem;color:#5a696c}.cc-dtext{margin:.2rem 0 0;font-size:.92rem;line-height:1.5}
.cc-x{background:#ffe08a;color:inherit;border-radius:3px;padding:0 .1rem}
.cc-msgs{margin:.3rem 0;padding-left:1.1rem;font-size:.9rem}
.cc-found{margin-top:.6rem}
.cc-res{border:1px solid var(--cg-line,#dde3e0);border-radius:10px;padding:.55rem .7rem;margin:.5rem 0;background:#f7faf9}
.cc-resref{word-break:break-word}.cc-meta{margin:.3rem 0;color:#3d4f52}
.cc-checks{list-style:none;margin:.2rem 0;padding:0}.cc-checks .is-ok{color:#1b7a4e}.cc-checks .is-bad{color:#a11d1d}.cc-checks .is-warn{color:#8a5a00}
.cc-empty{padding:.6rem 0}
.cc-all{margin:.8rem 0}.cc-all>details>summary{cursor:pointer;min-height:40px;display:flex;align-items:center;font-weight:600}
.cc-rr{border-top:1px solid var(--cg-line,#dde3e0);padding:.5rem 0}
.cc-rr .cc-ref{margin:.3rem 0 0}
.cc-st{display:inline-block;border-radius:999px;padding:.1rem .6rem;font-size:.78rem;font-weight:700}
.cc-st-ok{background:#e3f6ec;color:#0f5132}.cc-st-part{background:#fff3c4;color:#5c4600}.cc-st-bad{background:#fde3e3;color:#7a1414}.cc-st-err{background:#e6edea;color:#3d4f52}
@media (min-width:640px){
  .cc-entry .btn{flex:0 0 auto}
  .cc-style select{width:auto;min-width:18rem}
  .cc-cols{grid-template-columns:1fr 1fr}
  .cc-drow{grid-template-columns:9rem 1fr 1fr}
  .cc-prog progress{flex:1 1 12rem;width:auto}
}
html[data-theme="dark"] .cc-entry,html[data-theme="dark"] .cc-drow,html[data-theme="dark"] .cc-col,html[data-theme="dark"] .cc-res{background:#22302f}
html[data-theme="dark"] .cc-chip,html[data-theme="dark"] .cc-card{background:#161f22}
html[data-theme="dark"] .cc-note{background:#3a3014;border-color:#6b5a1f}
html[data-theme="dark"] .cc-disc{background:#14283a;border-color:#2c5a86}
html[data-theme="dark"] .cc-fail{background:#3b1717;border-color:#7a2d2d;color:#ffd0d0}
html[data-theme="dark"] .cc-stat span,html[data-theme="dark"] .cc-gn,html[data-theme="dark"] .cc-cl{color:#a9bcb8}
html[data-theme="dark"] .cc-x{background:#6b5a1f}
html[data-theme="dark"] .cc-warn{color:#ffd778}html[data-theme="dark"] .cc-ok{color:#7fe0a9}
.cc .sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* Summary generator */
.sg-tabs{display:flex;flex-wrap:wrap;gap:.3rem;border-bottom:2px solid var(--line,#dde3e0);margin-bottom:.8rem}
.sg-tab{border:0;background:transparent;padding:.55rem .8rem;font:inherit;font-weight:600;cursor:pointer;border-radius:10px 10px 0 0;border-bottom:3px solid transparent;margin-bottom:-2px;color:inherit}
.sg-tab[aria-selected=true]{border-bottom-color:var(--brand-primary,#00ffcc);background:color-mix(in srgb,var(--brand-primary,#00ffcc) 14%,transparent)}
.sg-pane[hidden]{display:none}
.sg-row{display:grid;gap:.8rem;grid-template-columns:1fr;margin-top:.9rem;align-items:end}
@media(min-width:640px){.sg-row{grid-template-columns:1fr auto}}
.sg-row .field{margin:0}
.sg-msg{min-height:1.2rem;margin:.6rem 0 0;font-size:.93rem}
.sg-msg.is-bad{color:#b3261e}
.sg-source{padding:.7rem .85rem;border:1px solid var(--line,#dde3e0);border-radius:12px;margin:1rem 0 .4rem;display:grid;gap:.15rem}
.sg-src-title{font-weight:700;overflow-wrap:anywhere}
.sg-src-h{font-weight:700;margin-bottom:.2rem}
.sg-src-row{display:grid;grid-template-columns:7.5rem 1fr;gap:.5rem;font-size:.93rem}
.sg-src-k{opacity:.7}.sg-src-v{overflow-wrap:anywhere}
.sg-h3{font-size:1.02rem;margin:1rem 0 .4rem}
.sg-kp ul{margin:0;padding-left:1.2rem;display:grid;gap:.4rem;line-height:1.55}
.sg-opt{margin-top:.6rem}.sg-opt>summary{cursor:pointer;font-weight:600;min-height:40px;display:flex;align-items:center}
.sg-optgrid{display:grid;gap:.6rem;grid-template-columns:1fr}
@media(min-width:640px){.sg-optgrid{grid-template-columns:1fr 1fr}.sg-optgrid .field:first-child{grid-column:1/-1}}
.sg-cardwrap{margin-top:1.4rem;padding-top:.4rem;border-top:2px solid var(--line,#dde3e0)}
.sg-cardwrap canvas{display:block;width:100%;max-width:420px;height:auto;border-radius:14px;border:1px solid var(--line,#dde3e0);margin:.5rem 0 .9rem;box-shadow:0 2px 10px rgba(0,0,0,.08)}
.sg-msg.is-ok{color:#1b7a4e}
.sg-result{padding:.9rem 1rem;border-radius:12px;background:#f1f6f4;line-height:1.65;overflow-wrap:anywhere}
.sg-result p{margin:0}.sg-result ul{margin:0;padding-left:1.2rem;display:grid;gap:.45rem}
.sg-sec+.sg-sec{margin-top:.7rem}.sg-sec b{display:block;font-size:.82rem;letter-spacing:.03em;text-transform:uppercase;opacity:.75}
.sg-note{padding:.5rem .7rem;border-left:3px solid #c99a00;background:#fff8e1;border-radius:6px}

/* Tool category tabs (tools/index.php) */
.tool-tabs{display:flex;gap:.45rem;overflow-x:auto;padding:.2rem 0 .6rem;margin:1rem 0 .2rem;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
.tool-tab{flex:0 0 auto;font:inherit;font-weight:600;font-size:.9rem;padding:.5rem .85rem;border:1px solid var(--line-strong,#c5cfcb);border-radius:999px;background:var(--surface,#fff);color:inherit;cursor:pointer;white-space:nowrap}
.tool-tab:hover{border-color:var(--brand-primary,#1b7a4e)}
.tool-tab.is-on{background:var(--brand-primary,#1b7a4e);border-color:var(--brand-primary,#1b7a4e);color:#fff}
.tool-tab:focus-visible{outline:3px solid rgba(27,122,78,.4);outline-offset:2px}
.tool-tab-n{display:inline-block;min-width:1.3em;margin-left:.25rem;padding:0 .35em;border-radius:999px;background:rgba(0,0,0,.08);font-size:.78rem;text-align:center}
.tool-tab.is-on .tool-tab-n{background:rgba(255,255,255,.25)}
.tool-cat[hidden]{display:none}
.tool-cat .tool-h2{margin-top:1.4rem}
#tool-cats.is-filtered .tool-cat .tool-h2{display:none}
html[data-theme="dark"] .tool-tab{background:#161f22}
