:root { color-scheme: dark; font-family: system-ui, sans-serif; background: #17191c; color: #eee; }
body { margin: 0; }
main { padding: clamp(24px, 6vw, 72px); }
h1 { font-size: clamp(32px, 6vw, 56px); font-weight: 600; margin: 0 0 28px; }
nav { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
a { color: #b7ccef; text-underline-offset: 4px; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
[hidden] { display: none !important; }

body[data-character-id="gm"] main { padding: 0; }
.gm-sheet { --gm-bar-height: 48px; --gm-connected-green: #4dce80; }
.gm-topbar { position: fixed; inset: 0 0 auto; z-index: 100; height: var(--gm-bar-height); display: flex; align-items: stretch; gap: 24px; padding: 0 20px; background: #1d2025; border-bottom: 1px solid #343940; }
.gm-brand { display: flex; align-items: center; flex-shrink: 0; color: #f0f2f5; text-decoration: none; font-size: 13px; font-weight: 700; letter-spacing: .03em; }
.gm-tabs { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; }
.gm-send-all { align-self: center; flex-shrink: 0; margin-left: auto; padding: 6px 12px; border: 1px solid #495565; border-radius: 4px; background: #29323e; color: #dce7f7; font: 600 12px system-ui, sans-serif; white-space: nowrap; }
.gm-send-all:disabled { color: #929ba8; background: #242a32; border-color: #3b434e; cursor: not-allowed; }
.gm-send-all:focus-visible { outline: 2px solid #9ab9ec; outline-offset: 3px; }
.gm-tab { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #aab2bd; font: 500 13px system-ui, sans-serif; white-space: nowrap; cursor: pointer; }
.numeric-die rect { fill:#ede4cd; stroke:#806b4b; stroke-width:2; }
.numeric-die circle { fill:#242c2d; }
.gm-profile { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; border: 2px solid #858b95; object-fit: cover; background: #30363f; }
.gm-profile[data-status="connected"] { border-color: var(--gm-connected-green); }
.gm-tab-player { padding-bottom: 6px; }
.gm-header-hp { position: absolute; left: 13px; right: 13px; bottom: 4px; height: 3px; background: #39413d; border-radius: 2px; overflow: hidden; }
.gm-header-hp-fill { display: block; height: 100%; background: var(--gm-connected-green); border-radius: inherit; transition: width .2s ease; }
.gm-header-hp[data-state="low"], .gm-header-hp[data-state="critical"] { background: #583333; }
.gm-header-hp[data-state="low"] .gm-header-hp-fill, .gm-header-hp[data-state="critical"] .gm-header-hp-fill { background: #ed6565; }
.gm-header-hp[data-state="critical"] { animation: gm-hp-pulse 2.8s ease-in-out infinite; }
.gm-header-hp[data-state="critical"] .gm-header-hp-fill { min-width: 2px; }
.gm-header-hp[data-state="unknown"] { background: #494e57; }
@keyframes gm-hp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .gm-header-hp[data-state="critical"] { animation: none; } .gm-header-hp-fill { transition: none; } }
.gm-profile[data-status="disconnected"] { border-color: #ed6565; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.gm-tab:hover { color: #f0f2f5; background: #252a31; }
.gm-tab[aria-selected="true"] { color: #e5eeff; border-bottom-color: #9ab9ec; background: #272e38; }
.gm-tab-character-start { margin-left: 16px; }
.gm-tab-character-start::before { content: ''; position: absolute; left: -10px; top: 14px; height: 18px; border-left: 1px solid #3b414a; }
.gm-tab:focus-visible, .gm-panel:focus-visible { outline: 2px solid #9ab9ec; outline-offset: -4px; }
.gm-panels { padding: calc(var(--gm-bar-height) + 24px) 24px 24px; }
.gm-panel h1 { font-size: 20px; font-weight: 600; margin: 0; color: #dce1e8; }
.gm-general-table { width: calc(280px + 6 * var(--gm-player-column-width, 140px)); table-layout: fixed; border-collapse: collapse; margin-top: 18px; }
.gm-general-layout { display: grid; grid-template-columns: max-content minmax(590px, 1fr); gap: 18px; align-items: start; }
.gm-general-sidebar { display: grid; grid-template-columns: minmax(300px, 1.1fr) minmax(270px, 1fr); grid-template-rows: minmax(0, 1fr); gap: 16px; height: var(--gm-general-height, 760px); margin-top: 18px; min-width: 0; }
.gm-side-panel { border: 1px solid #343940; border-radius: 4px; background: #1d2025; padding: 12px; min-height: 0; min-width: 0; }
.gm-initiative { display: flex; flex-direction: column; gap: 10px; }
.gm-initiative header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gm-initiative h2 { margin: 0; font-size: 15px; }
.gm-initiative button, .gm-initiative input { box-sizing: border-box; padding: 5px 7px; color: #e1e6ed; background: #242a32; border: 1px solid #495565; border-radius: 3px; font: 12px system-ui, sans-serif; }
.gm-initiative button { cursor: pointer; white-space: nowrap; }
.gm-initiative-add { display: flex; gap: 6px; }
.gm-initiative-add input { flex: 1; min-width: 0; }
.gm-initiative-status { margin: 0; font-size: 11px; line-height: 1.4; color: #aab2bd; }
.gm-initiative-error { margin: 0; color: #ed8585; font-size: 12px; }
.gm-initiative-scroll { overflow-y: auto; min-height: 0; flex: 1; }
.gm-initiative table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 12px; }
.gm-initiative th, .gm-initiative td { text-align: left; border-bottom: 1px solid #343940; padding: 5px 3px; }
.gm-initiative th:nth-child(1) { width: 22px; }
.gm-initiative th:nth-child(3) { width: 58px; }
.gm-creature-roll { width: 340px; max-width: 90vw; padding: 22px; color: #e1e6ed; background: #1d2025; border: 1px solid #6c91b5; border-radius: 6px; }
.gm-creature-roll::backdrop { background: #0009; }
.gm-creature-roll h2 { margin-top: 0; }
.gm-creature-roll select, .gm-creature-roll button { padding: 8px 12px; background: #304d69; color: #fff; border: 1px solid #6c91b5; border-radius: 4px; font: inherit; }
.gm-creature-pool { margin: 18px 0; }
.gm-creature-roll footer { display: flex; justify-content: flex-end; gap: 10px; }
.gm-initiative th:nth-child(4) { width: 34px; }
.gm-initiative th:nth-child(5) { width: 25px; }
.gm-initiative td input:not([type="checkbox"]) { width: 100%; min-width: 0; }
.gm-initiative-hidden td:nth-child(2) { color: #a99bbb; }
.gm-check-tracker { --check-row-height: 112px; display: flex; flex-direction: column; gap: 10px; }
.gm-check-tracker header, .gm-check-history header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gm-check-tracker h2 { margin: 0; font-size: 15px; }
.gm-check-tracker button, .gm-check-history button { padding: 5px 8px; border: 1px solid #495565; border-radius: 3px; background: #242a32; color: #e1e6ed; cursor: pointer; white-space: nowrap; }
.gm-check-recent { flex: 1; min-height: 0; overflow: hidden; }
.gm-check-entry { height: var(--check-row-height); box-sizing: border-box; padding: 8px 0; border-bottom: 1px solid #343940; font-size: 12px; line-height: 17px; }
.gm-check-challenge { font-weight: 600; }
.gm-check-challenge, .gm-check-character, .gm-check-faces { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-check-character { color: #aebed2; }
.gm-check-faces { color: #b9b2d1; }
.gm-check-result { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #b8ceb9; }
.gm-check-entry[data-status="pending"] .gm-check-result { color: #edb36d; }
.gm-check-entry[data-status="cancelled"] { opacity: .55; }
.gm-check-count { margin: 0; font-size: 11px; color: #aab2bd; }
.gm-check-history { box-sizing: border-box; width: 1100px; max-width: 95vw; max-height: 88vh; padding: 18px; border: 1px solid #495565; border-radius: 5px; background: #1d2025; color: #e1e6ed; }
.gm-check-history::backdrop { background: #0009; }
.gm-check-history h2 { margin: 0; font-size: 18px; }
.gm-check-history > div { margin-top: 16px; overflow: auto; max-height: 65vh; }
.gm-check-history table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gm-check-history th, .gm-check-history td { text-align: left; vertical-align: top; border-bottom: 1px solid #343940; padding: 10px; overflow-wrap: anywhere; }
.gm-check-history th { position: sticky; top: 0; background: #1d2025; }
.gm-check-history th:nth-child(4) { width: 30%; }
.gm-check-history th:nth-child(5) { width: 30%; }
.gm-player-column { width: var(--gm-player-column-width, 140px); }
.gm-legend-column { width: 140px; }
.gm-all-column { width: 140px; }
.gm-general-table th { padding: 16px 12px; text-align: left; vertical-align: middle; background: #1d2025; border: 1px solid #343940; font-size: 13px; font-weight: 600; }
.gm-general-table .gm-general-edge { color: #9ca6b3; }
.gm-general-table th:last-child { text-align: center; }
.gm-general-identity { display: flex; width: max-content; align-items: center; gap: 10px; white-space: nowrap; }
.gm-difficulty { width: 100%; min-width: 0; padding: 5px 3px; background: #242a32; color: #dce1e8; border: 1px solid #495565; border-radius: 4px; font: 12px system-ui, sans-serif; }
.gm-difficulty:focus-visible { outline: 2px solid #9ab9ec; outline-offset: 2px; }
.gm-general-identity .gm-profile { width: 40px; height: 40px; }
.gm-general-character { display: block; color: #e1e6ed; font-size: 14px; overflow-wrap: anywhere; }
.gm-general-player { display: block; color: #929ba8; font-size: 12px; font-weight: 400; margin-top: 4px; }
.gm-general-table .gm-hp-row th, .gm-general-table .gm-hp-row td { box-sizing: border-box; height: 46px; padding: 8px 12px; border: 1px solid #343940; background: #191c21; font-size: 13px; }
.gm-hp-fields { display: flex; align-items: center; gap: 5px; color: #7f8997; }
.gm-hp-fields input { box-sizing: border-box; width: 43px; min-width: 0; padding: 5px 3px; text-align: center; font: 13px system-ui, sans-serif; font-variant-numeric: tabular-nums; color: #e1e6ed; background: #242a32; border: 1px solid #495565; border-radius: 3px; appearance: textfield; }
.gm-hp-fields input::-webkit-inner-spin-button, .gm-hp-fields input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.gm-hp-fields input:read-only { background: transparent; border-color: transparent; color: #aab2bd; }
.gm-hp-fields input:focus-visible { outline: 2px solid #9ab9ec; outline-offset: 1px; }
.gm-damage-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.gm-damage-form input { box-sizing: border-box; width: 43px; min-width: 0; padding: 5px 3px; text-align: center; font: 13px system-ui, sans-serif; color: #e1e6ed; background: #242a32; border: 1px solid #495565; border-radius: 3px; appearance: textfield; }
.gm-damage-form input::-webkit-inner-spin-button { -webkit-appearance: none; }
.gm-damage-form button, .gm-damage-dialog button { padding: 5px 8px; font: 12px system-ui, sans-serif; color: #e1e6ed; background: #29323e; border: 1px solid #495565; border-radius: 3px; cursor: pointer; }
.gm-damage-form button:hover, .gm-damage-dialog button:hover { background: #354255; }
.gm-damage-form :focus-visible, .gm-damage-dialog button:focus-visible { outline: 2px solid #9ab9ec; outline-offset: 2px; }
.gm-damage-dialog { width: 720px; max-width: calc(100vw - 64px); padding: 20px; color: #e1e6ed; background: #1d2025; border: 1px solid #495565; border-radius: 6px; box-shadow: 0 16px 60px #0008; }
.gm-damage-dialog::backdrop { background: #0009; }
.gm-damage-dialog h2 { margin: 0; font-size: 18px; font-weight: 600; }
.gm-damage-dialog form { text-align: right; }
.gm-damage-note { font-size: 12px; color: #aab2bd; margin: 12px 0; }
.gm-damage-results { width: 100%; border-collapse: collapse; font: 12px system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.gm-damage-results th, .gm-damage-results td { padding: 9px 8px; border-bottom: 1px solid #343940; text-align: right; white-space: nowrap; }
.gm-damage-results th[scope="row"], .gm-damage-results thead th:nth-child(2) { text-align: left; }
.gm-damage-results thead th { color: #929ba8; font-weight: 500; }
.gm-damage-results td:last-child { color: #f0c1a3; font-weight: 600; }
.gm-damage-results input[type="checkbox"] { accent-color: #9ab9ec; cursor: pointer; }
.gm-damage-override { box-sizing: border-box; width: 60px; padding: 5px; font: 13px system-ui, sans-serif; text-align: right; color: #e1e6ed; background: #242a32; border: 1px solid #495565; border-radius: 3px; }
.gm-damage-excluded { opacity: .45; }
.gm-damage-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.gm-damage-actions button[type="submit"] { background: #385478; }
.gm-damage-actions button:disabled { opacity: .45; cursor: default; }
.gm-native-review { max-width: 1100px; }
.gm-map-toolbar { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
.gm-map-toolbar h1 { margin:0 auto 0 0; }
.gm-map button { padding:5px 10px; background:#29323e; border:1px solid #495565; border-radius:3px; color:#e1e6ed; cursor:pointer; }
.gm-map-layout { display:grid; grid-template-columns:minmax(0,1fr) 235px; gap:16px; }
.gm-map-canvas { height:calc(100vh - 150px); min-height:450px; background:#8bb8bf; border:1px solid #495565; border-radius:5px; overflow:hidden; }
.gm-map-canvas svg { display:block; width:100%; height:100%; touch-action:none; cursor:grab; user-select:none; }
.gm-map-canvas svg:active { cursor:grabbing; }
.gm-map aside { padding:12px; background:#1d2025; border:1px solid #343940; border-radius:5px; }
.gm-map h2 { font-size:13px; margin:6px 0 12px; }
.gm-map-layers label { display:block; font-size:12px; margin-bottom:8px; }
.gm-map-inspector label { display:block; font-size:12px; margin:10px 0; }
.gm-map aside select, .gm-map-inspector input:not([type="checkbox"]) { box-sizing:border-box; width:100%; padding:5px; background:#17191c; color:#eee; border:1px solid #495565; border-radius:3px; }
.gm-map-help, .gm-map-message { font-size:12px; line-height:1.5; color:#929ba8; }
.gm-map-label { font:600 12px Georgia,'Times New Roman',serif; fill:#302e26; stroke:#ece6d3; stroke-width:3px; paint-order:stroke; stroke-linejoin:round; }
.gm-map-region-label { font:italic 15px Georgia,serif; letter-spacing:1px; fill:#403b30; stroke:#e9e2cd; stroke-width:2.5px; paint-order:stroke; pointer-events:none; }
.gm-map-scar-label { fill:#f3ebd6; stroke:#292d29; stroke-width:2px; }
.gm-map-marker { cursor:pointer; }
.gm-map-party { cursor:move; }
.gm-town-dialog { min-width:240px; padding:20px; background:#1d2025; color:#eee; border:1px solid #495565; border-radius:5px; }
.gm-town-dialog::backdrop { background:#0006; }
.gm-town-dialog h2 { margin:0 0 16px; font-size:17px; }
.gm-town-dialog label { display:flex; align-items:center; gap:7px; margin:12px 0; font-size:13px; }
.gm-map-unseen { stroke:#a76bd6; stroke-width:3.5px; }
.gm-map-toolbar label { margin-right:16px; font-size:13px; color:#c8d4e5; }
.gm-map-footer { display:flex; justify-content:space-between; gap:16px; padding-top:8px; font-size:12px; color:#929ba8; }
.gm-map-feature.is-selected { filter:drop-shadow(0 0 3px #ffe396); }
.gm-inventory { max-width: 1100px; }
.gm-inventory-note { font-size: 12px; color: #929ba8; }
.gm-inventory table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.gm-inventory th, .gm-inventory td { text-align: left; padding: 5px 8px; border-bottom: 1px solid #343940; }
.gm-inventory thead th:first-child { width: 34%; }
.gm-inventory thead th:nth-child(2), .gm-inventory thead th:nth-child(3), .gm-inventory thead th:nth-child(4) { width: 8%; }
.gm-inventory thead th:nth-child(5), .gm-inventory thead th:nth-child(6) { width: 21%; }
.gm-inventory input, .gm-inventory select { box-sizing: border-box; width: 100%; padding: 4px; color: #e1e6ed; background: #1d2025; border: 1px solid #343940; border-radius: 3px; font: inherit; }
.gm-inventory td:first-child { position: relative; padding-left: 29px; }
.gm-inventory-delete { position: absolute; left: 4px; top: 7px; border: 0; background: transparent; color: #ed6565; cursor: pointer; }
.gm-inventory details { margin-top: 4px; font-size: 12px; color: #929ba8; }
.gm-inventory .gm-item-alternate-name { margin-top: 3px; font-size: 11px; color: #929ba8; background: transparent; border-color: transparent; }
.gm-inventory details summary { cursor: pointer; }
.gm-inventory details label { display: block; margin-top: 6px; }
.gm-inventory textarea { box-sizing: border-box; width: 100%; min-height: 70px; resize: vertical; background: #1d2025; color: #e1e6ed; border: 1px solid #343940; font: inherit; }
.gm-item-name-line { display: flex; align-items: center; gap: 6px; }
.gm-item-name-line > input { flex: 1; min-width: 0; }
.gm-inventory .gm-item-identified { flex-shrink: 0; white-space: nowrap; font-size: 12px; color: #c8d4e5; }
.gm-inventory .gm-item-identified input { width: auto; vertical-align: middle; }
.gm-store { max-width: 1600px; }
.gm-store-icon { background: #29323e; color: #dce7f7; border: 1px solid #495565; border-radius: 3px; padding: 4px; cursor: pointer; }
.gm-store-icon:disabled { opacity: .3; cursor: default; }
.gm-store-delete { white-space: nowrap; }
.gm-store-delete input { vertical-align: middle; margin-left: 6px; }
.gm-store-editor { width: 460px; max-height: 85vh; overflow-y: auto; color: #e1e6ed; background: #1d2025; border: 1px solid #495565; border-radius: 5px; }
.gm-store-editor::backdrop { background: #0009; }
.gm-store-editor label { display: block; margin: 10px 0; font-size: 12px; }
.gm-store-editor input, .gm-store-editor textarea, .gm-store-editor select { display: block; box-sizing: border-box; width: 100%; padding: 6px; margin-top: 4px; background: #17191c; color: #eee; border: 1px solid #495565; }
.gm-store-editor textarea { min-height: 60px; }
.gm-store-editor button, .gm-data button { padding: 7px 12px; margin-right: 8px; background: #29323e; color: #eee; border: 1px solid #495565; border-radius: 3px; cursor: pointer; }
.gm-data { min-height: calc(100vh - 115px); display: flex; flex-direction: column; }
.gm-data-controls { display: flex; gap: 8px; margin-bottom: 18px; }
.gm-data-drop { flex: 1; min-height: 55vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; border: 2px dashed #495565; border-radius: 8px; color: #aabbd1; cursor: pointer; }
.gm-data-drop strong { font-size: 22px; font-weight: 500; }
.gm-data-drop span { font-size: 13px; }
.gm-data-drag .gm-data-drop { background: #29323e; border-color: #9ab9ec; }
.gm-store-destination { max-width: 155px; padding: 4px; color: #e1e6ed; background: #1d2025; border: 1px solid #495565; border-radius: 3px; font: 12px system-ui, sans-serif; }
.gm-store-feedback { min-height: 18px; color: #aabbd1; font-size: 12px; }
.gm-store-feedback[data-error="true"] { color: #ed6565; }
.gm-money-coin { --coin-fill: #e7b938; --coin-shine: #ffe78b; display: inline-block; position: relative; width: 14px; height: 14px; margin-left: 5px; vertical-align: -2px; background: #000; clip-path: polygon(4px 0, 10px 0, 10px 2px, 12px 2px, 12px 4px, 14px 4px, 14px 10px, 12px 10px, 12px 12px, 10px 12px, 10px 14px, 4px 14px, 4px 12px, 2px 12px, 2px 10px, 0 10px, 0 4px, 2px 4px, 2px 2px, 4px 2px); }
.gm-money-coin::before { content: ''; position: absolute; inset: 2px; background: var(--coin-fill); clip-path: polygon(2px 0, 8px 0, 8px 2px, 10px 2px, 10px 8px, 8px 8px, 8px 10px, 2px 10px, 2px 8px, 0 8px, 0 2px, 2px 2px); }
.gm-money-coin::after { content: ''; position: absolute; left: 4px; top: 3px; width: 4px; height: 2px; background: var(--coin-shine); }
.gm-money-coin-i { --coin-fill: #b97336; --coin-shine: #e7ad70; }
.gm-money-coin-s { --coin-fill: #b9c0cb; --coin-shine: #f1f3f7; }
.gm-money-coin-p { --coin-fill: #c5e8ed; --coin-shine: #fff; }
.gm-money-coin-p::before { animation: gm-platinum-pulse 2.8s ease-in-out infinite; }
@keyframes gm-platinum-pulse { 0%, 100% { background: #c5e8ed; } 50% { background: #fff; } }
@media (prefers-reduced-motion: reduce) { .gm-money-coin-p::before { animation: none; background: #fff; } }
.gm-store-note { color: #929ba8; font-size: 12px; }
.gm-store-filters { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.gm-store-filters input, .gm-store-filters select { padding: 6px 8px; color: #e1e6ed; background: #1d2025; border: 1px solid #495565; border-radius: 3px; font: 13px system-ui, sans-serif; }
.gm-store-filters input { width: 270px; }
.gm-store-filters [role="status"] { color: #929ba8; font-size: 12px; }
.gm-store table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gm-store th, .gm-store td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #343940; }
.gm-store thead th { color: #c8d4e5; }
.gm-store td:nth-child(2), .gm-store td:nth-child(3) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.gm-store td:nth-child(4), .gm-store td:nth-child(5) { white-space: nowrap; }
.gm-store td:nth-child(6) { max-width: 350px; color: #929ba8; font-size: 12px; }
.gm-store .gm-store-category { padding-top: 18px; background: #1d2025; color: #aabbd1; font-weight: 500; }
.gm-store .gm-store-stocked td { background: #193d60; border-bottom-color: #365f86; }
.gm-store .gm-store-stocked td:nth-child(6) { color: #bcd9f4; }
.gm-store .gm-store-stocked td:first-child { box-shadow: inset 3px 0 #62b2ff; }
.gm-store-editor fieldset input[type="checkbox"] { display: inline-block; width: auto; margin-right: 6px; }
.gm-store-filters :focus-visible { outline: 2px solid #9ab9ec; outline-offset: 2px; }
.gm-inventory-add { margin-top: 12px; padding: 5px 8px; background: #29323e; color: #e1e6ed; border: 1px solid #495565; border-radius: 3px; cursor: pointer; }
.gm-overweight { color: #ed6565; }
.gm-check-button { padding: 4px 7px; font: 12px system-ui, sans-serif; color: #c8d4e5; background: #29323e; border: 1px solid #495565; border-radius: 3px; white-space: nowrap; }
.gm-check-button:not(:disabled) { cursor: pointer; }
.gm-check-button:not(:disabled):hover { background: #456c91; border-color: #a7ccef; box-shadow: 0 0 0 1px #a7ccef44; }
.gm-check-button:not(:disabled):active { background: #203b55; transform: translateY(1px); box-shadow: inset 0 2px 3px #0005; }
.gm-check-button:focus-visible { outline: 2px solid #b1d5fa; outline-offset: 2px; }
.gm-check-button:disabled { cursor: default; opacity: .4; }
.gm-native-progression { display: flex; align-items: center; gap: 16px; margin: 0 0 18px; font-size: 13px; color: #c8d4e5; }
.gm-native-progression input { width: 64px; padding: 4px 6px; background: #1d2025; border: 1px solid #343940; border-radius: 4px; color: #e1e6ed; }
.gm-native-source { margin: 10px 0 18px; color: #929ba8; font-size: 12px; line-height: 1.6; }
.gm-native-meter { margin: 0 0 18px; color: #c8d4e5; font-size: 13px; }
.gm-native-groups { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 16px; }
.gm-character-feats { margin: 0 0 20px; }
.gm-character-feats > h2 { font-size: 16px; }
.gm-character-feats h3 { margin: 0 0 8px; font-size: 14px; }
.gm-character-feats ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.gm-character-feats li + li { margin-top: 5px; }
.gm-feat-status { margin-left: 10px; font-size: 11px; color: #96b4a2; font-weight: normal; }
.gm-level-up { box-sizing: border-box; width: 650px; max-width: 95vw; max-height: 90vh; overflow-y: auto; background: #1d2025; color: #e1e6ed; border: 1px solid #495565; border-radius: 6px; padding: 20px; }
.gm-level-up::backdrop { background: #0009; }
.gm-level-up h2 { margin-top: 0; font-size: 18px; }
.gm-level-up button, .gm-native-progression button { padding: 6px 10px; background: #29323e; color: #e1e6ed; border: 1px solid #495565; border-radius: 4px; cursor: pointer; }
.gm-level-up button:disabled { opacity: .4; cursor: default; }
.gm-level-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 18px; margin: 12px 0 18px; }
.gm-level-stats > div { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; }
.gm-level-stats > div > span:nth-child(2) { font-variant-numeric: tabular-nums; }
.gm-level-up fieldset { border: 1px solid #495565; border-radius: 4px; }
.gm-level-choice { display: flex; align-items: flex-start; gap: 8px; padding: 9px 4px; font-size: 13px; line-height: 1.5; cursor: pointer; }
.gm-level-choice:has(input:checked) { background: #23415a; }
.gm-level-preview { font-size: 13px; line-height: 1.6; color: #b6cbe0; }
.gm-level-actions { display: flex; justify-content: flex-end; gap: 8px; }
.gm-level-confirm:not(:disabled) { background: #28673e; border-color: #4dce80; box-shadow: 0 0 8px #4dce8044; }
.gm-level-up [role="alert"] { color: #ff9898; }
.gm-native-group { flex: 0 1 300px; background: #1d2025; border: 1px solid #343940; border-radius: 4px; padding: 14px; }
.gm-native-group h2 { margin: 0 0 10px; color: #e1e6ed; font-size: 14px; font-weight: 600; }
.gm-native-group dl { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(0, 1fr); margin: 0; font-size: 13px; }
.gm-native-group dt, .gm-native-group dd { margin: 0; padding: 7px 0; border-bottom: 1px solid #30363e; line-height: 1.4; }
.gm-native-group dt { color: #aab2bd; }
.gm-native-group dd { text-align: right; color: #e1e6ed; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.gm-initiative-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.gm-initiative-controls label { display: flex; align-items: center; gap: 6px; }
.genesys-die { display: inline-block; width: 44px; height: 44px; flex: 0 0 44px; vertical-align: middle; margin: 2px; }
.gm-check-faces .genesys-die { width: 28px; height: 28px; margin: 0 2px 0 0; }

.gm-initiative-order { display: flex; gap: 6px; flex-wrap: wrap; }
.gm-initiative button:disabled { opacity: .4; cursor: default; }
.gm-initiative .gm-initiative-drag { padding: 3px; border: 0; background: transparent; cursor: grab; font-size: 18px; }
.gm-initiative tr[data-drop="before"] { box-shadow: 0 -2px #6c91b5; }
.gm-initiative tr[data-drop="after"] { box-shadow: 0 2px #6c91b5; }
.gm-exp-fields input { width: 58px; }
.gm-defense-roll form > label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; } .gm-defense-roll input[type="number"] { width: 58px; padding: 8px; background: #242a32; color: #e1e6ed; border: 1px solid #495565; }
.gm-check-bonuses { display: flex; gap: 12px; margin: 10px 0; }
.gm-check-bonuses label { display: flex; flex: 1; flex-direction: column; gap: 4px; font-size: 12px; }
.gm-check-bonuses input { width: 100%; box-sizing: border-box; padding: 5px; background: #242a32; color: #e1e6ed; border: 1px solid #495565; border-radius: 3px; }
.gm-lore { max-width: 900px; margin: 0 auto; }
.gm-lore-tools { display: flex; gap: 12px; margin-bottom: 16px; }
.gm-lore-tools input { flex: 1; }
.gm-lore input:not([type=checkbox]), .gm-lore textarea { box-sizing: border-box; background: #242a32; color: #e1e6ed; border: 1px solid #495565; padding: 10px; font: inherit; }
.gm-lore-card { border: 1px solid #495565; border-radius: 5px; background: #191c21; padding: 16px; margin-bottom: 16px; }
.gm-lore-card > input, .gm-lore-card textarea { display: block; width: 100%; margin-bottom: 12px; }
.gm-lore-card textarea { min-height: 160px; resize: vertical; }
.gm-lore-card p { white-space: pre-wrap; overflow-wrap: anywhere; }
.gm-lore-card h2 { font-size: 18px; }
.gm-lore button { padding: 8px 12px; margin-left: 12px; background: #29323e; border: 1px solid #495565; color: #e1e6ed; cursor: pointer; }
.gm-inventory .gm-inventory-search { display: block; width: min(100%, 420px); margin: 0 0 14px; padding: 8px; }
[data-character-view][hidden] { display: none !important; }

/* Dread GM management: independent ordered card lists, left to right. */
.gm-dread-management { display:flex; flex-direction:column; height:calc(100dvh - var(--gm-bar-height) - 48px); min-height:280px; gap:18px; }
.gm-dread-columns { display:grid; grid-template-columns:repeat(5,minmax(160px,1fr)); gap:14px; flex:1; min-height:0; overflow-x:auto; padding-bottom:4px; }
.gm-dread-zone { min-height:0; display:flex; flex-direction:column; background:#20242b; border:1px solid #495565; border-radius:4px; }
.gm-dread-zone h2 { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0; padding:12px; border-bottom:1px solid #495565; font-size:16px; color:#e1e6ed; }
.gm-dread-zone h2 span { color:#aab4c2; font-size:13px; font-weight:400; }
.gm-dread-zone ol { list-style:none; padding:0; margin:0; overflow-y:auto; scrollbar-width:thin; }
.gm-dread-zone li { display:flex; align-items:center; gap:12px; min-height:44px; padding:7px 12px; border-bottom:1px solid #343c48; }
.gm-dread-order { min-width:22px; color:#8e9aaa; font-size:12px; font-variant-numeric:tabular-nums; }
.gm-dread-card-name { color:#e1e6ed; font:22px Georgia,serif; }
.gm-dread-card-name.is-red { color:#ef8990; }
.gm-dread-empty { margin:12px; color:#8e9aaa; font-size:13px; }
.gm-dread-zone ol { padding:8px; display:flex; flex-direction:column; gap:6px; }
.gm-dread-zone li { flex-shrink:0; min-height:36px; padding:6px 9px; gap:8px; background:#2a3039; border:1px solid #4a5564; border-radius:3px; }
.gm-dread-card-name { font-size:18px; }
.gm-dread-order { min-width:19px; font-size:11px; }
.gm-dread-zone li { box-sizing:border-box; height:38px; min-height:38px; }
.gm-dread-feedback { margin:0; color:#efb58c; font-size:13px; }
.gm-dread-feedback:empty { display:none; }
.gm-dread-zone ol { position:relative; flex:1; }
.gm-dread-zone li { cursor:grab; }
.gm-dread-zone li:active { cursor:grabbing; }
.gm-dread-grip { color:#94a0af; font-size:17px; }
.gm-dread-zone li.is-dragging { opacity:.35; }
.gm-dread-zone.is-drop-target { border-color:#9bbbe9; background:#242e3e; }
.gm-dread-drop-marker { position:absolute; left:7px; right:7px; height:3px; background:#a8ceff; box-shadow:0 0 6px #79b2ff; pointer-events:none; z-index:2; }
.gm-dread-drop-marker::before { content:''; position:absolute; width:7px; height:7px; border-radius:50%; background:#a8ceff; left:-3px; top:-2px; }
.gm-dread-columns { grid-template-columns:repeat(5,minmax(220px,1fr)); }
.gm-dread-card-name { flex-shrink:0; white-space:nowrap; }
.gm-dread-zone li { gap:6px; }
.gm-dread-note { flex:1; min-width:0; width:0; box-sizing:border-box; height:26px; padding:3px 6px; color:#e1e6ed; background:#171c23; border:1px solid #4a5564; border-radius:3px; font:13px system-ui,sans-serif; cursor:text; }
.gm-dread-note:focus { outline:1px solid #a8ceff; border-color:#a8ceff; }
.gm-dread-note::placeholder { color:#7c899a; }
.gm-dread-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-shrink:0; }
.gm-dread-actions { display:flex; flex-wrap:wrap; gap:10px; }
.gm-dread-actions button { padding:7px 16px; background:#252d38; color:#dce1e8; border:1px solid #526074; border-radius:4px; font:14px system-ui,sans-serif; cursor:pointer; }
.gm-dread-actions button:hover { background:#344155; border-color:#9bbbe9; }
.gm-dread-actions button:active { background:#40516a; }
.gm-dread-actions button:focus-visible { outline:2px solid #a8ceff; outline-offset:2px; }
.gm-dread-heading { display:flex; align-items:center; gap:18px; }
.gm-dread-header-stats { display:flex; gap:8px; }
.gm-dread-stat { display:flex; align-items:center; gap:10px; padding:7px 10px; border:1px solid #526074; border-radius:3px; background:#20242b; white-space:nowrap; }
.gm-dread-stat span { color:#aab4c2; font-size:12px; }
.gm-dread-stat strong { color:#e1e6ed; font:20px Georgia,serif; }
@media(max-width:1100px) { .gm-dread-toolbar { flex-wrap:wrap; } .gm-dread-actions { margin-left:auto; } }
@media(max-width:600px) { .gm-dread-heading { flex-wrap:wrap; gap:10px; } .gm-dread-header-stats { flex-wrap:wrap; } }
.gm-general-heading { display:flex; align-items:center; justify-content:space-between; }
.gm-dice-button { width:34px; height:30px; padding:0 3px; color:#dce7f7; border:1px solid #495565; border-radius:4px; background:#29323e; cursor:pointer; }
.gm-dice-button svg { width:27px; height:27px; fill:none; stroke:currentColor; stroke-width:1.2; }
.gm-dice-button text { fill:currentColor; stroke:none; font:bold 7px system-ui,sans-serif; }
.gm-dice-button:hover { background:#3b4b62; }
.gm-dice-dialog { box-sizing:border-box; width:min(680px,calc(100vw - 24px)); max-height:calc(100dvh - 32px); overflow-y:auto; padding:22px; color:#e1e6ed; background:#20242b; border:1px solid #526074; border-radius:8px; font:14px system-ui,sans-serif; }
.gm-dice-dialog::backdrop { background:#0009; }
.gm-dice-dialog header { display:flex; align-items:center; justify-content:space-between; }
.gm-dice-dialog h2 { margin:0; font-size:22px; }
.gm-dice-dialog h3 { margin:0 0 14px; font-size:16px; }
.gm-dice-dialog section { border-top:1px solid #414a58; padding-top:18px; margin-top:18px; }
.gm-dice-dialog input { width:80px; min-width:0; padding:7px; border:1px solid #526074; border-radius:3px; color:#e1e6ed; background:#171c23; font:inherit; }
.gm-dice-dialog button { padding:7px 12px; border:1px solid #526074; border-radius:4px; background:#29323e; color:#dce7f7; font:inherit; cursor:pointer; }
.gm-dice-dialog button:hover:not(:disabled) { background:#3b4b62; }
.gm-dice-dialog button:disabled { opacity:.45; cursor:default; }
.gm-standard-dice { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.gm-dice-dialog [data-custom] { display:flex; gap:10px; align-items:center; }
.gm-dice-dialog label { display:flex; align-items:center; gap:10px; }
.gm-dice-pool { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:14px; }
.gm-dice-pool label { gap:8px; }
.gm-dice-pool span { flex:1; }
.gm-dice-pool small { display:block; color:#aab4c2; font-size:11px; }
.gm-dice-pool input { width:52px; }
.gm-dice-faces { display:flex; flex-wrap:wrap; gap:5px; margin-top:12px; }
.gm-dice-result { margin-top:10px; font-size:18px; overflow-wrap:anywhere; }
.gm-dice-select { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.gm-dice-select [data-connected] { color:#aab4c2; font-size:12px; }
.gm-dice-select [data-player-result] { flex-basis:100%; font-size:20px; }
.gm-dice-error { color:#ffb0a8; margin:10px 0 0; }
@media(max-width:480px) { .gm-dice-pool { grid-template-columns:1fr; } .gm-dice-dialog { padding:16px; } }
.gm-defense-roll { width:440px; }
.gm-defense-pool-controls { display:grid; gap:6px; margin:12px 0; }
.gm-defense-die { display:flex; align-items:center; gap:8px; }
.gm-defense-die > span:not(.dice-results) { flex:1; }
.gm-defense-die input { width:54px; padding:6px; background:#242a32; color:#e1e6ed; border:1px solid #495565; }
.gm-defense-die button { min-width:34px; padding:5px 9px; }
.gm-defense-die button:disabled { opacity:.4; cursor:default; }
/* Shared battle-board framing; scenery is deterministic SVG, never a bitmap payload. */
.battle-app { color:#dce5de; min-width:0; }
.battle-heading { display:flex; align-items:center; gap:22px; flex-wrap:wrap; margin-bottom:12px; }
.battle-heading h1 { margin:0; font-size:24px; }
.battle-app label { display:inline-flex; align-items:center; gap:7px; font-size:13px; }
.battle-app input,.battle-app select,.battle-app button { font:inherit; color:#e0e8e5; background:#263139; border:1px solid #53646c; border-radius:3px; padding:7px 9px; }
.battle-app input[type=checkbox] { accent-color:#a4c485; }
.battle-app input[type=number] { width:68px; }
.battle-app button { cursor:pointer; }
.battle-app button:hover:not(:disabled) { background:#3a4c56; border-color:#a4bdc8; }
.battle-app button:active:not(:disabled) { background:#506672; }
.battle-app button:disabled { opacity:.4; cursor:default; }
.battle-setup { background:#202a30; border:1px solid #42535b; padding:10px; margin-bottom:10px; }
.battle-setup summary { cursor:pointer; }
.battle-setup form,.battle-tools,.battle-player-controls { display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:8px 0; }
.battle-tools label { flex-wrap:wrap; }
.battle-tools [data-npc-name] { width:120px; }
.battle-app input[type=range] { width:95px; padding:0; }
.battle-workspace { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:16px; align-items:start; }
.battle-workspace > div { min-width:0; }
.battle-viewport { width:100%; max-height:68vh; overflow:auto; border:1px solid #647078; background:#10151c; overscroll-behavior:contain; }
.battle-svg { width:100%; display:block; user-select:none; }
.battle-sidebar { max-height:75vh; overflow:auto; display:grid; gap:12px; }
.battle-sidebar section[data-token-panel],.battle-sidebar section[data-proposals] { background:#20272d; border:1px solid #42505a; padding:12px; }
.battle-sidebar h2 { margin:0 0 8px; font-size:16px; }
.battle-sidebar p { font-size:13px; }
.battle-sidebar form { display:flex; gap:6px; margin-bottom:10px; }
.battle-sidebar [data-token-panel]>label { display:flex; margin-bottom:8px; }
.battle-sidebar [data-proposals] article { border-top:1px solid #52606a; padding:10px 0; }
.battle-sidebar .gm-side-panel { height:auto; min-height:300px; max-height:none; }
.battle-sidebar .gm-initiative-add input { min-width:0; width:100%; }
.battle-sidebar .gm-initiative-scroll { max-height:380px; overflow:auto; }
.battle-help,.battle-legend { font-size:12px; color:#a9b7b9; margin:8px 0; }
.battle-legend span { color:#d99489; }
.battle-error { color:#ffb5a5; font-size:13px; min-height:1em; margin:6px 0; }
.battle-player-order { display:flex; gap:8px; flex-wrap:wrap; }
.battle-player-order span { padding:5px 9px; border:1px solid #66755f; background:#20342b; font-size:13px; }
.battle-player-order span+span::before { content:'› '; color:#c6d6a7; }
.player-battle [data-status] { font-size:14px; min-height:1.4em; color:#e4d6a3; }
@media(max-width:1100px) { .battle-workspace { grid-template-columns:minmax(0,1fr) 300px; } }
@media(max-width:760px) { .battle-workspace { grid-template-columns:1fr; } .battle-sidebar { max-height:none; } .battle-heading { gap:12px; } .battle-heading h1 { font-size:22px; } .battle-viewport { max-height:60vh; } .battle-tools { align-items:start; } .battle-setup form { align-items:start; flex-direction:column; } .battle-player-controls { gap:7px; } .battle-player-controls button { min-height:40px; } }
.gm-battle .battle-svg [data-token],.gm-battle .battle-svg [data-obstacle],.player-battle .battle-svg [data-draggable=true] { cursor:grab; touch-action:none; }
.battle-svg [data-drag-ghost] { cursor:grabbing; }
.battle-svg { -webkit-user-select:none; }
