.spell-card-picker,.class-gallery{border:3px solid #c79d50;border-radius:18px;background:#fbf3df;color:#241b35;width:min(980px,calc(100% - 20px));max-height:calc(100vh - 30px);padding:18px 20px;box-shadow:0 20px 60px rgba(0,0,0,.5)}
.spell-card-picker::backdrop,.class-gallery::backdrop{background:rgba(12,8,30,.65)}
.spell-card-picker h2,.class-gallery h2{margin:0 0 .4rem;color:#241b35}
.spell-card-picker p,.class-gallery p{color:#3d2f18}
.scp-close,.cg-close{position:absolute;top:8px;right:14px;border:0;background:none;font-size:1.8rem;cursor:pointer;color:#5b4a2a}
.scp-actions{display:flex;gap:.5rem;flex-wrap:wrap;margin:.5rem 0 .8rem}
.scp-actions button,.cg-item button{width:auto}
.spell-card-picker .subtle,.class-gallery .subtle{color:#3b2c63!important;background:#fff7e3!important;border:2px solid #d9bd7c!important;opacity:1!important}
.spell-card-picker .primary,.class-gallery .primary{color:#241b35!important}
.scp-grid,.cg-grid,.tg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px;justify-items:center}
.scp-item{position:relative;cursor:pointer;display:block}
.scp-item input{position:absolute;top:10px;left:10px;width:22px;height:22px;z-index:2;accent-color:#3b2c63}
.scp-item:has(input:not(:checked)) .spell-card{opacity:.45;filter:grayscale(.6)}
.cg-head{display:flex;justify-content:space-between;align-items:center}
.cg-tabs{display:flex;gap:6px;margin:.3rem 0 .6rem;flex-wrap:wrap}
.cg-tabs button{border:2px solid #c79d50;background:#fff7e3;color:#3b2c63;border-radius:999px;padding:.4rem .9rem;font-weight:700;cursor:pointer}
.cg-tabs button[aria-selected="true"]{background:#3b2c63;color:#ffe9a8}
.cg-status{min-height:1.2em;font-weight:700;color:#3b6b2a!important;margin:.2rem 0}
.cg-status.cg-error{color:#9a2a1a!important}
.cg-item,.tg-item{margin:0;display:flex;flex-direction:column;align-items:center;gap:6px}
.cg-item figcaption,.tg-item figcaption{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:center;font-weight:700;color:#3d2f18;font-size:.9rem}
.cg-cheer{border:2px solid #c79d50;background:#fff7e3;color:#3b2c63;border-radius:999px;padding:.35rem .8rem;font-weight:700;cursor:pointer}
.cg-cheer.on{background:#3b2c63;color:#ffe9a8}
.cg-mine,.cg-state{font-size:.85rem}
.cg-empty,.tg-empty{font-style:italic;color:#5b4a2a!important;grid-column:1/-1}
.cg-note{font-size:.9rem}
.print-spell-cards,.open-gallery{margin:.3rem .5rem .8rem 0;width:auto}
.teacher-gallery{margin:1.2rem 0;padding:1rem;border:2px solid #c79d50;border-radius:14px;background:rgba(251,243,223,.6)}
.teacher-gallery h3{margin-top:0}
.tg-actions{display:flex;gap:.5rem;flex-wrap:wrap;margin:.5rem 0}
.tg-btns{display:flex;gap:6px}
.teacher-gallery details{margin-top:.8rem}
.teacher-gallery summary{cursor:pointer;font-weight:700}
@media (max-width:600px){.spell-card-picker,.class-gallery{padding:14px 10px}.scp-grid,.cg-grid{grid-template-columns:1fr}}
/* ---------- Focus Sets ---------- */
.focus-banner{margin:0 0 1rem;padding:.8rem 1rem;border:2px solid #c79d50}
.fb-head{display:flex;flex-wrap:wrap;gap:.3rem .8rem;align-items:baseline;margin-bottom:.5rem}
.fb-title{font-size:1.1rem}
.fb-sub{font-size:.88rem;opacity:.85}
.fb-chips{display:flex;flex-wrap:wrap;gap:.4rem}
.fb-chip{border:2px solid #c79d50;background:#fff7e3;color:#2b1d4a;border-radius:999px;padding:.3rem .75rem;font-size:.9rem;cursor:pointer;width:auto}
.fb-chip:hover{background:#3b2c63;color:#ffe9a8}
.root-card.focus-root{box-shadow:0 0 0 3px #e6a23a!important}
.root-card.focus-root::before{content:'🎯';position:absolute;top:6px;right:30px;font-size:.95rem;z-index:2}
.focus-quest-note{font-weight:700;background:rgba(230,162,58,.18);border-left:4px solid #e6a23a;padding:.4rem .7rem;border-radius:6px}
.teacher-focus{margin:1.2rem 0;padding:1rem;border:2px solid #c79d50;border-radius:14px;background:rgba(251,243,223,.6)}
.teacher-focus h3{margin-top:0}
.tf-name{display:block;margin:.6rem 0;font-weight:700}
.tf-name input,#tfSearch{display:block;width:100%;max-width:420px;padding:.45rem .6rem;border:2px solid #c79d50;border-radius:8px;margin-top:.25rem;font:inherit}
.tf-presets{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;margin:.5rem 0}
.tf-presets button{border:2px solid #c79d50;background:#fff7e3;border-radius:999px;padding:.25rem .7rem;cursor:pointer;font-size:.88rem}
.tf-roots{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.35rem;max-height:340px;overflow:auto;padding:.3rem;border:1px solid #d9bd7c;border-radius:10px;background:#fffaf0;margin:.4rem 0}
.tf-roots button{text-align:left;border:1.5px solid #d9bd7c;background:#fff;border-radius:8px;padding:.3rem .5rem;cursor:pointer;font-size:.85rem;display:flex;gap:.3rem;align-items:baseline}
.tf-roots button span{flex:1;color:#5b4a2a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tf-roots button small{color:#8a6a2c}
.tf-roots button.on{background:#3b2c63;color:#ffe9a8;border-color:#3b2c63}
.tf-roots button.on span,.tf-roots button.on small{color:#ffe9a8}
.tf-actions{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:.5rem}
.tf-count{font-weight:700;margin:.3rem 0}
.tf-table-wrap{overflow-x:auto}
.tf-table{border-collapse:collapse;width:100%;font-size:.9rem;margin:.4rem 0}
.tf-table th,.tf-table td{padding:.35rem .5rem;border-bottom:1px solid #e3cf9f;text-align:left}
.tf-bar{display:inline-block;width:70px;height:8px;background:#ead8b0;border-radius:4px;vertical-align:middle;overflow:hidden}
.tf-bar i{display:block;height:100%;background:#3b6b2a}
.tf-note,.tf-off{font-size:.88rem}
.root-card.focus-root{position:relative}
/* ---------- spell level guide ---------- */
.lv-guide{margin:.5rem 0;border:1.5px solid #d9bd7c;border-radius:10px;background:rgba(255,250,235,.7);padding:.35rem .6rem;color:#2b1d4a;font-size:.9rem}
.lv-guide summary{cursor:pointer;font-weight:700}
.lv-rule{margin:.3rem 0;font-size:.85rem;color:#5b4a2a}
.lv-roots{list-style:none;padding:0;margin:.3rem 0;display:flex;flex-direction:column;gap:.35rem}
.lv-roots li{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem}
.lv-roots li.done strong{color:#2f6b2a}
.lv-bar{display:inline-block;width:64px;height:8px;border-radius:4px;background:#ead8b0;overflow:hidden}.lv-bar i{display:block;height:100%;background:#3b6b2a}
.lv-dots i{font-style:normal;display:inline-block;width:1.1em;text-align:center;font-weight:800}.lv-dots .ok{color:#2f7a2a}.lv-dots .no{color:#b23a2a}.lv-dots .empty{color:#b9a57c}
.lv-where{font-size:.85rem;background:rgba(230,162,58,.15);border-radius:6px;padding:.3rem .5rem;margin:.35rem 0}
.lv-ladder{display:flex;flex-wrap:wrap;gap:.3rem;padding:0;margin:.4rem 0 .1rem;list-style:none;font-size:.78rem}
.lv-ladder li{border:1px solid #d9bd7c;border-radius:999px;padding:.1rem .5rem;background:#fff}
.lv-ladder li.past{opacity:.6}.lv-ladder li.now{background:#3b2c63;color:#ffe9a8;border-color:#3b2c63}
.level-help{margin:.4rem 0 .8rem;border:2px solid #c79d50;border-radius:12px;background:rgba(251,243,223,.85);padding:.5rem .8rem;color:#2b1d4a}
.level-help summary{cursor:pointer;font-weight:800}
.level-help ol{margin:.4rem 0;padding-left:1.2rem}.level-help p{margin:.2rem 0;font-size:.9rem;color:#3d2f18}
.evolved{margin:.3rem 0;padding:.3rem .6rem;border-radius:8px;background:linear-gradient(90deg,rgba(255,215,106,.35),transparent);font-size:.9rem;color:#5b3d10}
.evolved.lv4{background:linear-gradient(90deg,rgba(192,139,255,.4),transparent);color:#3b2c63}
.evolve-hint{margin:.3rem 0;font-size:.82rem;color:#7a5a1a;font-style:italic}
.levelup-toast{position:fixed;top:18px;left:50%;transform:translateX(-50%);z-index:1200;background:linear-gradient(120deg,#3b2c63,#6a3fa0);color:#ffe9a8;border:3px solid #ffd76a;border-radius:16px;padding:.8rem 1.2rem;font-weight:900;font-size:1.05rem;box-shadow:0 10px 30px rgba(0,0,0,.45);animation:lvlPop .5s ease-out}
@keyframes lvlPop{0%{transform:translateX(-50%) scale(.6);opacity:0}100%{transform:translateX(-50%) scale(1);opacity:1}}
