:root{--bg:#071018;--panel:#101920;--panel2:#151e24;--gold:#c89546;--gold2:#f0c979;--line:#6f532e;--cream:#efe2c7;--text:#f7f0e5;--muted:#b6ad9f;--red:#7c171d;--green:#2d6a4f;--shadow:0 16px 42px rgba(0,0,0,.34)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:radial-gradient(circle at 45% 0,#17252e 0,#071018 43%,#03070a 100%);color:var(--text);font-family:Georgia,'Times New Roman',serif}button,input,select,textarea{font:inherit}.sheet-app{min-height:100vh;padding:12px 14px 18px}.sheet-header{display:flex;align-items:center;gap:16px;min-height:86px;border-bottom:1px solid var(--line);padding:4px 8px 12px}.brand-mark{width:58px;height:58px;border:2px solid var(--gold);border-radius:50%;display:grid;place-items:center;color:var(--gold2);font-size:31px;box-shadow:inset 0 0 20px #000}.title-wrap{min-width:0;flex:1}.title-wrap h1{margin:0;font-size:clamp(25px,3vw,43px);letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.title-wrap p{margin:4px 0 0;color:var(--gold2);font-size:17px}.header-actions{display:flex;gap:8px}.icon-btn,.select-btn{min-width:48px;min-height:48px;border:1px solid var(--line);border-radius:10px;background:#0c1318;color:var(--gold2);cursor:pointer}.select-btn{padding:0 13px}.sheet-grid{display:grid;grid-template-columns:minmax(230px,25%) minmax(420px,1fr) minmax(430px,42%);grid-template-rows:auto auto 1fr auto;gap:14px;margin-top:14px}.card{background:linear-gradient(145deg,rgba(22,31,37,.97),rgba(9,15,19,.98));border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}.portrait-card{grid-row:1/3;position:relative;width:100%;height:345px;min-height:345px;max-height:345px;overflow:hidden;padding:10px;align-self:start;contain:layout paint}.portrait-card img{position:absolute;inset:10px;width:calc(100% - 20px)!important;height:calc(100% - 20px)!important;min-width:0!important;min-height:0!important;max-width:calc(100% - 20px)!important;max-height:calc(100% - 20px)!important;display:block;object-fit:contain;object-position:center;border:1px solid var(--gold);border-radius:9px;background:#080d10}.portrait-placeholder{position:absolute;inset:10px;display:grid;place-items:center;border:1px solid var(--gold);border-radius:9px;font-size:85px;color:#795f39;background:radial-gradient(circle,#253540,#080d10)}.level-badge{position:absolute;bottom:15px;left:50%;transform:translateX(-50%);background:#11181d;border:2px solid var(--gold);padding:8px 18px;text-align:center;clip-path:polygon(15% 0,85% 0,100% 22%,88% 100%,12% 100%,0 22%)}.level-badge strong{font-size:25px;display:block}.summary-card{grid-column:2/4;display:grid;grid-template-columns:1.35fr .8fr .8fr;overflow:hidden;min-height:142px}.summary-cell{padding:22px 26px;border-right:1px solid #33404a;cursor:pointer}.summary-cell:last-child{border-right:0}.summary-cell:hover,.metric:hover,.stat-card:hover,.resource-panel:hover,.skill-row:hover{filter:brightness(1.12)}.summary-cell.hp{background:linear-gradient(135deg,#77171c,#301012)}.label{color:var(--gold2);font-weight:bold;letter-spacing:.08em;text-transform:uppercase}.summary-value{font-size:clamp(35px,4.4vw,65px);margin-top:12px}.metrics{grid-column:2/4;display:grid;grid-template-columns:repeat(4,1fr);overflow:hidden}.metric{padding:17px;text-align:center;border-right:1px solid #33404a;cursor:pointer}.metric:last-child{border-right:0}.metric strong{display:block;font-size:34px;margin-top:8px}.wound-dots,.resource-dots{display:flex;gap:9px;flex-wrap:wrap;justify-content:center;margin-top:12px}.dot{width:28px;height:28px;border:2px solid var(--line);border-radius:50%;background:#11181d;cursor:pointer}.dot.on{background:#aa2529;border-color:#ff6262;box-shadow:inset 0 0 0 6px #4b1215}.stats-panel{grid-column:1/3;display:grid;grid-template-columns:repeat(4,1fr);gap:11px;background:none;border:0;box-shadow:none}.stat-card{min-height:180px;padding:16px 10px;text-align:center;background:linear-gradient(#f7edd8,#e3d0ae);color:#192027;border:2px solid #c6a46c;border-radius:10px;cursor:pointer}.stat-card .stat-icon{font-size:29px;color:#9f702e}.stat-card strong{display:block;font-size:46px;margin:11px 0}.stat-card em{background:#121a20;color:var(--gold2);padding:5px 18px;border-radius:4px;font-style:normal;font-size:23px}.skills-panel{grid-column:3;grid-row:3/5;padding:18px;min-height:420px}.section-head{display:flex;justify-content:space-between;align-items:center;color:var(--gold2);font-size:21px;margin-bottom:12px}.skills-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}.skill-row{display:grid;grid-template-columns:32px 1fr 45px 52px 45px;align-items:center;gap:6px;min-height:51px;padding:7px 9px;border:1px solid #4e402b;border-radius:9px;background:#121a20;cursor:pointer}.skill-icon{color:var(--gold2);font-size:20px}.skill-stat{color:var(--muted);font-size:13px}.skill-value{font-size:19px;text-align:center}.skill-rank{color:var(--gold2);letter-spacing:2px}.resources{grid-column:1/3;display:grid;grid-template-columns:.75fr 1.25fr;gap:12px}.resource-panel{padding:16px;text-align:center;cursor:pointer}.action-gems{display:flex;justify-content:center;gap:18px;margin:20px 0}.gem{width:35px;height:35px;transform:rotate(45deg);border:2px solid var(--gold);background:#11181d}.gem.on{background:radial-gradient(circle,#fff1a5 0,#e7a931 38%,#7e4b0f 70%);box-shadow:0 0 17px #d89122}.die-slot{width:49px;height:49px;border:2px solid var(--line);border-radius:9px;display:grid;place-items:center;font-weight:bold;color:#665b4a}.die-slot.on{color:#13191d;background:linear-gradient(#f1c96c,#bd7c20);border-color:#ffd685}.tabs{grid-column:1/4;display:grid;grid-template-columns:repeat(4,1fr);overflow:hidden}.tab{min-height:72px;border:0;border-right:1px solid var(--line);background:#11181d;color:var(--gold2);font-size:18px;cursor:pointer}.tab.active{background:linear-gradient(135deg,#4b3b28,#171b1c);box-shadow:inset 0 -4px var(--gold)}.tab-content{grid-column:1/4;padding:18px;display:none}.tab-content.active{display:block}.detail-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.detail-box{border:1px solid #4e402b;border-radius:9px;padding:13px;background:#11181d}.detail-box h3{margin:0 0 9px;color:var(--gold2)}.list-items{display:grid;gap:7px}.list-item{border:1px solid #403523;border-radius:7px;padding:9px;background:#0c1318}.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.76);display:none;place-items:center;z-index:100}.modal-backdrop.open{display:grid}.modal{width:min(520px,92vw);max-height:88vh;overflow:auto;background:linear-gradient(145deg,#18232b,#090f13);border:2px solid var(--gold);border-radius:15px;padding:20px;box-shadow:0 30px 80px #000}.modal h2{margin:0 0 15px;color:var(--gold2)}.modal label{display:block;margin:10px 0 5px;color:var(--cream)}.modal input,.modal select,.modal textarea{width:100%;padding:11px;border:1px solid #806338;border-radius:8px;background:#f4ead7;color:#10171b}.quick-buttons{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:12px 0}.quick-buttons button,.modal-actions button{padding:11px;border:1px solid var(--line);border-radius:8px;background:#1a252c;color:var(--text);cursor:pointer}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.modal-actions .save{background:#7a5121;color:#fff}.status-toast{position:fixed;right:18px;bottom:18px;padding:11px 16px;border:1px solid var(--line);border-radius:9px;background:#11181d;color:var(--gold2);opacity:0;transform:translateY(12px);transition:.2s;z-index:120}.status-toast.show{opacity:1;transform:none}.empty-message{padding:50px;text-align:center}.web-sheet-launch{display:inline-block;padding:12px 14px;border-radius:12px;background:linear-gradient(#a36735,#71371f);color:#fff;text-decoration:none;font-weight:bold;box-shadow:0 3px 0 #432213}
@media(max-width:1050px){.sheet-grid{grid-template-columns:230px 1fr;grid-template-rows:auto}.portrait-card{grid-row:auto}.summary-card,.metrics{grid-column:2}.stats-panel,.resources,.skills-panel,.tabs,.tab-content{grid-column:1/3}.skills-panel{grid-row:auto}.skills-list{grid-template-columns:1fr 1fr}.header-actions .hide-small{display:none}}
@media(max-width:720px){.sheet-app{padding:7px}.sheet-header{gap:8px}.brand-mark{display:none}.sheet-grid{grid-template-columns:1fr}.portrait-card,.summary-card,.metrics,.stats-panel,.resources,.skills-panel,.tabs,.tab-content{grid-column:1}.portrait-card{height:300px;min-height:300px;max-height:300px}.portrait-card img,.portrait-placeholder{min-height:0;max-height:none}.summary-card{grid-template-columns:1fr 1fr}.summary-cell:first-child{grid-column:1/3}.metrics{grid-template-columns:1fr 1fr}.stats-panel{grid-template-columns:1fr 1fr}.resources{grid-template-columns:1fr}.skills-list{grid-template-columns:1fr}.tabs{position:sticky;bottom:0;z-index:20}.tab{font-size:13px}.detail-grid{grid-template-columns:1fr}.title-wrap h1{font-size:22px}.title-wrap p{font-size:13px}}

.die-slot{height:58px;flex-direction:column;line-height:1.05}.die-slot strong{font-size:24px}.die-slot small{display:block;font-size:10px;margin-top:3px}.modal.modal-wide{width:min(1050px,94vw)}.detail-box.wide{grid-column:1/-1}.detail-box p{line-height:1.45}.list-item p{margin:7px 0 0;color:var(--muted);line-height:1.4}.portrait-picker{display:grid;grid-template-columns:minmax(180px,280px) 1fr;gap:20px;align-items:center}.portrait-picker img{width:100%;height:360px;max-height:360px;object-fit:contain;border:1px solid var(--gold);border-radius:10px;background:#080d10}.file-button,.secondary-button{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:10px 16px;border:1px solid var(--gold);border-radius:9px;background:#714b20;color:#fff;cursor:pointer}.secondary-button{background:#18232b;margin-top:10px}.modal-help{color:var(--muted);line-height:1.45}.die-value-picker{display:grid;grid-template-columns:repeat(auto-fit,minmax(62px,1fr));gap:9px;margin:12px 0 18px}.die-value-picker button{min-height:58px;border:1px solid var(--line);border-radius:9px;background:#152029;color:var(--gold2);font-size:22px;cursor:pointer}.die-value-picker button.selected{background:#9a671f;color:#fff;box-shadow:0 0 0 2px var(--gold2)}.inventory-editor textarea{min-height:130px}.modal hr{border:0;border-top:1px solid var(--line);margin:20px 0}.tab-content{display:none!important}@media(max-width:720px){.portrait-picker{grid-template-columns:1fr}.modal.modal-wide{width:94vw}.detail-grid{grid-template-columns:1fr}}

/* v1.2.1 â€” thÃ¨mes visuels et pictogrammes */
.picto{display:inline-grid;place-items:center;min-width:1.45em;filter:saturate(1.15);text-shadow:0 2px 5px rgba(0,0,0,.35)}
.theme-launch{font-size:23px;background:linear-gradient(135deg,#6e2e8e,#1b7aa4,#c68a29);border-color:#e7c97f}
.theme-intro{display:flex;justify-content:space-between;gap:18px;align-items:end;margin-bottom:16px;color:var(--cream)}.theme-intro span{color:var(--muted)}
.theme-gallery{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:12px}.theme-card{position:relative;min-height:142px;padding:14px 10px;border:2px solid var(--line);border-radius:18px;background:linear-gradient(145deg,var(--theme-card-a,#18232b),var(--theme-card-b,#0a1014));color:var(--text);cursor:pointer;overflow:hidden;transition:.18s transform,.18s box-shadow,.18s border-color}.theme-card:hover{transform:translateY(-3px)}.theme-card.selected{border-color:var(--gold2);box-shadow:0 0 0 3px rgba(240,201,121,.2),0 12px 28px rgba(0,0,0,.35)}.theme-symbol{display:block;font-size:42px;margin-bottom:7px}.theme-card strong,.theme-card small{display:block}.theme-card small{margin-top:4px;color:var(--muted)}.theme-sample{display:flex;justify-content:center;gap:5px;margin-top:10px}.theme-sample i{width:18px;height:6px;border-radius:9px;background:var(--gold)}.theme-sample i:nth-child(2){background:var(--panel2)}.theme-sample i:nth-child(3){background:var(--cream)}
.theme-card[data-theme-choice="forest"]{--theme-card-a:#1e3b2a;--theme-card-b:#0c1911}.theme-card[data-theme-choice="death"]{--theme-card-a:#302d2e;--theme-card-b:#0b0b0c}.theme-card[data-theme-choice="fire"]{--theme-card-a:#5f2518;--theme-card-b:#1c0906}.theme-card[data-theme-choice="ice"]{--theme-card-a:#24495b;--theme-card-b:#0a1920}.theme-card[data-theme-choice="storm"]{--theme-card-a:#343a56;--theme-card-b:#111420}.theme-card[data-theme-choice="nature"]{--theme-card-a:#4a3922;--theme-card-b:#1c1309}.theme-card[data-theme-choice="shadow"]{--theme-card-a:#3e2855;--theme-card-b:#120b19}.theme-card[data-theme-choice="sacred"]{--theme-card-a:#5b5134;--theme-card-b:#1d1a10}.theme-card[data-theme-choice="arcane"]{--theme-card-a:#263f62;--theme-card-b:#0b1424}
.ornament-choice{margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}.ornament-choice h3{color:var(--gold2)}.ornament-buttons{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.ornament-buttons button{min-height:50px;border:1px solid var(--line);border-radius:14px;background:#152029;color:var(--text);cursor:pointer}.ornament-buttons button.selected{background:var(--gold);color:#111;border-color:var(--gold2);font-weight:bold}

body[data-theme="royal"]{--bg:#071018;--panel:#101920;--panel2:#151e24;--gold:#c89546;--gold2:#f0c979;--line:#6f532e;--cream:#efe2c7;--text:#f7f0e5;--muted:#b6ad9f;--red:#7c171d;--theme-rgb:200,149,70;--ornament:'âœ¦'}
body[data-theme="forest"]{--bg:#07130d;--panel:#102018;--panel2:#172b20;--gold:#79a85e;--gold2:#c9e89b;--line:#466f3b;--cream:#e7e5c9;--text:#f3f5e9;--muted:#aebca8;--red:#742b2c;--theme-rgb:121,168,94;--ornament:'ðŸƒ'}
body[data-theme="death"]{--bg:#0b0b0c;--panel:#181718;--panel2:#232123;--gold:#9c9589;--gold2:#ddd3c1;--line:#5f5b56;--cream:#e9e2d5;--text:#f2eee7;--muted:#aaa39a;--red:#6f1018;--theme-rgb:156,149,137;--ornament:'â˜ '}
body[data-theme="fire"]{--bg:#170806;--panel:#28100c;--panel2:#3a1710;--gold:#db7134;--gold2:#ffd078;--line:#8b3d21;--cream:#f2ddbd;--text:#fff1df;--muted:#c8a58f;--red:#a51219;--theme-rgb:219,113,52;--ornament:'ðŸ”¥'}
body[data-theme="ice"]{--bg:#07141a;--panel:#10262f;--panel2:#183844;--gold:#73bad4;--gold2:#d7f7ff;--line:#46788b;--cream:#e2f2f4;--text:#f1fbff;--muted:#a8c5cc;--red:#7b3140;--theme-rgb:115,186,212;--ornament:'â„'}
body[data-theme="storm"]{--bg:#0c0f1b;--panel:#171c31;--panel2:#222946;--gold:#7586de;--gold2:#d8deff;--line:#4b568f;--cream:#e8e8f4;--text:#f7f7ff;--muted:#b0b4ce;--red:#7f2634;--theme-rgb:117,134,222;--ornament:'âš¡'}
body[data-theme="nature"]{--bg:#161006;--panel:#2a1e10;--panel2:#3a2a17;--gold:#b2864f;--gold2:#ead09b;--line:#6f512d;--cream:#eee0c2;--text:#f8f0df;--muted:#c1ac8c;--red:#7a2622;--theme-rgb:178,134,79;--ornament:'ðŸŒ¾'}
body[data-theme="shadow"]{--bg:#0e0814;--panel:#1e1228;--panel2:#2b1938;--gold:#9a65bd;--gold2:#e4bef6;--line:#67437d;--cream:#eee2f1;--text:#fbf5ff;--muted:#bea9c7;--red:#76233c;--theme-rgb:154,101,189;--ornament:'â˜¾'}
body[data-theme="sacred"]{--bg:#17140b;--panel:#292515;--panel2:#3a3420;--gold:#d4ad46;--gold2:#fff0a8;--line:#816c31;--cream:#fff4d8;--text:#fffdf5;--muted:#d0c6a8;--red:#8a2e30;--theme-rgb:212,173,70;--ornament:'â˜€'}
body[data-theme="arcane"]{--bg:#07101d;--panel:#101d31;--panel2:#172b48;--gold:#4da5d8;--gold2:#a9e8ff;--line:#356c92;--cream:#dcecf4;--text:#f1faff;--muted:#9db9ca;--red:#78264d;--theme-rgb:77,165,216;--ornament:'âœ§'}

body{background:radial-gradient(circle at 45% 0,rgba(var(--theme-rgb),.22) 0,var(--bg) 45%,#020405 100%);transition:background .25s,color .25s}.card,.icon-btn,.select-btn,.metric,.summary-cell,.resource-panel,.skill-row,.tab,.modal{transition:border-color .25s,background .25s,box-shadow .25s,border-radius .25s}.card{position:relative}.card:before,.card:after{pointer-events:none;position:absolute;z-index:2;color:var(--gold2);font-size:17px;line-height:1;text-shadow:0 1px 5px #000}.card:before{content:var(--ornament);left:8px;top:7px}.card:after{content:var(--ornament);right:8px;bottom:7px;transform:rotate(180deg)}
body[data-ornament="subtle"] .card:before,body[data-ornament="subtle"] .card:after{display:none}body[data-ornament="rich"] .card{box-shadow:0 0 0 2px rgba(var(--theme-rgb),.14),var(--shadow)}body[data-ornament="rich"] .card:before,body[data-ornament="rich"] .card:after{font-size:23px;filter:drop-shadow(0 0 5px rgba(var(--theme-rgb),.8))}
body .card:before,body .card:after{display:none!important}
body[data-theme="forest"] .card{border-radius:24px 12px 24px 12px}body[data-theme="death"] .card{border-radius:3px 16px 3px 16px}body[data-theme="fire"] .card{border-radius:22px 5px 22px 5px}body[data-theme="ice"] .card{border-radius:4px 18px 4px 18px}body[data-theme="storm"] .card{border-radius:8px 24px 8px 24px}body[data-theme="nature"] .card{border-radius:28px 10px 28px 10px}body[data-theme="shadow"] .card{border-radius:26px}body[data-theme="sacred"] .card{border-radius:18px 18px 6px 6px}body[data-theme="arcane"] .card{border-radius:50px 12px 50px 12px}
body[data-theme="forest"] .portrait-card,body[data-theme="nature"] .portrait-card{clip-path:polygon(4% 0,96% 0,100% 4%,100% 96%,96% 100%,4% 100%,0 96%,0 4%)}body[data-theme="death"] .portrait-card{clip-path:polygon(7% 0,93% 0,100% 7%,100% 93%,93% 100%,7% 100%,0 93%,0 7%)}
@media(max-width:900px){.theme-gallery{grid-template-columns:repeat(2,1fr)}.theme-intro{display:block}.theme-intro span{display:block;margin-top:5px}}

/* v1.2.1 â€” sÃ©lecteurs compacts et pictogrammes vectoriels en couleur */
.icon-sprite{position:absolute;width:0;height:0;overflow:hidden}
.vicon{width:28px;height:28px;display:inline-block;vertical-align:middle;overflow:visible;filter:drop-shadow(0 2px 3px rgba(0,0,0,.45))}
.icon-btn .vicon,.icon-btn use,.tab .vicon,.tab use,.custom-slot-icon{pointer-events:none}
.brand-mark .vicon{width:42px;height:42px}.placeholder-icon{width:108px;height:108px;opacity:.78}.theme-launch .vicon{width:28px;height:28px}
.label{display:flex;align-items:center;justify-content:center;gap:8px}.summary-cell .label{justify-content:flex-start}
.summary-cell .vicon{width:34px;height:34px}.metric .vicon{width:36px;height:36px}.resource-panel .vicon{width:36px;height:36px}.section-head .vicon{width:34px;height:34px}.tab .vicon{width:32px;height:32px;margin-right:8px}
.stat-card .stat-icon{height:54px;display:grid;place-items:center}.stat-card .stat-icon .vicon{width:50px;height:50px}.skill-icon .vicon{width:29px;height:29px}
.heart{color:#ef4252}.shield{color:#78c9f0}.die{color:#e3aa43}.lightning{color:#ffd14a}.boot{color:#bd8051}.drop{color:#e43143}.brain{color:#d999d7}.flame{color:#ff8a2b}.fist{color:#c88655}.feather,.leaf{color:#67bd68}.book,.books{color:#5c9fe7}.spark,.orb{color:#b579e5}.search{color:#72c9f2}.dagger{color:#dfe8ef}.speech,.lamp{color:#e8aa49}.eye{color:#5bb5e8}.hood{color:#77809a}.helmet{color:#d0a64d}.swords{color:#e2e9ef}.backpack{color:#b8783c}.medical{color:#ed4b5d}.palette{color:#eabf58}

/* Couleurs indÃ©pendantes du style de cadre */
body[data-palette="amber"]{--bg:#120d07;--panel:#241a0e;--panel2:#332313;--gold:#d5a13f;--gold2:#f5dc9a;--line:#765321;--cream:#f3e1bd;--text:#fff8eb;--muted:#c8b28a;--red:#812224;--theme-rgb:213,161,63}
body[data-palette="forest"]{--bg:#07130d;--panel:#102018;--panel2:#172b20;--gold:#77b85b;--gold2:#d3eb9d;--line:#466f3b;--cream:#e7e5c9;--text:#f3f5e9;--muted:#aebca8;--red:#742b2c;--theme-rgb:119,184,91}
body[data-palette="arcane"]{--bg:#07101d;--panel:#10203a;--panel2:#183055;--gold:#6b9de8;--gold2:#b9d8ff;--line:#3e6394;--cream:#dcecf4;--text:#f1faff;--muted:#9db9ca;--red:#78264d;--theme-rgb:107,157,232}
body[data-palette="royal"]{--bg:#100819;--panel:#21112e;--panel2:#321946;--gold:#a16be4;--gold2:#e0c4ff;--line:#68458e;--cream:#eee2f1;--text:#fbf5ff;--muted:#bea9c7;--red:#76233c;--theme-rgb:161,107,228}
body[data-palette="dragon"]{--bg:#170a07;--panel:#2b120d;--panel2:#431c13;--gold:#db674f;--gold2:#ffb48a;--line:#8a3e31;--cream:#f4dcc8;--text:#fff3ea;--muted:#c9a08e;--red:#a51219;--theme-rgb:219,103,79}
body[data-palette="ocean"]{--bg:#06141a;--panel:#0d2932;--panel2:#143c49;--gold:#4ec6d8;--gold2:#a9f0f4;--line:#2d7887;--cream:#ddf1f3;--text:#f0fcff;--muted:#9fc5cc;--red:#7b3140;--theme-rgb:78,198,216}
body[data-palette="steel"]{--bg:#0b0e11;--panel:#1a2025;--panel2:#28313a;--gold:#b6c0c9;--gold2:#eef4f8;--line:#606d78;--cream:#ebeff2;--text:#f8fbfd;--muted:#aeb8c1;--red:#752933;--theme-rgb:182,192,201}
body[data-palette="ember"]{--bg:#170806;--panel:#2b100a;--panel2:#45190e;--gold:#f19b38;--gold2:#ffd081;--line:#944a22;--cream:#f4debd;--text:#fff1df;--muted:#c8a58f;--red:#a51219;--theme-rgb:241,155,56}
body[data-palette="sand"]{--bg:#17130a;--panel:#2a2416;--panel2:#3a321e;--gold:#c8b37b;--gold2:#f2e0ab;--line:#74653d;--cream:#f0e4c7;--text:#fff8e7;--muted:#c7b893;--red:#7a342d;--theme-rgb:200,179,123}
body[data-palette="contrast"]{--bg:#050505;--panel:#121212;--panel2:#202000;--gold:#f2dc00;--gold2:#fff67a;--line:#827700;--cream:#ffffff;--text:#ffffff;--muted:#d4d4d4;--red:#e5202f;--theme-rgb:242,220,0}

/* Styles de cadres indÃ©pendants de la palette */
body[data-frame="classic"]{--ornament:'âœ¦'}
body[data-frame="forest"]{--ornament:'â§'}body[data-frame="forest"] .card{border-radius:25px 9px 25px 9px;border-width:2px}body[data-frame="forest"] .card:before,body[data-frame="forest"] .card:after{content:'â§';font-size:25px}
body[data-frame="death"]{--ornament:'â˜ '}body[data-frame="death"] .card{border-radius:2px 15px 2px 15px;border-width:2px}body[data-frame="death"] .card:before,body[data-frame="death"] .card:after{content:'â˜ ';font-size:21px}
body[data-frame="fire"]{--ornament:'â™¨'}body[data-frame="fire"] .card{border-radius:22px 3px 22px 3px;border-width:2px}body[data-frame="fire"] .card:before,body[data-frame="fire"] .card:after{content:'â™¨';font-size:23px}
body[data-frame="ice"]{--ornament:'â„'}body[data-frame="ice"] .card{border-radius:2px 17px 2px 17px;clip-path:polygon(8px 0,calc(100% - 8px) 0,100% 8px,100% calc(100% - 8px),calc(100% - 8px) 100%,8px 100%,0 calc(100% - 8px),0 8px)}
body[data-frame="storm"]{--ornament:'ÏŸ'}body[data-frame="storm"] .card{border-radius:7px 24px 7px 24px;border-width:2px}body[data-frame="storm"] .card:before,body[data-frame="storm"] .card:after{content:'ÏŸ';font-size:26px}
body[data-frame="earth"]{--ornament:'â—†'}body[data-frame="earth"] .card{border-radius:18px 8px 18px 8px;border-width:3px;border-style:double}
body[data-frame="shadow"]{--ornament:'â˜¾'}body[data-frame="shadow"] .card{border-radius:28px;box-shadow:inset 0 0 30px rgba(0,0,0,.45),var(--shadow)}
body[data-frame="sacred"]{--ornament:'âœ¥'}body[data-frame="sacred"] .card{border-radius:20px 20px 5px 5px;border-width:2px}body[data-frame="sacred"] .card:before,body[data-frame="sacred"] .card:after{content:'âœ¥';font-size:24px}
body[data-frame="arcane"]{--ornament:'â—ˆ'}body[data-frame="arcane"] .card{border-radius:38px 10px 38px 10px;border-width:2px}body[data-frame="arcane"] .card:before,body[data-frame="arcane"] .card:after{content:'â—ˆ';font-size:22px}

/* FenÃªtre d'apparence compacte, inspirÃ©e des boutons de Gestion D&D */
.appearance-section{border:1px solid var(--line);border-radius:20px;padding:15px;margin-bottom:16px;background:linear-gradient(145deg,rgba(var(--theme-rgb),.12),rgba(0,0,0,.18))}
.appearance-title{display:flex;align-items:center;gap:12px;margin-bottom:12px}.appearance-title .vicon{width:42px;height:42px}.appearance-title h3{margin:0;color:var(--cream);font-size:22px}.appearance-title p{margin:3px 0 0;color:var(--muted)}
.palette-grid{display:grid;grid-template-columns:repeat(5,minmax(135px,1fr));gap:10px}.palette-choice{min-height:58px;display:flex;align-items:center;gap:10px;padding:8px 12px;border:2px solid rgba(255,255,255,.24);border-radius:14px;background:linear-gradient(135deg,var(--c2),var(--c1));color:#fff;text-shadow:0 1px 3px #000;cursor:pointer;box-shadow:inset 0 0 16px rgba(255,255,255,.08)}.palette-choice:hover{filter:brightness(1.12)}.palette-choice.selected{border-color:var(--c3);box-shadow:0 0 0 3px color-mix(in srgb,var(--c1) 42%,transparent),inset 0 0 18px rgba(255,255,255,.2)}.palette-orb{position:relative;width:36px;height:36px;flex:0 0 36px;border-radius:50%;background:var(--c1);border:2px solid var(--c3);box-shadow:inset 0 0 8px rgba(255,255,255,.45),0 2px 6px #000}.palette-orb i{position:absolute;width:9px;height:9px;border-radius:50%;border:1px solid #fff}.palette-orb i:nth-child(1){left:2px;top:2px;background:var(--c3)}.palette-orb i:nth-child(2){right:1px;top:11px;background:var(--c2)}.palette-orb i:nth-child(3){left:13px;bottom:1px;background:var(--c1)}.palette-choice strong{font-size:16px}
.frame-grid{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:10px}.frame-choice{min-height:67px;display:flex;align-items:center;gap:10px;padding:8px 11px;border:2px solid var(--line);background:#11191f;color:var(--text);cursor:pointer}.frame-choice .vicon{width:41px;height:41px;flex:0 0 41px}.frame-choice span{text-align:left}.frame-choice strong,.frame-choice small{display:block}.frame-choice small{margin-top:2px;color:var(--muted)}.frame-choice.selected{border-color:var(--gold2);background:linear-gradient(135deg,rgba(var(--theme-rgb),.28),#11191f);box-shadow:0 0 0 3px rgba(var(--theme-rgb),.17)}.frame-choice[data-frame-choice="classic"]{border-radius:12px}.frame-choice[data-frame-choice="forest"]{border-radius:22px 6px 22px 6px}.frame-choice[data-frame-choice="death"]{border-radius:2px 12px 2px 12px}.frame-choice[data-frame-choice="fire"]{border-radius:18px 3px 18px 3px}.frame-choice[data-frame-choice="ice"]{border-radius:2px 16px 2px 16px}.frame-choice[data-frame-choice="storm"]{border-radius:6px 22px 6px 22px}.frame-choice[data-frame-choice="earth"]{border-radius:13px;border-style:double;border-width:4px}.frame-choice[data-frame-choice="shadow"]{border-radius:25px}.frame-choice[data-frame-choice="sacred"]{border-radius:18px 18px 4px 4px}.frame-choice[data-frame-choice="arcane"]{border-radius:28px 7px 28px 7px}
@media(max-width:900px){.palette-grid,.frame-grid{grid-template-columns:repeat(2,1fr)}}

/* v1.2.2 â€” pictogrammes illustrÃ©s plus grands + fenÃªtres accessibles iPad */
.summary-cell,.metric,.resource-panel{position:relative}
.label.large-left{display:grid;grid-template-columns:72px 1fr;align-items:center;gap:14px;text-align:left;justify-content:flex-start}
.label.large-left .label-text{display:block;line-height:1.1}
.label.large-left .vicon{width:72px;height:72px;filter:drop-shadow(0 4px 6px rgba(0,0,0,.5)) saturate(1.15)}
.summary-cell{display:flex;flex-direction:column;justify-content:center;padding:16px 20px 16px 18px}
.summary-cell .summary-value{padding-left:86px;margin-top:4px;font-size:clamp(38px,4.3vw,68px);line-height:1.05}
.summary-cell > div:not(.label){padding-left:86px}
.metrics .metric{display:flex;flex-direction:column;justify-content:center;align-items:stretch;padding:14px 18px}
.metric .label.large-left{grid-template-columns:64px 1fr}
.metric .label.large-left .vicon{width:64px;height:64px}
.metric strong{padding-left:78px;text-align:left;font-size:42px;line-height:1.1}
.metric .wound-dots{justify-content:flex-start;padding-left:78px;margin-top:10px}
.resource-panel{padding:16px 18px;text-align:left}
.resource-panel .label.large-left{grid-template-columns:66px 1fr}
.resource-panel .label.large-left .vicon{width:66px;height:66px}
.resource-panel .action-gems,.resource-panel .resource-dots{justify-content:flex-start;padding-left:80px}
.resource-panel > div:last-child{padding-left:80px;font-size:24px;line-height:1.25}
.stat-card{padding:14px 14px 12px;min-height:188px}
.stat-layout{display:grid;grid-template-columns:76px 1fr;gap:14px;align-items:center;min-height:120px}
.stat-card .stat-icon{height:76px;width:76px;display:grid;place-items:center;align-self:start}
.stat-card .stat-icon .vicon{width:70px;height:70px;filter:drop-shadow(0 4px 6px rgba(0,0,0,.28))}
.stat-copy{display:flex;flex-direction:column;align-items:flex-start;text-align:left}
.stat-copy .label{justify-content:flex-start;font-size:16px;letter-spacing:.07em}
.stat-copy strong{display:block;font-size:54px;margin:6px 0 8px}
.stat-copy em{padding:6px 14px;border-radius:8px;font-size:23px}
.stat-abbr{padding-left:90px;text-align:left;font-size:20px;font-weight:bold;letter-spacing:.12em;color:#403324}
.skill-row{grid-template-columns:44px 1fr 52px 66px 56px;min-height:62px;padding:9px 10px}
.skill-icon .vicon{width:36px;height:36px}
.skill-value{font-size:22px}
.skill-rank{font-size:20px}
.section-head span{display:flex;align-items:center;gap:10px}
.section-head .vicon{width:40px;height:40px}
.tab{display:flex;align-items:center;justify-content:center;gap:10px}
.tab .vicon{width:36px;height:36px;margin-right:0}

.modal{width:min(900px,96vw);max-height:92vh;overflow:auto;background:linear-gradient(145deg,#1a2730,#0c1318);border:2px solid var(--gold);border-radius:22px;padding:28px 30px;box-shadow:0 30px 80px #000}
.modal.modal-wide{width:min(1240px,97vw)}
.modal h2{margin:0 0 18px;color:var(--gold2);font-size:clamp(30px,3vw,44px);line-height:1.1}
.modal label,.field-label{display:block;margin:14px 0 8px;color:var(--cream);font-size:24px;font-weight:bold;line-height:1.2}
.modal input,.modal select,.modal textarea,.big-input{width:100%;padding:16px 18px;border:2px solid #98713a;border-radius:16px;background:#f7efdf;color:#10171b;font-size:30px;line-height:1.2;min-height:76px}
.modal textarea{min-height:180px;resize:vertical}
.modal select{background:#f7efdf}
.quick-buttons{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:18px 0}
.quick-buttons button,.modal-actions button{padding:14px 16px;border:1px solid var(--line);border-radius:16px;background:#1a252c;color:var(--text);cursor:pointer;font-size:28px;min-height:78px}
.modal-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px;flex-wrap:wrap}
.modal-actions .save{background:#8a5c24;color:#fff}
.modal-help{color:var(--muted);line-height:1.45;font-size:22px}
.portrait-picker{display:grid;grid-template-columns:minmax(240px,340px) 1fr;gap:24px;align-items:center}
.portrait-picker img{width:100%;height:420px;max-height:420px;object-fit:contain;border:1px solid var(--gold);border-radius:14px;background:#080d10}
.file-button,.secondary-button{display:inline-flex;align-items:center;justify-content:center;min-height:72px;padding:14px 18px;border:1px solid var(--gold);border-radius:14px;background:#714b20;color:#fff;cursor:pointer;font-size:25px}
.secondary-button{background:#18232b;margin-top:12px}
.die-value-picker{display:grid;grid-template-columns:repeat(auto-fit,minmax(92px,1fr));gap:12px;margin:16px 0 18px}
.die-value-picker button{min-height:78px;border:1px solid var(--line);border-radius:14px;background:#152029;color:var(--gold2);font-size:30px;cursor:pointer}
.die-value-picker button.selected{background:#9a671f;color:#fff;box-shadow:0 0 0 2px var(--gold2)}
.inventory-editor textarea{min-height:170px}
.inventory-unified{display:grid;gap:16px}
.inventory-unified-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.inventory-unified-summary span{display:grid;gap:5px;min-height:82px;place-content:center;text-align:center;border:1px solid rgba(216,174,90,.46);border-radius:8px;background:#101820;padding:10px}
.inventory-unified-summary b{color:var(--gold2);font-size:14px;text-transform:uppercase;letter-spacing:0}
.inventory-unified-summary strong{color:var(--cream);font-size:30px}
.inventory-unified-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.inventory-sheet-item{display:grid;gap:10px;min-width:0;padding:14px;border:1px solid rgba(216,174,90,.46);border-radius:8px;background:linear-gradient(145deg,rgba(22,31,37,.98),rgba(9,15,19,.98));transition:opacity .16s,filter .16s}
.inventory-sheet-item.unequipped{opacity:.62;filter:saturate(.55)}
.inventory-sheet-item header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px}
.inventory-sheet-item header span{min-width:0}
.inventory-sheet-item h3{margin:3px 0 0;color:var(--cream);font-size:22px;overflow-wrap:anywhere}
.inventory-sheet-item small{color:var(--gold2);font-weight:900;text-transform:uppercase;letter-spacing:0}
.inventory-sheet-item p{margin:5px 0;color:var(--muted);line-height:1.35}
.inventory-sheet-item p strong{color:var(--cream);font-size:20px}
.inventory-equip-toggle{min-width:108px;min-height:48px;border:1px solid rgba(255,223,156,.65);border-radius:8px;padding:8px 12px;background:#172229;color:var(--cream);font-weight:900;cursor:pointer}
.inventory-equip-toggle.on{background:linear-gradient(180deg,#347941,#174b25);border-color:#9ee19e;color:#f4ffed}
.inventory-equip-toggle.off{background:#22282d;color:#c7c7c7}
.inventory-sheet-empty{grid-column:1/-1;min-height:160px;display:grid;place-content:center;text-align:center;border:1px dashed rgba(216,174,90,.46);border-radius:8px;background:rgba(8,13,18,.5)}
.inventory-sheet-empty strong{color:var(--gold2);font-size:22px}
@media(max-width:760px){.inventory-unified-grid{grid-template-columns:1fr}.inventory-unified-summary{grid-template-columns:1fr 1fr}.inventory-unified-summary span:last-child{grid-column:1/-1}.inventory-sheet-item header{align-items:stretch;grid-template-columns:1fr}.inventory-equip-toggle{width:100%}}
.appearance-title .vicon{width:48px;height:48px}

@media (max-width:1100px){
  .quick-buttons{grid-template-columns:repeat(2,1fr)}
  .modal{width:97vw;padding:24px 20px}
  .portrait-picker{grid-template-columns:1fr}
}
@media (max-width:900px){
  .sheet-grid{grid-template-columns:1fr;grid-template-rows:auto}
  .summary-card,.metrics,.skills-panel,.resources,.tabs,.tab-content,.stats-panel{grid-column:auto}
  .stats-panel{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:720px){
  .stats-panel{grid-template-columns:1fr}
  .summary-card{grid-template-columns:1fr}
  .metrics{grid-template-columns:1fr 1fr}
  .resources{grid-template-columns:1fr}
  .quick-buttons{grid-template-columns:1fr}
  .modal h2{font-size:28px}
  .modal input,.modal select,.modal textarea,.big-input{font-size:26px;min-height:70px}
}

/* v1.2.3 â€” top cards simplified: icon left, value right; better badge and icon emphasis */
.level-badge{bottom:16px;left:18px;transform:none;width:88px;height:88px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:0;background:radial-gradient(circle at 35% 30%,#fff1b0 0,#d8a24d 30%,#7a4b16 70%,#26160a 100%);border:3px solid #f6d28a;clip-path:none;box-shadow:0 6px 18px rgba(0,0,0,.5), inset 0 0 12px rgba(255,255,255,.22)}
.level-badge strong{font-size:34px;line-height:1;color:#fff7dc;text-shadow:0 2px 4px rgba(0,0,0,.45)}
.level-badge span{font-size:13px;letter-spacing:.16em;color:#24150a;background:rgba(255,245,214,.9);padding:2px 7px;border-radius:999px;font-weight:bold}

.summary-card,.metrics{align-items:stretch}
.summary-cell,.metric,.resource-panel{padding:16px 18px;display:flex;flex-direction:column;justify-content:center}
.summary-cell .value-line,.metric .value-line,.resource-panel .value-line{display:flex;align-items:center;gap:16px;min-height:86px}
.summary-cell .vicon,.metric .vicon,.resource-panel .vicon{width:68px;height:68px;flex:0 0 68px;filter:drop-shadow(0 4px 6px rgba(0,0,0,.55))}
.summary-cell .summary-value,.metric strong,.resource-value{font-size:clamp(48px,4vw,66px);line-height:1.02;margin:0;color:var(--cream);font-weight:700;text-shadow:0 2px 6px rgba(0,0,0,.35)}
.summary-cell .value-stack,.resource-panel .value-stack{display:flex;flex-direction:column;justify-content:center}
.summary-cell .summary-sub,.resource-panel .summary-sub{font-size:20px;line-height:1.15;color:var(--gold2);text-transform:uppercase;letter-spacing:.08em;margin-top:4px}
.summary-cell > div:not(.value-line){padding-left:0}
.metric .wound-dots{justify-content:flex-start;margin-top:0;gap:10px;flex-wrap:nowrap}
.metric .dot{width:30px;height:30px}
.resource-panel .action-gems,.resource-panel .resource-dots{justify-content:flex-start;padding-left:84px;margin-top:4px}
.resource-panel .gem{width:34px;height:34px}.resource-panel .die-slot{width:56px;height:56px}
.resource-panel .die-slot strong{font-size:26px}.resource-panel .die-slot small{font-size:11px}

.stat-card{padding:12px 14px 10px;min-height:150px}
.stat-layout.compact{display:grid;grid-template-columns:66px 1fr;gap:12px;align-items:center;min-height:92px}
.stat-card .stat-icon{width:66px;height:66px;display:grid;place-items:center}.stat-card .stat-icon .vicon{width:60px;height:60px}
.stat-copy.compact{display:flex;align-items:center;gap:12px;justify-content:flex-start;text-align:left}
.stat-copy.compact strong{font-size:56px;line-height:1;margin:0}.stat-copy.compact em{font-size:26px;padding:4px 12px;border-radius:10px;line-height:1.1}
.stat-abbr{padding-left:78px;font-size:30px;line-height:1.1}

/* make specific icons a bit more prominent */
.vicon.die,.summary-cell .die,.resource-panel .die{transform:translateY(-1px)}
.skill-icon .vicon{width:34px;height:34px}

@media (max-width:1300px){
  .summary-cell .summary-value,.metric strong,.resource-value{font-size:clamp(42px,3.7vw,58px)}
}
@media (max-width:900px){
  .summary-cell .vicon,.metric .vicon,.resource-panel .vicon{width:58px;height:58px;flex-basis:58px}
  .summary-cell .summary-value,.metric strong,.resource-value{font-size:42px}
  .resource-panel .action-gems,.resource-panel .resource-dots{padding-left:74px}
  .stat-copy.compact strong{font-size:48px}
}

/* v1.2.4 â€” grandes illustrations rÃ©alistes Ã  gauche, chiffres gÃ©ants Ã  droite */
:root{
  --summary-tile-h: 132px;
  --metric-tile-h: 102px;
  --resource-tile-h: 136px;
  --icon-col-summary: 150px;
  --icon-col-metric: 120px;
  --icon-col-resource: 150px;
}
.summary-cell,.metric,.resource-panel{padding:0 14px;overflow:hidden}
.summary-cell{min-height:var(--summary-tile-h)}
.metric{min-height:var(--metric-tile-h)}
.resource-panel{min-height:var(--resource-tile-h)}
.summary-cell .value-line,.metric .value-line,.resource-panel .value-line,.summary-cell .label,.metric .label,.resource-panel .label{display:none !important}
.tile-shell{height:100%;display:grid;grid-template-columns:var(--icon-col) 1fr;align-items:stretch}
.summary-cell .tile-shell{--icon-col:var(--icon-col-summary)}
.metric .tile-shell{--icon-col:var(--icon-col-metric)}
.resource-panel .tile-shell{--icon-col:var(--icon-col-resource)}
.tile-icon-wrap{height:100%;display:flex;align-items:center;justify-content:center;padding:0 4px}
.tile-image,.tile-svg{display:block;height:50%;width:auto;max-width:100%;object-fit:contain;filter:drop-shadow(0 4px 10px rgba(0,0,0,.45))}
.tile-svg{height:48%;width:auto}
.tile-main{height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;min-width:0;padding:10px 6px 8px}
.tile-value{font-family:Georgia,serif;font-weight:700;color:var(--cream);line-height:.95;font-size:clamp(42px,4.2vw,88px);text-shadow:0 2px 6px rgba(0,0,0,.42);white-space:nowrap}
.summary-cell .tile-value{font-size:clamp(42px,4vw,82px)}
.summary-cell .hp-value{font-size:clamp(36px,3.5vw,74px)}
.metric .tile-value{font-size:clamp(46px,4.2vw,80px)}
.resource-panel .tile-value{font-size:clamp(38px,3.7vw,72px)}
.tile-meta{margin-top:6px;font-size:16px;line-height:1.1;color:var(--gold2);text-transform:uppercase;letter-spacing:.08em}
.metric .tile-meta,.summary-cell .tile-meta{font-size:15px}
.metric .wound-dots,.resource-panel .action-gems,.resource-panel .resource-dots{justify-content:center;padding-left:0;margin-top:8px}
.metric .wound-dots{gap:8px;flex-wrap:nowrap}
.metric .dot{width:24px;height:24px}
.resource-panel .gem{width:30px;height:30px}.resource-panel .die-slot{width:54px;height:54px}
.resource-panel .die-slot strong{font-size:25px}.resource-panel .die-slot small{font-size:10px}

/* retire un peu d'espace des vieux blocs pour laisser respirer les nouvelles tuiles */
.summary-card{gap:0}.metrics{gap:0}.resources{gap:8px}

@media (max-width:1500px){
  :root{--icon-col-summary:132px;--icon-col-resource:132px;--icon-col-metric:108px}
  .summary-cell .tile-value{font-size:clamp(40px,3.7vw,76px)}
  .metric .tile-value{font-size:clamp(42px,3.7vw,68px)}
  .resource-panel .tile-value{font-size:clamp(34px,3.4vw,60px)}
}
@media (max-width:1100px){
  :root{--summary-tile-h:118px;--resource-tile-h:124px;--metric-tile-h:94px;--icon-col-summary:116px;--icon-col-resource:116px;--icon-col-metric:98px}
  .tile-value{white-space:normal}
  .metric .wound-dots{flex-wrap:wrap}
}

/* v1.2.6 â€” icÃ´nes toutes distinctes + portion droite des compÃ©tences remontÃ©e jusqu'en haut */
.sheet-grid{
  grid-template-columns:minmax(220px,240px) minmax(340px,0.95fr) minmax(600px,1.45fr);
  grid-template-rows:auto auto auto auto auto;
}
.portrait-card{grid-column:1;grid-row:1 / 3;height:320px;min-height:320px;max-height:320px}
.summary-card{grid-column:2;grid-row:1;grid-template-columns:1.15fr .85fr .9fr;min-height:132px}
.metrics{grid-column:2;grid-row:2;grid-template-columns:repeat(4,1fr);min-height:92px}
.skills-panel{grid-column:3;grid-row:1 / 5;align-self:stretch;min-height:0;height:100%}
.stats-panel{grid-column:1 / 3;grid-row:3}
.resources{grid-column:1 / 3;grid-row:4}
.tabs{grid-column:1 / 4;grid-row:5}
.tab-content{grid-column:1 / 4}

:root{--summary-tile-h:132px;--metric-tile-h:92px;--resource-tile-h:126px}
.summary-cell,.metric,.resource-panel{padding:0 10px}
.summary-cell{min-height:var(--summary-tile-h)}
.metric{min-height:var(--metric-tile-h)}
.resource-panel{min-height:var(--resource-tile-h)}
.tile-shell{grid-template-columns:84px 1fr;column-gap:10px}
.tile-icon-wrap{width:84px;justify-self:center;padding:0}
.tile-image,.tile-svg{width:60px;height:60px;max-width:60px;max-height:60px;object-fit:contain}
.summary-cell .tile-main,.metric .tile-main,.resource-panel .tile-main{padding:6px 2px 6px 0}
.summary-cell .tile-value{font-size:clamp(42px,3.3vw,70px)}
.summary-cell .hp-value{font-size:clamp(34px,2.8vw,58px)}
.metric .tile-value{font-size:clamp(38px,3vw,58px)}
.resource-panel .tile-value{font-size:clamp(34px,2.8vw,52px)}
.tile-meta{font-size:15px;margin-top:2px}
.metric .wound-dots,.resource-panel .action-gems,.resource-panel .resource-dots{margin-top:6px}
.skills-panel{padding:14px 16px}
.section-head{font-size:24px;margin-bottom:14px}
.skills-list{grid-template-columns:1fr;gap:9px}
.skill-row{grid-template-columns:42px 1fr 52px 60px 56px;min-height:61px;padding:10px 12px}
.skill-icon .vicon{width:34px;height:34px}

/* carrÃ©s d'image vraiment compacts */
.tile-icon-wrap::before{content:'';display:block;width:60px;height:60px;position:absolute;opacity:0}
.tile-icon-wrap{position:relative;height:100%;display:flex;align-items:center;justify-content:center}

@media(max-width:1280px){
  .sheet-grid{grid-template-columns:220px minmax(300px,0.9fr) minmax(470px,1.25fr)}
  .tile-shell{grid-template-columns:76px 1fr}
  .tile-icon-wrap{width:76px}.tile-image,.tile-svg{width:54px;height:54px;max-width:54px;max-height:54px}
  .summary-cell .tile-value{font-size:clamp(36px,3vw,58px)}
  .metric .tile-value{font-size:clamp(32px,2.8vw,50px)}
  .resource-panel .tile-value{font-size:clamp(30px,2.6vw,46px)}
}
@media(max-width:1050px){
  .sheet-grid{grid-template-columns:230px 1fr;grid-template-rows:auto}
  .portrait-card{grid-column:1;grid-row:1 / 3}
  .summary-card,.metrics{grid-column:2}
  .skills-panel{grid-column:1 / 3;grid-row:auto;height:auto}
  .stats-panel,.resources,.tabs,.tab-content{grid-column:1 / 3}
  .skills-list{grid-template-columns:1fr 1fr}
}
@media(max-width:720px){
  .skills-list{grid-template-columns:1fr}
  .tile-shell{grid-template-columns:72px 1fr}
  .tile-icon-wrap{width:72px}.tile-image,.tile-svg{width:50px;height:50px;max-width:50px;max-height:50px}
}

/* v1.3.0 â€” images de cases Ã  90%, stats harmonisÃ©es, compÃ©tences en deux colonnes plus grosses */
:root{
  --summary-tile-h: 136px;
  --metric-tile-h: 98px;
  --resource-tile-h: 132px;
  --summary-icon-box: 122px;
  --metric-icon-box: 88px;
  --resource-icon-box: 118px;
}
.summary-cell{min-height:var(--summary-tile-h)}
.metric{min-height:var(--metric-tile-h)}
.resource-panel{min-height:var(--resource-tile-h)}
.summary-cell .tile-shell{grid-template-columns:var(--summary-icon-box) 1fr}
.metric .tile-shell{grid-template-columns:var(--metric-icon-box) 1fr}
.resource-panel .tile-shell{grid-template-columns:var(--resource-icon-box) 1fr}
.summary-cell .tile-icon-wrap{width:var(--summary-icon-box);height:100%}
.metric .tile-icon-wrap{width:var(--metric-icon-box);height:100%}
.resource-panel .tile-icon-wrap{width:var(--resource-icon-box);height:100%}
.summary-cell .tile-image,.summary-cell .tile-svg{width:90%;height:90%;max-width:90%;max-height:90%}
.metric .tile-image,.metric .tile-svg{width:90%;height:90%;max-width:90%;max-height:90%}
.resource-panel .tile-image,.resource-panel .tile-svg{width:90%;height:90%;max-width:90%;max-height:90%}

/* Stats: mÃªme logique visuelle que les autres cases */
.stats-panel{grid-template-columns:repeat(2,1fr);gap:12px}
.stat-card{min-height:126px;padding:0 10px;display:flex;align-items:center;background:linear-gradient(#f6ebd5,#e3d2af)}
.stat-layout.compact{grid-template-columns:86px 1fr;gap:12px;align-items:center;min-height:100px;width:100%}
.stat-card .stat-icon{width:86px;height:100px;display:flex;align-items:center;justify-content:center}
.stat-card .stat-icon .vicon{width:78px;height:78px;filter:drop-shadow(0 3px 4px rgba(0,0,0,.18))}
.stat-copy.compact{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-width:0;width:100%}
.stat-copy.compact strong{font-size:60px;line-height:.95;margin:0}
.stat-copy.compact em{font-size:24px;line-height:1;padding:5px 14px;border-radius:10px}
.stat-abbr{display:block;position:absolute;right:18px;bottom:10px;padding-left:0;font-size:28px;line-height:1;color:#4b3723;letter-spacing:.10em}
.stat-card{position:relative}

/* CompÃ©tences en deux colonnes et plus grosses */
.skills-panel{padding:16px 16px 14px}
.section-head{font-size:26px;margin-bottom:14px}
.skills-list{grid-template-columns:1fr 1fr;gap:10px}
.skill-row{grid-template-columns:48px 1fr 58px 68px 58px;min-height:74px;padding:12px 14px}
.skill-icon .vicon{width:40px;height:40px}
.skill-row span:nth-child(2){font-size:24px}
.skill-stat{font-size:15px}
.skill-value{font-size:24px}
.skill-rank{font-size:24px;letter-spacing:1px}

/* colonne droite prend bien sa place */
.sheet-grid{grid-template-columns:minmax(220px,240px) minmax(340px,0.95fr) minmax(640px,1.6fr)}
.skills-panel{grid-column:3;grid-row:1 / 5}

/* petits ajustements des ressources */
.metric .wound-dots{margin-top:4px;gap:8px}
.metric .dot{width:24px;height:24px}
.resource-panel .action-gems,.resource-panel .resource-dots{margin-top:4px}
.resource-panel .gem{width:32px;height:32px}
.resource-panel .die-slot{width:52px;height:52px}

@media(max-width:1500px){
  .sheet-grid{grid-template-columns:220px minmax(300px,0.95fr) minmax(520px,1.4fr)}
  .skill-row span:nth-child(2){font-size:21px}
}
@media(max-width:1200px){
  .stats-panel{grid-template-columns:repeat(2,1fr)}
  .skills-list{grid-template-columns:1fr}
}
@media(max-width:1050px){
  .stats-panel{grid-template-columns:repeat(2,1fr)}
  .skills-list{grid-template-columns:1fr 1fr}
}
@media(max-width:720px){
  .stats-panel{grid-template-columns:1fr 1fr}
  .skills-list{grid-template-columns:1fr}
  .summary-cell .tile-shell{grid-template-columns:86px 1fr}
  .metric .tile-shell{grid-template-columns:74px 1fr}
  .resource-panel .tile-shell{grid-template-columns:82px 1fr}
}

/* v1.3.0 â€” cinquiÃ¨me onglet Ressources de classe */
.tabs{grid-template-columns:repeat(5,1fr)}
@media(max-width:900px){.tab{font-size:15px}.tab .vicon{width:30px;height:30px}}

/* v1.3.5 â€” page plein Ã©cran des pouvoirs et lecture exacte */
.tabs{grid-template-columns:repeat(6,1fr)}
body.overlay-open{overflow:hidden}
.powers-page{position:fixed;inset:0;z-index:300;display:none;flex-direction:column;background:radial-gradient(circle at 35% 0,rgba(var(--theme-rgb),.22),var(--bg) 42%,#020405 100%);color:var(--text);padding:0;overflow:hidden}
.powers-page.open{display:flex}
.powers-header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 28px;border-bottom:2px solid var(--gold);background:linear-gradient(135deg,var(--panel2),var(--panel));box-shadow:0 5px 22px rgba(0,0,0,.45)}
.powers-header h2{margin:0;font-size:clamp(34px,4vw,58px);color:var(--cream)}
.powers-header p{margin:6px 0 0;font-size:22px;color:var(--gold2)}
.powers-close{min-width:170px;min-height:68px;padding:12px 20px;border:2px solid var(--gold2);border-radius:16px;background:#18232b;color:#fff;font-size:25px;font-weight:bold;cursor:pointer}
.powers-grid{flex:1;overflow:auto;padding:24px 28px 42px;display:grid;grid-template-columns:repeat(3,minmax(280px,1fr));gap:18px;align-content:start}
.power-card{display:flex;flex-direction:column;min-height:230px;padding:20px 22px;text-align:left;border:2px solid var(--line);border-radius:20px;background:linear-gradient(145deg,rgba(var(--theme-rgb),.2),var(--panel));color:var(--text);box-shadow:0 12px 30px rgba(0,0,0,.28);cursor:pointer}
.power-card:hover,.power-card:focus{border-color:var(--gold2);filter:brightness(1.12);transform:translateY(-2px)}
.power-card-top{display:flex;justify-content:space-between;gap:12px;margin-bottom:12px}
.power-group,.power-level{display:inline-flex;align-items:center;min-height:38px;padding:5px 11px;border-radius:999px;background:#101820;border:1px solid var(--line);color:var(--gold2);font-size:17px;font-weight:bold}
.power-card h3{margin:0 0 12px;font-size:29px;line-height:1.1;color:var(--cream)}
.power-card p{margin:0;flex:1;font-size:21px;line-height:1.42;color:var(--text)}
.power-read{margin-top:16px;color:var(--gold2);font-size:20px;font-weight:bold}
.power-empty{grid-column:1/-1;padding:60px 30px;text-align:center;border:2px dashed var(--line);border-radius:20px;font-size:24px}
.power-detail-backdrop{position:fixed;inset:0;z-index:350;display:none;place-items:center;padding:26px;background:rgba(0,0,0,.78)}
.power-detail-backdrop.open{display:grid}
.power-detail-modal{width:min(920px,94vw);max-height:88vh;display:flex;flex-direction:column;overflow:hidden;border:3px solid var(--gold);border-radius:24px;background:linear-gradient(145deg,#1b2831,#090f13);box-shadow:0 30px 90px #000}
.power-detail-modal header{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;padding:24px 26px 18px;border-bottom:1px solid var(--line)}
.power-detail-modal h2{margin:0;font-size:clamp(32px,4vw,48px);color:var(--cream)}
.power-detail-modal header p{margin:7px 0 0;color:var(--gold2);font-size:20px}
.power-detail-text{padding:28px 32px;overflow:auto;white-space:pre-wrap;font-size:26px;line-height:1.55;color:#fff8e9}
.power-detail-modal footer{padding:13px 26px;border-top:1px solid var(--line);color:var(--muted);font-size:16px}
@media(max-width:1200px){.powers-grid{grid-template-columns:repeat(2,minmax(280px,1fr))}}
@media(max-width:760px){.tabs{grid-template-columns:repeat(3,1fr)}.powers-header{padding:16px;align-items:flex-start}.powers-close{min-width:120px;min-height:60px;font-size:21px}.powers-grid{grid-template-columns:1fr;padding:16px}.power-card{min-height:200px}.power-detail-text{font-size:23px;padding:22px}.power-detail-modal header{padding:18px}}

/* v1.3.5 â€” DOIH sous les points d'action */
.resources{align-items:stretch}
.resource-panel.action-panel{min-height:250px}
.resource-panel.action-panel .tile-shell{grid-template-columns:112px 1fr;align-items:stretch}
.resource-panel.action-panel .tile-icon-wrap{align-items:flex-start;padding-top:24px}
.resource-panel.action-panel .tile-image{width:96px;height:96px;max-width:96px;max-height:96px}
.action-main{justify-content:flex-start!important;padding-top:10px!important;padding-bottom:12px!important}
.action-count{line-height:.9;margin-top:0}
.action-panel .action-gems{margin:4px 0 10px}
.doih-actions{width:100%;display:grid;grid-template-columns:repeat(4,minmax(92px,1fr));gap:10px;margin-top:auto}
.doih-btn{min-width:0;min-height:112px;padding:5px 5px 7px;border:2px solid var(--line);border-radius:12px;background:#0d1419;color:var(--cream);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;overflow:hidden}
.doih-btn img{display:block;width:78px;height:78px;object-fit:cover;border-radius:50%;box-shadow:0 3px 10px rgba(0,0,0,.5)}
.doih-btn span{font-size:15px;font-weight:700;line-height:1.05;text-align:center}
.doih-btn.available{border-color:var(--gold);box-shadow:inset 0 0 14px rgba(var(--theme-rgb),.15)}
.doih-btn.used{border-color:#555;opacity:.68;background:#121416;color:#aaa}
.doih-btn.used img{filter:grayscale(1);opacity:.72}
.doih-btn:hover{filter:brightness(1.14)}
.doih-btn:focus-visible{outline:4px solid var(--gold2);outline-offset:2px}

@media(max-width:1400px){
  .doih-actions{gap:7px;grid-template-columns:repeat(4,minmax(76px,1fr))}
  .doih-btn{min-height:100px}.doih-btn img{width:66px;height:66px}.doih-btn span{font-size:13px}
}
@media(max-width:1050px){
  .resource-panel.action-panel{min-height:232px}
  .doih-btn img{width:72px;height:72px}
}
@media(max-width:720px){
  .doih-actions{grid-template-columns:repeat(2,1fr)}
  .resource-panel.action-panel{min-height:360px}
  .doih-btn{min-height:128px}.doih-btn img{width:88px;height:88px}.doih-btn span{font-size:17px}
}

/* v1.3.5 â€” corrections portrait, DOIH, blessures, compÃ©tences et page Pouvoirs */

/* DOIH : occupe toute la largeur sous le compteur et commence complÃ¨tement Ã  gauche */
.resource-panel.action-panel{min-height:270px;overflow:visible}
.resource-panel.action-panel .action-shell{
  display:grid;
  grid-template-columns:108px minmax(0,1fr);
  grid-template-rows:auto auto;
  column-gap:10px;
  row-gap:6px;
  align-items:center;
}
.resource-panel.action-panel .tile-icon-wrap{grid-column:1;grid-row:1;align-items:center;padding-top:0}
.resource-panel.action-panel .action-main{grid-column:2;grid-row:1;justify-content:center!important;padding:4px 0 0!important}
.resource-panel.action-panel .doih-actions{
  grid-column:1 / 3;
  grid-row:2;
  width:100%;
  margin:0;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
.doih-btn{min-height:104px;padding:5px 4px 6px}
.doih-btn img{width:66px;height:66px}
.doih-btn span{font-size:14px}

/* Blessures : compteur et pastilles restent entiÃ¨rement dans la portion droite */
.wounds-panel .tile-shell{grid-template-columns:84px minmax(0,1fr)}
.wounds-panel .tile-main{overflow:visible;padding-right:6px}
.wounds-panel .tile-value{font-size:clamp(30px,2.35vw,48px);line-height:.95}
.wounds-panel .wound-dots{
  display:grid;
  grid-template-columns:repeat(6,18px);
  justify-content:center;
  gap:5px;
  margin:7px 0 0;
  width:100%;
}
.wounds-panel .dot{width:18px;height:18px;min-width:18px;min-height:18px}

/* CompÃ©tences : deux colonnes, icÃ´nes et textes nettement plus grands */
.skills-panel{padding:18px 18px 16px}
.section-head{font-size:29px;margin-bottom:16px}
.section-head .vicon{width:42px;height:42px;vertical-align:middle}
.skills-list{grid-template-columns:1fr 1fr;gap:12px}
.skill-row{
  grid-template-columns:56px minmax(0,1fr) 54px 70px 54px;
  min-height:88px;
  padding:14px 16px;
  gap:9px;
  border-radius:12px;
}
.skill-icon .vicon{width:48px;height:48px}
.skill-row span:nth-child(2){font-size:27px;font-weight:700}
.skill-stat{font-size:17px}
.skill-value{font-size:27px;font-weight:700}
.skill-rank{font-size:25px}

/* Pouvoirs : fond rÃ©ellement opaque, aucune transparence avec la fiche */
.powers-page{
  background:#0a0d10!important;
  background-image:linear-gradient(180deg,#21170d 0,#0d0f12 180px,#080a0c 100%)!important;
  opacity:1!important;
  isolation:isolate;
  backdrop-filter:none!important;
}
.powers-page::before{
  content:'';
  position:absolute;
  inset:0;
  z-index:-1;
  background:#080a0c;
}
.powers-header{background:#21170d!important;opacity:1!important}
.powers-grid{background:#080a0c!important}
.power-card{background:#20170d!important;opacity:1!important}
.power-detail-backdrop{background:rgba(0,0,0,.92)!important}
.power-detail-modal{background:#0d1318!important;opacity:1!important}

@media(max-width:1500px){
  .skill-row{grid-template-columns:50px minmax(0,1fr) 46px 62px 48px;min-height:80px;padding:12px 13px}
  .skill-icon .vicon{width:42px;height:42px}
  .skill-row span:nth-child(2){font-size:23px}
  .skill-value{font-size:24px}
  .doih-btn img{width:60px;height:60px}
}
@media(max-width:1200px){
  .skills-list{grid-template-columns:1fr 1fr}
  .resource-panel.action-panel .doih-actions{grid-template-columns:repeat(4,minmax(72px,1fr))}
}
@media(max-width:900px){
  .skills-list{grid-template-columns:1fr}
  .resource-panel.action-panel .doih-actions{grid-template-columns:repeat(2,1fr)}
}

/* v1.4.8 â€” interface stable optimisÃ©e iPad Pro paysage */
@media (orientation:landscape) and (min-width:1000px) and (max-width:1400px) and (pointer:coarse){
  html,body{width:100%;min-height:100%;overflow-x:hidden;-webkit-text-size-adjust:100%}
  body{font-size:18px}
  .sheet-app{min-height:100dvh;padding:8px 10px 12px}

  .sheet-header{min-height:72px;height:72px;padding:4px 4px 8px;gap:10px;position:sticky;top:0;z-index:60;background:rgba(3,7,10,.97);backdrop-filter:blur(8px)}
  .brand-mark{width:50px;height:50px;font-size:26px;flex:0 0 50px}
  .title-wrap h1{font-size:30px;line-height:1.05}
  .title-wrap p{font-size:15px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .header-actions{gap:7px;align-items:center}
  .icon-btn,.select-btn{min-width:58px;min-height:56px;height:56px;border-radius:12px;font-size:22px}
  .select-btn{width:190px;max-width:190px;padding:0 12px;font-size:18px;font-weight:700}
  .header-actions .hide-small{display:none}
  .theme-launch .vicon{width:32px;height:32px}

  .sheet-grid{
    display:grid!important;
    grid-template-columns:180px minmax(0,1.14fr) minmax(410px,.96fr)!important;
    grid-template-rows:126px 96px 154px 190px 70px!important;
    gap:10px!important;
    margin-top:10px!important;
    align-items:stretch!important;
  }
  .portrait-card{grid-column:1!important;grid-row:1 / 3!important;height:auto!important;min-height:0!important;max-height:none!important;padding:7px!important}
  .portrait-card img,.portrait-placeholder{inset:7px!important;width:calc(100% - 14px)!important;height:calc(100% - 14px)!important;max-width:calc(100% - 14px)!important;max-height:calc(100% - 14px)!important;object-fit:contain!important}
  .level-badge{bottom:10px;width:68px;height:68px;padding:0!important;border-radius:50%!important;clip-path:none!important;display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:center!important}
  .level-badge strong{font-size:27px!important}.level-badge span{font-size:11px!important}

  .summary-card{grid-column:2 / 4!important;grid-row:1!important;min-height:0!important;display:grid!important;grid-template-columns:1.25fr .72fr .78fr!important}
  .summary-cell{min-height:0!important;height:100%!important;padding:8px 10px!important}
  .summary-cell .tile-shell{height:100%!important;grid-template-columns:86px 1fr!important;gap:8px!important}
  .summary-cell .tile-icon-wrap{width:86px!important;height:100%!important}
  .summary-cell .tile-image{width:74px!important;height:74px!important;max-width:74px!important;max-height:74px!important}
  .summary-cell .tile-main{padding:4px 2px!important}
  .summary-cell .tile-value{font-size:50px!important;white-space:nowrap!important}
  .summary-cell .hp-value{font-size:43px!important}
  .summary-cell .tile-meta{font-size:15px!important}

  .metrics{grid-column:2 / 4!important;grid-row:2!important;min-height:0!important;display:grid!important;grid-template-columns:repeat(4,1fr)!important}
  .metric{min-height:0!important;height:100%!important;padding:5px 8px!important}
  .metric .tile-shell{height:100%!important;grid-template-columns:66px 1fr!important;gap:5px!important}
  .metric .tile-icon-wrap{width:66px!important;height:100%!important}
  .metric .tile-image{width:56px!important;height:56px!important;max-width:56px!important;max-height:56px!important}
  .metric .tile-main{padding:2px!important}
  .metric .tile-value{font-size:39px!important;white-space:nowrap!important}
  .metric .wound-dots{gap:5px!important;margin-top:3px!important;flex-wrap:wrap!important}
  .metric .dot{width:22px!important;height:22px!important;min-width:22px!important}

  .stats-panel{grid-column:1 / 3!important;grid-row:3!important;display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:8px!important}
  .stat-card{min-height:0!important;height:100%!important;padding:6px 7px!important}
  .stat-layout.compact{min-height:0!important;height:105px!important;grid-template-columns:58px 1fr!important;gap:7px!important}
  .stat-card .stat-icon{width:58px!important;height:90px!important}
  .stat-card .stat-icon .vicon{width:52px!important;height:52px!important}
  .stat-copy.compact strong{font-size:48px!important}
  .stat-copy.compact em{font-size:20px!important;padding:4px 10px!important}
  .stat-abbr{font-size:23px!important;right:10px!important;bottom:8px!important}

  .skills-panel{grid-column:3!important;grid-row:3 / 5!important;min-height:0!important;height:auto!important;padding:10px!important;overflow:hidden!important}
  .section-head{font-size:23px!important;margin-bottom:8px!important;min-height:34px!important}
  .section-head .vicon{width:30px!important;height:30px!important}
  .section-head small{font-size:12px!important}
  .skills-list{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important}
  .skill-row{min-height:65px!important;height:65px!important;grid-template-columns:38px minmax(0,1fr) 34px 46px 34px!important;gap:5px!important;padding:6px 7px!important}
  .skill-icon .vicon{width:32px!important;height:32px!important}
  .skill-row span:nth-child(2){font-size:19px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .skill-stat{font-size:12px!important}.skill-value{font-size:20px!important}.skill-rank{font-size:16px!important}

  .resources{grid-column:1 / 3!important;grid-row:4!important;display:grid!important;grid-template-columns:1.15fr .85fr!important;gap:10px!important}
  .resource-panel{min-height:0!important;height:100%!important;padding:8px!important}
  .resource-panel .tile-shell{height:100%!important;grid-template-columns:96px 1fr!important;gap:6px!important}
  .resource-panel .tile-icon-wrap{width:96px!important;height:100%!important}
  .resource-panel .tile-image{width:80px!important;height:80px!important;max-width:80px!important;max-height:80px!important}
  .resource-panel .tile-main{padding:3px!important}
  .resource-panel .tile-value{font-size:42px!important}
  .action-panel .action-shell{display:grid!important;grid-template-columns:96px 1fr!important;grid-template-rows:82px 1fr!important}
  .action-panel .tile-icon-wrap{grid-column:1!important;grid-row:1!important}
  .action-panel .action-main{grid-column:2!important;grid-row:1!important}
  .doih-actions{grid-column:1 / 3!important;grid-row:2!important;display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:8px!important;width:100%!important;padding:2px 0 0!important}
  .doih-btn{min-width:0!important;min-height:86px!important;height:86px!important;padding:4px!important;border-radius:10px!important}
  .doih-btn img{height:58px!important;width:58px!important;object-fit:contain!important}
  .doih-btn span{font-size:14px!important;line-height:1!important}
  .action-gems{margin:5px 0!important;gap:13px!important}.gem{width:29px!important;height:29px!important}
  .resource-dots{gap:7px!important;margin-top:5px!important}.die-slot{width:50px!important;height:50px!important}

  .tabs{grid-column:1 / 4!important;grid-row:5!important;display:grid!important;grid-template-columns:repeat(6,1fr)!important;position:sticky!important;bottom:0!important;z-index:55!important;min-height:70px!important}
  .tab{min-height:70px!important;height:70px!important;font-size:15px!important;padding:3px 4px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;white-space:nowrap!important}
  .tab .vicon{width:27px!important;height:27px!important;margin-right:0!important}

  .tab-content{display:none!important}

  .modal-backdrop{padding:20px!important;align-items:center!important}
  .modal{width:min(900px,94vw)!important;max-height:90dvh!important;padding:26px!important;border-radius:18px!important}
  .modal h2{font-size:32px!important}
  .modal label{font-size:22px!important}
  .modal input,.modal select,.modal textarea{min-height:66px!important;font-size:27px!important;padding:12px 16px!important}
  .modal textarea{min-height:180px!important}
  .modal-actions button,.quick-buttons button{min-height:64px!important;font-size:22px!important}
  .powers-header{padding:18px 22px!important}.powers-header h2{font-size:34px!important}.powers-close{min-height:58px!important;font-size:20px!important}
  .powers-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important;padding:18px!important}
  .power-card{min-height:185px!important;padding:18px!important}.power-card h3{font-size:24px!important}.power-card p{font-size:18px!important}
}

/* iPad Pro portrait: interface empilÃ©e mais toujours tactile */
@media (orientation:portrait) and (min-width:760px) and (max-width:1100px) and (pointer:coarse){
  .sheet-app{padding:10px}
  .sheet-header{position:sticky;top:0;z-index:60;background:rgba(3,7,10,.97)}
  .sheet-grid{grid-template-columns:210px 1fr!important;gap:10px!important}
  .portrait-card{grid-column:1!important;grid-row:1 / 3!important}
  .summary-card,.metrics{grid-column:2!important}
  .stats-panel,.resources,.skills-panel,.tabs{grid-column:1 / 3!important}
  .skills-panel{grid-row:auto!important}
  .skills-list{grid-template-columns:1fr 1fr!important}
  .tabs{grid-template-columns:repeat(3,1fr)!important;position:sticky!important;bottom:0!important;z-index:55!important}
  .tab{min-height:70px!important;font-size:17px!important}
  .icon-btn,.select-btn{min-height:58px!important;font-size:20px!important}
  .skill-row{min-height:68px!important}.skill-row span:nth-child(2){font-size:20px!important}
}

/* v1.4.9 â€“ iPad Pro refinements requested by StÃ©phane */
body .summary-card{grid-template-columns:1.42fr .72fr 1.06fr !important}
body .metrics{grid-template-columns:repeat(3,1fr) !important}
body .portrait-card{overflow:hidden !important}
body .portrait-card img{object-position:center top !important}
body .hp-panel .tile-shell{height:100%}
body .hp-main{position:relative;display:grid !important;grid-template-columns:minmax(0,1fr) 120px;align-items:center;gap:10px;height:100%}
body .hp-readout{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;padding-top:22px}
body .hp-panel .hp-value{font-size:clamp(32px,4vw,56px);line-height:1.05;text-align:center}
body .hp-condition-badges{position:absolute;top:3px;left:0;right:0;z-index:2;display:flex;align-items:center;justify-content:center;gap:5px;max-width:100%;overflow:hidden}
body .hp-condition-badges[hidden]{display:none}
body .hp-condition-badge{display:inline-flex;align-items:center;justify-content:center;min-width:0;max-width:31%;height:25px;padding:2px 6px;border:1px solid rgba(255,230,163,.82);border-radius:999px;background:#fff3cf;color:#26150e;box-shadow:0 2px 6px rgba(0,0,0,.35);font:800 11px/1 Arial,sans-serif;cursor:pointer}
body .hp-condition-badge span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body .hp-condition-badge:focus-visible{outline:3px solid #fff;outline-offset:2px}
body .hp-wounds{justify-content:center !important;gap:10px !important;flex-wrap:wrap;max-width:100%;margin-top:8px !important}
body .hp-wounds .dot{width:20px;height:20px;min-width:20px;min-height:20px}
body .hp-adjust-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-self:center}
body .hp-adjust-btn{min-height:46px;border:1px solid var(--line);border-radius:10px;background:#1a252c;color:var(--gold2);font-weight:bold;font-size:20px;cursor:pointer}
body .hp-adjust-btn:active{transform:translateY(1px)}
body .temp-panel .tile-main{display:grid;place-items:center;height:100%}
body .tile-svg.temp-drop{width:74px;height:74px;filter:drop-shadow(0 4px 8px rgba(0,0,0,.5))}
body .hitdice-panel .tile-shell{grid-template-columns:1fr !important}
body .hitdice-main{width:100%;display:flex;align-items:center;justify-content:center;padding:10px 12px !important}
body .hit-dice-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;width:100%}
body .hit-die-token, body .class-die{appearance:none;border:2px solid #8a744f;background:#121a20;color:var(--gold2);display:grid;place-items:center;cursor:pointer;transition:transform .15s ease, box-shadow .15s ease, background .15s ease}
body .hit-die-token span, body .class-die .die-core{font-weight:bold;letter-spacing:.02em}
body .hit-die-token{width:50px;height:50px}
body .hit-die-token.active{background:linear-gradient(180deg,#f4dc8b,#bf7a1e);color:#1a1610;border-color:#ffdf9c;transform:scale(1.06);box-shadow:0 0 12px rgba(255,196,88,.45)}
body .hit-die-token.used{opacity:.6}
body .class-resource-panel .tile-shell{grid-template-columns:90px 1fr !important;align-items:center;height:100%}
body .class-resource-main{display:flex;align-items:center;justify-content:flex-start;padding:8px 6px !important;overflow:visible}
body .class-dice-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:flex-start;width:100%}
body .class-die{width:54px;height:54px}
body .class-die.on{background:linear-gradient(180deg,#f4dc8b,#bf7a1e);color:#16120c;border-color:#ffdf9c;box-shadow:0 0 12px rgba(255,196,88,.38)}
body .class-die.off{background:#11181d;color:#cdb58a}
body .shape-d20{clip-path:polygon(50% 0%,82% 12%,100% 38%,94% 72%,69% 100%,31% 100%,6% 72%,0% 38%,18% 12%)}
body .shape-d4{clip-path:polygon(50% 0%,100% 100%,0% 100%)}
body .shape-d6{border-radius:8px !important;clip-path:none}
body .shape-d8{clip-path:polygon(50% 0%,100% 50%,50% 100%,0% 50%)}
body .shape-d10{clip-path:polygon(50% 0%,78% 14%,100% 42%,84% 84%,50% 100%,16% 84%,0% 42%,22% 14%)}
body .shape-d12{clip-path:polygon(50% 0%,82% 10%,100% 38%,94% 70%,68% 100%,32% 100%,6% 70%,0 38%,18% 10%)}
body .stat-card-simple{position:relative;display:grid !important;grid-template-rows:auto auto 1fr;align-items:start;text-align:center;padding:14px 12px 10px !important;min-height:170px}
body .stat-icon-corner{justify-self:start;align-self:start}
body .stat-icon-corner .vicon{width:34px;height:34px}
body .under-icon{margin-top:4px;font-size:18px;letter-spacing:.08em}
body .stat-big{display:grid;place-items:center;height:100%;font-size:62px !important;line-height:1.02;margin:0 !important}
body .skill-row-simple{position:relative;grid-template-columns:34px minmax(0,1fr) auto !important;gap:10px !important}
body .skill-row-simple .skill-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body .skill-row-simple.trained{padding-bottom:17px;border-color:rgba(255,230,163,.7);background:linear-gradient(90deg,rgba(145,99,31,.3),#121a20 48%)}
body .skill-row-simple.trained:after{content:'Entraîné';position:absolute;left:53px;bottom:4px;color:#ffe6a3;font:800 9px/1 Arial,sans-serif;text-transform:uppercase}
body .skill-row-simple .skill-stat, body .skill-row-simple .skill-rank{display:none !important}
body .skill-row-simple .skill-value{font-size:24px;text-align:right;padding-right:4px}
body .section-head{margin-bottom:10px !important;background:transparent !important}
body .section-head small{font-size:14px;opacity:.9}
body .action-panel .tile-shell{grid-template-columns:100px 1fr !important}
body .action-panel .action-main{justify-content:center !important;padding-top:12px !important}
body .action-gems{justify-content:flex-start !important;padding-left:8px !important;gap:24px !important;margin:18px 0 8px !important}
body .action-gems .gem{width:34px;height:34px}
body .doih-actions{gap:14px !important;padding-left:2px !important}
body .doih-btn{min-height:100px}
body .doih-btn img{max-width:60px;max-height:60px}
body .doih-btn span{font-size:16px}
body .tabs .tab{display:flex;align-items:center;justify-content:center;gap:8px}
@media (min-width: 1000px) and (max-width: 1450px){
  body .sheet-grid{grid-template-columns:220px minmax(350px,1fr) minmax(420px,1.02fr) !important;gap:10px !important}
  body .portrait-card{height:340px !important;min-height:340px !important;max-height:340px !important}
  body .summary-card{grid-column:2 / 4 !important;grid-row:1 !important}
  body .metrics{grid-column:2 / 4 !important;grid-row:2 !important}
  body .stats-panel{grid-column:1 / 3 !important;grid-row:3 !important;grid-template-columns:repeat(4,1fr) !important}
  body .resources{grid-column:1 / 3 !important;grid-template-columns:.94fr 1.06fr !important}
  body .skills-panel{grid-column:3 !important;grid-row:3 / 5 !important;padding:12px !important}
  body .summary-cell,.metric,.resource-panel{padding:8px 10px !important}
  body .summary-cell .tile-main, body .metric .tile-main{padding:4px !important}
  body .hp-main{grid-template-columns:minmax(0,1fr) 108px !important}
  body .hp-adjust-btn{min-height:42px;font-size:18px}
  body .hit-die-token{width:44px;height:44px}
  body .class-die{width:48px;height:48px}
  body .skill-row-simple{min-height:58px !important}
}
@media (max-width: 999px){
  body .summary-card{grid-template-columns:1fr !important}
  body .hp-main{grid-template-columns:1fr !important}
  body .hp-adjust-grid{grid-template-columns:repeat(4,1fr)}
  body .metrics{grid-template-columns:1fr 1fr 1fr !important}
  body .resources{grid-template-columns:1fr !important}
}

/* v1.4.10 refinements */
body .stats-panel{align-items:stretch}
body .stat-card-simple{display:grid !important;grid-template-columns:74px 1fr;grid-template-rows:56px 34px;align-items:center;padding:10px 12px !important;min-height:150px}
body .stat-icon-corner{grid-column:1;grid-row:1;justify-self:center;align-self:end;width:auto;height:auto}
body .stat-icon-corner .vicon{width:42px;height:42px}
body .under-icon{grid-column:1;grid-row:2;justify-self:center;align-self:start;margin:0 !important;font-size:20px;line-height:1}
body .stat-big{grid-column:2;grid-row:1 / span 2;display:flex !important;align-items:center;justify-content:center;height:100%;font-size:58px !important;line-height:1;margin:0 !important;padding:0 8px}
body .action-panel .action-main{justify-content:flex-start !important;align-items:flex-start !important;padding:8px 0 0 10px !important}
body .action-gems{justify-content:flex-start !important;align-items:center !important;padding-left:0 !important;margin:10px 0 6px !important}
body .doih-actions{justify-content:flex-start !important;align-content:start !important;padding-top:10px !important}
body .doih-btn{pointer-events:auto !important;z-index:2;position:relative}
body .doih-btn span{font-size:15px !important;letter-spacing:0 !important}
body .class-resource-main{justify-content:flex-start !important;align-items:center !important;padding:4px 0 4px 10px !important}
body .class-dice-row{justify-content:flex-start !important;align-content:center !important;height:100%}
body .class-dice-row.few{display:flex !important;flex-wrap:nowrap !important;gap:12px !important;align-items:center !important;justify-content:flex-start !important}
body .class-dice-row.many{display:grid !important;grid-template-columns:repeat(var(--cols), 54px);grid-auto-rows:54px;gap:10px !important;align-content:center !important;justify-content:flex-start !important}
body .class-resource-panel .tile-shell{align-items:center !important}
@media (min-width: 1000px) and (max-width: 1450px){
  body .portrait-card{height:auto !important;min-height:0 !important;max-height:none !important;align-self:stretch !important}
  body .portrait-card img, body .portrait-placeholder{height:calc(100% - 20px) !important;max-height:none !important}
  body .stat-card-simple{grid-template-columns:68px 1fr;grid-template-rows:50px 30px;min-height:140px !important;padding:8px 10px !important}
  body .stat-icon-corner .vicon{width:38px;height:38px}
  body .under-icon{font-size:18px}
  body .stat-big{font-size:52px !important}
  body .action-panel .action-shell{grid-template-columns:88px 1fr !important;grid-template-rows:72px 1fr !important}
  body .action-panel .tile-icon-wrap{align-items:flex-start !important;padding-top:8px !important}
  body .action-panel .tile-image{width:74px !important;height:74px !important;max-width:74px !important;max-height:74px !important}
  body .action-gems{gap:18px !important}
  body .doih-actions{gap:10px !important}
  body .doih-btn{min-height:92px !important;padding:10px 4px !important}
  body .doih-btn img{max-width:50px !important;max-height:50px !important}
  body .class-die{width:50px !important;height:50px !important}
  body .class-dice-row.many{grid-template-columns:repeat(var(--cols), 50px);grid-auto-rows:50px}
}

/* v1.4.11 iPad refinements + richer palette backgrounds */
body .stat-card-simple{
  position:relative;
  display:block !important;
  min-height:150px;
  padding:10px 10px 8px 10px !important;
  text-align:left;
}
body .stat-card-simple .stat-icon-corner{
  position:absolute;
  left:16px;
  top:12px;
  width:52px;
  height:52px;
  display:flex !important;
  align-items:center;
  justify-content:center;
}
body .stat-card-simple .stat-icon-corner .vicon{width:42px;height:42px}
body .stat-card-simple .under-icon{
  position:absolute;
  left:16px;
  top:60px;
  width:52px;
  text-align:center;
  font-size:20px;
  line-height:1;
  margin:0 !important;
}
body .stat-card-simple .stat-big{
  position:absolute;
  left:78px;
  right:10px;
  top:0;
  bottom:0;
  display:flex !important;
  align-items:center;
  justify-content:center;
  font-size:58px !important;
  line-height:1;
  margin:0 !important;
}

body .action-panel .action-shell,
body .class-resource-panel .tile-shell{
  justify-items:start !important;
  align-items:start !important;
}
body .action-panel .tile-icon-wrap,
body .class-resource-panel .tile-icon-wrap{
  justify-content:flex-start !important;
  align-items:flex-start !important;
}
body .action-panel .action-main{
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:flex-start !important;
  padding:8px 0 0 2px !important;
}
body .action-panel .action-gems{
  justify-content:flex-start !important;
  align-items:center !important;
  margin:8px 0 0 !important;
  gap:14px !important;
}
body .action-panel .doih-actions{
  width:auto !important;
  justify-content:flex-start !important;
  align-content:start !important;
  gap:12px !important;
  margin-top:10px !important;
  padding:0 !important;
}
body .doih-btn{
  width:84px !important;
  min-width:84px !important;
  height:84px !important;
  min-height:84px !important;
  aspect-ratio:1 / 1 !important;
  border-radius:12px !important;
  padding:8px 4px !important;
}
body .doih-btn img{max-width:48px !important;max-height:48px !important}
body .doih-btn span{font-size:15px !important;line-height:1.05}

body .class-resource-panel .class-resource-main{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  padding:8px 0 0 4px !important;
}
body .class-resource-panel .tile-image{width:88px !important;height:88px !important;max-width:88px !important;max-height:88px !important}
body .class-dice-row{justify-content:flex-start !important;align-content:center !important;gap:12px !important}
body .class-dice-row.few{display:flex !important;flex-wrap:nowrap !important}
body .class-dice-row.many{
  display:grid !important;
  grid-template-columns:repeat(var(--cols), 60px) !important;
  grid-auto-rows:60px !important;
  justify-content:flex-start !important;
  align-content:center !important;
}
body .class-die{
  width:60px !important;
  height:60px !important;
  font-size:24px !important;
}
body .class-die.off{
  background:linear-gradient(180deg,rgba(var(--theme-rgb),.18),rgba(0,0,0,.2)) !important;
  border-color:rgba(255,235,180,.65) !important;
  color:var(--gold2) !important;
  box-shadow:0 0 0 1px rgba(var(--theme-rgb),.18), inset 0 -8px 16px rgba(0,0,0,.25) !important;
}
body .class-die.on{
  box-shadow:0 0 0 1px rgba(255,214,133,.4),0 0 14px rgba(255,190,70,.28) !important;
}

/* Palette affects backgrounds, not only borders */
body .card,
body .icon-btn,
body .select-btn,
body .tab,
body .modal,
body .skill-row,
body .appearance-section,
body .palette-choice,
body .frame-choice,
body .ornament-buttons button{
  background:
    linear-gradient(145deg, rgba(var(--theme-rgb),.16), rgba(255,255,255,.015) 35%, rgba(0,0,0,.18)),
    linear-gradient(145deg, var(--panel2), var(--panel)) !important;
}
body .resource-panel,
body .metric,
body .skills-panel,
body .tab-content{
  background:
    linear-gradient(145deg, rgba(var(--theme-rgb),.17), rgba(0,0,0,.14) 42%),
    linear-gradient(145deg, var(--panel2), var(--panel)) !important;
}
body .summary-cell:not(.hp){
  background:
    linear-gradient(145deg, rgba(var(--theme-rgb),.18), rgba(0,0,0,.12) 40%),
    linear-gradient(145deg, var(--panel2), var(--panel)) !important;
}
body .summary-cell.hp{
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--red) 82%, var(--panel2) 18%), color-mix(in srgb, var(--red) 45%, var(--panel) 55%)) !important;
}
body .skills-panel .section-head,
body .section-head{background:transparent !important}

@media (min-width: 1000px) and (max-width: 1450px){
  body .stat-card-simple{min-height:140px !important}
  body .stat-card-simple .stat-icon-corner{left:14px;top:10px;width:48px;height:48px}
  body .stat-card-simple .stat-icon-corner .vicon{width:38px;height:38px}
  body .stat-card-simple .under-icon{left:14px;top:54px;width:48px;font-size:18px}
  body .stat-card-simple .stat-big{left:70px;font-size:52px !important}
  body .action-panel .action-gems{gap:16px !important}
  body .action-panel .doih-actions{gap:10px !important}
  body .doih-btn{width:80px !important;min-width:80px !important;height:80px !important;min-height:80px !important}
  body .class-die{width:56px !important;height:56px !important;font-size:22px !important}
  body .class-dice-row.many{grid-template-columns:repeat(var(--cols), 56px) !important;grid-auto-rows:56px !important}
}

/* v1.4.12 icon unification + alignment fixes */
body .summary-cell .tile-svg, body .metric .tile-svg, body .resource-panel .tile-svg{
  width:62px;height:62px;max-width:62px;max-height:62px;
}
body .summary-cell .hp-drop{width:66px;height:66px;max-width:66px;max-height:66px}
body .stat-card-simple .under-icon{top:72px !important}
body .stat-card-simple .stat-big{left:74px !important}

body .action-panel .tile-shell,
body .class-resource-panel .tile-shell{
  padding-left:4px !important;
  column-gap:8px !important;
}
body .action-panel .tile-icon-wrap,
body .class-resource-panel .tile-icon-wrap{
  width:82px !important;
  min-width:82px !important;
  justify-content:flex-start !important;
}
body .action-panel .action-main,
body .class-resource-panel .class-resource-main{
  padding-left:0 !important;
  margin-left:0 !important;
  justify-content:flex-start !important;
}
body .action-panel .action-gems{
  padding-left:0 !important;
  margin-left:0 !important;
  gap:16px !important;
}
body .action-panel .doih-actions{
  padding-left:0 !important;
  margin-left:0 !important;
  gap:10px !important;
}
body .doih-btn{
  width:82px !important; min-width:82px !important;
  height:82px !important; min-height:82px !important;
  border-radius:14px !important;
}
body .class-resource-panel .class-dice-row{
  margin-left:0 !important;
  padding-left:0 !important;
  gap:10px !important;
}
body .class-resource-panel .tile-image,
body .class-resource-panel .tile-svg{width:72px !important;height:72px !important;max-width:72px !important;max-height:72px !important}
body .class-die{
  width:62px !important;height:62px !important;font-size:26px !important;
  color:#f8d47e !important; border-color:rgba(255,214,133,.72) !important;
  text-shadow:0 1px 0 rgba(0,0,0,.75);
}
body .class-die.off{background:linear-gradient(180deg, rgba(37,27,10,.92), rgba(12,10,8,.96)) !important}
body .class-die.on{background:linear-gradient(180deg,#f3d07a,#b8801c) !important;color:#2b1b07 !important}

@media (min-width:1000px) and (max-width:1450px){
  body .stat-card-simple .under-icon{top:66px !important}
  body .summary-cell .tile-svg, body .metric .tile-svg, body .resource-panel .tile-svg{width:56px;height:56px;max-width:56px;max-height:56px}
  body .summary-cell .hp-drop{width:60px;height:60px;max-width:60px;max-height:60px}
  body .action-panel .tile-icon-wrap, body .class-resource-panel .tile-icon-wrap{width:76px !important; min-width:76px !important}
  body .doih-btn{width:76px !important; min-width:76px !important; height:76px !important; min-height:76px !important}
  body .class-die{width:56px !important;height:56px !important;font-size:23px !important}
}

body .class-die{
  position:relative;
  overflow:hidden;
  padding:4px!important;
}
body .class-die .resource-die-img{
  width:100%!important;
  height:100%!important;
  object-fit:contain;
  display:block;
  filter:drop-shadow(0 0 5px rgba(255,210,90,.35));
}
body .class-die.off .resource-die-img{
  opacity:.42;
  filter:grayscale(.55) drop-shadow(0 0 3px rgba(0,0,0,.4));
}
body .class-die .resource-die-badge{
  position:absolute;
  right:3px;
  bottom:3px;
  min-width:19px;
  height:19px;
  padding:0 5px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:rgba(5,8,11,.86);
  border:1px solid rgba(255,223,156,.8);
  color:var(--gold2);
  font-size:12px;
  line-height:1;
  text-shadow:0 1px 2px #000;
  pointer-events:none;
}
body .class-die.on .resource-die-badge{
  background:rgba(255,244,205,.92);
  color:#2b1b07;
  border-color:#6a4312;
}

/* v1.4.14 stronger icon clarity */
.summary-cell .tile-svg, .metric .tile-svg, .resource-panel .tile-svg { width: 68px; height: 68px; max-width:68px; max-height:68px; }
.summary-cell .hp-drop, .summary-cell .temp-drop { width: 70px; height: 70px; max-width:70px; max-height:70px; }
.metric .tile-icon-wrap, .resource-panel .tile-icon-wrap { min-width: 74px !important; width: 74px !important; }
@media (min-width:1000px) and (max-width:1450px){
  .summary-cell .tile-svg, .metric .tile-svg, .resource-panel .tile-svg { width: 64px; height: 64px; max-width:64px; max-height:64px; }
  .summary-cell .hp-drop, .summary-cell .temp-drop { width: 66px; height: 66px; max-width:66px; max-height:66px; }
  .metric .tile-icon-wrap, .resource-panel .tile-icon-wrap { min-width: 70px !important; width: 70px !important; }
}

/* v1.4.15 icon reset + lower stat labels + left edge alignment */
body .stat-card-simple .under-icon{top:92px !important}
body .stat-card-simple .stat-icon-corner{top:14px !important}
body .action-panel .tile-shell,
body .class-resource-panel .tile-shell{padding-left:2px !important; column-gap:4px !important}
body .action-panel .tile-icon-wrap,
body .class-resource-panel .tile-icon-wrap{width:70px !important; min-width:70px !important}
body .action-panel .action-main,
body .class-resource-panel .class-resource-main{padding-left:2px !important; margin-left:0 !important}
body .action-panel .action-gems,
body .action-panel .doih-actions,
body .class-resource-panel .class-dice-row{padding-left:0 !important; margin-left:0 !important; justify-content:flex-start !important}
body .action-panel .doih-actions{gap:8px !important}
body .summary-cell .tile-svg, body .metric .tile-svg, body .resource-panel .tile-svg{width:72px; height:72px; max-width:72px; max-height:72px}
@media (min-width:1000px) and (max-width:1450px){
  body .stat-card-simple .under-icon{top:84px !important}
  body .action-panel .tile-shell,
  body .class-resource-panel .tile-shell{padding-left:2px !important}
  body .action-panel .tile-icon-wrap,
  body .class-resource-panel .tile-icon-wrap{width:66px !important; min-width:66px !important}
  body .summary-cell .tile-svg, body .metric .tile-svg, body .resource-panel .tile-svg{width:66px; height:66px; max-width:66px; max-height:66px}
}

/* v1.4.16 custom icon studio integration */
.custom-slot-icon{display:block;width:72px;height:72px;object-fit:contain;filter:drop-shadow(0 2px 4px rgba(0,0,0,.24))}
.custom-slot-icon.stat-img{width:56px;height:56px}
.custom-slot-icon.tile-img{width:68px;height:68px}
.icon-picker-actions{display:flex;justify-content:flex-end;margin:10px 0 14px}
.inline-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.icon-slot-list{display:grid;gap:14px}
.icon-slot-box{border:1px solid rgba(216,174,90,.28);border-radius:14px;padding:12px;background:rgba(10,14,22,.35)}
.icon-slot-head{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:10px}
.icon-slot-head small{color:var(--muted,#c8baa2)}
.icon-choice-row{display:flex;flex-wrap:wrap;gap:8px}
.icon-choice-btn{border:1px solid rgba(255,255,255,.12);background:linear-gradient(180deg,#fffaf1,#f1e7d3);color:#2c2219;border-radius:12px;padding:8px;min-width:110px;display:flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer}
.icon-choice-btn img{width:44px;height:44px;object-fit:contain}
.icon-choice-btn span{font-size:.8rem;font-weight:700;text-align:center;line-height:1.15}
.icon-choice-btn.selected{outline:3px solid #70c56b}
@media (max-width:900px){
  .custom-slot-icon{width:58px;height:58px}
  .custom-slot-icon.tile-img{width:54px;height:54px}
  .custom-slot-icon.stat-img{width:46px;height:46px}
  .icon-slot-head{flex-direction:column;align-items:flex-start}
  .icon-choice-btn{min-width:96px}
}

/* v1.4.18 attributions */
.attribution-section{margin-top:18px}
.attribution-list{display:grid;gap:10px}
.attribution-item{display:grid;grid-template-columns:minmax(180px,1fr) minmax(240px,2fr) auto auto;gap:10px;align-items:center;padding:12px;border:1px solid rgba(216,174,90,.28);border-radius:12px;background:rgba(10,14,22,.35)}
.attribution-item span{color:var(--muted,#c8baa2)}
.attribution-item a{color:#f0c979;font-weight:700}
@media(max-width:900px){.attribution-item{grid-template-columns:1fr}.attribution-item a{display:inline-block}}

/* v1.4.25 dice icon choices */
.hitdice-main{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px!important;width:100%}
.hitdice-title{color:var(--gold2);font-weight:bold;text-transform:uppercase;letter-spacing:.07em;font-size:clamp(15px,1.2vw,20px);text-align:center;line-height:1.1}
.hitdice-title span{display:block;color:var(--cream);font-size:1.35em;text-transform:none;letter-spacing:0;margin-top:2px}
.hit-dice-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.hit-die-token{clip-path:none!important;border-radius:14px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:0!important;padding:4px!important;overflow:hidden}.hit-die-token .hit-die-img{width:100%!important;height:100%!important;object-fit:contain}.hit-die-token.used .hit-die-img{filter:grayscale(1);opacity:.38}.hit-die-token.active .hit-die-img{filter:drop-shadow(0 0 6px rgba(255,210,90,.8))}

/* v1.4.34 subtle interface icon decorations */
.sheet-header{position:relative}
.interface-decor-top{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;gap:8px;width:auto;max-width:min(360px,34vw);min-width:0;pointer-events:none;user-select:none;z-index:1}
.title-wrap,.header-actions,.brand-mark{position:relative;z-index:2}
.interface-decor-top[hidden],.interface-decor-bottom[hidden]{display:none!important}
.interface-decor-img{display:block;width:48px;height:48px;object-fit:contain;filter:drop-shadow(0 2px 3px rgba(0,0,0,.42));pointer-events:none;user-select:none}
.interface-decor-top .interface-decor-img.center{width:59px;height:59px}
.interface-decor-bottom{grid-column:1/4;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:20px;min-height:54px;padding:8px 18px;border:1px solid rgba(216,174,90,.28);border-radius:14px;box-shadow:var(--shadow);pointer-events:none;user-select:none;background:linear-gradient(145deg,rgba(22,31,37,.97),rgba(9,15,19,.98))}
.interface-decor-group{display:flex;align-items:center;gap:8px;min-height:34px}
.interface-decor-group.side-left{justify-content:flex-start}
.interface-decor-group.center{justify-content:center}
.interface-decor-group.side-right{justify-content:flex-end}
.interface-decor-bottom .interface-decor-img{width:42px;height:42px;opacity:.9}
.interface-decor-bottom .interface-decor-img.center{width:48px;height:48px;opacity:.96}
.decor-toggle-row{display:flex;flex-wrap:wrap;gap:12px;margin:12px 0}
.decor-toggle-row label{display:inline-flex!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;width:auto!important;margin:0!important;padding:10px 12px;border:1px solid rgba(216,174,90,.32);border-radius:10px;background:rgba(10,14,22,.42);cursor:pointer;line-height:1.2!important}
.decor-toggle-row input[type="checkbox"]{width:22px!important;height:22px!important;min-width:22px!important;min-height:22px!important;margin:0!important;padding:0!important;flex:0 0 22px!important}

/* Les éléments couvrant plusieurs colonnes ne doivent jamais imposer leur
   largeur intrinsèque à la grille (particulièrement sur iPad paysage). */
.sheet-grid,
.sheet-grid > *,
.summary-card,
.metrics,
.skills-panel,
.resources,
.tabs,
.tab-content,
.summary-cell,
.metric,
.skill-row,
.tab{min-width:0}
.tabs{max-width:100%}
.tab{overflow:hidden;text-overflow:ellipsis}
.initiative-advantage{display:flex!important;align-items:center;gap:12px;margin-top:18px!important;padding:14px;border:1px solid var(--line);border-radius:12px;background:rgba(10,16,22,.5)}
.initiative-advantage input{width:26px!important;height:26px!important;min-width:26px;padding:0!important}
.turn-reset-button{width:100%;margin-top:18px!important}
.turn-reset-button.selected{background:#2f704c;border-color:#66c991;color:#fff}
.interface-decor-preview{display:grid;gap:10px;margin:10px 0 14px;padding:12px;border:1px solid rgba(216,174,90,.26);border-radius:12px;background:rgba(0,0,0,.18)}
.decor-preview-row{display:grid;grid-template-columns:54px 1fr;align-items:center;gap:10px;color:var(--muted,#c8baa2)}
.decor-preview-row>div{min-height:44px;display:flex;align-items:center;justify-content:center;gap:8px;border:1px dashed rgba(216,174,90,.22);border-radius:10px;background:rgba(255,255,255,.025)}
.decor-preview-bottom>div{justify-content:space-between;padding:0 16px}
.decor-preview-bottom .interface-decor-group{min-width:80px}
.decor-selectors{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.decor-selector h4{margin:2px 0 8px;color:var(--gold2)}
.decor-search{width:100%!important;height:48px!important;min-height:48px!important;margin:0 0 10px!important;padding:8px 12px!important;border-radius:10px!important;font-size:18px!important}
.decor-choice-grid{display:block;max-height:360px;overflow:auto;padding-right:6px}
.decor-category{margin:0 0 12px}
.decor-category h5{position:sticky;top:0;z-index:1;margin:0 0 8px;padding:7px 9px;border:1px solid rgba(216,174,90,.24);border-radius:9px;background:#11191f;color:var(--gold2);font-size:14px}
.decor-category-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(108px,1fr));gap:8px}
.decor-choice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:94px;padding:8px;border:1px solid rgba(255,255,255,.12);border-radius:12px;background:linear-gradient(180deg,#fffaf1,#f1e7d3);color:#2c2219;cursor:pointer}
.decor-choice-none{width:100%;min-height:52px;margin-bottom:10px}
.decor-choice img{width:46px;height:46px;object-fit:contain}
.decor-choice span{font-size:12px;font-weight:700;text-align:center;line-height:1.15}
.decor-choice.selected{outline:3px solid #70c56b}
.decor-none{color:#463628}
@media(max-width:1050px){.interface-decor-bottom{grid-column:1/3}}
@media(max-width:980px){.sheet-header{flex-wrap:wrap}.interface-decor-top{position:static;transform:none;order:3;flex:1 0 100%;max-width:none;min-width:0}.decor-selectors{grid-template-columns:1fr}.interface-decor-bottom{gap:10px;padding:8px}.interface-decor-bottom .interface-decor-img{width:36px;height:36px}.interface-decor-bottom .interface-decor-img.center{width:42px;height:42px}}
@media(max-width:720px){.interface-decor-bottom{grid-column:1}}

/* v1.4.34 class resources */
.class-resource-ui{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:flex-start;width:100%}
.resource-counter{min-width:116px;min-height:66px;display:grid;grid-template-columns:34px 1fr 34px;grid-template-rows:auto auto;align-items:center;gap:2px 6px;padding:7px;border:1px solid rgba(221,181,91,.55);border-radius:10px;background:rgba(6,12,17,.72);box-shadow:inset 0 0 12px rgba(0,0,0,.35)}
.resource-counter small{grid-column:1/-1;color:var(--gold2);font-size:11px;line-height:1.1;text-transform:uppercase;letter-spacing:.05em;white-space:normal}
.resource-counter strong{font-size:28px;line-height:1;color:var(--cream);text-align:center}
.resource-counter .resource-max{font-size:15px;color:var(--gold2)}
.resource-counter button,.resource-mark{border:1px solid var(--line);border-radius:8px;background:#121a20;color:var(--gold2);cursor:pointer;min-height:32px}
.resource-counter button:hover,.resource-mark:hover{filter:brightness(1.18)}
.resource-mark{min-width:132px;min-height:58px;padding:8px 10px;font-weight:bold;text-align:center}
.resource-mark.on{background:linear-gradient(135deg,#2f5628,#1c2d1a);border-color:#8fc469;color:#f2ffd8;box-shadow:0 0 12px rgba(114,191,85,.25)}
.resource-special{display:flex;flex-direction:column;gap:4px;max-width:360px;padding:10px 12px;border:1px solid rgba(221,181,91,.55);border-radius:10px;background:rgba(6,12,17,.72)}
.resource-special strong{font-size:19px;color:var(--cream)}
.resource-special small{font-size:13px;line-height:1.25;color:var(--gold2)}
.modal-check{display:flex!important;align-items:center;gap:8px;margin:12px 0!important;color:var(--cream)}
.modal-check input{width:auto!important}
body .class-resource-panel .class-resource-ui.class-dice-row{display:flex!important}
body .class-resource-panel .class-resource-ui.ui-hybrid-judgment{gap:9px!important}
.resource-pips{display:flex;flex-direction:column;gap:7px;min-width:180px;padding:8px 10px;border:1px solid rgba(221,181,91,.55);border-radius:10px;background:rgba(6,12,17,.72)}
.resource-pips small{color:var(--gold2);font-size:12px;line-height:1.1;text-transform:uppercase;font-weight:bold;letter-spacing:.05em}
.resource-pip-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.resource-pip{width:48px;height:48px;border:1px solid var(--line);border-radius:11px;background:#121a20;display:grid;place-items:center;cursor:pointer;padding:4px;opacity:.44;filter:grayscale(.8)}
.resource-pip.on{opacity:1;filter:none;background:linear-gradient(180deg,#f3d07a,#8c5b17);box-shadow:0 0 12px rgba(255,196,88,.35);border-color:#ffdf9c}
.resource-pip .resource-pip-img{width:38px!important;height:38px!important;object-fit:contain}
.resource-pip-add{width:44px;height:44px;border:1px solid #7ed957;border-radius:999px;background:linear-gradient(180deg,#2f8d42,#155a28);color:#f6ffe9;font-size:26px;font-weight:bold;line-height:1;cursor:pointer;box-shadow:0 0 12px rgba(126,217,87,.28)}
.resource-pip-add:hover{filter:brightness(1.15)}
.ui-mark-and-charges{gap:7px!important;align-content:center}
.ui-mark-and-charges .resource-mark{min-height:46px;padding:7px 12px}
.ui-mark-and-charges .resource-pips{min-width:0;width:100%;padding:7px 8px;gap:5px}
.ui-mark-and-charges .resource-pip-row{gap:6px}
.ui-mark-and-charges .resource-pip{width:40px;height:40px;border-radius:10px}
.ui-mark-and-charges .resource-pip .resource-pip-img{width:31px!important;height:31px!important}
.ui-mark-and-charges .resource-pip-add{width:38px;height:38px;font-size:23px}
.calc-shell{border:2px solid var(--gold);border-radius:22px;background:linear-gradient(145deg,rgba(var(--theme-rgb),.22),rgba(8,13,18,.96));padding:10px;box-shadow:inset 0 0 18px rgba(0,0,0,.34)}
.calc-mid{display:grid;grid-template-columns:54px minmax(260px,1fr) 54px;gap:10px;align-items:stretch}
.calc-band{display:flex;align-items:center;justify-content:center;gap:6px;overflow:hidden;pointer-events:none}
.calc-band-top,.calc-band-bottom{min-height:42px}
.calc-band-side{flex-direction:column;min-width:54px}
.calc-band img{width:34px;height:34px;object-fit:contain;filter:drop-shadow(0 1px 2px rgba(0,0,0,.45))}
.calc-core{display:grid;gap:10px}
.calc-label{font-size:22px!important;text-align:center!important;margin:0!important;color:var(--gold2)!important}
.calc-display{height:76px!important;min-height:76px!important;text-align:center!important;font-size:44px!important;font-weight:bold!important;background:linear-gradient(180deg,color-mix(in srgb,var(--gold2) 22%,#fff 78%),#f6ead2)!important;border:2px solid var(--gold)!important;border-radius:16px!important;color:#16120b!important}
.calc-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.calc-grid button{min-height:76px;border:1px solid var(--line);border-radius:16px;background:#172229;color:var(--cream);font-size:32px;font-weight:bold;cursor:pointer}
.calc-grid button:hover{filter:brightness(1.18)}
.calc-grid .calc-wide{grid-column:1/-1;color:var(--gold2)}
@media(max-width:720px){.calc-mid{grid-template-columns:1fr}.calc-band-side{display:none}.calc-band img{width:28px;height:28px}.calc-grid button{min-height:66px}}

.weapon-lines{display:grid;gap:10px}
.weapon-line{display:grid;grid-template-columns:minmax(120px,1.2fr) auto;gap:4px 12px;align-items:center;padding:10px 12px;border:1px solid rgba(221,181,91,.38);border-radius:10px;background:rgba(7,13,18,.45)}
.weapon-line strong{color:var(--cream)}
.weapon-line span{justify-self:end;color:var(--gold2);font-size:24px;font-weight:800}
.weapon-line small{grid-column:1/-1;color:var(--muted);line-height:1.25}

/* v1.4.44 icon search and condition panel */
.modal.modal-icon-browser,.modal:has(.icon-library-search),.modal.modal-condition{width:min(1480px,98vw);max-height:96vh}
.modal.modal-icon-browser #modalBody,.modal:has(.icon-library-search) #modalBody,.modal.modal-condition #modalBody{max-height:calc(96vh - 142px);overflow:auto}
.icon-library-search,.icon-slot-search{width:100%!important;min-height:50px!important;border-radius:12px!important;border:2px solid rgba(216,174,90,.45)!important;background:#fffaf1!important;color:#17120c!important;font-size:18px!important;font-weight:700!important;padding:10px 14px!important;margin:0 0 12px!important}
.icon-library-search{position:sticky;top:0;z-index:3;box-shadow:0 8px 18px rgba(0,0,0,.28)}
.icon-slot-search{min-height:42px!important;font-size:15px!important;margin-bottom:10px!important;border-width:1px!important}
.icon-slot-list{grid-template-columns:repeat(auto-fit,minmax(330px,1fr));align-items:start}
.icon-slot-box{min-width:0}
.icon-choice-row{max-height:330px;overflow:auto;align-content:flex-start;padding-right:4px}
.icon-choice-btn[hidden],.decor-choice[hidden],.icon-slot-box[hidden]{display:none!important}
.icon-slot-empty{margin:8px 0 0;color:var(--gold2);font-weight:bold}
.icon-choice-btn{min-width:116px;max-width:142px;min-height:100px}
.icon-choice-btn img{width:52px;height:52px}
.icon-choice-btn span{max-width:118px;overflow-wrap:anywhere}
.icon-browser-layout{display:grid;grid-template-columns:minmax(240px,300px) 1fr;gap:16px;align-items:start}
.icon-target-list{position:sticky;top:60px;display:grid;gap:8px;max-height:calc(96vh - 230px);overflow:auto;padding-right:4px}
.icon-target-btn{display:grid;grid-template-columns:48px 1fr;gap:10px;align-items:center;text-align:left;border:1px solid rgba(221,181,91,.38);border-radius:12px;background:rgba(8,13,18,.72);color:var(--cream);padding:8px;cursor:pointer}
.icon-target-btn.active{border-color:#ffdf9c;background:linear-gradient(180deg,rgba(243,208,122,.28),rgba(8,13,18,.9));box-shadow:0 0 0 3px rgba(255,223,156,.14)}
.icon-target-btn img{width:46px;height:46px;object-fit:contain}
.icon-target-btn span{display:grid;gap:2px;min-width:0}
.icon-target-btn strong{font-size:15px;line-height:1.05}
.icon-target-btn small{color:var(--gold2);font-size:12px;line-height:1.1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.icon-library-panel{min-width:0}
.icon-category-filter-row{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.icon-category-filter{border:1px solid rgba(221,181,91,.45);border-radius:999px;background:#172229;color:var(--cream);padding:8px 12px;font-weight:800;cursor:pointer}
.icon-category-filter.active{background:linear-gradient(180deg,#f3d07a,#9a681f);color:#17120c;border-color:#ffe4a1}
.icon-library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(124px,1fr));gap:10px;max-height:calc(96vh - 360px);min-height:360px;overflow:auto;padding:4px}
.icon-library-grid .icon-choice-btn{width:100%;max-width:none;min-height:126px}
.icon-library-grid .icon-choice-btn img{width:64px;height:64px}
.icon-library-grid .icon-choice-btn small{display:block;color:var(--gold2);font-size:11px;line-height:1.05;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.icon-library-grid .icon-choice-btn.selected{box-shadow:0 0 0 3px rgba(126,217,87,.42),0 0 18px rgba(126,217,87,.3);border-color:#bfff9e}
.modal-condition .modal-actions{position:sticky;bottom:0;background:linear-gradient(180deg,rgba(15,22,29,.78),rgba(15,22,29,.98));padding-top:12px}
.condition-panel{position:relative;isolation:isolate;min-height:min(720px,72vh);padding:22px;border:2px solid rgba(216,174,90,.46);border-radius:22px;background:linear-gradient(145deg,rgba(9,14,20,.96),rgba(20,27,35,.98));box-shadow:inset 0 0 28px rgba(0,0,0,.38)}
.condition-panel:before{content:'';position:absolute;inset:0;border-radius:20px;background:url('/condition-icons/conditions-watermark.svg') center/cover no-repeat;z-index:-1;opacity:.9;pointer-events:none}
.condition-selected{display:grid;gap:10px;margin-bottom:22px;padding:14px;border:1px solid rgba(255,230,163,.28);border-radius:16px;background:rgba(0,0,0,.32)}
.condition-selected h3{margin:0;color:#ffe6a3;font-size:clamp(23px,2.1vw,32px)}
.condition-chip-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.condition-empty{display:inline-flex;align-items:center;min-height:54px;color:#fff4d0;font-size:20px;font-weight:800}
.condition-chip,.condition-toggle,.condition-detail-card{border:2px solid rgba(255,230,163,.55);background:linear-gradient(180deg,#fff7df,#eed9a9);color:#15110c;box-shadow:0 6px 18px rgba(0,0,0,.28);cursor:pointer}
.condition-chip{display:inline-flex;align-items:center;gap:10px;min-height:58px;padding:8px 14px;border-radius:999px;font-size:20px;font-weight:900}
.condition-chip img{width:42px;height:42px;object-fit:contain}
.condition-toggle-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:16px}
.condition-toggle{min-height:154px;border-radius:18px;padding:14px;display:grid;grid-template-rows:72px auto auto;place-items:center;gap:7px;text-align:center}
.condition-toggle img{width:72px;height:72px;object-fit:contain}
.condition-toggle span{font-size:clamp(21px,1.8vw,28px);font-weight:950;line-height:1.05}
.condition-toggle small{display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:3px 10px;border-radius:999px;background:#1b2430;color:#fff4d0;font-size:15px;font-weight:900}
.condition-toggle.active{background:linear-gradient(180deg,#7fef77,#188b38);border-color:#e8ffd8;color:#06150a;box-shadow:0 0 0 4px rgba(126,217,87,.24),0 10px 24px rgba(0,0,0,.35)}
.condition-toggle.active small{background:#07240e;color:#eaffdd}
.condition-detail-card{width:100%;min-height:360px;border-radius:22px;padding:24px;display:grid;grid-template-columns:minmax(130px,180px) 1fr;gap:24px;align-items:center;text-align:left}
.condition-detail-card img{width:100%;max-height:180px;object-fit:contain}
.condition-detail-card span{display:grid;gap:12px}
.condition-detail-card strong{font-size:clamp(38px,4vw,62px);line-height:1;color:#140f08}
.condition-detail-card em{font-style:normal;font-size:clamp(24px,2.3vw,34px);line-height:1.25;color:#1d160d;font-weight:850}
.condition-detail-card small{font-size:18px;font-weight:900;color:#5a2f10}
@media(max-width:760px){.modal.modal-icon-browser,.modal:has(.icon-library-search),.modal.modal-condition{width:98vw}.icon-slot-list{grid-template-columns:1fr}.condition-panel{padding:14px}.condition-toggle-grid{grid-template-columns:1fr 1fr;gap:10px}.condition-toggle{min-height:136px}.condition-detail-card{grid-template-columns:1fr;text-align:center}.condition-detail-card img{max-height:130px;margin:auto}}

/* v1.4.49 secondary resources */
.modal.modal-secondary-resources,.modal:has(.secondary-resources-panel){width:min(1260px,98vw);max-height:95vh}
.modal.modal-secondary-resources #modalBody,.modal:has(.secondary-resources-panel) #modalBody{max-height:calc(95vh - 142px);overflow:auto}
.secondary-resources-panel{display:grid;gap:20px;color:var(--cream)}
.primary-resource-reminder{display:grid;grid-template-columns:74px minmax(0,1fr) auto;align-items:center;gap:14px;padding:14px 16px;border:2px solid rgba(216,174,90,.46);border-radius:8px;background:linear-gradient(135deg,rgba(var(--theme-rgb),.27),rgba(8,13,18,.94))}
.primary-resource-symbol{width:66px;height:66px;display:grid;place-items:center}
.primary-resource-symbol img,.primary-resource-symbol svg{width:62px!important;height:62px!important;object-fit:contain}
.primary-resource-reminder span,.secondary-resources-title span,.secondary-resource-kind{display:block;color:var(--gold2);font-size:13px;font-weight:900;text-transform:uppercase;letter-spacing:0}
.primary-resource-reminder h3,.secondary-resources-title h3,.secondary-resource-head h3,.secondary-resource-add h3{margin:3px 0;color:var(--cream);line-height:1.1}
.primary-resource-reminder p,.secondary-resource-head p,.secondary-resource-summary,.secondary-resource-empty p{margin:4px 0 0;color:var(--muted);line-height:1.35}
.primary-resource-reminder button,.secondary-resources-title button,.secondary-refill,.secondary-edit-toggle,.secondary-apply,.secondary-remove,.secondary-resource-add button{min-height:46px;border:1px solid rgba(255,223,156,.68);border-radius:8px;background:#172229;color:var(--cream);padding:9px 14px;font-weight:900;cursor:pointer}
.primary-resource-reminder button:hover,.secondary-resources-title button:hover,.secondary-refill:hover,.secondary-edit-toggle:hover,.secondary-apply:hover,.secondary-resource-add button:hover{filter:brightness(1.18)}
.secondary-resources-title{display:flex;align-items:end;justify-content:space-between;gap:14px;padding:0 2px}
.secondary-resources-title button:disabled{opacity:.42;cursor:not-allowed}
.secondary-resource-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
.secondary-resource-card{display:grid;gap:13px;min-width:0;padding:16px;border:1px solid rgba(216,174,90,.38);border-radius:8px;background:linear-gradient(145deg,rgba(22,31,37,.97),rgba(9,15,19,.98));box-shadow:0 8px 20px rgba(0,0,0,.24)}
.secondary-resource-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px}
.secondary-resource-head h3{font-size:clamp(21px,2vw,28px);overflow-wrap:anywhere}
.secondary-resource-head p{font-size:14px}
.secondary-resource-kind{font-size:11px}
.secondary-resource-tracker{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:10px;min-height:58px}
.secondary-charge-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.secondary-charge{width:48px;height:48px;display:grid;place-items:center;border:2px solid rgba(216,174,90,.45);border-radius:8px;background:#101820;padding:7px;cursor:pointer;opacity:.46}
.secondary-charge span{width:100%;height:100%;border-radius:50%;background:#5b6570;box-shadow:inset 0 0 8px rgba(0,0,0,.55)}
.secondary-charge.on{opacity:1;border-color:#ffe4a1;background:linear-gradient(180deg,#f6d77f,#8f5b15);box-shadow:0 0 14px rgba(255,202,83,.34)}
.secondary-charge.on span{background:#fff4bf;box-shadow:0 0 9px #fff4bd,inset 0 -6px 9px rgba(157,93,10,.4)}
.secondary-resource-total{min-width:52px;color:var(--cream);font-size:19px;text-align:center;white-space:nowrap}
.secondary-counter{display:grid;grid-template-columns:48px minmax(78px,1fr) 48px;align-items:center;gap:8px}
.secondary-counter button{width:48px;height:48px;border:1px solid rgba(216,174,90,.54);border-radius:8px;background:#172229;color:var(--gold2);font-size:27px;font-weight:900;cursor:pointer}
.secondary-counter strong{color:var(--cream);font-size:28px;text-align:center;white-space:nowrap}
.secondary-counter small{color:var(--gold2);font-size:16px}
.secondary-refill{min-width:108px}
.secondary-resource-summary{padding-top:10px;border-top:1px solid rgba(216,174,90,.2);font-size:15px}
.secondary-resource-empty{grid-column:1/-1;min-height:150px;display:grid;place-content:center;text-align:center;padding:24px;border:1px dashed rgba(216,174,90,.44);border-radius:8px;background:rgba(8,13,18,.46)}
.secondary-resource-empty strong{color:var(--gold2);font-size:22px}
.secondary-resource-edit{display:grid;grid-template-columns:minmax(170px,1fr) 120px minmax(170px,1fr);gap:10px;align-items:end;padding-top:12px;border-top:1px solid rgba(216,174,90,.26)}
.secondary-resource-edit[hidden]{display:none!important}
.secondary-resource-edit label,.secondary-resource-add-grid label{display:grid;gap:6px;color:var(--gold2);font-weight:900}
.secondary-resource-add-grid label{font-size:16px;line-height:1.2}
.secondary-resource-edit input,.secondary-resource-edit select,.secondary-resource-add-grid input,.secondary-resource-add-grid select{width:100%;min-height:48px;border:2px solid rgba(216,174,90,.38);border-radius:8px;background:#fffaf1;color:#17120c;padding:8px 11px;font-size:17px;font-weight:800}
.secondary-resource-edit>div{grid-column:1/-1;display:flex;gap:10px;justify-content:flex-end}
.secondary-remove{border-color:#ef8d82;background:#411c1c;color:#ffe5df}
.secondary-remove.confirm{background:#9c2424;border-color:#ffd1ca}
.secondary-resource-add{display:grid;gap:12px;padding:16px;border:1px solid rgba(216,174,90,.34);border-radius:8px;background:rgba(8,13,18,.6)}
.secondary-resource-add-grid{display:grid;grid-template-columns:minmax(220px,1.5fr) 120px minmax(190px,1fr) auto;gap:12px;align-items:end}
.secondary-resource-add-grid button{min-height:48px;background:linear-gradient(180deg,#317b3d,#194c26);border-color:#88d989;color:#f4ffed}
@media(max-width:900px){.secondary-resource-list{grid-template-columns:1fr}.secondary-resource-add-grid{grid-template-columns:1fr 120px}.secondary-resource-add-grid label:nth-child(3){grid-column:1}.secondary-resource-add-grid button{grid-column:2;grid-row:2}}
@media(max-width:620px){.primary-resource-reminder{grid-template-columns:58px 1fr}.primary-resource-symbol{width:54px;height:54px}.primary-resource-symbol img,.primary-resource-symbol svg{width:52px!important;height:52px!important}.primary-resource-reminder button{grid-column:1/-1}.secondary-resources-title{align-items:stretch;flex-direction:column}.secondary-resource-tracker{grid-template-columns:1fr}.secondary-resource-total{text-align:left}.secondary-refill{width:100%}.secondary-resource-edit,.secondary-resource-add-grid{grid-template-columns:1fr}.secondary-resource-edit>div,.secondary-resource-add-grid label:nth-child(3),.secondary-resource-add-grid button{grid-column:1;grid-row:auto}.secondary-charge{width:45px;height:45px}}

/* v1.4.55 iPad bottom navigation and quick weapon readouts */
.quick-weapons{
  grid-column:1 / 3;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.quick-weapon-card{
  min-width:0;
  min-height:108px;
  padding:12px 16px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:auto auto auto;
  align-items:center;
  column-gap:14px;
  row-gap:2px;
  color:var(--text);
  text-align:left;
  cursor:default;
  overflow:hidden;
  background:
    linear-gradient(145deg,rgba(var(--theme-rgb),.18),rgba(0,0,0,.16) 48%),
    linear-gradient(145deg,var(--panel2),var(--panel));
}
.quick-weapon-index{grid-column:1;grid-row:1;color:var(--gold2);font-size:12px;font-weight:700;letter-spacing:.08em}
.quick-weapon-name{grid-column:1;grid-row:2;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:22px;font-weight:700;color:var(--cream)}
.quick-weapon-attack{grid-column:2;grid-row:1 / 3;display:flex;flex-direction:column;align-items:flex-end;justify-content:center;white-space:nowrap}
.quick-weapon-attack small{color:var(--muted);font-size:11px;letter-spacing:.06em}
.quick-weapon-attack strong{color:var(--gold2);font-size:27px;line-height:1.1}
.quick-weapon-bonus{display:none}
.quick-weapon-meta{grid-column:1 / 3;grid-row:3;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:13px}
.quick-weapon-card.unequipped{opacity:.68}
.quick-weapon-card.empty{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px}
.quick-weapon-card.empty strong{font-size:20px;color:var(--cream)}
.quick-weapon-card.empty small{color:var(--muted)}

@media(min-width:1051px){
  body .quick-weapons{grid-row:5}
  body .skills-panel{grid-row:1 / 6}
  body .tabs{grid-row:6}
}

@media(min-width:1000px) and (max-width:1450px){
  body .sheet-app{padding-bottom:calc(92px + env(safe-area-inset-bottom,0px))}
  body .sheet-grid{grid-template-rows:126px 96px 154px 190px 108px!important}
  body .quick-weapons{grid-column:1 / 3!important;grid-row:5!important;gap:10px!important}
  body .quick-weapon-card{height:108px;min-height:108px;padding:9px 13px}
  body .quick-weapon-name{font-size:20px}
  body .quick-weapon-attack strong{font-size:24px}
  body .skills-panel{grid-column:3!important;grid-row:3 / 6!important}
  body .tabs{
    position:fixed!important;
    left:10px!important;
    right:10px!important;
    bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;
    width:auto!important;
    grid-column:auto!important;
    grid-row:auto!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    z-index:80!important;
    min-height:70px!important;
  }
}

@media(max-width:1050px){
  body .quick-weapons{grid-column:1 / 3;grid-row:auto}
  body .skills-panel{grid-row:auto}
  body .tabs{grid-row:auto}
}

@media(max-width:720px){
  body .quick-weapons{grid-column:1;grid-template-columns:1fr}
  body .tabs{position:sticky!important;left:auto!important;right:auto!important;bottom:0!important;width:auto!important}
}

/* Full-screen inventory manager */
.modal-backdrop:has(.modal .inventory-unified){padding:0!important;place-items:stretch!important}
.modal:has(.inventory-unified){
  width:100vw!important;
  height:100dvh!important;
  max-width:none!important;
  max-height:100dvh!important;
  padding:0!important;
  border-radius:0!important;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  overflow:hidden!important;
}
.modal:has(.inventory-unified)>h2{margin:0!important;padding:18px 26px;border-bottom:1px solid var(--line);background:linear-gradient(135deg,var(--panel2),var(--panel));font-size:32px!important}
.modal:has(.inventory-unified)>#modalBody{min-height:0;overflow:auto;padding:20px 26px 30px}
.modal:has(.inventory-unified)>.modal-actions{margin:0;padding:12px 26px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line);background:#0b1116}
.modal:has(.inventory-unified)>.modal-actions button{min-height:54px!important;font-size:21px!important;padding:8px 24px!important}
.inventory-manager-toolbar{display:grid;grid-template-columns:minmax(210px,1fr) auto minmax(260px,.8fr);align-items:end;gap:18px;padding:16px;border:1px solid rgba(216,174,90,.46);border-radius:8px;background:linear-gradient(145deg,rgba(27,39,48,.98),rgba(12,19,24,.98))}
.inventory-manager-toolbar h3{margin:0;color:var(--cream);font-size:25px}
.inventory-manager-toolbar p{margin:5px 0 0;color:var(--muted);font-size:16px}
.inventory-manager-add{display:flex;gap:8px;flex-wrap:wrap}
.inventory-manager-add button,.inventory-sheet-item footer button,.inventory-editor-actions button,.inventory-editor-close{min-height:48px;padding:9px 14px;border:1px solid var(--line);border-radius:7px;background:#17242c;color:var(--cream);font-size:18px;font-weight:800;cursor:pointer}
.inventory-manager-add button{background:linear-gradient(180deg,#76501f,#493115);border-color:#d2a553}
.inventory-manager-search{margin:0!important;font-size:15px!important}
.inventory-manager-search span{display:block;margin-bottom:5px;color:var(--gold2)}
.inventory-manager-search input{min-height:50px!important;padding:9px 12px!important;border-radius:7px!important;font-size:18px!important}
.inventory-manager-editor{scroll-margin-top:18px;border:2px solid var(--gold);border-radius:9px;background:#111b22;box-shadow:0 16px 38px rgba(0,0,0,.4);overflow:visible}
.inventory-manager-editor[hidden]{display:none!important}
.inventory-manager-editor>header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 16px;border-bottom:1px solid var(--line);background:#18252d}
.inventory-manager-editor>header small{color:var(--gold2);font-size:13px;font-weight:900;text-transform:uppercase}
.inventory-manager-editor>header h3{margin:3px 0 0;color:var(--cream);font-size:25px}
.inventory-editor-close{width:48px;padding:0;font-size:30px;line-height:1}
.inventory-editor-grid{display:grid;grid-template-columns:240px minmax(280px,1fr) 220px;gap:13px 16px;padding:14px 16px}
.inventory-editor-grid label{margin:0!important;font-size:16px!important}
.inventory-editor-grid input,.inventory-editor-grid select{min-height:52px!important;padding:9px 11px!important;border-radius:7px!important;font-size:19px!important}
.inventory-editor-name{grid-column:2}
.inventory-editor-equipped,.inventory-editor-check{display:flex!important;align-items:center;gap:9px;align-self:end;min-height:52px;padding:9px 12px;border:1px solid #806338;border-radius:7px;background:#162128}
.inventory-editor-equipped input,.inventory-editor-check input{width:26px!important;min-height:26px!important;margin:0}
.inventory-editor-note{grid-column:1 / 3}
.inventory-editor-uses{grid-column:3;display:grid;align-content:end;gap:8px}
.inventory-editor-uses-fields{display:grid;grid-template-columns:90px 1fr;gap:8px}
.inventory-editor-uses-fields[hidden]{display:none!important}
.inventory-weapon-editor{grid-column:1 / -1;display:grid;grid-template-columns:minmax(300px,1.5fr) repeat(2,minmax(150px,.75fr));gap:12px 16px;padding:14px;border:1px solid rgba(216,174,90,.36);border-radius:8px;background:#0c1419}
.inventory-weapon-editor[hidden]{display:none!important}
.inventory-weapon-search{grid-row:span 2;position:relative}
.inventory-weapon-results{position:absolute;z-index:10;top:100%;left:0;right:0;max-height:320px;overflow:auto;display:grid;padding:6px;border:1px solid var(--gold);border-radius:7px;background:#0a1014;box-shadow:0 16px 35px #000}
.inventory-weapon-results[hidden]{display:none!important}
.inventory-weapon-results button{display:grid;grid-template-columns:1fr auto;gap:10px;min-height:50px;padding:8px 10px;border:0;border-bottom:1px solid #3c3325;background:transparent;color:var(--cream);text-align:left;cursor:pointer}
.inventory-weapon-results button:hover,.inventory-weapon-results button:focus{background:#263844;outline:1px solid var(--gold)}
.inventory-weapon-results small{color:var(--gold2);font-size:13px}
.inventory-editor-effects{grid-column:1/-1;margin:0;color:var(--gold2)}
.inventory-editor-actions{display:flex;justify-content:flex-end;gap:10px;padding:12px 16px;border-top:1px solid var(--line)}
.inventory-editor-actions .primary{background:linear-gradient(180deg,#347941,#174b25);border-color:#9ee19e}
.inventory-sheet-item footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:auto;padding-top:10px;border-top:1px solid rgba(216,174,90,.22)}
.inventory-sheet-item footer span{margin-right:auto;color:var(--muted);font-size:14px}
.inventory-sheet-item footer button{min-height:42px;padding:7px 12px;font-size:16px}
.inventory-sheet-item footer button.danger{background:#4e2020;border-color:#a86464}
.inventory-sheet-item footer button.danger[data-confirm="1"]{background:#8e2424;color:#fff}
.inventory-filter-empty{padding:25px;border:1px dashed var(--line);border-radius:8px;color:var(--gold2);font-size:20px;text-align:center}

@media(max-width:1050px){
  .inventory-manager-toolbar{grid-template-columns:1fr 1fr}
  .inventory-manager-toolbar>div:first-child{grid-column:1/-1}
  .inventory-editor-grid{grid-template-columns:1fr 1fr}
  .inventory-editor-equipped{grid-column:auto}
  .inventory-editor-note,.inventory-editor-uses{grid-column:1/-1}
  .inventory-weapon-editor{grid-template-columns:1fr 1fr}
  .inventory-weapon-search{grid-column:1/-1;grid-row:auto}
}
@media(max-width:680px){
  .modal:has(.inventory-unified)>#modalBody{padding:12px}
  .inventory-manager-toolbar,.inventory-editor-grid,.inventory-weapon-editor{grid-template-columns:1fr}
  .inventory-manager-toolbar>*{grid-column:1!important}
  .inventory-manager-add{display:grid;grid-template-columns:1fr}
  .inventory-editor-name,.inventory-editor-equipped,.inventory-editor-note,.inventory-editor-uses,.inventory-weapon-search{grid-column:1}
  .inventory-editor-uses-fields{grid-template-columns:1fr}
  .inventory-sheet-item footer{align-items:stretch;flex-direction:column}
}

/* v1.4.57 full-screen class reference */
.class-page{position:fixed;inset:0;z-index:300;display:none;flex-direction:column;overflow:hidden;background:#080b0e;color:var(--text);isolation:isolate}
.class-page.open{display:flex}
.class-page-header{display:flex;align-items:center;justify-content:space-between;gap:20px;flex:0 0 auto;padding:18px 26px;border-bottom:2px solid var(--gold);background:linear-gradient(135deg,#21170d,#111a20);box-shadow:0 5px 22px rgba(0,0,0,.52)}
.class-page-header h2{margin:0;color:var(--cream);font-size:42px;line-height:1.08;letter-spacing:0}
.class-page-header p{margin:6px 0 0;color:var(--gold2);font-size:20px;letter-spacing:0}
.class-page-body{flex:1;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding:0 0 calc(32px + env(safe-area-inset-bottom,0px));background:linear-gradient(180deg,#10171c 0,#080b0e 460px)}
.class-dashboard{width:min(1540px,100%);min-width:0;margin:0 auto;overflow:hidden}
.class-hero{display:grid;grid-template-columns:minmax(0,1fr) 190px;align-items:center;gap:24px;padding:30px 28px;border-bottom:1px solid rgba(216,174,90,.32);background:linear-gradient(115deg,rgba(var(--theme-rgb),.2),rgba(11,17,21,.95) 64%)}
.class-eyebrow,.class-mechanic-card>span,.class-progression>div>span,.class-feature-toolbar>div>span{display:block;color:var(--gold2);font-size:15px;font-weight:900;text-transform:uppercase;letter-spacing:0}
.class-hero h3{margin:6px 0 8px;color:#fff8e9;font-size:36px;line-height:1.12;letter-spacing:0}
.class-hero p{max-width:940px;margin:0;color:#e7dfce;font-size:20px;line-height:1.45}
.class-hero-level{display:grid;place-items:center;min-height:144px;padding:12px;border:2px solid var(--gold);border-radius:8px;background:#171f25;text-align:center}
.class-hero-level small{color:var(--gold2);font-size:16px;font-weight:900;text-transform:uppercase}
.class-hero-level strong{color:#fff6d8;font-size:60px;line-height:1}
.class-hero-level span{color:var(--muted);font-size:15px}
.class-mechanics-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:22px 28px;background:#0b1014}
.class-mechanic-card{min-height:184px;padding:17px;border:1px solid rgba(216,174,90,.48);border-radius:8px;background:linear-gradient(150deg,#17232a,#10171c);box-shadow:0 8px 22px rgba(0,0,0,.28)}
.class-mechanic-card h4{margin:9px 0;color:#fff7dd;font-size:23px;line-height:1.2;letter-spacing:0}
.class-mechanic-card p{margin:7px 0;color:#e5dfd2;font-size:17px;line-height:1.38}
.class-mechanic-card small{display:block;margin-top:8px;color:var(--muted);font-size:15px;line-height:1.35}
.class-key-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:11px 0}
.class-key-stat{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:54px;padding:7px 10px;border:1px solid #4c5860;border-radius:6px;background:#0b1115;color:#d6d9d8}
.class-key-stat b{font-size:18px}.class-key-stat strong{font-size:27px}
.class-key-stat.active{border-color:#8fc77d;background:#13231a;color:#edffe9;box-shadow:inset 0 0 14px rgba(100,190,102,.15)}
.class-progression{display:grid;grid-template-columns:210px minmax(0,1fr);align-items:center;gap:20px;min-width:0;padding:18px 28px;border-top:1px solid rgba(216,174,90,.24);border-bottom:1px solid rgba(216,174,90,.24);background:#141b20}
.class-progression h3{margin:4px 0 0;color:var(--cream);font-size:24px;letter-spacing:0}
.class-level-track{display:grid;grid-template-columns:repeat(20,minmax(38px,1fr));gap:5px;min-width:820px}
.class-level-track span{display:grid;place-items:center;aspect-ratio:1;border:1px solid #4f5b62;border-radius:6px;background:#0b1115;color:#7f898e}
.class-level-track span b{font-size:15px}
.class-level-track span.done{border-color:#8c6b36;background:#2a2013;color:#e6c780}
.class-level-track span.current{border:2px solid #f2c96b;background:#6d4b19;color:#fff9df;box-shadow:0 0 14px rgba(242,201,107,.35)}
.class-progression{overflow-x:auto}
.class-feature-browser{min-width:0;padding:24px 28px 40px}
.class-feature-toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,430px);align-items:end;gap:18px}
.class-feature-toolbar h3{margin:5px 0 0;color:var(--cream);font-size:29px;letter-spacing:0}
.class-feature-toolbar label{margin:0;color:var(--gold2);font-size:15px;font-weight:800}
.class-feature-toolbar label span{display:block;margin-bottom:5px}
.class-feature-toolbar input{width:100%;min-height:54px;padding:10px 13px;border:1px solid #7f6740;border-radius:7px;background:#0a1115;color:#fff;font-size:19px}
.class-filter-row{display:flex;flex-wrap:wrap;gap:8px;margin:17px 0}
.class-filter-row button{display:flex;align-items:center;justify-content:center;gap:9px;min-height:50px;padding:9px 14px;border:1px solid #6d604b;border-radius:7px;background:#142027;color:#e8e1d4;font-size:17px;font-weight:800;cursor:pointer}
.class-filter-row button b{display:grid;place-items:center;min-width:29px;height:29px;padding:0 5px;border-radius:50%;background:#090e11;color:var(--gold2);font-size:14px}
.class-filter-row button.active{border-color:#efc768;background:#60431d;color:#fff9e8;box-shadow:inset 0 0 12px rgba(255,221,143,.13)}
.class-feature-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.class-feature-card{display:flex;flex-direction:column;min-height:228px;padding:17px;border:1px solid #735f3d;border-radius:8px;background:linear-gradient(150deg,#1a252c,#10171c);color:var(--text);text-align:left;cursor:pointer}
.class-feature-card:hover,.class-feature-card:focus-visible{border-color:var(--gold2);outline:2px solid rgba(241,199,104,.25);filter:brightness(1.1)}
.class-feature-card[hidden]{display:none!important}
.class-feature-card.future{border-style:dashed;filter:saturate(.55);opacity:.7;background:#10161a}
.class-feature-card.future:hover,.class-feature-card.future:focus-visible{filter:saturate(.8) brightness(1.1);opacity:.9}
.class-feature-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.class-feature-top b,.class-feature-top em{display:inline-flex;align-items:center;min-height:34px;padding:4px 9px;border:1px solid #655a48;border-radius:6px;background:#0b1115;color:var(--gold2);font-size:14px;font-style:normal}
.class-feature-card>strong{margin-bottom:10px;color:#fff7df;font-size:25px;line-height:1.15;letter-spacing:0}
.class-feature-summary{flex:1;color:#e4ded3;font-size:18px;line-height:1.42}
.class-feature-card>small{margin-top:14px;color:var(--gold2);font-size:17px;font-weight:800}
.class-feature-empty{padding:32px;border:1px dashed #7b6745;border-radius:8px;color:var(--gold2);font-size:20px;text-align:center}

@media(max-width:1120px){
  .class-mechanics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .class-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .class-progression{grid-template-columns:1fr;gap:12px}
}
@media(max-width:700px){
  .class-page-header{align-items:flex-start;padding:14px}
  .class-page-header h2{font-size:31px}
  .class-page-header p{font-size:16px}
  .class-page-header .powers-close{min-width:112px;min-height:54px;padding:8px 10px;font-size:19px}
  .class-hero{grid-template-columns:1fr;padding:20px 14px}
  .class-hero h3{font-size:29px}
  .class-hero p{font-size:18px}
  .class-hero-level{grid-template-columns:auto auto;justify-content:center;gap:12px;min-height:88px}
  .class-hero-level strong{font-size:46px}
  .class-hero-level span{grid-column:1/-1}
  .class-mechanics-grid{grid-template-columns:1fr;padding:14px}
  .class-mechanic-card{min-height:0}
  .class-progression{padding:15px 14px}
  .class-feature-browser{padding:20px 14px 34px}
  .class-feature-toolbar{grid-template-columns:1fr}
  .class-filter-row{display:grid;grid-template-columns:1fr 1fr}
  .class-filter-row button{min-width:0}
  .class-feature-grid{grid-template-columns:1fr}
  .class-feature-card{min-height:205px}
  .class-feature-top{align-items:flex-start}
}

/* v1.4.59 full-screen identity dossier */
.identity-page{position:fixed;inset:0;z-index:305;display:none;flex-direction:column;overflow:hidden;background:#080b0e;color:var(--text);isolation:isolate}
.identity-page.open{display:flex}
.identity-page-header{display:flex;align-items:center;justify-content:space-between;gap:20px;flex:0 0 auto;padding:18px 26px;border-bottom:2px solid var(--gold);background:linear-gradient(135deg,#21170d,#111a20);box-shadow:0 5px 22px rgba(0,0,0,.52)}
.identity-page-header h2{margin:0;color:var(--cream);font-size:42px;line-height:1.08;letter-spacing:0}
.identity-page-header p{margin:6px 0 0;color:var(--gold2);font-size:20px;letter-spacing:0}
.identity-page-actions{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.identity-edit-button{min-height:54px;padding:10px 17px;border:1px solid var(--gold);border-radius:7px;background:#68471f;color:#fff8e7;font-size:18px;font-weight:800;cursor:pointer}
.identity-edit-button:hover,.identity-edit-button:focus-visible{border-color:var(--gold2);outline:2px solid rgba(241,199,104,.25);filter:brightness(1.12)}
.identity-page-body{flex:1;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding-bottom:calc(34px + env(safe-area-inset-bottom,0px));background:linear-gradient(180deg,#10171c 0,#080b0e 540px)}
.identity-dashboard{width:min(1500px,100%);min-width:0;margin:0 auto}
.identity-hero{display:grid;grid-template-columns:330px minmax(0,1fr);align-items:stretch;gap:30px;padding:28px;border-bottom:1px solid rgba(216,174,90,.32);background:linear-gradient(115deg,rgba(var(--theme-rgb),.18),rgba(11,17,21,.97) 66%)}
.identity-portrait{position:relative;display:grid;place-items:center;width:100%;aspect-ratio:4/5;min-height:0;overflow:hidden;border:2px solid var(--gold);border-radius:8px;background:#080d10;box-shadow:0 18px 36px rgba(0,0,0,.38)}
.identity-portrait img{width:100%;height:100%;object-fit:contain;object-position:center;background:#080d10}
.identity-portrait-empty{display:grid;place-items:center;gap:12px;color:var(--gold2);font-size:18px;font-weight:800}
.identity-portrait-empty .vicon{width:108px;height:108px;opacity:.72}
.identity-level{position:absolute;right:12px;bottom:12px;display:grid;place-items:center;min-width:82px;min-height:82px;padding:8px;border:2px solid var(--gold2);border-radius:50%;background:#11181d;color:#fff6d9;box-shadow:0 5px 18px rgba(0,0,0,.55)}
.identity-level b{font-size:35px;line-height:1}.identity-level small{font-size:11px;font-weight:900}
.identity-hero-copy{min-width:0;padding:8px 0}
.identity-eyebrow,.identity-story-heading>span{display:block;color:var(--gold2);font-size:15px;font-weight:900;text-transform:uppercase;letter-spacing:0}
.identity-hero-copy>h3{margin:7px 0 8px;color:#fff8e9;font-size:44px;line-height:1.08;letter-spacing:0;overflow-wrap:anywhere}
.identity-hero-copy>p{margin:0;color:#e7dfce;font-size:22px;line-height:1.4}
.identity-origin-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;margin-top:24px}
.identity-fact{display:grid;grid-template-columns:54px minmax(0,1fr);align-items:center;gap:12px;min-height:92px;padding:13px;border:1px solid rgba(216,174,90,.48);border-radius:8px;background:linear-gradient(150deg,#17232a,#10171c)}
.identity-fact.empty{border-style:dashed;opacity:.72}
.identity-fact-icon{display:grid;place-items:center;width:54px;height:54px;border:1px solid #5f533e;border-radius:7px;background:#0b1115;color:var(--gold2)}
.identity-fact-icon .vicon{width:35px;height:35px}
.identity-fact small,.identity-metric small{display:block;color:var(--gold2);font-size:13px;font-weight:900;text-transform:uppercase}
.identity-fact strong{display:block;margin-top:4px;color:#fff6df;font-size:21px;line-height:1.2;overflow-wrap:anywhere}
.identity-metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;padding:22px 28px;border-bottom:1px solid rgba(216,174,90,.25);background:#0b1014}
.identity-metric{display:flex;flex-direction:column;justify-content:center;min-height:112px;padding:14px;border:1px solid #5f533e;border-radius:8px;background:#141d23;text-align:center}
.identity-metric strong{display:block;margin-top:6px;color:#fff8e7;font-size:29px;line-height:1.1;overflow-wrap:anywhere}
.identity-metric span{display:block;margin-top:5px;color:var(--muted);font-size:14px}
.identity-story{display:grid;grid-template-columns:260px minmax(0,1fr);gap:22px;padding:28px}
.identity-story-heading h3{margin:6px 0 0;color:var(--cream);font-size:28px;letter-spacing:0}
.identity-notes{min-height:170px;padding:20px;border-left:4px solid var(--gold);background:#121a20;color:#f1eadf;font-size:20px;line-height:1.55;overflow-wrap:anywhere}
.identity-notes.empty{border-left-style:dashed;color:var(--muted);font-style:italic}

@media(max-width:1120px){
  .identity-hero{grid-template-columns:280px minmax(0,1fr);gap:22px}
  .identity-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:700px){
  .identity-page-header{flex-direction:column;align-items:stretch;padding:14px}
  .identity-page-header h2{font-size:30px}
  .identity-page-header p{font-size:15px}
  .identity-page-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .identity-edit-button,.identity-page-header .powers-close{min-width:0;min-height:54px;padding:8px 9px;font-size:16px}
  .identity-hero{grid-template-columns:1fr;gap:20px;padding:18px 14px}
  .identity-portrait{width:min(290px,100%);margin:0 auto}
  .identity-hero-copy{padding:0}
  .identity-hero-copy>h3{font-size:32px}
  .identity-hero-copy>p{font-size:18px}
  .identity-origin-grid{grid-template-columns:1fr}
  .identity-fact{min-height:80px}
  .identity-metrics{grid-template-columns:1fr 1fr;padding:14px}
  .identity-metric{min-height:100px}
  .identity-story{grid-template-columns:1fr;padding:22px 14px}
  .identity-notes{font-size:18px}
}

/* v1.4.59 device-specific display profiles */
.display-mode-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.display-mode-choice{display:flex;min-width:0;min-height:82px;flex-direction:column;align-items:flex-start;justify-content:center;gap:5px;padding:12px 14px;border:1px solid var(--line);border-radius:8px;background:#111b22;color:var(--text);text-align:left;cursor:pointer}
.display-mode-choice strong{color:var(--cream);font-size:19px}
.display-mode-choice small{color:var(--muted);font-size:14px}
.display-mode-choice.selected{border:2px solid var(--gold2);background:linear-gradient(145deg,rgba(var(--theme-rgb),.32),#111b22);box-shadow:0 0 0 2px rgba(var(--theme-rgb),.18)}
.display-mode-choice:focus-visible{outline:3px solid var(--gold2);outline-offset:2px}
.display-mode-status{margin:12px 0 0;color:var(--muted);font-size:15px}
.display-mode-status strong{color:var(--gold2)}
@media(max-width:900px){.display-mode-grid{grid-template-columns:1fr 1fr}}
@media(max-width:520px){.display-mode-grid{grid-template-columns:1fr}}

body[data-display-profile="desktop"]{overflow-x:auto}
body[data-display-profile="desktop"] .sheet-app{min-width:1180px;padding-bottom:12px!important}
body[data-display-profile="desktop"] .sheet-header{position:relative!important;top:auto!important;height:auto!important;min-height:0!important}
body[data-display-profile="desktop"] .sheet-grid{display:grid!important;grid-template-columns:240px minmax(420px,1fr) minmax(560px,1.35fr)!important;grid-template-rows:auto auto auto auto auto auto!important;gap:12px!important;align-items:stretch!important}
body[data-display-profile="desktop"] .portrait-card{grid-column:1!important;grid-row:1 / 3!important;height:320px!important;min-height:320px!important;max-height:320px!important}
body[data-display-profile="desktop"] .summary-card{grid-column:2 / 4!important;grid-row:1!important;grid-template-columns:1.42fr .72fr 1.06fr!important}
body[data-display-profile="desktop"] .metrics{grid-column:2 / 4!important;grid-row:2!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
body[data-display-profile="desktop"] .stats-panel{grid-column:1 / 3!important;grid-row:3!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
body[data-display-profile="desktop"] .resources{grid-column:1 / 3!important;grid-row:4!important;grid-template-columns:.94fr 1.06fr!important}
body[data-display-profile="desktop"] .quick-weapons{grid-column:1 / 3!important;grid-row:5!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
body[data-display-profile="desktop"] .skills-panel{grid-column:3!important;grid-row:3 / 6!important;height:100%!important;overflow:hidden!important}
body[data-display-profile="desktop"] .skills-list{grid-template-columns:1fr 1fr!important}
body[data-display-profile="desktop"] .tabs{position:static!important;left:auto!important;right:auto!important;bottom:auto!important;width:auto!important;grid-column:1 / 4!important;grid-row:6!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;min-height:70px!important}
body[data-display-profile="desktop"] .interface-decor-bottom{grid-column:1 / 4!important}

body[data-display-profile="tablet"]{overflow-x:hidden}
body[data-display-profile="tablet"] .sheet-app{min-width:0;padding:8px 10px calc(94px + env(safe-area-inset-bottom,0px))!important}
body[data-display-profile="tablet"] .sheet-header{position:sticky!important;top:0!important;z-index:60!important;background:rgba(3,7,10,.97)!important;backdrop-filter:blur(8px)}
body[data-display-profile="tablet"] .header-actions .hide-small{display:none!important}
body[data-display-profile="tablet"] .tabs{position:fixed!important;left:10px!important;right:10px!important;bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;width:auto!important;z-index:80!important}
body[data-display-profile="tablet"] .tab-content{display:none!important}

@media(orientation:landscape){
  body[data-display-profile="tablet"] .sheet-grid{display:grid!important;grid-template-columns:180px minmax(0,1.14fr) minmax(410px,.96fr)!important;grid-template-rows:126px 96px 154px 190px 108px!important;gap:10px!important;margin-top:10px!important;align-items:stretch!important}
  body[data-display-profile="tablet"] .portrait-card{grid-column:1!important;grid-row:1 / 3!important;height:auto!important;min-height:0!important;max-height:none!important}
  body[data-display-profile="tablet"] .summary-card{grid-column:2 / 4!important;grid-row:1!important;grid-template-columns:1.42fr .72fr 1.06fr!important;min-height:0!important}
  body[data-display-profile="tablet"] .metrics{grid-column:2 / 4!important;grid-row:2!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;min-height:0!important}
  body[data-display-profile="tablet"] .stats-panel{grid-column:1 / 3!important;grid-row:3!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
  body[data-display-profile="tablet"] .resources{grid-column:1 / 3!important;grid-row:4!important;grid-template-columns:.94fr 1.06fr!important}
  body[data-display-profile="tablet"] .quick-weapons{grid-column:1 / 3!important;grid-row:5!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body[data-display-profile="tablet"] .skills-panel{grid-column:3!important;grid-row:3 / 6!important;height:100%!important;overflow:hidden!important}
  body[data-display-profile="tablet"] .skills-list{grid-template-columns:1fr 1fr!important}
  body[data-display-profile="tablet"] .tabs{grid-template-columns:repeat(6,minmax(0,1fr))!important;min-height:70px!important}
  body[data-display-profile="tablet"] .interface-decor-bottom{grid-column:1 / 4!important}
}

@media(orientation:portrait){
  body[data-display-profile="tablet"] .sheet-app{padding-bottom:calc(148px + env(safe-area-inset-bottom,0px))!important}
  body[data-display-profile="tablet"] .sheet-grid{display:grid!important;grid-template-columns:210px minmax(0,1fr)!important;grid-template-rows:auto!important;gap:10px!important}
  body[data-display-profile="tablet"] .portrait-card{grid-column:1!important;grid-row:1 / 3!important;height:330px!important;min-height:330px!important;max-height:330px!important}
  body[data-display-profile="tablet"] .summary-card{grid-column:2!important;grid-row:1!important;grid-template-columns:1fr!important}
  body[data-display-profile="tablet"] .metrics{grid-column:2!important;grid-row:2!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body[data-display-profile="tablet"] .stats-panel{grid-column:1 / 3!important;grid-row:3!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
  body[data-display-profile="tablet"] .resources{grid-column:1 / 3!important;grid-row:4!important;grid-template-columns:1fr 1fr!important}
  body[data-display-profile="tablet"] .quick-weapons{grid-column:1 / 3!important;grid-row:5!important;grid-template-columns:1fr 1fr!important}
  body[data-display-profile="tablet"] .skills-panel{grid-column:1 / 3!important;grid-row:6!important;height:auto!important;overflow:visible!important}
  body[data-display-profile="tablet"] .skills-list{grid-template-columns:1fr 1fr!important}
  body[data-display-profile="tablet"] .tabs{grid-template-columns:repeat(3,minmax(0,1fr))!important;min-height:126px!important}
  body[data-display-profile="tablet"] .interface-decor-bottom{grid-column:1 / 3!important}
}

/* v1.4.66 full-screen appearance settings and live preview */
body[data-palette="amethyst"]{--bg:#10081a;--panel:#211534;--panel2:#342052;--gold:#a579e8;--gold2:#dcc8ff;--line:#684a91;--cream:#f0e7fa;--text:#fcf9ff;--muted:#c4b4d3;--red:#78264d;--theme-rgb:165,121,232}
body[data-palette="rose"]{--bg:#180910;--panel:#321525;--panel2:#4b2038;--gold:#df6ba7;--gold2:#ffc4e1;--line:#8a4668;--cream:#f7e2ec;--text:#fff7fb;--muted:#d1adbe;--red:#8e243f;--theme-rgb:223,107,167}
body[data-palette="jade"]{--bg:#06140f;--panel:#0d2a21;--panel2:#164234;--gold:#42b98b;--gold2:#b8f1d8;--line:#2b755c;--cream:#dcf0e7;--text:#f2fff9;--muted:#a6c9bb;--red:#773239;--theme-rgb:66,185,139}
body[data-palette="sun"]{--bg:#171506;--panel:#2d290e;--panel2:#433d16;--gold:#d8c34b;--gold2:#fff0a3;--line:#81742c;--cream:#f5efce;--text:#fffdf1;--muted:#cdc49a;--red:#842f2b;--theme-rgb:216,195,75}
body[data-palette="copper"]{--bg:#160d08;--panel:#2b1a10;--panel2:#432819;--gold:#bd7446;--gold2:#edba91;--line:#75482d;--cream:#efdfd2;--text:#fff8f2;--muted:#c9ab97;--red:#812224;--theme-rgb:189,116,70}
body[data-palette="ivory"]{--bg:#11100d;--panel:#292720;--panel2:#3c3930;--gold:#ded4bd;--gold2:#fffaf0;--line:#7f796b;--cream:#fffaf0;--text:#fffdf8;--muted:#cbc5b8;--red:#7f3032;--theme-rgb:222,212,189}
body[data-palette="custom"]{--bg:#120d07;--panel:#241a0e;--panel2:#332313;--gold:#d5a13f;--gold2:#f5dc9a;--line:#765321;--cream:#f3e1bd;--text:#fff8eb;--muted:#c8b28a;--red:#812224;--theme-rgb:213,161,63}

body[data-frame="classic"]{--ornament:'\2726'}
body[data-frame="forest"]{--ornament:'\2766'}
body[data-frame="death"]{--ornament:'\2620'}
body[data-frame="fire"]{--ornament:'\2727'}
body[data-frame="ice"]{--ornament:'\2744'}
body[data-frame="storm"]{--ornament:'\26A1'}
body[data-frame="earth"]{--ornament:'\25C6'}
body[data-frame="shadow"]{--ornament:'\263E'}
body[data-frame="sacred"]{--ornament:'\2725'}
body[data-frame="arcane"]{--ornament:'\25C8'}
body[data-ornament="normal"] .card:before,body[data-ornament="normal"] .card:after{display:block!important;opacity:.34;font-size:15px;content:var(--ornament)}
body[data-ornament="rich"] .card:before,body[data-ornament="rich"] .card:after{display:block!important;opacity:.88;font-size:22px;content:var(--ornament)}
body[data-ornament="subtle"] .card:before,body[data-ornament="subtle"] .card:after{display:none!important}

.modal-backdrop:has(.modal.modal-icon-browser){padding:0!important;place-items:stretch!important;background:#070c10}
.modal.modal-icon-browser{width:100vw!important;height:100dvh!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:#0b1217;box-shadow:none}
.modal.modal-icon-browser>h2{min-height:68px;margin:0;padding:18px 24px;border-bottom:1px solid var(--line);background:#0a1115;color:var(--cream);font-size:28px}
.modal.modal-icon-browser #modalBody{min-height:0!important;max-height:none!important;overflow:hidden!important;padding:0}
.modal.modal-icon-browser .modal-actions{min-height:66px;margin:0;padding:10px max(22px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(22px,env(safe-area-inset-left));border-top:1px solid var(--line);background:#0a1115}
.modal.modal-icon-browser .modal-actions button{min-width:140px;min-height:46px}
.appearance-workspace{height:100%;min-height:0;display:grid;grid-template-columns:220px minmax(430px,1fr) 330px;background:#0c1216}
.appearance-sidebar{min-height:0;padding:18px 11px;border-right:1px solid var(--line-soft,#344047);background:#0b1216;overflow:auto}
.appearance-sidebar>p{margin:0 10px 10px;color:var(--muted);font-family:Segoe UI,Arial,sans-serif;font-size:12px;font-weight:900;letter-spacing:.08em}
.appearance-nav{width:100%;min-height:66px;display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:10px;margin:0 0 6px;padding:9px 10px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--text);text-align:left;cursor:pointer}
.appearance-nav:hover{background:#141e24}.appearance-nav.active{border-color:var(--gold);background:rgba(var(--theme-rgb),.18);box-shadow:inset 4px 0 var(--gold)}
.appearance-nav .vicon{width:32px;height:32px;color:var(--gold2)}
.appearance-nav span,.appearance-nav strong,.appearance-nav small{display:block;min-width:0}.appearance-nav strong{font-size:16px}.appearance-nav small{margin-top:3px;color:var(--muted);font-size:12px;line-height:1.15}
.appearance-pages{min-width:0;min-height:0;overflow:auto;padding:24px clamp(18px,2vw,34px) 38px;background:#0d1419}
.appearance-page{display:none;max-width:980px;margin:0 auto}.appearance-page.active{display:block}
.appearance-page-head{margin-bottom:20px;padding-bottom:17px;border-bottom:1px solid var(--line-soft,#344047)}
.appearance-page-head h3{margin:0;color:var(--cream);font-size:28px}.appearance-page-head p{margin:6px 0 0;color:var(--muted);font-size:15px;line-height:1.4}
.appearance-workspace .appearance-section{border-radius:8px;background:#11191e}.appearance-workspace .appearance-title h3{font-size:20px}.appearance-workspace .appearance-title p{font-size:14px}
.appearance-workspace .palette-grid{grid-template-columns:repeat(auto-fill,minmax(132px,1fr))}.appearance-workspace .frame-grid{grid-template-columns:repeat(auto-fill,minmax(145px,1fr))}
.palette-choice-custom{position:relative;overflow:hidden}.palette-choice-custom input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.palette-orb-spectrum{background:conic-gradient(#e95d63,#e4c94f,#4ec47a,#4bbbdc,#846ee1,#dd64b2,#e95d63)}
.palette-choice-custom strong{pointer-events:none}

.appearance-preview-pane{min-width:0;min-height:0;padding:16px;border-left:1px solid var(--line-soft,#344047);background:#091015;overflow:auto}
.appearance-preview-pane>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;color:var(--cream);font-family:Segoe UI,Arial,sans-serif}
.appearance-preview-pane>header small{padding:5px 8px;border:1px solid var(--line);border-radius:999px;color:var(--gold2);font-weight:800}
.settings-preview-sheet{--preview-ornament:'\2726';width:100%;max-width:310px;margin:0 auto;border:1px solid var(--line);border-radius:7px;background:radial-gradient(circle at 50% 0,rgba(var(--theme-rgb),.18),var(--bg) 60%);color:var(--text);box-shadow:0 16px 34px rgba(0,0,0,.45);overflow:hidden;transition:max-width .2s ease}
.settings-preview-header{min-height:54px;display:grid;grid-template-columns:36px 1fr;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid var(--line)}
.settings-preview-mark{width:32px;height:32px;display:grid;place-items:center;border:1px solid var(--gold);border-radius:50%}.settings-preview-mark .vicon{width:22px;height:22px}
.settings-preview-header strong,.settings-preview-header small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.settings-preview-header strong{font-size:13px}.settings-preview-header small{margin-top:2px;color:var(--gold2);font-size:8px}
.settings-preview-main{display:grid;grid-template-columns:1.35fr .9fr;gap:5px;padding:6px}
.settings-preview-card{position:relative;min-width:0;border:1px solid var(--line);border-radius:6px;background:linear-gradient(145deg,var(--panel2),var(--panel));overflow:hidden}
.settings-preview-card:before,.settings-preview-card:after{position:absolute;z-index:2;color:var(--gold2);font-size:8px;line-height:1;content:var(--preview-ornament);opacity:.42}.settings-preview-card:before{left:3px;top:3px}.settings-preview-card:after{right:3px;bottom:3px;transform:rotate(180deg)}
.settings-preview-sheet[data-preview-ornament="subtle"] .settings-preview-card:before,.settings-preview-sheet[data-preview-ornament="subtle"] .settings-preview-card:after{display:none}.settings-preview-sheet[data-preview-ornament="rich"] .settings-preview-card:before,.settings-preview-sheet[data-preview-ornament="rich"] .settings-preview-card:after{font-size:13px;opacity:.92;filter:drop-shadow(0 0 4px rgba(var(--theme-rgb),.9))}
.settings-preview-sheet[data-preview-frame="forest"]{--preview-ornament:'\2766'}.settings-preview-sheet[data-preview-frame="forest"] .settings-preview-card{border-radius:14px 3px 14px 3px}
.settings-preview-sheet[data-preview-frame="death"]{--preview-ornament:'\2620'}.settings-preview-sheet[data-preview-frame="death"] .settings-preview-card{border-radius:1px 9px 1px 9px}
.settings-preview-sheet[data-preview-frame="fire"]{--preview-ornament:'\2727'}.settings-preview-sheet[data-preview-frame="fire"] .settings-preview-card{border-radius:12px 2px 12px 2px}
.settings-preview-sheet[data-preview-frame="ice"]{--preview-ornament:'\2744'}.settings-preview-sheet[data-preview-frame="ice"] .settings-preview-card{border-radius:2px 11px 2px 11px}
.settings-preview-sheet[data-preview-frame="storm"]{--preview-ornament:'\26A1'}.settings-preview-sheet[data-preview-frame="storm"] .settings-preview-card{border-radius:4px 15px 4px 15px}
.settings-preview-sheet[data-preview-frame="earth"]{--preview-ornament:'\25C6'}.settings-preview-sheet[data-preview-frame="earth"] .settings-preview-card{border:3px double var(--line);border-radius:8px}
.settings-preview-sheet[data-preview-frame="shadow"]{--preview-ornament:'\263E'}.settings-preview-sheet[data-preview-frame="shadow"] .settings-preview-card{border-radius:16px;box-shadow:inset 0 0 14px rgba(0,0,0,.55)}
.settings-preview-sheet[data-preview-frame="sacred"]{--preview-ornament:'\2725'}.settings-preview-sheet[data-preview-frame="sacred"] .settings-preview-card{border-width:2px;border-radius:12px 12px 3px 3px}
.settings-preview-sheet[data-preview-frame="arcane"]{--preview-ornament:'\25C8'}.settings-preview-sheet[data-preview-frame="arcane"] .settings-preview-card{border-width:2px;border-radius:20px 5px 20px 5px}
.settings-preview-hp{min-height:74px;display:grid;grid-template-columns:48px 1fr;align-items:center;padding:8px;background:linear-gradient(135deg,#761d24,#331013)}
.settings-preview-hp span img,.settings-preview-hp span .vicon{width:44px!important;height:44px!important;object-fit:contain}.settings-preview-hp strong{font-size:22px;text-align:center}.settings-preview-hp i{position:absolute;bottom:7px;width:7px;height:7px;border:1px solid var(--gold);border-radius:50%;background:#142029}.settings-preview-hp i:nth-of-type(1){left:54%}.settings-preview-hp i:nth-of-type(2){left:64%}.settings-preview-hp i:nth-of-type(3){left:74%}
.settings-preview-resource{display:grid;grid-template-columns:44px 1fr;align-items:center;padding:8px}.settings-preview-resource img,.settings-preview-resource .vicon{width:40px!important;height:40px!important}.settings-preview-resource strong{text-align:center;font-size:22px}
.settings-preview-dice{grid-column:1/-1;min-height:52px;padding:6px;text-align:center}.settings-preview-dice>small{display:block;color:var(--gold2);font-size:8px;font-weight:900}.settings-preview-dice>div{display:flex;justify-content:center;gap:5px;margin-top:4px}.settings-preview-dice img,.settings-preview-dice .vicon{width:30px!important;height:30px!important}
.settings-preview-metrics{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr);gap:5px}.settings-preview-metrics section{min-height:48px;display:grid;grid-template-columns:30px 1fr;place-items:center;padding:5px}.settings-preview-metrics img,.settings-preview-metrics .vicon{width:27px!important;height:27px!important}.settings-preview-metrics b{font-size:17px}
.settings-preview-stats{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.settings-preview-stats section{min-height:58px;display:grid;grid-template-columns:24px 1fr;grid-template-rows:24px 1fr;place-items:center;padding:4px;background:#eadbbd;color:#172027}.settings-preview-stats img,.settings-preview-stats .vicon{width:23px!important;height:23px!important}.settings-preview-stats small{font-size:8px;font-weight:900}.settings-preview-stats b{grid-column:1/-1;font-size:18px}
.settings-preview-utility{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:5px}.settings-preview-actions,.settings-preview-class-resource{min-height:58px;display:grid;grid-template-columns:40px 1fr;align-items:center;gap:5px;padding:6px}.settings-preview-actions>span img,.settings-preview-actions>span .vicon,.settings-preview-class-resource>span img,.settings-preview-class-resource>span .vicon{width:36px!important;height:36px!important}.settings-preview-actions small,.settings-preview-class-resource small{display:block;overflow:hidden;color:var(--gold2);font-size:7px;font-style:normal;font-weight:900;text-overflow:ellipsis;white-space:nowrap}.settings-preview-actions b,.settings-preview-class-resource b{display:block;margin:2px 0;font-size:13px}.settings-preview-actions em,.settings-preview-class-resource em{display:flex;gap:3px}.settings-preview-actions em i,.settings-preview-class-resource em i{width:7px;height:7px;border:1px solid var(--gold);border-radius:2px;background:#142029}.settings-preview-actions em i.on,.settings-preview-class-resource em i.on{background:var(--gold2);box-shadow:0 0 5px rgba(var(--theme-rgb),.8)}
.settings-preview-weapons{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:5px}.settings-preview-weapons article{min-height:48px;display:grid;grid-template-columns:1fr auto;align-content:center;gap:2px 5px;padding:6px}.settings-preview-weapons small{grid-column:1/-1;color:var(--gold2);font-size:7px;font-weight:900}.settings-preview-weapons strong{overflow:hidden;font-size:9px;text-overflow:ellipsis;white-space:nowrap}.settings-preview-weapons b{font-size:10px}.settings-preview-weapons .empty strong{grid-column:1/-1;color:var(--muted);font-weight:700}
.settings-preview-focus{min-height:72px;padding:7px}.settings-preview-focus>small{display:block;color:var(--gold2);font-size:7px;font-weight:900}.settings-preview-focus>div{display:grid;grid-template-columns:42px 1fr;align-items:center;gap:6px;margin-top:6px}.settings-preview-focus img,.settings-preview-focus .vicon{width:40px!important;height:40px!important}.settings-preview-focus strong{font-size:10px;line-height:1.1}
.settings-preview-skills{min-height:72px;padding:7px;display:grid;grid-template-columns:1fr 1fr;gap:4px}.settings-preview-skills>strong{grid-column:1/-1;color:var(--gold2);font-size:9px}.settings-preview-skills span{display:flex;justify-content:space-between;gap:3px;padding:3px;border:1px solid rgba(255,255,255,.1);border-radius:3px;font-size:7px}
.settings-preview-tabs{display:grid;grid-template-columns:repeat(6,1fr);border-top:1px solid var(--line)}.settings-preview-tabs span{min-height:27px;display:grid;place-items:center;border-right:1px solid var(--line);color:var(--gold2);font-size:5px}.settings-preview-tabs span:last-child{border-right:0}
.settings-preview-decor{display:flex;align-items:center;justify-content:center;gap:4px;min-height:31px;padding:3px 8px;border-bottom:1px solid rgba(var(--theme-rgb),.25);background:rgba(0,0,0,.2)}.settings-preview-decor.bottom{display:grid;grid-template-columns:1fr auto 1fr;border-top:1px solid rgba(var(--theme-rgb),.25);border-bottom:0}.settings-preview-decor small{color:var(--muted);font-size:8px}.settings-preview-decor .interface-decor-img{width:22px!important;height:22px!important}.settings-preview-decor .interface-decor-img.center{width:26px!important;height:26px!important}.settings-preview-decor .interface-decor-group{display:flex;min-height:0;gap:3px}.settings-preview-decor .side-left{justify-content:flex-start}.settings-preview-decor .center{justify-content:center}.settings-preview-decor .side-right{justify-content:flex-end}
.settings-preview-sheet[data-preview-profile="phone"]{max-width:184px}.settings-preview-sheet[data-preview-profile="phone"] .settings-preview-main{grid-template-columns:1fr}.settings-preview-sheet[data-preview-profile="phone"] .settings-preview-resource,.settings-preview-sheet[data-preview-profile="phone"] .settings-preview-focus,.settings-preview-sheet[data-preview-profile="phone"] .settings-preview-skills{grid-column:1}.settings-preview-sheet[data-preview-profile="phone"] .settings-preview-stats,.settings-preview-sheet[data-preview-profile="phone"] .settings-preview-utility,.settings-preview-sheet[data-preview-profile="phone"] .settings-preview-weapons{grid-template-columns:1fr 1fr}.settings-preview-sheet[data-preview-profile="phone"] .settings-preview-tabs{grid-template-columns:1fr 1fr}
.settings-preview-sheet[data-preview-profile="tablet"]{max-width:278px}
.settings-preview-sheet[data-preview-profile="desktop"]{max-width:310px}

@media(max-width:1180px){.appearance-workspace{grid-template-columns:185px minmax(390px,1fr) 255px}.appearance-preview-pane{padding:12px}.appearance-workspace .icon-browser-layout{grid-template-columns:180px minmax(0,1fr)}.appearance-workspace .icon-target-btn{grid-template-columns:40px 1fr}.appearance-workspace .icon-target-btn img{width:38px;height:38px}}
@media(max-width:820px){.appearance-workspace{grid-template-columns:165px minmax(390px,1fr)}.appearance-preview-pane{display:none}.appearance-pages{padding:18px 14px 30px}.appearance-nav{grid-template-columns:30px 1fr;padding:7px}.appearance-nav .vicon{width:27px;height:27px}}
@media(max-width:620px){.modal.modal-icon-browser>h2{min-height:58px;padding:14px 16px;font-size:23px}.appearance-workspace{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr)}.appearance-sidebar{display:grid;grid-template-columns:repeat(4,minmax(94px,1fr));gap:5px;padding:8px;overflow-x:auto;border-right:0;border-bottom:1px solid var(--line)}.appearance-sidebar>p{display:none}.appearance-nav{min-height:58px;margin:0;grid-template-columns:26px 1fr}.appearance-nav small{display:none}.appearance-page-head h3{font-size:24px}.appearance-workspace .icon-browser-layout{grid-template-columns:1fr}.appearance-workspace .icon-target-list{position:static;grid-template-columns:1fr 1fr;max-height:220px}.modal.modal-icon-browser .modal-actions button{min-width:110px}}

body[data-display-profile="phone"]{overflow-x:hidden}
body[data-display-profile="phone"] .sheet-app{min-width:0;padding:7px 7px calc(134px + env(safe-area-inset-bottom,0px))!important}
body[data-display-profile="phone"] .sheet-header{display:flex!important;flex-wrap:wrap!important;position:sticky!important;top:0!important;z-index:60!important;gap:8px!important;background:rgba(3,7,10,.98)!important}
body[data-display-profile="phone"] .brand-mark{display:none!important}
body[data-display-profile="phone"] .title-wrap{flex:1 1 100%;min-width:0}
body[data-display-profile="phone"] .title-wrap h1{font-size:24px!important}
body[data-display-profile="phone"] .title-wrap p{font-size:13px!important}
body[data-display-profile="phone"] .header-actions{display:grid!important;grid-template-columns:minmax(0,1fr) repeat(3,54px)!important;width:100%!important;gap:6px!important}
body[data-display-profile="phone"] .header-actions .hide-small{display:none!important}
body[data-display-profile="phone"] .select-btn{width:100%!important;max-width:none!important;min-width:0!important}
body[data-display-profile="phone"] .icon-btn{min-width:54px!important;width:54px!important}
body[data-display-profile="phone"] .sheet-grid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto!important;gap:9px!important}
body[data-display-profile="phone"] .portrait-card{grid-column:1!important;grid-row:1!important;height:280px!important;min-height:280px!important;max-height:280px!important}
body[data-display-profile="phone"] .summary-card{grid-column:1!important;grid-row:2!important;grid-template-columns:1fr!important}
body[data-display-profile="phone"] .metrics{grid-column:1!important;grid-row:3!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
body[data-display-profile="phone"] .stats-panel{grid-column:1!important;grid-row:4!important;grid-template-columns:1fr 1fr!important}
body[data-display-profile="phone"] .skills-panel{grid-column:1!important;grid-row:5!important;height:auto!important;overflow:visible!important}
body[data-display-profile="phone"] .skills-list{grid-template-columns:1fr!important}
body[data-display-profile="phone"] .resources{grid-column:1!important;grid-row:6!important;grid-template-columns:1fr!important}
body[data-display-profile="phone"] .quick-weapons{grid-column:1!important;grid-row:7!important;grid-template-columns:1fr!important}
body[data-display-profile="phone"] .tabs{position:fixed!important;left:7px!important;right:7px!important;bottom:calc(7px + env(safe-area-inset-bottom,0px))!important;width:auto!important;grid-column:auto!important;grid-row:auto!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;z-index:80!important;min-height:116px!important}
body[data-display-profile="phone"] .tab{min-width:0!important;min-height:56px!important;height:56px!important;padding:3px!important;font-size:12px!important;white-space:normal!important}
body[data-display-profile="phone"] .tab .vicon{width:24px!important;height:24px!important}
body[data-display-profile="phone"] .interface-decor-bottom{grid-column:1!important}
body[data-display-profile="phone"] .tab-content{display:none!important}
.powers-header>div{min-width:0;flex:1}
.powers-filter-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
.powers-filter-row button{min-height:48px;padding:8px 18px;border:2px solid var(--line);border-radius:12px;background:#18232b;color:var(--text);font-size:19px;font-weight:700;cursor:pointer}
.powers-filter-row button.active,.powers-filter-row button:focus-visible{border-color:var(--gold2);background:var(--gold);color:#1b1208}
.power-card.spell-card{border-color:rgba(var(--theme-rgb),.72);background:linear-gradient(145deg,rgba(var(--theme-rgb),.28),var(--panel))}
.power-card.spell-card .power-group{color:var(--gold2)}
@media(max-width:760px){.powers-filter-row{gap:7px;margin-top:12px}.powers-filter-row button{min-height:42px;padding:7px 12px;font-size:17px}.powers-header{gap:12px}}
