/* Shared platform skin. Rules retain their own panels, data and resolution logic. */
:root{--trpg-bg:#111714;--trpg-surface:#1a231c;--trpg-raised:#273028;--trpg-line:#3c493b;--trpg-text:#e9e8dc;--trpg-muted:#a3b19f;--trpg-accent:#e8b979;--gold:#e8b979;--gold-light:#f2d19d;--vtt-surface:#1a231c}
body.trpg-legacy{--bg-main:#131c16;--bg-panel:#1b261d;--bg-topbar:#1f2b21;--border-color:#42503c;--text-main:#e9e8dc;--text-dim:#aab89f;--accent:#a58853;--accent-hover:#c1a26a;--act-bg:#1c271e;--act-btn-bg:#33412f;--act-btn-hover:#44533a;--act-border-top:#40523a;--skill-bg:#19231b;--skill-slot-bg:#293625;--skill-weapon:#3d4830;--skill-spell:#454236;--inv-bg:#1c271e;--inv-border-top:#40523a;--inv-slot-bg:#293625;--inv-slot-border:#4b5c40;--inv-slot-hover:#3d4c33;--tip-bg:#202d22;--tip-border:#506044;background:#131a15!important;color:#e9e8dc!important;font-family:"Segoe UI","Microsoft YaHei",sans-serif!important}
body.trpg-legacy .topbar,body.trpg-legacy .char-head,body.trpg-legacy .inventory-bar{background:#1f2b21!important;border-color:#42503c!important}
body.trpg-legacy #mapWrap{background:#152019!important}
body.trpg-legacy .block,body.trpg-legacy .stat-box{background:#1f2b21!important;border-color:#42503c!important}
body.trpg-legacy .ch-portrait{background:#293625!important;border-color:#ae9967!important}
body.trpg-legacy .map-empty-hint{color:#91a185!important}
body.trpg-legacy .skill-bar{background:#19231b!important;border-color:#42503c!important}
body.trpg-legacy .left-panel,body.trpg-legacy .right-panel,body.trpg-legacy .center-panel{background:#1a231c!important;border-color:#3e4a38!important}
body.trpg-legacy .panel-card{background:#253025!important;border-color:#44513d!important;border-radius:12px!important;box-shadow:none!important}
body.trpg-legacy .panel-header,body.trpg-legacy .panel-header h4{color:#e2dfc6!important;font-weight:500!important}
body.trpg-legacy .scene-tabs,body.trpg-legacy .map-toolbar,body.trpg-legacy .bottom-panel{background:#1b251c!important;border-color:#405039!important}
body.trpg-legacy .scene-tabs .scene-tab.active,body.trpg-legacy #openCreateBtn,body.trpg-legacy #exportSaveBtn,body.trpg-legacy #chatSendBtn{background:#8d754e!important;color:#fff2d6!important;border-color:#bc9f68!important}
body.trpg-legacy .map-toolbar button,body.trpg-legacy .dice-btn,body.trpg-legacy .tab-btn,body.trpg-legacy #importSaveBtn{background:#303b2c!important;color:#dedfc9!important;border-color:#4c5b43!important}
body.trpg-legacy .bg-layer{background:#172219!important;background-image:linear-gradient(45deg,#202d2080 25%,transparent 25%,transparent 75%,#202d2080 75%),linear-gradient(45deg,#202d2080 25%,transparent 25%,transparent 75%,#202d2080 75%)!important;background-size:40px 40px!important;background-position:0 0,20px 20px!important}
body.trpg-legacy #chatMessages,body.trpg-legacy .chat-messages{background:#151e16!important;border-color:#3f4e39!important}
body.trpg-legacy input:not([type=color]),body.trpg-legacy select,body.trpg-legacy textarea{background:#151f17!important;color:#e6e5d4!important;border-color:#506046!important}
body.trpg-legacy .placeholder,body.trpg-legacy .empty-hint{color:#a1af94!important}
body.trpg-workshop{background:#f2f2e9!important;color:#29352a!important;font-family:"Segoe UI","Microsoft YaHei",sans-serif!important}
body.trpg-workshop .navbar{background:#f4f4e9f5!important;border-color:#d5dbc9!important}
body.trpg-workshop .navbar .logo{color:#384b34!important;font-size:18px!important;font-weight:500!important}
body.trpg-workshop .join-section{background:#e9eddf!important;border-color:#c8d2bc!important}
body.trpg-workshop #joinRoomBtn,body.trpg-workshop .cc-btn-save{background:#4f6544!important;color:#fff!important}
body.trpg-workshop .char-card{border-color:#cbd5bf!important}
#ccSaveError{font-size:12px;line-height:1.7;white-space:pre-line;color:#9b342b;background:#fff1e9;border:1px solid #dfb9a3;border-radius:8px;padding:10px 14px;margin:0 20px 10px;max-height:110px;overflow:auto}
body.trpg-table{color:var(--trpg-text)!important;background:var(--trpg-bg)!important;font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif!important}
body.trpg-table button,body.trpg-table input,body.trpg-table select{font-family:inherit!important;font-size:12px;border-radius:7px!important}
body.trpg-table button{background:#29332b!important;border-color:#4b5947!important;color:#e6e8db!important;min-height:30px;transition:background .12s,border-color .12s}
body.trpg-table button:hover{background:#35422f!important;border-color:#8c9c7d!important}
body.trpg-table button:focus-visible,body.trpg-table input:focus-visible,body.trpg-table select:focus-visible{outline:2px solid #e8b979!important;outline-offset:2px}
body.trpg-table button.active,body.trpg-table button.selected,body.trpg-table button[data-tab].active,body.trpg-table .primary{background:#4b4530!important;color:#f4d09b!important;border-color:#ad9160!important}
body.trpg-table input,body.trpg-table select{background:#131c16!important;color:#e7e9dc!important;border-color:#4a5846!important;accent-color:#e8b979}
body.trpg-table .muted,body.trpg-table .mini-help{color:#a0ae9b!important;font-size:11px!important;line-height:1.8!important}
body.trpg-table #roomView header{background:#18201a!important;border-bottom:1px solid #3c493b!important;color:#e9e8dc!important;min-height:48px;padding:0 14px!important;gap:12px!important}
body.trpg-table #roomView header h2{font-size:14px!important;font-weight:500!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:42vw}
body.trpg-table #roomView header #status{font-size:11px;color:#a8c8a8}
body.trpg-table #roomIdLabel{display:none!important}
body.trpg-table #returnDash{margin-left:auto!important;font-size:11px!important;white-space:nowrap}
body.trpg-table #roomView .room-layout,body.trpg-table #work{background:#111714!important}
body.trpg-table #m12Rail{background:#1a231b!important;border-right:1px solid #3c493b!important;width:64px!important;min-width:64px!important;padding:12px 6px!important;gap:7px!important}
body.trpg-table #m12Rail button{min-height:40px!important;border-radius:8px!important;border:1px solid transparent!important;background:transparent!important;color:#b5c0ae!important;padding:5px 2px!important;gap:4px!important}
body.trpg-table #m12Rail button:hover,body.trpg-table #m12Rail button.active,body.trpg-table #m12Rail button[aria-expanded=true]{background:#343c29!important;color:#edc78e!important;border-color:#5f6649!important}
body.trpg-table #m12Rail .m12-lbl{font-size:11px!important;line-height:1.25!important}
body.trpg-table #m12Rail .m12-ico{display:grid;place-items:center;height:20px!important;font-size:17px!important}
body.trpg-table #m12Rail .m12-ico svg{width:20px;height:20px}
body.trpg-table #m12Rail .m7-bar [data-mode]{font-size:11px!important;line-height:1.35!important}
body.trpg-table #m12Rail .m7-bar [data-mode]::before{content:none!important}
body.trpg-table #m12Rail .m7-bar [data-mode] svg{width:18px;height:18px;display:block;margin:auto auto 3px}
body.trpg-table #m12Rail .m7-bar input{width:46px!important;padding:5px!important}
body.trpg-table #m12Rail #m7-msg{font-size:10px!important;color:#d0c69e!important;line-height:1.5}
body.trpg-table #m12Drawer,body.trpg-table #m12pDrawer{background:#1c261e!important;border-color:#52614a!important;left:64px!important;box-shadow:12px 0 30px #0005!important}
body.trpg-table #m12DrawerHead,body.trpg-table #m12pDrawerHead{background:#253023!important;border-color:#46553e!important;color:#f1e1ba!important;min-height:45px}
body.trpg-table #m12DrawerBody,body.trpg-table #m12pDrawerBody{padding:14px!important}
body.trpg-table #roomView .group{background:transparent!important;border-color:#3b4837!important;padding:12px 0!important}
body.trpg-table #roomView .group h3,body.trpg-table #work h3{font-size:12px!important;color:#d3dcbe!important;letter-spacing:.3px;font-weight:500}
body.trpg-table #roomView .right-panel,body.trpg-table #work>aside.right{background:#1a221b!important;border-left:1px solid #3c493b!important;width:300px!important;min-width:0!important;color:#e9e8dc!important;scrollbar-color:#52604b #1b231c!important}
body.trpg-table #m12pRightHead{background:#263024!important;border-bottom:1px solid #414d3c!important;padding:11px 12px!important;color:#e1dcc7!important}
body.trpg-table #m12pMe{left:76px!important;top:10px!important;background:#222d21ed!important;border:1px solid #4b5b43!important;box-shadow:0 6px 20px #0003!important;color:#e9e8dc!important}
body.trpg-table #m10Conn{border-color:#65845c!important;color:#b5d7a9!important}
body.trpg-table #m10MeAvatar{background:#5a6041!important;color:#ffdfb0!important}
body.trpg-table #work main,body.trpg-table #roomView .center-panel,body.trpg-table #mapContainer,body.trpg-table #mapFrame,body.trpg-table #mapWrap{background:#101813!important}
body.trpg-table #map{background-color:#253025!important;border-color:#56634d!important;box-shadow:0 15px 55px #0003}
body.trpg-table .token{border-color:#e8bc78!important;box-shadow:0 0 0 2px #131b16aa,0 4px 10px #0005!important}
body.trpg-table .token.owned{cursor:grab!important}
body.trpg-table .token>span{background:#18221aef!important;color:#f3ebd3!important;padding:3px 6px!important;border-radius:4px!important;font-size:10px!important;line-height:1.25}
body.trpg-table .vtt-comm,body.trpg-table #m5DicePanel,body.trpg-table .vtt-right-tabs{background:transparent!important;border-color:#3c493b!important;color:#e9e8dc!important}
body.trpg-table .vtt-comm-log{background:#121b15!important;border:1px solid #3f4e38!important;border-radius:9px!important;font-size:12px!important;line-height:1.8!important;padding:10px!important}
body.trpg-table .vtt-comm-log p{border-color:#2e3d2b!important}
body.trpg-table #m5DicePanel{padding:14px!important}
body.trpg-table #m5DicePanel button{min-height:36px!important}
body.trpg-table #m5LastRoll{background:#222c1f!important;border-color:#4d5b42!important;color:#e3d4a3!important}
body.trpg-table #m10LastRoll{background:#222c1f!important;border-color:#4d5b42!important;color:#e3d4a3!important}
body.trpg-table .vtt-comm h3{color:#d3dcbe!important}
body.trpg-table #roomView footer{background:#182019!important;border-color:#3b4837!important;color:#a9b49c!important;font-size:10px!important;padding:5px 12px!important}
body.trpg-table .scene-tabs{background:#18221a!important;border-color:#394732!important;min-height:40px!important}
body.trpg-table #join:not([hidden]){position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(440px,calc(100vw - 32px));background:#1d291f;border:1px solid #53634b;padding:30px;border-radius:18px;box-shadow:0 25px 80px #0007}
body.trpg-table #join input{width:100%;padding:12px;margin:18px 0 12px}body.trpg-table #join button{padding:10px 20px;width:100%}
.trpg-quickstart{position:absolute;left:82px;top:20px;z-index:35;background:#1c291eef;border:1px solid #526348;border-radius:10px;padding:12px;box-shadow:0 6px 20px #0004;max-width:min(390px,calc(100% - 110px));color:#e6e7d7;font-size:12px}
.trpg-quickstart p{margin:0 0 8px;font-size:11px;color:#b9c6ad}.trpg-quickstart div{display:flex;gap:6px;flex-wrap:wrap}.trpg-quickstart button{font-size:11px!important;padding:5px 9px!important}.trpg-quickstart .dismiss{position:absolute;right:5px;top:2px;min-height:20px!important;padding:0 7px!important;background:transparent!important;border:0!important}
.trpg-map-hint{position:absolute;bottom:12px;left:82px;z-index:20;padding:6px 10px;background:#1e2b20de;border:1px solid #46543d;border-radius:6px;color:#b8c6ad;font-size:10px;pointer-events:none}
.trpg-mobile-chat{display:none}.trpg-drag-ghost{position:absolute;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;z-index:80;border:2px solid #f2d299!important;background:#293823;color:#f3e2bb;box-shadow:0 0 0 4px #e8bc7825,0 10px 20px #0006;cursor:grabbing;opacity:.95}.trpg-drag-ghost>span{position:absolute;top:100%;white-space:nowrap;font-size:10px;background:#1c261dee;padding:3px 6px;border-radius:4px}
.trpg-legacy-bar{position:fixed;z-index:9999;bottom:12px;left:12px;display:flex;gap:7px;align-items:center;background:#1e291fe8;border:1px solid #56654b;padding:7px 10px;border-radius:10px;color:#d1dbbe;box-shadow:0 8px 24px #0004;font:12px "Microsoft YaHei",sans-serif;max-width:calc(100vw - 24px)}.trpg-legacy-bar a,.trpg-legacy-bar button{color:#eed1a1!important;font:12px "Microsoft YaHei",sans-serif;background:#303a29!important;border:1px solid #5a6448!important;border-radius:6px;padding:7px 10px;text-decoration:none;cursor:pointer;white-space:nowrap}.trpg-legacy-bar .label{padding:0 5px;font-size:10px;letter-spacing:1px}.trpg-legacy-status{position:fixed;left:14px;bottom:70px;z-index:9999;max-width:calc(100vw - 28px);padding:10px 14px;border:1px solid #667650;border-radius:8px;background:#1e2b20;color:#eadbb2;font-size:12px;overflow-wrap:anywhere}
@media(max-width:800px){body.trpg-table #roomView:not([hidden]){height:100dvh!important}body.trpg-table #work{display:flex!important;min-width:0!important;position:relative!important;height:100dvh!important}body.trpg-table #work main{flex:1!important;min-width:0!important;width:auto!important}body.trpg-table #m12Rail{width:56px!important;min-width:56px!important;padding:8px 4px!important}body.trpg-table #m12pMe{left:65px!important;max-width:calc(100vw - 78px)!important;overflow:hidden!important;font-size:10px!important}body.trpg-table #work>aside.right{position:absolute!important;right:0!important;top:0!important;bottom:0!important;z-index:65!important;width:min(300px,calc(100vw - 70px))!important;box-shadow:-12px 0 35px #0006!important}body.trpg-table #work.m12p-right-collapsed>aside.right{display:none!important}body.trpg-table #m12Drawer,body.trpg-table #m12pDrawer{left:56px!important;width:min(300px,calc(100vw - 68px))!important;max-width:none!important;z-index:60!important}body.trpg-table #roomView .right-panel{display:none!important;position:absolute!important;right:0!important;top:48px!important;bottom:20px!important;z-index:70!important;width:min(300px,calc(100vw - 68px))!important;box-shadow:-12px 0 35px #0007!important}body.trpg-table.trpg-show-chat #roomView .right-panel{display:block!important}body.trpg-table #roomView header>.muted{display:none!important}body.trpg-table #roomView header{gap:8px!important;padding:0 8px!important}body.trpg-table #returnDash{font-size:10px!important;padding:4px 7px!important}body.trpg-table #roomView header h2{max-width:40vw!important;font-size:12px!important}.trpg-mobile-chat{display:block!important;position:fixed;right:12px;bottom:35px;z-index:85;padding:8px 12px!important;box-shadow:0 5px 18px #0006}.trpg-quickstart{left:67px;top:12px;max-width:calc(100% - 80px)}.trpg-map-hint{left:66px;max-width:calc(100% - 80px);font-size:9px;bottom:8px}.trpg-legacy-bar{bottom:8px;left:8px;padding:5px;gap:5px}.trpg-legacy-bar .label{display:none}.trpg-legacy-bar a,.trpg-legacy-bar button{padding:6px 8px;font-size:10px}}
/* Stable scroll geometry and a name layer above all token artwork. */
#mapContainer,#work main{overflow-anchor:none;scroll-behavior:auto;scrollbar-gutter:stable}
#map.vtt-labels-ready>.token>small,#map.vtt-labels-ready>.token>span{visibility:hidden}
#map>.vtt-token-labels{z-index:45;overflow:visible}
.vtt-token-name{position:absolute;transform:translateX(-50%);font:11px/1.4 "Microsoft YaHei",sans-serif;color:#fff;background:#111d16f2;border:1px solid #64745a;border-radius:4px;padding:2px 5px;white-space:nowrap;pointer-events:none;text-shadow:0 1px 2px #000}
.vtt-measure-label{position:absolute;font:12px/1.5 "Microsoft YaHei",sans-serif;background:#111d16;color:#ffdf9f;border:1px solid #c9a76a;border-radius:4px;padding:2px 6px;white-space:nowrap}
.trpg-drag-ghost{overflow:visible;inset:auto}
