/* Per-DM palette, with a slow animated aurora tracing the workspace edge. */
:root{--theme-accent:#d7a45c;--theme-accent-strong:#f1c77d;--theme-glow:rgba(238,160,74,.2);--theme-wash:rgba(238,160,74,.09)}
:root[data-dm-theme="arcane"]{--theme-accent:#b493ff;--theme-accent-strong:#d4c0ff;--theme-glow:rgba(157,111,255,.23);--theme-wash:rgba(157,111,255,.1)}
:root[data-dm-theme="tide"]{--theme-accent:#59c7d0;--theme-accent-strong:#9be9eb;--theme-glow:rgba(52,197,210,.23);--theme-wash:rgba(52,197,210,.1)}
:root[data-dm-theme="verdant"]{--theme-accent:#8ec879;--theme-accent-strong:#b6e59e;--theme-glow:rgba(111,196,92,.22);--theme-wash:rgba(111,196,92,.1)}
:root[data-dm-theme="rose"]{--theme-accent:#ee8cae;--theme-accent-strong:#ffbad0;--theme-glow:rgba(235,106,157,.23);--theme-wash:rgba(235,106,157,.1)}
:root{--gold:var(--theme-accent)}
html,body{scrollbar-width:thin;scrollbar-color:var(--theme-accent) #111713}
html::-webkit-scrollbar,body::-webkit-scrollbar{width:11px;height:11px}
html::-webkit-scrollbar-track,body::-webkit-scrollbar-track{background:#111713;box-shadow:inset 0 0 0 1px #293129}
html::-webkit-scrollbar-thumb,body::-webkit-scrollbar-thumb{border:2px solid #111713;border-radius:9px;background:linear-gradient(180deg,var(--theme-accent-strong),var(--theme-accent));box-shadow:0 0 9px var(--theme-glow)}
html::-webkit-scrollbar-thumb:hover,body::-webkit-scrollbar-thumb:hover{background:var(--theme-accent-strong);box-shadow:0 0 14px var(--theme-glow)}
html::-webkit-scrollbar-corner,body::-webkit-scrollbar-corner{background:#111713}
body::before{content:"";position:fixed;z-index:20;top:0;left:0;width:100%;height:2px;pointer-events:none;background:linear-gradient(90deg,transparent,var(--theme-accent),#fff8,var(--theme-accent-strong),transparent);background-size:220% 100%;animation:dm-aurora 11s ease-in-out infinite;box-shadow:0 0 14px var(--theme-glow)}
body::after{content:"";position:fixed;z-index:0;inset:-20%;pointer-events:none;opacity:.3;background:radial-gradient(ellipse at 68% 2%,var(--theme-wash),transparent 38%);animation:dm-bloom 18s ease-in-out infinite alternate}
.toast{z-index:2147483647;max-width:min(90vw,720px);box-shadow:0 16px 48px #000c}
.custom-dialog-result-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.custom-dialog-result-actions #custom-dialog-bubble-preview[aria-pressed="true"]{border-color:var(--theme-accent);color:var(--theme-accent-strong);background:var(--theme-wash)}
.custom-dialog-game-frame{box-sizing:border-box;width:100%;min-height:94px;margin-top:16px;padding:15px 17px;border:1px solid #625447;border-radius:5px;background:linear-gradient(145deg,rgba(40,29,29,.93),rgba(17,14,17,.96));box-shadow:inset 0 1px 0 #9c7c6044,inset 0 0 28px #0009,0 8px 24px #0005;color:#f4f0e8;font:normal 16px/1.28 Georgia,'Times New Roman',serif;text-shadow:0 1px 2px #000;overflow-wrap:anywhere}
.custom-dialog-result.is-game-width .custom-dialog-game-frame{max-width:410px}
.custom-dialog-speaker{color:#b5a5ff;font:inherit;text-shadow:0 1px 2px #000}
.custom-dialog-speaker::after{content:': ';color:#f4f0e8}
.custom-dialog-game-frame .custom-dialog-output{display:inline;min-height:0;padding:0;color:#f4f0e8;font:inherit;line-height:inherit;white-space:pre-wrap;text-shadow:inherit}
.custom-dialog-game-frame .custom-dialog-output:empty{color:#a99e98}
.custom-dialog-history-row{display:grid;grid-template-columns:minmax(0,1fr) 36px;gap:7px;min-width:0}
.custom-dialog-history-row .custom-dialog-history-item{min-width:0}
.custom-dialog-history-delete{width:36px;min-height:36px;align-self:stretch;border:1px solid #5b3e3c;border-radius:7px;background:rgba(45,25,25,.58);color:#dbaaa4;font-size:20px;line-height:1;cursor:pointer;opacity:.72}
.custom-dialog-history-delete:hover,.custom-dialog-history-delete:focus-visible{opacity:1;border-color:#df8980;background:rgba(91,37,34,.75);outline:none}
.custom-dialog-history-delete:disabled{opacity:.35;cursor:wait}
@media(max-width:580px){.custom-dialog-result-head{align-items:flex-start;gap:12px}.custom-dialog-result-actions{gap:5px}.custom-dialog-game-frame{font-size:15px;padding:12px}}
.app{position:relative;z-index:1}
@keyframes dm-aurora{0%,100%{background-position:100% 0;opacity:.65}50%{background-position:0 0;opacity:1}}
@keyframes dm-bloom{from{transform:translate3d(-1%,0,0) scale(.96)}to{transform:translate3d(1%,2%,0) scale(1.05)}}
.theme-picker{display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border:1px solid #343b35;background:#191e1a;border-radius:20px;color:var(--theme-accent);transition:border-color .25s,box-shadow .25s}
.ai-npc-search{border-color:rgba(185,205,190,.22);background:linear-gradient(110deg,rgba(0,0,0,.63),rgba(3,7,8,.43));backdrop-filter:blur(14px) saturate(125%);-webkit-backdrop-filter:blur(14px) saturate(125%);box-shadow:inset 0 1px rgba(255,255,255,.06),0 8px 24px rgba(0,0,0,.18);color:var(--theme-accent);transition:border-color .2s,box-shadow .2s}
.ai-npc-search:hover,.ai-npc-search:focus-within{border-color:color-mix(in srgb,var(--theme-accent) 65%,transparent);box-shadow:inset 0 1px rgba(255,255,255,.08),0 0 0 2px var(--theme-wash),0 9px 28px rgba(0,0,0,.25)}
.ai-npc-search input{color:#edf2eb;caret-color:var(--theme-accent);background:transparent}
.ai-npc-search input::placeholder{color:#a4b2a5;opacity:.78}
:root[data-dm-pills="custom"] :is(.theme-picker,.topbar .view-tabs,.topbar .view-tab.active,.ai-global-switch,.ai-global-radius,.ai-global-count,.ai-global-count select,.capture-state,.ai-badge,.director-engage,.dir-toggle,.director-controls.is-open .dir-toggle,.dir-btn,.channel-chip,.theme-category-tabs button,.theme-card-badges span,.theme-current-check,.ai-player-auto,.ai-npc-favorite,.ai-player-star){background:var(--dm-pill-bg);backdrop-filter:blur(7px)}
.theme-picker:focus-within,.theme-picker:hover{border-color:var(--theme-accent);box-shadow:0 0 15px var(--theme-glow)}
.theme-orbit{font-size:12px;animation:dm-orbit 7s linear infinite;text-shadow:0 0 12px var(--theme-accent)}
@keyframes dm-orbit{to{transform:rotate(360deg)}}
.theme-picker select{max-width:72px;border:0;outline:0;background:transparent;color:#d8dbd1;font-size:9px;cursor:pointer}
.theme-picker option{background:#191e1a;color:#e7e8e2}
.brand,.welcome-foot span,.list-marker,.text-action,.context-tip,.prompt-detail-back{color:var(--theme-accent)}
.brand{border-color:var(--theme-accent);box-shadow:0 0 17px var(--theme-glow)}
.rail-icon.active,.list-item.active,.list-item:hover{background:var(--theme-wash)}
.rail-icon.active,.list-item.active{color:var(--theme-accent-strong)}
.sigil{color:var(--theme-accent);text-shadow:0 0 30px var(--theme-glow)}
.primary,.send-button{border-color:var(--theme-accent);background:var(--theme-accent);color:#11140f;transition:background .2s,box-shadow .25s,transform .2s}
.primary:hover,.send-button:hover{background:var(--theme-accent-strong);box-shadow:0 0 22px var(--theme-glow);transform:translateY(-1px)}
.quiet-button:hover,.prompt-detail-back:hover{color:var(--theme-accent-strong);border-color:var(--theme-accent)}
.field input:focus,.field textarea:focus,.composer:focus-within{border-color:var(--theme-accent);box-shadow:0 0 0 3px var(--theme-wash)}
.prompt-card:hover{border-color:var(--theme-accent);box-shadow:0 0 22px var(--theme-wash)}
.prompt-state.testable{border-color:var(--theme-accent);box-shadow:0 0 12px var(--theme-wash)}
.view-tab.active{color:var(--theme-accent-strong);border-color:var(--theme-accent)}
.dc-editor .dc-stage textarea,.dc-editor .dc-stage .dc-preview{scrollbar-width:thin;scrollbar-color:var(--theme-accent) #111512}
.dc-editor .dc-stage textarea::-webkit-scrollbar,.dc-editor .dc-stage .dc-preview::-webkit-scrollbar{width:10px;height:10px}
.dc-editor .dc-stage textarea::-webkit-scrollbar-track,.dc-editor .dc-stage .dc-preview::-webkit-scrollbar-track{background:#111512;border-radius:8px;box-shadow:inset 0 0 0 1px #292f2a}
.dc-editor .dc-stage textarea::-webkit-scrollbar-thumb,.dc-editor .dc-stage .dc-preview::-webkit-scrollbar-thumb{border:2px solid #111512;border-radius:8px;background:linear-gradient(180deg,var(--theme-accent-strong),var(--theme-accent),var(--theme-accent-strong));background-size:100% 220%;box-shadow:0 0 9px var(--theme-glow);animation:dm-editor-scroll 6s ease-in-out infinite;transition:filter .2s,box-shadow .2s}
.dc-editor .dc-stage textarea::-webkit-scrollbar-thumb:hover,.dc-editor .dc-stage .dc-preview::-webkit-scrollbar-thumb:hover{filter:brightness(1.25);box-shadow:0 0 14px var(--theme-glow)}
@keyframes dm-editor-scroll{0%,100%{background-position:0 0;box-shadow:0 0 6px var(--theme-glow)}50%{background-position:0 100%;box-shadow:0 0 13px var(--theme-glow)}}
@media(prefers-reduced-motion:reduce){body::before,body::after,.theme-orbit,.dc-editor .dc-stage textarea::-webkit-scrollbar-thumb,.dc-editor .dc-stage .dc-preview::-webkit-scrollbar-thumb{animation:none}.primary,.send-button{transition:none}}
@media(max-width:760px){.top-actions{gap:7px}.theme-picker{padding:4px 6px}.theme-picker select{max-width:62px}}

/* Personalities are the full-height navigation for the current DM workspace. */
.sidebar{height:100vh;position:sticky;top:0;min-height:0}
.sidebar .npc-heading{padding-top:12px}
.sidebar .npc-list{flex:1;min-height:0;max-height:none;align-content:start;grid-auto-rows:max-content;overflow-y:auto;overscroll-behavior:contain;padding-right:4px;scrollbar-width:thin;scrollbar-color:var(--theme-accent) #151917}
.sidebar .npc-list::-webkit-scrollbar{width:9px}
.sidebar .npc-list::-webkit-scrollbar-track{background:#151917;border-radius:8px}
.sidebar .npc-list::-webkit-scrollbar-thumb{background:var(--theme-accent);border:2px solid #151917;border-radius:8px}
.sidebar .npc-list::-webkit-scrollbar-thumb:hover{background:var(--theme-accent-strong)}
.sidebar.drag-scroll-ready,.sidebar .npc-list.drag-scroll-ready{cursor:grab}
.sidebar.is-drag-scrolling,.sidebar.is-drag-scrolling *{cursor:grabbing!important;user-select:none!important}
.sidebar .side-foot{flex:none;margin-top:0}
.personality-row{position:relative;min-width:0;border-radius:8px;overflow:hidden}
.personality-row.has-personality-image{background-image:linear-gradient(90deg,rgba(13,18,15,.88),rgba(13,18,15,.67)),var(--personality-bg);background-size:cover;background-position:center}
.personality-row .list-item{position:relative;min-height:58px;padding-right:27px}
.personality-row.has-personality-image .list-item:hover{background:rgba(20,28,22,.38)}
.personality-image-cog{position:absolute;right:5px;bottom:5px;z-index:2;width:19px;height:19px;display:grid;place-items:center;border:0;border-radius:5px;background:transparent;color:var(--theme-accent-strong);opacity:.52;font-size:14px;line-height:1;cursor:pointer}
.personality-image-cog:hover,.personality-image-cog:focus-visible{opacity:1;background:transparent;outline:none;filter:drop-shadow(0 0 5px var(--theme-accent))}
#modal.personality-image-modal{width:min(650px,calc(100% - 28px))}
.personality-image-preview{height:130px;display:grid;place-items:center;overflow:hidden;border:1px solid #3b483c;border-radius:9px;background:#111713;color:#9ca69b;font-size:12px;touch-action:none;cursor:grab}
.personality-image-preview:active{cursor:grabbing}
.personality-image-preview img{width:100%;height:100%;object-fit:cover;pointer-events:none;user-select:none}
.personality-image-hint{display:block;margin-top:8px;color:#a9b4a6;font-size:10px}

/* Give the personality navigation its color back without washing out labels. */
:root[data-studio-theme="on"] .sidebar{
  background-image:linear-gradient(rgba(10,14,12,calc(var(--studio-theme-overlay) * .76)),rgba(10,14,12,calc(var(--studio-theme-overlay) * .76))),var(--studio-theme-navigation)!important;
}
:root[data-studio-theme="on"][data-studio-image-mode="full"] .sidebar{
  background-image:linear-gradient(90deg,rgba(10,14,12,.25),rgba(10,14,12,.16))!important;
  background-color:transparent!important;
}
.sidebar .side-brand h1{color:#f5f2e9;text-shadow:0 2px 9px #000a}
.sidebar .side-heading{color:#afbbaa}
.sidebar .side-foot{color:#a5b1a5}
.sidebar .personality-row{background:rgba(13,20,16,.74);box-shadow:inset 0 0 0 1px rgba(180,205,174,.08)}
.sidebar .personality-row.has-personality-image{
  background-image:linear-gradient(90deg,rgba(8,13,11,.76) 0%,rgba(8,13,11,.39) 62%,rgba(8,13,11,.17) 100%),var(--personality-bg);
}
.sidebar .personality-row .list-item strong{color:#f2f2e9;font-weight:600;text-shadow:0 1px 5px #000d}
.sidebar .personality-row .list-item small{color:#b9c7b8;text-shadow:0 1px 4px #000e}
.sidebar .personality-row .npc-initial{background:rgba(29,35,29,.88);border:1px solid rgba(209,177,115,.35)}
.sidebar .personality-row.has-personality-image .list-item:hover{background:rgba(235,187,112,.12)}

/* Clearer section navigation and a quiet model readout in the sidebar. */
.sidebar .side-brand{justify-content:flex-start}
.sidebar .side-brand h1{display:flex;align-items:center;gap:12px;white-space:nowrap}
.sidebar .side-brand .status-dot{flex:none;margin-top:0}
.sidebar .side-foot.sidebar-model{padding:14px 4px 0;border-top:1px solid rgba(184,202,180,.22)}
.sidebar-model .ai-badge{box-sizing:border-box;display:block;width:100%;max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;padding:9px 11px;background:rgba(11,18,14,.8);border-color:rgba(181,198,177,.25);color:#c3d0c0;opacity:.25;transition:opacity .18s ease}
.sidebar-model .ai-badge:hover,.sidebar-model .ai-badge:focus-visible{opacity:1}
.sidebar-model .ai-badge.off{color:#dab494;border-color:rgba(216,153,104,.4)}
.topbar{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;column-gap:18px;padding:0 28px}
.topbar .view-tabs{grid-column:2;justify-self:center;align-self:center;display:flex;align-items:center;gap:4px;height:auto;padding:5px;border:1px solid rgba(194,207,188,.18);border-radius:999px;background:rgba(10,17,13,.78);box-shadow:0 8px 24px #0004,inset 0 1px rgba(255,255,255,.04)}
.topbar .view-tab{position:relative;flex:none;border:0;border-radius:999px;padding:10px 18px;background:transparent;color:#b6c2b2;font-size:11px;font-weight:600;letter-spacing:.025em;white-space:nowrap;transition:background .18s,color .18s,box-shadow .18s}
.topbar .view-tab:hover,.topbar .view-tab:focus-visible{background:var(--theme-wash);color:var(--theme-accent-strong);outline:none}
.topbar .view-tab.active{background:linear-gradient(135deg,color-mix(in srgb,var(--theme-accent) 20%,transparent),var(--theme-wash));color:var(--theme-accent-strong);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--theme-accent) 45%,transparent),0 2px 10px #0005}
.topbar .view-tab.active::after{display:none}
.topbar .top-actions{grid-column:3;justify-self:end;gap:14px}
@media(max-width:1200px){.topbar{display:flex;justify-content:space-between;gap:12px;padding:0 18px}.topbar .view-tabs{min-width:0;overflow-x:auto;justify-self:auto}.topbar .view-tab{padding:9px 12px}.topbar .top-actions{gap:8px}}
@media(max-width:900px){.topbar{height:auto;min-height:76px;flex-wrap:wrap;padding:10px 14px;gap:9px}.topbar .top-actions{order:1;margin-left:auto}.topbar .view-tabs{order:2;width:100%;justify-content:space-between}.topbar .view-tab{padding:9px 11px}}

/* World-wide possession controls and the same violet scan language as the editor build bar. */
.ai-possession-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}
.ai-possession-heading h2{margin:0}
#ai-npc-count.is-refreshing::after{content:"";display:inline-block;width:8px;height:8px;margin-left:7px;border:2px solid color-mix(in srgb,var(--theme-accent) 35%,transparent);border-top-color:var(--theme-accent);border-radius:50%;vertical-align:middle;animation:ai-count-spin .7s linear infinite}
@keyframes ai-count-spin{to{transform:rotate(360deg)}}
.ai-global-controls{display:grid;grid-template-columns:minmax(145px,1fr) max-content max-content max-content minmax(240px,1.1fr) max-content;align-items:center;gap:7px;margin:10px 0 11px;padding:7px;border:1px solid rgba(194,207,188,.2);border-radius:22px;background:rgba(10,17,13,.82);box-shadow:0 8px 24px #0004,inset 0 1px rgba(255,255,255,.04)}
.ai-global-copy{min-width:0;padding:0 10px}
.ai-global-copy h3{font:500 17px 'Playfair Display';margin:0;color:#ede9db}
.ai-global-switch{display:flex;align-items:center;gap:9px;min-height:46px;padding:6px 13px;border:1px solid rgba(181,198,177,.2);border-radius:999px;background:rgba(20,30,23,.8);cursor:pointer;transition:background .18s,border-color .18s,box-shadow .18s}
.ai-global-switch:hover,.ai-global-switch:focus-within{border-color:var(--theme-accent);box-shadow:0 0 0 2px var(--theme-wash)}
.ai-global-switch:has(input:checked){border-color:color-mix(in srgb,var(--theme-accent) 48%,transparent);background:linear-gradient(135deg,color-mix(in srgb,var(--theme-accent) 18%,#132019),#15221a)}
.ai-global-switch:has(input:disabled){opacity:.62;cursor:not-allowed}
.ai-global-switch input{appearance:none;position:relative;width:30px;height:17px;margin:0;flex:none;border:1px solid #617064;border-radius:99px;background:#39443b;cursor:pointer;transition:background .18s,border-color .18s}
.ai-global-switch input::before{content:"";position:absolute;top:2px;left:2px;width:11px;height:11px;border-radius:50%;background:#bdc6bb;transition:transform .18s,background .18s}
.ai-global-switch input:checked{border-color:var(--theme-accent);background:var(--theme-accent)}
.ai-global-switch input:checked::before{transform:translateX(13px);background:#151b15}
.ai-global-switch input:focus-visible{outline:2px solid var(--theme-accent-strong);outline-offset:3px}
.ai-global-switch strong,.ai-global-switch small{display:block;white-space:nowrap}
.ai-global-switch strong{color:#e7eadf;font-size:11px;font-weight:600}
.ai-global-switch small{color:#9daa9d;font-size:9px;margin-top:2px;max-width:230px;overflow:hidden;text-overflow:ellipsis}
.ai-global-switch:has(input:not(:checked)) strong{color:#c9c6bc}
.ai-global-radius{display:flex;align-items:center;gap:10px;min-height:46px;padding:5px 14px 5px 13px;border:1px solid rgba(181,198,177,.2);border-radius:999px;background:rgba(20,30,23,.8);color:#aebbaa;font-size:10px;white-space:nowrap}
.ai-global-radius input{width:150px;accent-color:#9bb88f;cursor:pointer}.ai-global-radius output{min-width:38px;color:#e7eadf;font-weight:700;text-align:right}
.ai-global-count{display:flex;align-items:center;gap:8px;min-height:46px;padding:5px 6px 5px 13px;border:1px solid rgba(181,198,177,.2);border-radius:999px;background:rgba(20,30,23,.8);color:#aebbaa;font-size:10px;white-space:nowrap}
.ai-global-count select{width:96px;height:32px;padding:0 8px;border:1px solid #435347;border-radius:999px;background:#111c16;color:#e7eadf;font-size:10px}
.ai-global-count:has(select:disabled){opacity:.62}
.ai-global-controls.is-off{border-color:#6f4842}.ai-global-controls.is-off .ai-global-copy h3{color:#e3b0a5}
.ai-free-active{margin:0 0 11px;padding:11px 15px;border:1px solid color-mix(in srgb,var(--theme-accent) 42%,transparent);border-radius:17px;background:linear-gradient(135deg,rgba(17,29,22,.95),rgba(13,19,16,.9));box-shadow:0 10px 28px #0005}
.ai-free-active[hidden]{display:none}
.ai-free-active-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:6px;color:#e9e9df}
.ai-free-active-head strong{font:500 16px 'Playfair Display'}
.ai-free-active-head span{font-size:11px;color:var(--theme-accent)}
.ai-free-active-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:8px}
.ai-free-active-card{display:flex;align-items:center;gap:10px;min-width:0;padding:9px 11px;border:1px solid rgba(178,194,174,.2);border-radius:12px;background:#19231ccc;color:#e9e9df}
.ai-free-active-orb{display:grid;place-items:center;flex:none;width:30px;height:30px;border:1px solid var(--theme-accent);border-radius:50%;color:var(--theme-accent)}
.ai-free-active-card>span:nth-child(2){min-width:0;flex:1}
.ai-free-active-card strong,.ai-free-active-card small,.ai-free-active-card em{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ai-free-active-card strong{font-size:12px}.ai-free-active-card small,.ai-free-active-card em{margin-top:2px;color:#aeb9ac;font-size:10px;font-style:normal}
.ai-free-active-card em{color:var(--theme-accent)}
.ai-free-active-live{font-size:10px;color:#9cc89e}
.ai-free-active-empty{margin:0;color:#aeb9ac;font-size:11px}
.ai-free-active-card.director-card{display:block;padding:12px;min-width:0}
.director-summary{display:flex;align-items:center;gap:10px}
.director-identity{min-width:0;flex:1}
.director-identity strong,.director-identity small,.director-identity em{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.director-identity strong{font-size:12px}.director-identity small,.director-identity em{font-size:10px;font-style:normal;color:#adb7a9;margin-top:2px}.director-identity em{color:var(--theme-accent)}
.director-dialogue{height:160px;overflow:auto;display:flex;flex-direction:column;gap:6px;margin:11px 0;padding:10px;border:1px solid #ffffff1f;border-radius:11px;background:#0b130fcc;scrollbar-color:var(--theme-accent) #18241c}
.director-dialogue p{max-width:92%;margin:0;padding:7px 9px;border-radius:10px;font-size:11px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}
.director-dialogue p b{display:block;margin-bottom:2px;font-size:10px;color:var(--theme-accent)}
.director-dialogue .director-player{align-self:flex-start;background:#243025;color:#e0e6dc}
.director-dialogue .director-npc{align-self:flex-end;background:color-mix(in srgb,var(--theme-accent) 19%,#1b201a);color:#f0e9da}
.director-dialogue .director-no-dialogue{align-self:center;background:none;color:#93a194}
.director-reply label{display:block;color:#c4d0c1;font-size:10px;font-weight:600}
.director-reply textarea{display:block;box-sizing:border-box;width:100%;min-height:60px;max-height:260px;margin-top:5px;padding:10px 11px;resize:vertical;border:1px solid #516250;border-radius:10px;background:#101a14;color:#eeeae0;font:inherit;font-size:12px;line-height:1.5;outline:none}
.director-reply textarea:focus{border-color:var(--theme-accent);box-shadow:0 0 0 2px var(--theme-wash)}
.director-reply textarea:disabled{opacity:.62}
.director-reply-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:7px}
.director-reply-actions span{flex:1;color:#aeb9ac;font-size:10px}
.director-reply-actions button{white-space:nowrap}
.ai-scan-panel{margin:18px 0 12px;padding:15px 17px;border:1px solid rgba(165,125,204,.42);border-radius:11px;background:linear-gradient(180deg,rgba(255,255,255,.045),transparent 40%),rgba(19,14,27,.92);box-shadow:0 8px 24px #0005,0 0 18px rgba(165,125,204,.11)}
.ai-scan-panel.is-idle{margin:10px 0 8px;padding:8px 11px;background:rgba(19,14,27,.75);box-shadow:none}
.ai-scan-panel.is-idle .ai-scan-head{margin-bottom:0}
.ai-scan-panel.is-idle .ai-scan-head>div{display:block;min-width:0}
.ai-scan-panel.is-idle .ai-scan-head .eyebrow{display:none}
.ai-scan-panel.is-idle .ai-scan-head strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#b9a8c6;font-size:11px;font-weight:500}
.ai-scan-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}.ai-scan-head>div{display:grid;gap:5px}.ai-scan-head .eyebrow{color:#a987cb}.ai-scan-head strong{color:#eee2f6;font-size:12px;font-weight:600}.ai-scan-head button{flex:none}
.ai-scan-track{height:12px;overflow:hidden;border:1px solid rgba(165,125,204,.45);border-radius:99px;background:linear-gradient(180deg,#08060d,#292032);box-shadow:inset 0 1px 3px #000a,0 0 14px rgba(165,125,204,.16)}
.ai-scan-track span{display:block;height:100%;width:0;border-radius:99px;transition:width .5s ease;background:linear-gradient(180deg,#fff6,transparent 50%,#0002),linear-gradient(90deg,#7146a3,#a77bcb 55%,#d3aeeb);box-shadow:0 0 12px rgba(165,125,204,.7)}
.ai-scan-track.is-indeterminate span{width:35%;animation:ai-scan-sweep 1.7s ease-in-out infinite alternate}@keyframes ai-scan-sweep{from{transform:translateX(-100%)}to{transform:translateX(300%)}}
.ai-scan-panel small{display:block;margin-top:8px;color:#a99bb7;font-size:10px}
@media(max-width:1550px){.ai-global-controls{display:flex;flex-wrap:wrap}.ai-global-copy{flex:1 1 150px}.ai-global-switch{flex:1 1 170px}.ai-global-radius{flex:1 1 240px}.ai-global-count{flex:0 1 170px;justify-content:space-between}}
@media(max-width:1150px){.ai-global-copy{flex-basis:100%;padding:3px 10px 2px}.ai-global-switch{flex:1 1 190px}.ai-global-count{flex:1 1 175px;justify-content:space-between}}
@media(max-width:650px){.ai-possession-heading{align-items:flex-start;flex-wrap:wrap}.ai-possession-heading .capture-state{margin-left:0}.ai-global-controls{border-radius:16px}.ai-global-radius{flex:1 1 100%}.ai-global-switch,.ai-global-count{flex:1 1 100%;justify-content:flex-start}.ai-global-count{justify-content:space-between}.ai-global-switch small{max-width:none}.ai-scan-head{align-items:flex-start}.ai-scan-head button{max-width:115px}}
@media(prefers-reduced-motion:reduce){.ai-scan-track.is-indeterminate span{animation:none;width:100%;opacity:.55}#ai-npc-count.is-refreshing::after{animation:none}}

.director-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin:8px 0 2px;font-size:10px;color:#aeb9ac}
.director-engage{padding:3px 10px;border:1px solid rgba(181,198,177,.25);border-radius:999px;background:rgba(20,30,23,.7);color:#c9d3c5;font-weight:700;letter-spacing:.02em}
.director-review-option{display:flex!important;align-items:center;gap:8px;width:max-content;max-width:100%;margin:0 0 8px;color:var(--theme-accent-strong);font-size:10px;font-weight:600;cursor:pointer}
.director-options{display:flex;align-items:center;flex-wrap:wrap;gap:4px 18px}
.director-options .director-review-option small{color:#a9b5a8;font-size:9px;font-weight:400}
.director-review-option input{width:15px;height:15px;margin:0;accent-color:var(--theme-accent);cursor:pointer}
.director-review-option input:disabled{cursor:not-allowed;opacity:.6}
.director-review-load{align-self:flex-start;margin:6px 0 0;border-color:var(--theme-accent)!important;color:var(--theme-accent-strong)!important}
.director-engage.is-pc{border-color:#6f9bd1;color:#bcd6f5;background:rgba(40,70,110,.35)}
.director-engage.is-npc{border-color:#b59a62;color:#ecd9a8;background:rgba(95,75,30,.35)}
.director-rel{display:inline-flex;align-items:center;gap:7px}
.rel-bar{position:relative;display:inline-block;width:90px;height:6px;border-radius:99px;background:linear-gradient(90deg,#a85a52,#6b6f66 50%,#6fa77a)}
.rel-bar b{position:absolute;top:-3px;width:3px;height:12px;margin-left:-1px;border-radius:2px;background:#f2f4ec;box-shadow:0 0 0 1px #111c16}
.director-controls{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:8px 0}
.director-controls .dir-label{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:#8f9b8c;margin-right:2px}
.dir-btn{padding:5px 11px;font-size:10px;white-space:nowrap}
.dir-attack:hover,.dir-attack.is-active{border-color:#c4685c;color:#ffd2cb;background:rgba(150,50,40,.3)}
.dir-flee:hover,.dir-flee.is-active{border-color:#c9a95c;color:#f3e2b4;background:rgba(120,95,30,.3)}
.dir-improve:hover,.dir-improve.is-active{border-color:#6fa77a;color:#cdeed3;background:rgba(50,100,65,.3)}
.dir-worsen:hover,.dir-worsen.is-active{border-color:#7f93b0;color:#d3def0;background:rgba(55,75,110,.3)}
.dir-status{flex:1 1 100%;font-size:10px;color:#aeb9ac;min-height:0}.dir-status:empty{display:none}

@property --gold-angle{syntax:'<angle>';inherits:false;initial-value:0deg}
.director-card{position:relative}
.director-card.is-engaged{box-shadow:0 0 16px rgba(240,190,70,.38),0 0 42px rgba(240,190,70,.16);animation:goldpulse 2.6s ease-in-out infinite}
.director-card.is-engaged::before{content:"";position:absolute;inset:-2px;border-radius:inherit;padding:2px;pointer-events:none;background:conic-gradient(from var(--gold-angle),#6e500f,#ffd86b,#fff4c2,#ffd86b,#6e500f 75%,#6e500f);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);animation:goldspin 3s linear infinite}
@keyframes goldspin{to{--gold-angle:360deg}}
@keyframes goldpulse{50%{box-shadow:0 0 24px rgba(255,205,90,.55),0 0 56px rgba(240,190,70,.25)}}
@media(prefers-reduced-motion:reduce){.director-card.is-engaged,.director-card.is-engaged::before{animation:none}}

.director-typing{display:flex;align-items:center;gap:8px;margin:6px 0 2px;font-size:10px;color:#aeb9ac}
.director-typing[hidden]{display:none}
.typing-bubble{display:inline-flex;align-items:center;gap:4px;padding:8px 12px;border-radius:14px 14px 14px 3px;background:rgba(80,100,85,.45);border:1px solid rgba(181,198,177,.25)}
.typing-bubble i{width:6px;height:6px;border-radius:50%;background:#dfe8da;opacity:.35;animation:typingdot 1.2s ease-in-out infinite}
.typing-bubble i:nth-child(2){animation-delay:.18s}.typing-bubble i:nth-child(3){animation-delay:.36s}
@keyframes typingdot{0%,60%,100%{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
@media(prefers-reduced-motion:reduce){.typing-bubble i{animation:none;opacity:.8}}

.director-pin{position:relative;margin-left:6px;width:26px;height:34px;padding:0;border:0;background:transparent;cursor:pointer;line-height:0}
.director-pin svg{width:20px;height:28px;overflow:visible;transform:rotate(62deg) translateY(0);transform-origin:50% 90%;transition:transform .25s ease,filter .25s ease;filter:grayscale(1) brightness(.7)}
.director-pin:hover svg{filter:grayscale(.4) brightness(.95);transform:rotate(40deg) translateY(-1px)}
.dg-pommel{fill:#8b6a2b}.dg-grip{fill:#5a3b22}.dg-guard{fill:#b8923f}.dg-blade{fill:#cfd6dc}.dg-edge{stroke:#7d8791;stroke-width:1;fill:none}
.director-pin.is-pinned svg{filter:drop-shadow(0 2px 3px rgba(0,0,0,.6));transform:rotate(-8deg) translateY(3px);animation:daggerstab .32s cubic-bezier(.2,.9,.3,1.3)}
.director-pin.is-pinned::after{content:"";position:absolute;left:50%;bottom:-1px;width:14px;height:4px;margin-left:-7px;border-radius:50%;background:radial-gradient(#0008,#0000 70%)}
@keyframes daggerstab{0%{transform:rotate(40deg) translateY(-14px)}70%{transform:rotate(-8deg) translateY(6px)}100%{transform:rotate(-8deg) translateY(3px)}}
@media(prefers-reduced-motion:reduce){.director-pin.is-pinned svg{animation:none}}
.director-card.is-away .ai-free-active-live{background:rgba(120,120,120,.25);color:#bbb}

.director-controls .dir-label{display:none}
.dir-toggle{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border:1px solid rgba(181,198,177,.35);border-radius:999px;background:rgba(20,30,23,.85);color:#c9d3c5;font:inherit;font-size:10px;letter-spacing:.12em;text-transform:uppercase;cursor:pointer;transition:background .2s,border-color .2s}
.dir-toggle:hover{background:rgba(60,82,66,.7);border-color:#9bb88f}
.dir-toggle i{font-style:normal;font-size:14px;line-height:1;transition:transform .25s ease}
.director-controls.is-open .dir-toggle{border-color:#9bb88f;background:rgba(60,82,66,.7)}
.director-controls.is-open .dir-toggle i{transform:rotate(90deg)}
.director-controls.has-directive .dir-toggle{border-color:#d9b45a;color:#f3e2b4;text-transform:none;letter-spacing:.02em}
.dir-pills{display:inline-flex;flex-wrap:wrap;gap:6px}
.dir-pills[hidden]{display:none}
.dir-pills .dir-btn{animation:pillout .28s cubic-bezier(.2,.9,.3,1.2) both;transform-origin:left center}
.dir-pills .dir-btn:nth-child(2){animation-delay:.04s}.dir-pills .dir-btn:nth-child(3){animation-delay:.08s}.dir-pills .dir-btn:nth-child(4){animation-delay:.12s}.dir-pills .dir-btn:nth-child(5){animation-delay:.16s}
@keyframes pillout{from{opacity:0;transform:translateX(-18px) scale(.6)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.dir-pills .dir-btn{animation:none}}

.director-stop{border-color:rgba(196,104,92,.55);color:#f0beb7}
.director-stop:hover:not(:disabled){background:rgba(150,50,40,.35);border-color:#c4685c;color:#ffd9d3}

.tile-chat{grid-column:1/-1;margin-top:10px;padding:10px 12px;border:1px solid rgba(181,198,177,.18);border-radius:12px;background:rgba(14,22,17,.55)}
.tile-chat[hidden]{display:none}
.tile-chat .director-dialogue{height:130px;margin:0 0 8px}
.tile-chat-empty{margin:0;color:#93a194;font-size:11px}

.ai-player.heartbeat{animation:heartbeat .8s ease-out 1;transform-origin:center}
@keyframes heartbeat{
  0%{transform:scale(1);box-shadow:0 0 0 0 color-mix(in srgb,var(--theme-accent) 28%,transparent)}
  25%{transform:scale(1.03);box-shadow:0 0 0 3px color-mix(in srgb,var(--theme-accent) 14%,transparent)}
  100%{transform:scale(1);box-shadow:0 0 0 7px transparent}
}
@media(prefers-reduced-motion:reduce){.ai-player.heartbeat{animation:none}}
