#action-tabs{display:flex;gap:.35rem;flex-wrap:wrap}#spell-panel{padding:1rem;border:1px solid #4e756d;border-radius:12px;background:#172d31}#spell-panel label{display:block;margin:.75rem 0}#spell-panel label input,#spell-panel label select{display:block;width:100%;margin-top:.3rem}#spell-panel label input[type=checkbox]{display:inline;width:auto;margin-right:.4rem}.spell-card-mini{margin:1rem 0;padding:.7rem;border-left:3px solid #e8bb72}.spell-source{color:#a5decb;font-size:.85rem}.spell-card-mini .muted{font-size:.85rem;max-height:8rem;overflow:auto}.spell-mode #combat-panel>:not(.pending-hit){display:none}.quick-magic{margin:1rem 0;border-top:1px solid #40595e;padding-top:.6rem}.quick-magic .resource-row{gap:.3rem;padding:.4rem 0}.custom-spell-editor label{display:block;margin:.5rem 0}.custom-spell-editor input,.custom-spell-editor select,.custom-spell-editor textarea{width:100%;margin-top:.3rem}.custom-spell-editor textarea{min-height:10rem}.custom-spell-editor{max-width:780px}.custom-spell-editor .sheet-grid{grid-template-columns:1fr 1fr}.reference-card .spell-source{white-space:pre-wrap}

/* Session controls stay distinct from preparation and the complete record. */
:root{--sidebar-width:260px;--actions-width:330px}
main{grid-template-columns:var(--sidebar-width) minmax(220px,1fr) var(--actions-width)}
header{gap:14px}.header-right{min-width:0}#scene-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#left-toggle{font-size:12px}#left-panel{padding:16px 13px}#sidebar-label{font-size:10px;color:var(--muted);letter-spacing:1.5px;text-transform:uppercase;margin-bottom:12px}
#tabs{border:0;padding:0;margin:0 0 14px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}#tabs button{font-size:11px;padding:9px 3px;min-width:0;white-space:normal}#tabs button[data-tab=access]{grid-column:span 2}
.ui-count,#log-unread{display:inline-flex;align-items:center;justify-content:center;min-width:18px;min-height:18px;margin-left:6px;padding:0 4px;border-radius:10px;background:#cce3b4;color:#172b22;font:700 10px system-ui}
#party-drawer{border:1px solid var(--line);border-radius:9px;margin:0 0 14px;padding:9px;background:#142126}#party-drawer>summary{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--text);list-style:none}#party-drawer>summary:before{content:'›';font-size:19px;line-height:1;color:var(--green)}#party-drawer[open]>summary:before{transform:rotate(90deg)}#party-heading{flex:1}#party-count{border-radius:12px;background:#273c39;padding:1px 7px;color:var(--green);font-size:11px}#party-review{width:100%;margin-top:10px;white-space:normal;font-size:11px}.pc{margin:7px 0;padding:7px}.pc img{height:36px;width:36px}.pc small{font-size:10px}#party>.eyebrow{display:none}.character-create{width:100%}
#player-tools{margin:0 0 18px}.own-character{padding:14px 10px;border:1px solid #4b7564;border-radius:12px;background:linear-gradient(150deg,#253e36,#16272c);margin-bottom:14px}.own-character-head{display:flex;align-items:center;gap:12px;margin-bottom:15px}.own-character-head img{width:64px;height:64px;object-fit:cover;border-radius:14px;border:1px solid #84b394;cursor:zoom-in}.own-character h2{margin:0 0 4px;font-size:25px}.own-character .muted{font-size:11px}.own-stats{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:6px;margin:12px 0}.own-stat{padding:9px 4px;background:#10211e7d;border-radius:8px;text-align:center}.own-stat small{display:block;font-size:10px}.own-stat strong{font-size:19px;color:#dceccd}.own-character>button{width:100%;margin-top:8px;padding:10px;font-size:12px}.own-character details{font-size:11px;margin:10px 0 0}.own-character details p{margin-top:8px}.quick-magic{border:1px solid var(--line);padding:12px 10px;border-radius:10px;margin:12px 0}.quick-magic h3{font-size:13px}.quick-magic .resource-row{padding:5px 0}.quick-magic .resource-row button{min-width:31px}.quick-magic>button{font-size:11px;margin:4px 4px 0 0;padding:7px}.quick-magic details{font-size:11px}.quick-magic details>select{margin:5px 0}.quick-magic details>button{width:100%;white-space:normal;font-size:11px}.quick-magic .muted{font-size:11px}.own-effects{padding:10px;border:1px solid #665e3c;border-radius:8px}.own-effects p{margin:6px 0 10px}
#gm-panel>details,.gm-section{padding:10px;border:1px solid var(--line);border-radius:9px;margin:10px 0;background:#142126}#gm-panel>details>summary,.gm-section>summary{color:#c6d5c9;font-size:12px}#gm-panel>details[open]>summary,.gm-section[open]>summary{margin-bottom:10px}.gm-section h3{margin-top:12px}.gm-section>button{white-space:normal;width:100%;margin:5px 0}.gm-section p,.gm-section label{font-size:12px}.encounter-peek{display:flex;justify-content:space-between;gap:8px;align-items:center;border:1px solid #4a6957;padding:10px;border-radius:8px;margin:10px 0;font-size:12px}.encounter-peek strong{color:var(--gold);font-size:16px}.enemy-card{padding:9px;margin:8px 0}.enemy-card .enemy-portrait{width:38px;height:38px;border-radius:8px;margin-right:8px}.enemy-card .row{clear:both;margin-bottom:0}.enemy-card .row button{font-size:10px;padding:5px 6px}.enemy-card .manual-help{display:none}.enemy-card:has(.warn) .manual-help{display:block}
#right-panel{padding:13px;overflow:hidden;gap:12px;min-height:0}#workspace-tabs{display:flex;gap:6px;flex-shrink:0}#workspace-tabs button{flex:1;font-weight:600;padding:10px;font-size:13px}#workspace-play.attention{box-shadow:inset 0 0 0 1px #eac779}#activity-pane{overflow:auto;min-height:0;flex:1;padding-right:3px;scrollbar-gutter:stable}#activity-pane>*{max-width:100%}#activity-pane #combat-panel{max-height:none;overflow:visible}#action-tabs{display:grid;grid-template-columns:1fr 1fr 1fr;margin:0 0 13px;gap:4px}#action-tabs button{font-size:11px;min-width:0;white-space:normal;padding:8px 4px}#spell-panel{padding:12px}#spell-panel label{margin:9px 0}.spell-card-mini{margin:10px 0}.spell-card-mini .muted{font-size:12px;max-height:5rem}#activity-pane .dice{border:1px solid var(--line);background:#14252a;border-radius:11px;padding:13px}.dice>.eyebrow{display:none}.dice h2{font-size:23px;margin-bottom:12px}.dice label{font-size:11px}.dice .check{font-size:11px}.dice .row{flex-wrap:nowrap}#last-roll{margin-top:13px;padding-top:10px;border-top:1px solid var(--line);min-height:0;gap:10px}#last-roll:empty{display:none}#last-roll span{font-size:11px}#last-roll strong{font-size:25px}#dice-animation:not(:has(.rolling)){display:none}
#turn-panel{max-height:35dvh;overflow:auto;padding:10px;margin:0;flex-shrink:0}#turn-panel .eyebrow{font-size:9px;letter-spacing:1.5px}.turn-heading{display:flex;justify-content:space-between;gap:7px;align-items:center;margin-bottom:8px}.turn-heading strong{color:#efdaa4;font-size:13px}.turn-heading small{font-size:10px}.turn-order{margin:7px 0;font-size:11px}.turn-order>summary{color:#c5d9cd}.initiative-row{padding:4px;font-size:11px}.initiative-row img{width:26px;height:26px}.turn-budget{margin:8px 0 5px}.turn-budget span{font-size:10px;padding:4px 5px}#turn-panel>p{margin:6px 0;font-size:12px}#turn-panel .row button{font-size:11px;padding:5px}#turn-panel>button{padding:8px;font-size:12px}body[data-workspace=log] #turn-panel{max-height:105px}body[data-workspace=log] #turn-panel>button,body[data-workspace=log] #turn-panel>.row,body[data-workspace=log] #turn-panel>details:not(.turn-order),body[data-workspace=log] #turn-panel>.turn-budget,body[data-workspace=log] #turn-panel>.pending-hit{display:none}
.turn-actions{font-size:11px;margin:8px 0}.turn-actions button{white-space:normal;font-size:11px;padding:6px;margin:4px 2px}body[data-workspace=log] #turn-panel>.turn-order{display:none}body[data-play-mode=combat] #preview-entries{max-height:130px}#spell-panel>button.primary{width:100%;white-space:normal;padding:10px}.spell-card-mini .muted{max-height:3.4rem}.turn-extra-controls{display:flex;gap:6px;align-items:center;margin:8px 0 0}.turn-extra-controls button{font-size:11px;flex:1;padding:8px}
#log-preview{border-top:1px solid var(--line);padding-top:11px;flex:0 0 auto}#log-preview>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}#log-preview h3{font-size:11px;color:var(--muted);margin:0}#preview-open{font-size:10px;padding:4px 8px}#preview-entries{display:grid;gap:6px;max-height:210px;overflow:auto}#preview-entries .table-entry{padding:8px 10px}#preview-entries .table-title{font-size:11px;max-height:3em;overflow:hidden}#preview-entries .table-total{font-size:25px}#preview-entries .table-entry-head{font-size:9px}#preview-entries .table-outcome{font-size:10px;padding:2px 5px}.table-entry{border:1px solid #2f4647;border-left:3px solid #52796e;border-radius:9px;padding:11px;background:#15252b;margin:0 0 8px;overflow-wrap:anywhere}.table-entry-head{display:flex;align-items:center;gap:7px;color:#94aaa4;font-size:10px;margin-bottom:7px}.table-kind{font-weight:600;color:#bfd5cb;background:#28423c;border-radius:5px;padding:2px 5px;flex-shrink:0}.table-person{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.table-entry-head time{white-space:nowrap}.table-entry-main{display:flex;align-items:center;gap:12px}.table-title{flex:1;font-size:12px;line-height:1.5;white-space:pre-wrap}.table-total{flex-shrink:0;color:#a9e2bf;font-size:32px;line-height:1;font-weight:700}.table-outcome{display:inline-block;padding:3px 7px;margin-top:7px;background:#304530;border-radius:5px;font-size:11px;color:#c9e5b7}.table-outcome.miss{background:#423237;color:#e7bcb6}.table-message{border-left-color:#8cb5db;background:#182a36}.table-message .table-kind{background:#2b405b;color:#ccdcee}.table-combat{border-left-color:#cbaa6c}.table-private{border-left-color:#d7b378;background:#2b2929}.table-privacy{font-size:10px;color:#e0c187;margin:0 0 6px}.table-calculation{margin:9px 0 0;padding-top:7px;border-top:1px solid #314342;font-size:11px}.table-calculation summary{font-size:10px;color:#a6bbb2}.table-calculation p{margin:8px 0 0;color:#c4d2c9}.log-day{font-size:10px;color:#8da69b;letter-spacing:1px;text-align:center;margin:13px 0}.log-day:first-child{margin-top:2px}.log-empty{font-size:12px;color:var(--muted);padding:25px 12px;text-align:center}
#right-panel .log-section{margin:0;min-height:0;flex:1;overflow:hidden;gap:7px}.tabletop-heading{display:flex;align-items:center;gap:8px;flex-shrink:0}.tabletop-heading h2{flex:1;font-size:23px;margin:0}.tabletop-heading select{width:145px;font-size:11px;padding:7px}.log-tools{margin:0;font-size:11px;flex-shrink:0}.log-tools>summary{font-size:11px}.log-tools[open]{padding:8px;border:1px solid var(--line);border-radius:7px}.log-tools input,.log-tools select{font-size:11px;margin-top:6px;padding:6px}.log-tools label{font-size:10px;margin:4px 0}#log-meta{font-size:10px;color:var(--muted);margin:0;flex-shrink:0}#log-latest,#log-older{font-size:11px;padding:6px;flex-shrink:0}#right-panel .log-section #log{border:0;border-radius:0;padding:2px 2px 0 0;background:transparent;max-height:none;min-height:80px;flex:1;scrollbar-gutter:stable}#log-announcement{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.message-composer{padding-top:9px;border-top:1px solid var(--line);flex-shrink:0}.message-composer label{margin:0 0 5px;font-size:10px}.message-composer #message-to{margin:0;padding:7px;font-size:11px}.message-composer .row{flex-wrap:nowrap;margin:5px 0}.message-composer #message{font-size:12px;padding:10px}.message-composer #send-message{padding:8px 12px}.message-composer #message-status{font-size:10px;color:#b4c7bc;margin:3px 0}.log-export{margin:0;font-size:10px;flex-shrink:0}.log-export button{font-size:11px;padding:6px 8px}.log-export .row{margin-bottom:0}
body.left-hidden main{grid-template-columns:minmax(220px,1fr) var(--actions-width)}body.left-hidden #left-panel{display:none}body.map-focus main{grid-template-columns:1fr}body.map-focus #left-panel,body.map-focus #right-panel{display:none}
@media(max-width:1250px){:root{--sidebar-width:235px;--actions-width:305px}header{gap:10px}.brand{font-size:19px;letter-spacing:2px}#audio-enable,#logout{font-size:11px;padding:7px}.status{font-size:10px;max-width:90px}.tabletop-heading select{width:130px}.tabletop-heading h2{font-size:21px}}
@media(max-width:1000px){:root{--sidebar-width:205px;--actions-width:285px}#left-panel,#right-panel{padding:10px}.own-character-head{gap:8px}.own-character-head img{width:48px;height:48px}.own-character h2{font-size:22px}#tabs{grid-template-columns:repeat(2,minmax(0,1fr))}#tabs button[data-tab=access]{grid-column:auto}#scene-title{font-size:11px}.header-right{gap:5px}.tabletop-heading{flex-wrap:wrap}.tabletop-heading select{flex:1}}
@media(max-width:800px){main{grid-template-columns:minmax(230px,1fr) var(--actions-width)}#left-panel{display:none;position:absolute;top:66px;bottom:36px;left:0;width:280px;z-index:6;box-shadow:10px 0 35px #0009;max-height:none!important}body.mobile-left-open #left-panel{display:block}#scene-title{display:none}.status{display:none}.brand{font-size:18px}.tabletop-heading{flex-wrap:nowrap}.tabletop-heading h2{font-size:20px}.tabletop-heading select{max-width:135px}body.map-focus main{grid-template-columns:1fr}}
@media(max-width:640px){header{min-height:80px;padding:9px;gap:5px;height:auto}.brand{font-size:18px}.header-right{gap:5px;width:auto;flex:1;justify-content:flex-end}.header-right button{font-size:10px;padding:6px}#left-toggle{font-size:10px}#logout{display:none}main{display:flex;flex-direction:column;height:auto}#left-panel{top:80px;bottom:36px;position:fixed;width:min(300px,90vw)}#map-area{height:52dvh;min-height:310px;order:0}#right-panel{width:100%;height:650px!important;min-height:0;padding:13px;order:1;overflow:hidden}#turn-panel{max-height:240px}#activity-pane{flex:1;min-height:0}#preview-entries{max-height:140px}#log-preview{max-height:185px}#right-panel .log-section #log{max-height:none}.tabletop-heading{flex-wrap:nowrap}.tabletop-heading h2{font-size:23px}.tabletop-heading select{max-width:none;width:155px;flex:0 0 auto}body.map-focus #map-area{height:calc(100dvh - 120px)}.map-toolbar{gap:5px}.map-toolbar button{font-size:10px}#turn-panel>.row{flex-wrap:nowrap}#activity-pane .dice .row{flex-wrap:nowrap}.message-composer .row{flex-wrap:nowrap}}

/* Version 8: character spell cards and turn prompts */
.spell-row-edit{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px;min-width:0;padding:13px 0}
.spell-row-edit>.spell-title{flex:1 1 220px;min-width:0;overflow-wrap:anywhere;text-align:left}
.spell-row-edit>small{flex:0 1 auto;max-width:170px;overflow-wrap:anywhere}
.spell-row-edit>button:not(.spell-title){flex:0 0 auto;width:auto;max-width:100%;padding:7px 10px;font-size:11px;white-space:normal}
.spell-row-edit>button:last-child{width:32px;min-width:32px;height:32px;padding:0;flex:0 0 32px;font-size:19px}
.spell-row-edit>label{display:flex;align-items:center;gap:6px;margin:0 5px;font-size:11px;white-space:nowrap}
.spell-row-edit>label input{width:17px;height:17px;margin:0}
.sheet-content,.sheet-card{min-width:0}.sheet-card>button{max-width:100%;white-space:normal}.sheet-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sheet-grid>*{min-width:0}
.downed-label{display:block;background:#633e28;border:1px solid #edbd7d;border-radius:6px;padding:9px;font-size:12px;color:#ffe1a2;margin-top:8px}
.combat-prompt{width:450px;max-width:92vw;padding:25px;border-color:#c7b680;z-index:25}.combat-prompt h2{font-size:27px}.combat-prompt p{font-size:14px;margin:15px 0}.prompt-actions{display:flex;flex-wrap:wrap;gap:8px}.prompt-actions button{white-space:normal;font-size:12px}
.turn-notice{position:fixed;top:80px;left:50%;transform:translateX(-50%);max-width:min(520px,94vw);background:#264937;border:1px solid #abd2a1;color:#f2e4bf;box-shadow:0 8px 35px #0008;z-index:24;border-radius:12px;padding:14px 20px;pointer-events:none}
#toast.enemy-status{display:grid;grid-template-columns:35px 1fr;text-align:left;gap:3px 12px;border-color:#94cfa4;min-width:230px;background:#18352d}
.enemy-status-icon{grid-row:span 2;font-size:32px;color:#e6c88d}.enemy-status-text{font-size:13px;color:#d5e8d6}#toast.status-danger{border-color:#e5aa66;background:#452c21}#toast.status-dead{border-color:#c2aaa0;background:#292126}
#gm-override.active{background:#6b392c;border-color:#d89171}#log-clear{color:#edc29a;margin-top:9px;border-color:#785041}
@media(max-width:650px){.spell-row-edit>.spell-title{flex-basis:100%}.spell-row-edit>small{max-width:45%}.combat-prompt{padding:20px}.prompt-actions button{flex:1 1 110px}.turn-notice{top:88px;font-size:12px;width:90%}}

#log-clear{align-self:flex-end;font-size:11px;padding:5px 9px;margin:0;flex-shrink:0}

#dice-stage{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:35}#dice-stage-caption{position:absolute;left:50%;top:23%;transform:translateX(-50%);z-index:36;pointer-events:none;background:#0c2029ed;border:1px solid #b5ccb0;border-radius:14px;padding:12px 22px;color:#eee6c5;text-align:center;max-width:80%;box-shadow:0 12px 35px #0009}#dice-stage-caption[hidden],#dice-stage[hidden]{display:none}.dice-drama{font-family:Georgia,serif;font-size:clamp(18px,3vw,32px);letter-spacing:.06em}.critical-success{border-color:#f2cf73!important;box-shadow:0 0 35px #e4c56b66!important}.critical-fail{border-color:#db897e!important}.dice-shake>canvas#map{animation:dice-jolt .38s ease-out}@keyframes dice-jolt{15%{transform:translate(3px,-2px)}35%{transform:translate(-3px,2px)}60%{transform:translate(2px,1px)}85%{transform:translate(-1px,-1px)}}.critical-window{max-width:840px}.crit-table-toolbar{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin:12px 0}.crit-table-toolbar button{width:auto}.crit-rule-row{padding:8px;border-bottom:1px solid #56736977}.crit-result{border:1px solid #d7b96e;background:linear-gradient(135deg,#253c38,#142429);padding:18px;border-radius:14px;margin:14px 0}.crit-result h3{margin:0 0 10px}.crit-choice{display:grid;gap:12px;margin:16px 0}.crit-progress{font-size:13px;color:#b4d4bf}.crit-actions{display:flex;gap:10px;flex-wrap:wrap}.crit-actions button{width:auto}.crit-buttonbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.crit-buttonbar button{width:auto}.crit-objects{border-top:1px solid #476259;padding-top:10px;margin-top:12px}.crit-effect-button{font-size:12px;padding:6px 10px}.roll-hidden-note{color:#a8c9bb;font-size:13px}.critical-summon{border:1px solid #aa93ce;border-radius:10px;padding:10px;margin:10px 0}@media(prefers-reduced-motion:reduce){.dice-shake>canvas#map{animation:none}}
