/* Interactive Tabletop — one dark tabletop, one readable D&D sheet.
   All palette and dimensions live here; no second theme or duplicate layout tree. */
:root {
  color-scheme: dark;
  --gold: #e9b96f;
  --gold-dim: #bc9162;
  --blue: #9acfe4;
  --red: #ee9787;
  --green: #a9d8ad;
  --ink: #eee8df;
  --muted: #b5babf;
  --page: #202932;
  --panel: #26303a;
  --panel-raised: #303c45;
  --line: #54616a;
  --line-gold: #977953;
}
* {box-sizing:border-box}
[hidden] {display:none!important}
html,body {margin:0;width:100%;height:100%;overflow:hidden;background:#100e0d;color:var(--ink);font:13px/1.45 system-ui,-apple-system,'Segoe UI',sans-serif}
button,input,textarea,select {font:inherit}
button {cursor:pointer}
button:disabled {opacity:.45;cursor:default}
button:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible {outline:2px solid var(--blue);outline-offset:2px}
button,select,input,textarea {min-width:0}
#shell {height:100dvh;width:100%;display:flex;flex-direction:column;overflow:hidden}

.brand {display:flex;align-items:center;gap:10px;min-width:0;white-space:nowrap}
.brand .sunmark {width:36px;height:36px;object-fit:contain;filter:drop-shadow(0 0 9px #d49a5345)}
.brand small {display:block;font-size:10px;line-height:1.1;letter-spacing:.16em;color:#b5ab9e;text-transform:uppercase}
.brand strong {display:block;color:#f8dfb5;font:23px/1.1 Georgia,serif}
.top-actions {display:flex;gap:7px;align-items:center;justify-content:flex-end;flex-wrap:wrap;min-width:0}
.save-state {font-size:11px;color:var(--green);white-space:nowrap;margin-right:8px}
.button,button.ghost {display:inline-flex;align-items:center;justify-content:center;gap:5px;border:1px solid #5f5b56;border-radius:6px;background:#2c2c32;color:#f2e9db;min-height:34px;padding:6px 11px;font-size:12px;text-decoration:none;white-space:nowrap}
.button:hover,button.ghost:hover {border-color:var(--gold);background:#393238}
.button.primary {background:#d9a764;border-color:#e6b571;color:#211b16;font-weight:750}
.button.primary:hover {background:#f0c484}
.button.subtle {background:#24252b}
.button.warn {background:#493031;border-color:#985e58;color:#ffd5cd}
.button.mini {min-height:27px;padding:4px 8px;font-size:11px}
#workspace,.tabletop-dock,.dice-stage {position:relative;min-height:0;width:100%;overflow:hidden}
#workspace {flex:1}
.tabletop-dock,.dice-stage {height:100%}
.dice-stage {
  background-image:radial-gradient(ellipse at 55% 50%,transparent 25%,#050505a4 100%),linear-gradient(96deg,#090b0d42,#08080b18),var(--desk-texture,url('./walnut-texture.jpg'));
  background-color:#1b1715;background-size:cover,cover,512px 512px;
  box-shadow:inset 0 10px 35px #000b,inset 0 0 100px #000b;
}
.dice-stage::before {content:'';position:absolute;inset:10px;border:1px solid #b38c524a;box-shadow:inset 0 0 0 6px #08090877,inset 0 7px 12px #0008;pointer-events:none;border-radius:8px}
.dice-stage::after {content:'INTERACTIVE TABLETOP  •  LOCAL-FIRST';position:absolute;bottom:9px;left:0;right:0;text-align:center;color:#c1a3776b;font:10px Georgia,serif;letter-spacing:.35em;pointer-events:none}

.sheet-wrap::before {content:'';position:absolute;inset:5px -5px -5px 6px;background:#131619;border:1px solid #9c774c;transform:rotate(.35deg);pointer-events:none}




#page {position:relative;z-index:2;height:100%;min-width:0;overflow:auto;overscroll-behavior:contain;scrollbar-color:#6a655b #1c242c;padding:18px 19px 26px;
  background-image:linear-gradient(100deg,#0f151a42,transparent 36%,#0c101b52),var(--sheet-texture,url('./vellum-texture.jpg'));background-size:cover,512px 512px;
  color:var(--ink);border:1px solid #9d8058;box-shadow:inset 0 0 0 3px #1b242b,inset 0 0 0 4px #655842, inset 0 0 55px #080f1d7c;
}
#page::before {content:'';position:absolute;inset:9px;border:1px solid #98795033;pointer-events:none}
#page .title-row {position:relative;display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 13px;padding:0 1px 11px;border-bottom:1px solid #83684e}
#page .sheet-eyebrow {display:block;color:#d0a96c;font-size:10px;letter-spacing:.16em;text-transform:uppercase;margin-bottom:2px}
#page .page-title {margin:0;color:#f7e8c9;font:normal 27px/1.12 Georgia,serif;letter-spacing:.01em}
#page .lead {margin-top:4px;color:#c0c7ca;font-size:12px;line-height:1.35}
#page .sheet-portrait {width:52px;height:54px;flex-shrink:0;object-fit:cover;object-position:60% 25%;border-radius:5px 18px 5px 5px;border:2px solid #bf925c;box-shadow:0 0 0 3px #27323b}
#page .grid {display:grid;gap:8px;min-width:0}

#page .two {grid-template-columns:repeat(2,minmax(0,1fr))}
#page .three {grid-template-columns:repeat(3,minmax(0,1fr))}

#page .kpi small {display:block;color:#bac1c4;font-size:10px;font-weight:650;line-height:1.2;text-transform:uppercase;letter-spacing:.045em}

#page .kpi .meta {font-size:10px;line-height:1.2;color:#b6bec4}
#page .panel {margin:0;min-width:0;overflow:hidden;background:#242e38e6;border:1px solid #53616d;border-radius:7px}

#page .panel>summary::-webkit-details-marker {display:none}
#page .panel>summary::after {content:'−';color:#efc182;font:19px system-ui,sans-serif}
#page .panel:not([open])>summary::after {content:'+'}
#page .panel:not([open])>summary {border-bottom:0}

#page .section-label,#page .field-label {display:block;color:#e5c396;font-size:10px;font-weight:680;letter-spacing:.09em;text-transform:uppercase}
#page .section-label {margin:8px 0 6px}
#page .field-label {margin:0 0 4px}
#page .form-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
#page .field {display:block;min-width:0;margin:0}
#page .input,.throw-row .input {width:100%;min-width:0;border-radius:5px;background:#151e27;border:1px solid #60707c;color:#f8f2e6;padding:7px 9px;outline:none;font-size:13px}
#page .input:focus,.throw-row .input:focus {border-color:var(--gold);box-shadow:0 0 0 2px #eab96c30}
#page .input.sm {width:62px;padding:5px;text-align:center}
#page .input.md {width:82px}
#page .input.search {max-width:360px}
#page .button,#page button.ghost {min-height:30px;padding:5px 8px;border-color:#74644d;background:#3a4047;color:#f7ebd7;border-radius:5px;font-size:12px}
#page .button:hover,#page button.ghost:hover {background:#525052;border-color:#e5bd7e}
#page .button.primary {background:#d8a65e;color:#221b14;border-color:#e4b877}
#page .button.warn {background:#623d3c;border-color:#a96660;color:#ffe0d7}
#page .button.mini {min-height:27px;padding:4px 7px;font-size:11px}
#page .controls-row,.controls-row {display:flex;flex-wrap:wrap;align-items:center;gap:6px}
#page .healthbar {height:9px;margin:0;background:#20262d;border:1px solid #4c5358;overflow:hidden;border-radius:20px}
#page .healthbar>i {display:block;height:100%;background:linear-gradient(90deg,#c45e53,#f0ad7e);transition:width .25s}
#page .hp-action-row {display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-top:8px}
#page .hp-action-row .input {width:72px}
#page .hp-options {margin-top:9px;border-top:1px solid #45525b;padding-top:6px}
#page .hp-options summary {color:#c9d0d0;cursor:pointer;font-size:12px;padding:3px 0}
#page .hp-options .form-grid {margin:8px 0}
#page .resource-row {display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:7px;padding:7px 0;border-bottom:1px solid #44505b}
#page .resource-row:last-child {border-bottom:0}
#page .resource-row strong {color:#f0e9dd;font-size:12px;font-weight:650}
#page .resource-row small {display:block;color:#b3bec6;font-size:10px;line-height:1.3}
#page .res-count {font:17px Georgia,serif;color:#f4deb8;white-space:nowrap}
#page .res-count span {color:#bec4ca;font-size:12px}
#page .step-buttons {display:flex;gap:3px}
#page .step-buttons button {width:27px;height:27px;border:1px solid #5d6d77;border-radius:4px;background:#303e49;color:#e9c48c}

#page .ability-card>span {display:block;color:#e7c18e;font-size:11px;font-weight:700;letter-spacing:.1em;margin-bottom:3px}
#page .ability-card .ability-number {width:64px;padding:5px 3px;font:22px Georgia,serif;color:#fff0cd}
#page .ability-card small {display:flex;justify-content:center;align-items:center;gap:3px;margin:5px 0 7px;color:#bfc8d0;font-size:10px}
#page .ability-card .ability-mod {width:48px;color:#abddf1}
#page .condition-row {display:flex;flex-wrap:wrap;gap:5px}
#page .cond {padding:5px 8px;background:#2b3741;border:1px solid #5a6a74;border-radius:4px;color:#d7e1e5;font-size:11px}
#page .cond.on {background:#67443d;border-color:#d49d69;color:#fff2d7}
#page .rollable {width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 9px;border:1px solid #526674;background:#2c3741;color:#f4f0e6;border-radius:5px;text-align:left;font-size:12px}
#page .rollable:hover {background:#42505d;border-color:#efbd7b}
#page .rollable .tag {color:#a4daf2;font-weight:750;font-size:13px}
#page .rollrow {display:flex;gap:6px;align-items:center}
#page .rollrow .rollable {flex:1}
#page .stack {display:flex;flex-direction:column;gap:6px}
#page .table-wrap {overflow:auto;max-width:100%}
#page .data-table {border-collapse:collapse;width:100%;font-size:12px}
#page .data-table th {position:sticky;top:0;background:#2b3540;color:#e8c798;text-align:left;font-size:10px;text-transform:uppercase;letter-spacing:.055em;font-weight:700;border-bottom:1px solid #677381;padding:8px}
#page .data-table td {padding:8px;border-bottom:1px solid #495761;vertical-align:middle;color:#e3e7e7}
#page .data-table tr:hover td {background:#34434e}
#page .data-table .data-title {font-weight:650;color:#fff0d2}
#page .pill {display:inline-block;padding:3px 7px;border:1px solid #71808a;border-radius:30px;color:#e5e9e9;font-size:11px}
#page .pill.gold {border-color:#b68e54;color:#f0cd94}
#page .pill.green {border-color:#658b78;color:#b8e8c8}
#page .muted,#page .subtle-note,#page .help,#page .lead {color:#bbc4cb}
#page .subtle-note {font-size:11px;line-height:1.45}
#page .help {font-size:12px;line-height:1.5}
#page .feature {border:1px solid #56636c;border-radius:5px;margin-bottom:6px;background:#26333b}
#page .feature summary {cursor:pointer;padding:8px 10px;font:14px Georgia,serif;color:#f8deb3}
#page .feature pre {white-space:pre-wrap;overflow-wrap:anywhere;max-height:380px;overflow:auto;margin:0;padding:7px 10px;font:12px/1.55 system-ui,sans-serif;color:#e0e0dc}
#page .longtext {min-height:130px;resize:vertical}
#page .toolbar {display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:10px}
#page .loading {padding:50px;text-align:center;color:#efcfaa}
#dice-canvas {position:absolute;z-index:5;inset:0;width:100%;height:100%;display:block;pointer-events:none}


.desk-heading .button {font:11px system-ui,sans-serif;min-height:26px;padding:4px 7px;letter-spacing:0}
.dice-choice {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.dice-choice button {min-width:0;min-height:34px;padding:4px 0;border:1px solid #716b62;border-radius:5px;color:#f5e8d7;background:#333b43;font-weight:750;font-size:12px}
.dice-choice button:hover {border-color:var(--gold);background:#52505a}
.throw-row {display:flex;align-items:stretch;gap:4px}
.throw-row .input {flex:1;width:60px;font-size:12px;padding:5px 6px}
.throw-row .button {font-size:11px;padding:5px 7px;min-height:34px}
.table-result {min-height:46px;border:1px solid #6f6657;border-radius:6px;background:#242e38;padding:9px;color:#e0d7cb;font-size:13px;line-height:1.4;display:flex;align-items:center;gap:10px}
.table-result strong {color:#ffda9d;font:700 29px/1.1 Georgia,serif;font-variant-numeric:tabular-nums}
.table-history {color:#c9c5bb;border-top:1px solid #5d5244;font-size:11px}
.table-history summary {cursor:pointer;padding:4px 0}
.history {list-style:none;margin:0;padding:0;max-height:140px;overflow:auto}
.history li {border-bottom:1px solid #4c5156;padding:6px 0;font-size:11px}
.history li b {color:#ffdea7;font-size:14px}
.tray-help {font-size:11px;line-height:1.35;color:#b9bdc2;text-align:left}
.status-msg {position:absolute;z-index:12;right:13px;bottom:6px;color:#f3d6a2;text-shadow:0 1px 5px black;font-size:11px;pointer-events:none}


#dialog-layer:not([hidden]) {position:fixed;z-index:80;inset:0;display:flex;align-items:center;justify-content:center;background:#000c;padding:20px}
#dialog-layer .dialog {width:min(560px,100%);max-height:92dvh;overflow-y:auto;padding:22px;border-radius:10px;border:1px solid #b18a5a;background:#242e39;box-shadow:0 30px 80px #000b}
#dialog-layer h2 {font:24px Georgia,serif;color:#ffe1b3;margin:0 0 9px}
#dialog-layer p {font-size:13px;color:#d6dce0;line-height:1.5;white-space:pre-line;overflow-wrap:anywhere}
#dialog-layer .controls-row {justify-content:flex-end}
.overlay-notice {padding:12px;border-radius:6px;border:1px solid #bd8a4a;background:#59402d;color:#fff1d7}
/* v0.7 — Compact game HUD: a single character JSON drives all meters. */
#page .title-row {margin-bottom:9px;padding-bottom:8px}
#page .page-title {font-size:25px}



#page .kpi .meta {font-size:10px}
#page .overview-columns {margin-top:8px}
#page .overview-column {gap:8px}


#page .vitals-panel{border:1px solid #716656;border-radius:7px;background:#202b35ed;padding:6px 10px;margin-bottom:7px;position:relative}
#page .vitals-line{display:flex;align-items:center;gap:5px;min-width:0;white-space:nowrap}
#page .vital-label{font:15px Georgia,serif;color:#f3ce90;flex:none}
#page .hp-total{color:#ffc9aa;font:20px/1 Georgia,serif;white-space:nowrap;flex:none;cursor:ns-resize}
#page .hp-total span{color:#c4c8c9;font:13px Georgia,serif}
#page .vital-gap{flex:0 0 7px}
#page .vital-controls{display:flex;align-items:center;gap:5px;flex:none}
#page .vital-controls .input{width:56px;padding:3px 5px;min-height:26px}
#page .vital-controls .button{min-height:26px;padding:3px 7px;font-size:11px}
#page .hearts{display:flex;align-items:center;gap:2px;flex:1 1 180px;min-width:45px;min-height:28px;padding:3px 5px;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap;scrollbar-width:thin;background:#141e2680;border-radius:5px;border:1px solid #3c4851}
#page .heart{display:block;flex:0 0 17px;width:17px;height:19px;background:none;border:0;padding:0;transition:transform .13s;position:relative}
#page .heart svg{display:block;width:100%;height:100%;overflow:visible;filter:drop-shadow(0 1px 1px #000a)}
#page .heart-empty{fill:#263039;stroke:#8a6f68;stroke-width:1.2px}
#page .heart-full{fill:#e77a6b;stroke:#f9c49c;stroke-width:.75px;clip-path:inset(0 calc(100% - var(--heart-fill)) 0 0)}
#page .heart:hover,#page .heart:focus-visible{transform:translateY(-3px);filter:brightness(1.3)}
#page .temp-hp{color:#aac8d8;font-size:11px;flex:none}
#page .vital-edit{position:static;flex:none;margin-left:auto}
#page .vital-edit summary{list-style:none;cursor:pointer;border:1px solid #52626c;border-radius:4px;padding:5px 7px;font-size:11px;color:#d0c7b8;white-space:nowrap}
#page .vital-edit summary::-webkit-details-marker{display:none}
#page .vital-edit .form-grid{position:absolute;right:0;top:calc(100% + 4px);width:min(425px,calc(100vw - 45px));margin:0;padding:10px;border:1px solid #ae8855;border-radius:7px;background:#19242efb;box-shadow:0 15px 45px #000d;z-index:14}
@media(max-width:720px){#page .vitals-line{flex-wrap:wrap}#page .hearts{flex:1 1 100px}#page .vital-gap{flex-basis:2px}}
#page .condition-rail{display:inline-flex;align-items:center;gap:7px;flex-wrap:wrap;min-width:0;max-width:100%}
#page .condition-icons{display:flex;align-items:center;flex-wrap:wrap;gap:5px;max-width:100%}
#page .condition-icon {display:inline-grid;place-items:center;position:relative;flex:0 0 27px;width:27px;height:27px;padding:4px;border:1px solid #44515c;background:#2c3842;border-radius:5px;color:#a2b0bd}
#page .condition-icon svg {width:18px;height:18px}
#page .condition-icon:hover,#page .condition-icon:focus-visible {background:#3a4550;color:#f3d6a5;border-color:#c4a171}
#page .condition-icon.on {background:#735042;border-color:#e1a268;color:#ffdbad;box-shadow:inset 0 0 7px #eab35a36,0 0 0 1px #a95d393c}
#page .condition-icon.on::before {content:'';width:4px;height:4px;position:absolute;top:-3px;right:-3px;background:#f0ad79;border-radius:50%}
/* Icons share the one fast card presenter; the edition reference owns rules text. */
#page .resource-pips {padding:6px 0 8px;border-bottom:1px solid #44505b}
#page .resource-pips:first-child {padding-top:1px}
#page .resource-pips:last-child {border:0;padding-bottom:1px}
#page .resource-info {display:flex;align-items:baseline;gap:8px;margin-bottom:5px}
#page .resource-info strong {font-size:12px;font-weight:650;color:#f0e9df}
#page .resource-count {font-size:14px;color:#f7dba7;font-weight:700;margin-left:auto;font-variant-numeric:tabular-nums}
#page .resource-count span {color:#aebcc4;font-weight:500}
#page .resource-info small {color:#99a9b7;font-size:10px;min-width:61px;text-align:right}


#page .resource-pip.filled {background:linear-gradient(145deg,#ffe1a9,#c88644);border-color:#f1bb77;box-shadow:0 0 5px #d8944140,inset 0 1px 1px #fff6}
#page .resource-pip:hover,#page .resource-pip:focus-visible {filter:brightness(1.35);transform:translateY(-2px)}

#page .ability-head {display:flex;justify-content:space-between;align-items:center;gap:4px;margin-bottom:4px}
#page .ability-head>span {font-size:11px;color:#edc48a;font-weight:750;letter-spacing:.09em}
#page .ability-roll {font-size:10px;border:1px solid #685c4a;border-radius:4px;background:#293640;color:#e8cfa6;padding:2px 5px;white-space:nowrap}
#page .ability-roll:hover {background:#49515a;border-color:#dcad71}
#page .ability-values {display:flex;justify-content:space-between;align-items:center;gap:5px}
#page .ability-values label {display:flex;align-items:center;gap:3px;font-size:9px;color:#afbbc5;font-weight:650}





.hud-tooltip {position:fixed;z-index:90;pointer-events:none;border:1px solid #c99c65;border-radius:6px;background:#131d26f7;color:#ffe3b9;padding:7px 10px;font:12px/1.35 system-ui,sans-serif;box-shadow:0 5px 18px #000c;white-space:nowrap;max-width:calc(100vw - 16px);overflow:hidden;text-overflow:ellipsis}
.hud-tooltip[hidden]{display:none}
.hud-tooltip.has-detail{width:max-content;max-width:min(340px,calc(100vw - 16px));max-height:min(420px,70dvh);white-space:normal;overflow:hidden;overflow-wrap:anywhere}
.hud-tip-title{display:block;font-weight:700;color:#ffe2ad}
.hud-tip-detail{display:block;margin-top:6px;color:#e0e6e9;line-height:1.5;font-size:12px}
.hud-tip-source{display:block;margin-top:7px;padding-top:5px;border-top:1px solid #53616b;color:#a9bcc7;font-size:10px;line-height:1.35}
.hud-tooltip.is-pinned{border-color:#f1c989;box-shadow:0 5px 22px #000e}





/* v0.8: one dashboard, three content lanes, one shared physical tabletop.
   Desktop, laptop, tablet and narrow-screen layouts are defined here. */
.topbar{position:relative;z-index:12;flex:0 0 43px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:3px 13px;background:linear-gradient(180deg,#202026,#141519);border-bottom:1px solid #896c49;box-shadow:0 5px 20px #0008}
.brand .sunmark{width:28px;height:28px}
.brand strong{font-size:19px}.brand small{font-size:9px}
.top-actions .button{min-height:28px;padding:4px 8px;font-size:11px}
.sheet-wrap{position:absolute;z-index:2;top:42px;left:9px;right:9px;bottom:9px;filter:drop-shadow(7px 10px 13px #030305a6);transition:opacity .2s,transform .2s}
.sheet-hidden .sheet-wrap{opacity:0;transform:translateX(-20px);pointer-events:none;visibility:hidden}
#page{padding:10px 13px 16px}
#page .panel{align-self:start;border-color:#586571;background:#242e38e6}
#page .panel>summary{font:15px/1.12 Georgia,serif;padding:7px 10px;background:linear-gradient(100deg,#39444c,#2e3944)}
#page .panel-content{padding:7px 8px}
#page .grid.three{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
/* Identity and stats are a single fluid ribbon, not four stretched cards. */
#page .identity-ribbon{display:flex;align-items:center;gap:11px;position:relative;min-width:0;margin-bottom:7px;padding:0 3px 8px;border-bottom:1px solid #8a704f}
#page .identity-ribbon .sheet-portrait{width:43px;height:43px;object-fit:cover;border-radius:6px 13px 6px 6px;border:1px solid #bf945a;flex:0 0 auto}
#page .identity-copy{flex:1 1 185px;min-width:150px}
#page .identity-copy .sheet-eyebrow{font-size:9px;margin-bottom:0}
#page .identity-copy .page-title{font-size:23px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#page .identity-sub{font-size:11px;color:#c0c9cc;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#page .header-rest{display:flex;align-items:center;gap:5px;flex:0 0 auto}
#page .header-rest .button{white-space:nowrap;padding:5px 7px;min-height:30px}
#page .status-chips{display:flex;flex-wrap:wrap;align-items:center;gap:5px;justify-content:flex-end;min-width:0}
#page .status-chips .kpi{display:inline-flex;flex:0 0 auto;align-items:baseline;gap:7px;border:1px solid #536372;background:#29343ecb;padding:5px 9px;border-radius:6px;min-height:30px}
#page .status-chips .kpi small{font-size:10px;white-space:nowrap;color:#bac6ca}
#page .status-chips .kpi .value{font:18px/1 Georgia,serif;color:#ffdaa1;white-space:nowrap}
#page .identity-editor{flex:0 0 auto;position:relative;z-index:4}
#page .identity-editor>summary{list-style:none;border:1px solid #5a6976;border-radius:5px;background:#283440;color:#f2cf97;padding:5px 8px;cursor:pointer;font-size:11px}
#page .identity-editor>summary::-webkit-details-marker{display:none}
#page .identity-editor[open]>summary{border-color:#d2a873}
#page .identity-fields{position:absolute;top:calc(100% + 5px);right:0;width:min(425px,calc(100vw - 45px));padding:12px;border:1px solid #ae8855;border-radius:7px;background:#19242efb;box-shadow:0 15px 45px #000d;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;z-index:13}
#page .identity-fields .field{min-width:0}
#page .identity-fields .input{width:100%}
#page .condition-icon{width:25px;height:25px;flex-basis:25px}
/* Three distinct columns; panels never stretch to a neighbor's height. */
#page .ability-card{padding:5px 6px;min-width:0;background:#303d46;border:1px solid #5b6973;border-radius:5px}
#page .ability-values .ability-number{font:18px Georgia,serif;width:53px;padding:3px 2px;color:#fff0d0}
#page .ability-values .ability-mod{width:39px;padding:3px 2px;color:#a9def1}
#page .ability-head{margin-bottom:2px}
#page .pip-track{display:flex;flex-direction:column;gap:3px;align-items:flex-start;max-width:100%}
#page .pip-row{display:grid;grid-template-columns:repeat(10,14px);gap:4px;min-height:14px}
#page .resource-pip{width:14px;height:14px;min-width:14px;padding:0;border:1px solid #647581;border-radius:3px;background:#18242d;box-shadow:inset 0 1px 2px #0008}
#page .resource-pips{padding:5px 0;border-bottom:1px solid #43505b}
#page .resource-pips:first-child{padding-top:0}
#page .resource-pips:last-child{border-bottom:0;padding-bottom:0}
#page .resource-info{display:flex;align-items:baseline;gap:7px;margin-bottom:4px}
#page .resource-info strong{font-size:12px}
#page .resource-count{margin-left:auto;font-size:13px}
#page .resource-info small{font-size:10px;min-width:55px;text-align:right}
#page .resource-pip:hover,#page .resource-pip:focus-visible{filter:brightness(1.3);transform:translateY(-1px)}
#page .attack-list{display:flex;flex-direction:column;gap:0}
#page .attack-row{display:grid;grid-template-columns:minmax(0,1fr) 32px auto;align-items:center;gap:5px;min-height:28px;border-bottom:1px solid #46515a;padding:2px 0}
#page .attack-row:last-child{border-bottom:0}
#page .attack-name{font-size:12px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
#page .attack-bonus{color:#ade2f6;font-size:12px;text-align:right}
#page .attack-row .controls-row{gap:3px;flex-wrap:nowrap}
#page .attack-row .button{min-height:23px;padding:2px 6px;font-size:11px}
#page .combat-actions{display:flex;gap:4px;align-items:center;flex-wrap:wrap;border-top:1px solid #59636b;margin-top:6px;padding-top:6px}
#page .combat-actions strong{font:12px Georgia,serif;color:#f1ce92}
#page .combat-actions .button{min-height:25px;font-size:11px;padding:3px 5px}
#page .rolls-tight{display:flex;flex-direction:column;gap:3px}
#page .rolls-tight .rollable{padding:4px 8px;min-height:26px;font-size:12px}
#page .rolls-tight .tag{font-size:12px}
#page .rolls-tight .rollrow{min-width:0;gap:3px}
#page .rolls-tight .rollrow .rollable{min-width:0}
#page .rolls-tight [data-filter-row][hidden]{display:none!important}
#page .bonus-editor{display:none;width:49px;padding:3px 4px}
#page .skill-tools{display:flex;align-items:center;gap:5px;margin-bottom:6px}
#page .skill-tools #skill-filter{flex:1;width:100%;padding:5px 7px;font-size:12px}
#page .edit-bonus{order:2;border:1px solid #687788;background:#303d46;color:#e6c397;border-radius:5px;min-height:29px;padding:3px 7px;font-size:12px}
#page .edit-bonus:hover{border-color:#d1a66e}
#page .sr-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.desk-controls{position:absolute;z-index:9;right:12px;bottom:12px;width:154px;max-width:calc(100% - 24px);display:block;border:1px solid #94754f;border-radius:8px;background:linear-gradient(170deg,#242830f7,#141a21fa);box-shadow:0 13px 33px #000c;color:#f3e4d1;overflow:hidden}
.desk-controls[open]{width:min(360px,calc(100% - 26px))}
.desk-heading{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 10px;min-height:33px;cursor:pointer;color:#ffdcaa;font:14px Georgia,serif}
.desk-heading::-webkit-details-marker{display:none}
.collapsed-result{font:11px system-ui,sans-serif;color:#b7cad4;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:155px}
.desk-controls:not([open]) .desk-heading{display:flex;min-height:33px;gap:4px;padding:3px 7px}
.desk-controls:not([open]) .desk-heading>span:first-child{flex:0 0 auto;font:12px/1.2 Georgia,serif}
.desk-controls:not([open]) .expand-glyph{flex:0 0 auto;font-size:12px}
.desk-controls:not([open]) .collapsed-result{display:flex;flex:1 1 auto;flex-direction:row;align-items:center;gap:4px;min-width:0;max-width:none;overflow:hidden;text-overflow:clip;white-space:nowrap}
.collapsed-result .compact-total{display:block;color:#ffe0a8;font:700 21px/1.05 Georgia,serif;font-variant-numeric:tabular-nums;white-space:nowrap}
.desk-controls:not([open]) .compact-total{font-size:25px;line-height:1}
.collapsed-result .compact-label{display:block;min-width:0;max-width:100%;font:12px/1.3 system-ui,sans-serif;color:#d2e0e8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.desk-controls:not([open]) .compact-label{font-size:9px;line-height:1.1}
.collapsed-result .compact-ready{font:600 15px/1.2 system-ui,sans-serif;color:#d2e0e8}
.desk-controls[open] .collapsed-result{display:inline-flex;align-items:baseline;gap:5px;min-width:0}
.desk-controls[open] .collapsed-result .compact-label{font-size:11px}
.desk-controls:not([open]) .desk-heading:focus-visible{outline:2px solid #e9c389;outline-offset:-3px}

.expand-glyph{font:15px system-ui;transition:transform .15s}
.desk-controls[open] .expand-glyph{transform:rotate(180deg)}
.dice-widget-content{display:flex;flex-direction:column;gap:7px;padding:2px 10px 10px;border-top:1px solid #786147}
#dice-canvas{z-index:5}
@media(max-width:1180px){
 #page .identity-ribbon{flex-wrap:wrap;gap:7px}
 #page .identity-copy{flex:1 1 205px}
 #page .status-chips{flex:1 1 auto;justify-content:flex-end}
}
@media(max-width:980px){
 #page{padding:9px 10px 18px}
 #page .identity-ribbon .identity-copy{min-width:135px}
}
@media(max-width:680px){
 .brand small,.top-actions .save-state{display:none}
 .topbar{padding:3px 7px}
 .top-actions{gap:3px}
 .top-actions .button{padding:4px 6px;font-size:10px}
 .sheet-wrap{top:40px;left:5px;right:5px;bottom:7px}
 #page .identity-ribbon{gap:7px}
 #page .identity-copy{flex:1 1 140px;min-width:0}
 #page .status-chips{flex:1 1 100%;justify-content:flex-start}
 #page .identity-editor{margin-left:auto}
 #page .identity-fields{right:0}
 #page .condition-icons{width:100%}
}
@media(max-width:460px){
 .brand strong{font-size:15px}
 .brand .sunmark{width:22px;height:22px}
 .top-actions label.button,.top-actions #import-json,.top-actions #export-json{display:none}
 #page{padding:7px 7px 19px}
 #page .identity-copy .page-title{font-size:21px}
 #page .identity-ribbon .sheet-portrait{width:37px;height:37px}
 #page .status-chips .kpi{padding:4px 6px;gap:4px}
 #page .status-chips .kpi small{font-size:9px}
 #page .status-chips .kpi .value{font-size:16px}
 #page .ability-values .ability-number{width:42px;font-size:17px}
 #page .ability-values .ability-mod{width:33px}
 #page .ability-values label{font-size:0;gap:0}
 #page .vitals-panel{padding:7px}
 #page .vital-heading{gap:6px}
 #page .temp-hp{font-size:10px}
 .desk-controls{right:7px;bottom:10px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;scroll-behavior:auto!important}}

/* v0.9: persistent HUD and tabbed gameplay workspace. Replaces old three-column composition. */
.sheet-wrap{top:10px;left:9px;right:9px;bottom:9px}
#page{padding:10px 13px 25px}
#page .identity-ribbon{margin-bottom:6px;padding-bottom:5px}
#page .identity-ribbon .identity-copy{flex:1 1 240px}
#page .identity-ribbon .status-chips{flex:0 1 auto}
#page .identity-ribbon .edit-mode-button{margin-left:5px}
#page .hud-four{display:grid;grid-template-columns:minmax(170px,1.07fr) minmax(190px,1.18fr) minmax(190px,1.04fr) minmax(330px,2.22fr);align-items:start;gap:7px}
#page .hud-zone{min-width:0;display:flex;flex-direction:column;gap:7px}
#page .hud-zone>.panel{min-width:0;width:100%}
#page .hud-attributes .grid.three{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
#page .hud-attributes .ability-card{padding:6px}
#page .ability-values{align-items:center}
#page .ability-readout{font:22px/1 Georgia,serif;color:#ffdf9d}
#page .mod-readout{font:700 14px/1 system-ui;color:#a9dbf5;min-width:27px;text-align:center}
#page .hud-four[data-edit-bonuses] .bonus-editor{display:inline-block}
#page .hud-skills .skills-list{max-width:100%}
#page .game-workspace{min-width:0;border:1px solid #62707b;border-radius:7px;background:#222c37ef;overflow:hidden}
#page .workspace-caption{font:700 10px system-ui,sans-serif;letter-spacing:.16em;color:#e9bc79;padding:8px 10px 5px}
#page .workspace-caption span{font-weight:400;color:#a8b2bf;letter-spacing:0}
#page .workspace-tabs{display:flex;gap:3px;overflow-x:auto;padding:2px 7px 0;border-bottom:1px solid #64717c;scrollbar-width:thin}
#page .workspace-tabs button{white-space:nowrap;padding:7px 9px;font:600 11px system-ui;border:1px solid transparent;border-radius:5px 5px 0 0;background:none;color:#bac3cf;cursor:pointer}
#page .workspace-tabs button:hover{color:white;background:#344452}
#page .workspace-tabs button.active{background:#354654;border-color:#7a6d57;border-bottom-color:#354654;color:#ffe0ac}
#page .workspace-content{min-width:0;padding:9px}
#page .workspace-toolbar{display:flex;justify-content:space-between;gap:6px;align-items:center;flex-wrap:wrap;margin-bottom:8px}
#page .workspace-filters{display:flex;gap:4px;flex-wrap:wrap}
#page .filter-chip{background:#1b242c;border:1px solid #5c6972;border-radius:4px;color:#d3dce2;padding:5px 9px;font-size:11px}
#page .filter-chip.selected{background:#bd8e4e;color:#151b21;border-color:#e2b77a;font-weight:700}
#page .workspace-hint{font-size:11px;color:#c0c7ce}
#page .workspace-content .panel{width:100%}
#page .workspace-content .data-table td{padding:6px 5px}
#page .workspace-content .data-table th{padding:6px 5px}
#page .journal-page h2{margin:0 0 8px;color:#e9c58e;font:19px Georgia,serif}
#page .journal-page p{font-size:12px}
#page .journal-page textarea{width:100%;min-height:200px}
#page .workspace-feature-list{display:flex;flex-direction:column;gap:7px}
#page .workspace-feature-list .grid.two{grid-template-columns:1fr}
#page .workspace-content .attack-row{grid-template-columns:minmax(0,1fr) 35px auto}
@media(max-width:1310px){
 #page .hud-four{grid-template-columns:minmax(190px,.9fr) minmax(190px,.9fr) minmax(280px,1.5fr)}
 #page .hud-main{grid-column:1 / -1;grid-row:2}
 #page .hud-attributes .grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
 #page .hud-skills .skills-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
}
@media(max-width:760px){
 #page .hud-four{grid-template-columns:repeat(2,minmax(0,1fr))}
 #page .hud-main{grid-column:1 / -1;grid-row:auto}
 #page .hud-resources{grid-column:1 / -1}
 #page .hud-attributes .grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}
 #page .hud-skills .skills-list{display:block}
}
@media(max-width:510px){
 #page .hud-four{grid-template-columns:1fr}
 #page .hud-resources,#page .hud-main{grid-column:auto}
 #page .hud-attributes .grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
 #page .workspace-content .attack-row{grid-template-columns:minmax(0,1fr) 30px auto}
 #page .workspace-tabs button{padding:7px 7px}
}

/* On narrow screens put the gameplay workspace before the long skill list. */
@media(max-width:510px){
 #page .hud-attributes{order:1}
 #page .hud-main{order:2}
 #page .hud-resources{order:3}
 #page .hud-skills{order:4}
}

/* v0.9 compact list architecture: one disclosure per imported record. */
#page .workspace-toolbar>.search{flex:1 1 130px;min-width:0;max-width:none}
#page .workspace-entries{display:flex;flex-direction:column;gap:4px;min-width:0}
#page .work-entry{min-width:0;background:#283640c7;border:1px solid #52616e;border-radius:5px;color:#ebedf0}
#page .work-entry>summary{display:flex;align-items:center;gap:8px;cursor:pointer;min-height:32px;padding:6px 9px;list-style:none}
#page .work-entry>summary::-webkit-details-marker{display:none}
#page .work-entry>summary::before{content:'›';color:#ecc486;font:16px Georgia,serif}
#page .work-entry[open]>summary::before{content:'⌄'}
#page .entry-title{font-size:12px;font-weight:650;min-width:0;overflow-wrap:anywhere;flex:1}
#page .entry-meta{flex:0 1 auto;font-size:10px;color:#afc4d2;text-align:right}
#page .entry-details{padding:8px 10px 10px;background:#1b2833;font-size:11px;line-height:1.6;border-top:1px solid #52616e}
#page .entry-details .field{margin-bottom:6px}
#page .entry-details .field .input{width:100%}
#page .entry-details .entry-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#page .entry-details p{margin:7px 0 0;white-space:pre-wrap}
#page .work-entry.archived{opacity:.67}
#page .spell-entry{display:flex;align-items:stretch;gap:4px;min-width:0}
#page .spell-entry .work-entry{flex:1;min-width:0}
#page .prepared-control{flex:0 0 41px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;background:#25343e;border:1px solid #536470;border-radius:5px;font-size:9px;color:#d7c299}
#page .prepared-control input{accent-color:#d5a35f;width:15px;height:15px}

/* v0.9.2: fixed desktop HUD, independently scrolling content lanes.
   Keep one document tree and one workspace; scrolling does not affect dice. */
@media (min-width:1311px) and (min-height:630px) {
  #page {display:flex;flex-direction:column;overflow:hidden;padding-bottom:11px}
  #page > .identity-ribbon,#page > .vitals-panel {flex:0 0 auto}
  #page .hud-four {flex:1 1 auto;min-height:0;align-items:stretch;overflow:hidden}
  #page .hud-zone {min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#7d858c #1e2832;padding-right:3px;align-self:stretch}
  #page .hud-main {overflow:hidden;padding-right:0}
  #page .game-workspace {height:100%;min-height:0;display:flex;flex-direction:column}
  #page .workspace-caption,#page .workspace-tabs {flex:0 0 auto}
  #page .workspace-content {flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#8b7961 #1b2630}
}
#page .ability-action-list{display:flex;flex-direction:column;gap:5px;margin-top:8px}
#page .action-entry>summary {min-height:34px}
#page .action-description {white-space:pre-wrap;line-height:1.55;overflow-wrap:anywhere}
#page .action-buttons{margin:7px 0}
#page .action-editor {margin-top:9px;padding-top:9px;border-top:1px solid #576371}
#page .action-editor>.field{margin-top:7px}
#page .spell-summary {color:#b6cbd5;font-size:11px;margin:0 0 8px}
#page .prepared-control:has(input:disabled){background:#253b36;border-color:#64877a;color:#b6e3ca}
#page .prepared-control input:disabled {opacity:1}
#page .spell-entry[hidden]{display:none}
#page .workspace-entries {scrollbar-width:thin}
@media(max-width:1310px){
  #page .workspace-content {overflow:visible}
}

/* Import-first public alpha and neutral character identity */
.welcome-vault{max-width:780px;margin:clamp(30px,10vh,125px) auto;text-align:center;padding:40px 36px;border:1px solid #705532;border-radius:18px;background:linear-gradient(145deg,#1a2531f4,#10151ef0);box-shadow:0 25px 80px #000a;color:#e9e2d6}
.welcome-vault h1{font-size:clamp(30px,4vw,53px);font-family:Georgia,serif;line-height:1.12;margin:15px 0;color:#ffdc9a}
.welcome-vault p{font-size:16px;line-height:1.65;color:#cdd2d9}
.welcome-crest{font-size:66px;color:#e3ac61}.alpha-pill{display:inline-block;padding:7px 14px;border:1px solid #976435;color:#e8b877;border-radius:99px;letter-spacing:2px;font-size:11px;font-weight:700}
.welcome-steps{display:flex;gap:12px;align-items:center;justify-content:center;flex-wrap:wrap;margin:29px 0}
.welcome-button{cursor:pointer;display:inline-flex;padding:14px 25px;border-radius:8px;background:#d7a45d;color:#16191f;font-weight:800;font-size:15px}
.welcome-button:hover{background:#f1c587}.welcome-vault .welcome-note{font-size:12px;color:#aab5c1}.welcome-vault details{text-align:left;margin:22px auto 0;max-width:560px}
.avatar-glyph{display:grid;place-items:center;font-size:36px;color:#edbf78;border:1px solid #b88443;background:#1c2530;flex-shrink:0}
@media(max-width:720px){.welcome-vault{padding:25px 15px;margin:25px 10px}.welcome-vault p{font-size:14px}}

/* Character vault — separate modal, not a competing sheet or rules UI. */
#vault-layer:not([hidden]){position:fixed;z-index:95;inset:0}
.vault-shade{height:100%;width:100%;padding:20px;display:grid;place-items:center;background:#050608d9;backdrop-filter:blur(7px)}
.vault-dialog{display:flex;flex-direction:column;gap:14px;width:min(870px,100%);max-height:min(740px,92dvh);min-height:0;overflow:hidden;padding:22px;border:1px solid #997344;border-radius:12px;background:linear-gradient(145deg,#253440,#141c27);box-shadow:0 30px 100px #000d,inset 0 0 0 2px #e8b76c0e}
.vault-header{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;border-bottom:1px solid #6d5b43;padding-bottom:13px}
.vault-header small{font:700 10px system-ui;color:#d8aa6c;letter-spacing:.15em}
.vault-header h2{font:normal 30px/1.2 Georgia,serif;color:#ffdfaa;margin:5px 0}
.vault-header p,.vault-footnote{font-size:12px;color:#bac6d3;margin:0;line-height:1.5}
.vault-toolbar{display:flex;gap:8px;flex-wrap:wrap}
.vault-characters{min-height:0;overflow-y:auto;display:grid;align-content:start;gap:9px;scrollbar-color:#96764b #17202a}
.vault-card{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #52616e;border-radius:7px;padding:13px 14px;background:#1c2832}
.vault-card.selected{border-color:#bc925a;background:#26343e}
.vault-info{display:flex;flex-direction:column;gap:2px;min-width:0}
.vault-info strong{font:20px Georgia,serif;color:#f8dfb6;overflow-wrap:anywhere}
.vault-info span{font-size:12px;color:#e0e6e9}.vault-info small{font-size:11px;color:#a2b6c0}
.vault-card-actions{display:flex;gap:6px;flex-wrap:wrap;flex-shrink:0}
.vault-footnote{border-top:1px solid #485665;padding-top:10px}
@media(max-width:650px){.vault-shade{padding:8px}.vault-dialog{padding:15px;max-height:96dvh}.vault-header h2{font-size:25px}.vault-card{align-items:stretch;flex-direction:column}.vault-card-actions{width:100%}.vault-card-actions .button{flex:1}.vault-toolbar>.button{flex:1}}

/* Compact context for validated ability usage and optional healing. */
#page .action-cost{color:#e9b96f;font-size:11px;align-self:center;}
.roll-effect{display:flex;align-items:center;flex-wrap:wrap;gap:8px;font-size:12px;color:#ecdcbb;padding:4px 0;}
.roll-effect:empty{display:none;}

/* v0.13: use existing panel and controls, no second HUD system. */
.effect-tracker {display:grid;gap:4px}
.effect-row {display:flex;align-items:center;gap:7px;padding:6px 4px;border-bottom:1px solid #59626c60}
.effect-row:last-child {border-bottom:0}
.effect-label {flex:1;min-width:0;overflow-wrap:anywhere;color:#f2d7a0;font-size:12px}
.effect-row small {color:#c2cbd1;white-space:nowrap;font-size:11px}
.spell-cast-controls {display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px}
.spell-cast-controls label {font-size:11px;color:#d9bc92}
.spell-cast-controls .input {min-width:96px;max-width:160px;margin-left:4px}
.spell-execution-editor {margin-top:10px;padding:8px;border:1px solid #6c644f;border-radius:6px;background:#1a242b}
.spell-execution-editor .field input[type=checkbox] {margin-right:6px}

/* v0.14: compact action-economy controls within the existing Actions workspace. */
#page .combat-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
#page .turn-tracker{display:flex;align-items:center;gap:5px;flex-wrap:wrap;min-width:0;margin-right:8px}
#page .turn-tracker>strong{font-size:11px;color:#f3d6a6;margin-right:3px}
#page .turn-chip{padding:4px 7px;min-height:25px;font-size:11px;color:#c8e4cb;background:#263f36;border:1px solid #577963;border-radius:5px;cursor:pointer}
#page .turn-chip.spent{color:#d0b0a7;background:#442b32;border-color:#8b6060}
#page .turn-chip:focus-visible{outline:2px solid #efd19e;outline-offset:2px}
#page .combat-notice{font-size:11px;color:#aebdc9}

/* v0.15: Dice are a single captured interaction surface, even above form controls.
   Keep text inputs editable, but never select the character sheet while throwing. */
.dice-stage{user-select:none;-webkit-user-select:none}
.dice-stage input,.dice-stage textarea,.dice-stage [contenteditable]{user-select:text;-webkit-user-select:text}
body.dice-dragging .dice-stage{cursor:grabbing}

.dice-stage.die-hover{cursor:grab}
.dice-stage.dice-following{cursor:grab!important}
.dice-stage.dice-following *{touch-action:none}
.dice-stage.dice-following :is(button,input,select,textarea,summary,label,a[href],[role="button"],[role="tab"]),
.dice-stage.dice-following :is(button,input,select,textarea,summary,label,a[href],[role="button"],[role="tab"]) *{cursor:pointer!important}

/* SRD reference material stays in a read-only, visually separate pane. */
.reference-pill{display:inline-flex;align-items:center;gap:3px;margin:7px 0;padding:4px 9px;border-radius:20px;background:#243b45;color:#d0e5ee;border:1px solid #658697;cursor:pointer;font-size:11px;font-weight:700}
.reference-pill:hover,.reference-item:hover{border-color:var(--gold);background:#354957}
.reference-disclaimer{font-size:11px;color:#c3c8ca;line-height:1.5;margin:4px 0 10px}
.reference-count{font-size:11px;color:#c9b99a;padding:6px 1px 10px}
.reference-list{display:flex;flex-direction:column;gap:4px;overflow-y:auto;min-height:0}
.reference-item{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 9px;text-align:left;background:#252f38;border:1px solid #495760;border-radius:5px;color:#ece7df;cursor:pointer}
.reference-item small{color:#b4c5cc;white-space:nowrap;font-size:10px}
.reference-item[hidden]{display:none}
.text-link{border:0;background:none;padding:0;color:#e9bc79;text-decoration:underline;cursor:pointer;font:inherit}
#reference-layer:not([hidden]){position:fixed;z-index:110;inset:0;background:#030609d9;display:flex;align-items:center;justify-content:center;padding:18px}
.reference-dialog{width:min(680px,100%);max-height:min(90vh,850px);overflow:auto;background:linear-gradient(155deg,#273440,#1b222b);color:#ece8e3;border:1px solid #a07c54;box-shadow:0 24px 90px #000c;border-radius:11px;padding:20px 24px}
.reference-dialog h2{margin:2px 0 5px;font:25px/1.2 Georgia,serif;color:#ffe2b3}
.reference-dialog h3{font:17px Georgia,serif;color:#e6c090;margin:16px 0 5px}
.reference-dialog p{font-size:13px;line-height:1.55}
.reference-dialog a{color:#b6e3f7}
.reference-dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}
.reference-dialog-heading small{color:#d9b67f;font-size:10px;letter-spacing:.12em}
.reference-details{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:7px;margin:18px 0}
.reference-details>div{background:#1a262f;border:1px solid #43525e;border-radius:5px;padding:8px}
.reference-details dt{font-size:10px;text-transform:uppercase;letter-spacing:.07em;color:#aebec8}
.reference-details dd{margin:2px 0 0;font-size:13px;color:#fff0cf}
.reference-description{padding:12px;border-left:3px solid #bd9762;background:#202c35}
.attribution-text{background:#16232c;padding:12px;border-radius:5px;border:1px solid #57646e;white-space:pre-wrap}
@media(max-width:650px){.reference-item{align-items:flex-start;flex-direction:column;gap:3px}.reference-dialog{padding:16px}.top-actions #about-open{font-size:10px}}

/* v0.17 catalog: one responsive, filtered reference workspace; no new layout system. */
.reference-search-tools{display:flex;align-items:center;gap:7px;flex:1;min-width:180px}
.reference-search-tools .search{flex:1;min-width:100px;max-width:none}
.reference-level{min-width:125px;max-width:150px;font-size:12px}
.reference-browser{min-height:0;display:flex;flex-direction:column}
.reference-browser .reference-list{flex:1;min-height:60px}
@media(max-width:750px){.reference-search-tools{width:100%;flex-wrap:wrap}.reference-level{max-width:100%;flex:1}}

/* v0.18: reference comparisons are non-editable; actionable choices stay explicit. */
.reference-compare,.reference-draft{margin:12px 0;padding:10px;background:#17232dc9;border:1px solid #556777;border-radius:7px}
.reference-compare table{width:100%;border-collapse:collapse;font-size:12px;margin:10px 0}
.reference-compare th,.reference-compare td{border-bottom:1px solid #42515c;text-align:left;padding:7px;vertical-align:top}
.reference-compare thead th{color:#ead0a3}
.reference-compare tbody th{color:#c4d2db;font-weight:500}
.reference-compare .compare-review td:nth-child(2){color:#f6c58e}
.reference-compare .compare-match td:nth-child(2){color:#a5d7bb}
.reference-draft .button{margin-top:3px}
@media(max-width:520px){.reference-compare table{font-size:11px}.reference-compare th,.reference-compare td{padding:4px}}
/* Confirmation must be above reference details when creating a draft. */
#dialog-layer:not([hidden]){z-index:120}
/* D&D effect HUD: derived state, compact tokens, no duplicated character model. */
#page .buff-bar{display:flex;gap:6px;align-items:center;min-height:37px;padding:6px 9px;flex-wrap:wrap;
 background:linear-gradient(90deg,#1b2731f2,#2b2d32e9);border:1px solid #6a5840;border-radius:7px;margin:6px 0 8px}
#page .buff-caption{font-size:10px;letter-spacing:.14em;color:#e7c08c;font-weight:750;margin-right:4px}
#page .buff-separator{width:1px;height:24px;margin:0 6px;flex:0 0 1px;background:#786b53}
#page .buff-token{display:inline-flex;align-items:center;gap:5px;padding:4px 6px;border:1px solid #8b7659;border-radius:5px;background:#263948;
 font-size:11px;line-height:1.2;min-height:28px;max-width:100%}
#page .buff-token strong{color:#e6dbc6;font-weight:650;white-space:nowrap}
#page .buff-token>span{color:#f6d49a;font-weight:650}
#page .buff-token small{font-size:10px;color:#aecdde;white-space:nowrap}
#page .buff-check{border-color:#c4944e;background:#403521}
#page .buff-token .button{min-height:23px;padding:2px 5px}
#page .srd-preset{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:7px 9px;border:1px solid #847354;border-radius:5px;
 background:#3d372b66;color:#eed9b7;font-size:11px}
#page .srd-preset .button{min-height:25px;padding:3px 6px}
@media(max-width:720px){#page .buff-bar{padding:6px;gap:4px}#page .buff-token{flex-wrap:wrap}#page .buff-token strong{white-space:normal}}
#page .buff-empty{color:#acb8c1;font-size:11px;line-height:1.3}
#page .status-info{border:0;background:transparent;color:#b8cfda;cursor:pointer;font-size:14px;padding:0 3px;min-width:19px;min-height:22px;border-radius:4px}
#page .status-info:hover,#page .status-info:focus-visible{color:#ffdfa9;background:#49535d}

/* Encounter is its own tabbed workspace, projected from existing character combat state. */
#page .encounter-workspace{display:grid;gap:8px;min-width:0}
#page .encounter-context{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:7px;margin:0 0 8px;padding:8px 10px;background:#24303a;border:1px solid #526371;border-radius:6px;font-size:12px;color:#d7d1c4}
#page .encounter-context>span{min-width:0;overflow-wrap:anywhere}
#page .target-quick{margin:0 0 6px;align-items:center}
#page .encounter-targets{border:1px solid #526371;border-radius:7px;background:#202c36e8;margin:0 0 9px;overflow:visible}
#page .encounter-targets>summary{padding:9px 11px;cursor:pointer;color:#ebca99;font:600 12px Georgia,serif;list-style-position:inside}
#page .encounter-targets>summary small{margin-left:8px;font:400 10px system-ui,sans-serif;color:#a9bbca}
#page .encounter-targets[open]>summary{border-bottom:1px solid #526371}
#page .target-toolbar{display:flex;flex-wrap:wrap;align-items:end;gap:7px;padding:7px 10px}
#page .target-toolbar>label{display:flex;flex-direction:column;gap:3px;color:#cfb58e;font-size:10px;min-width:68px;max-width:100%}
#page .target-label{min-width:min(190px,100%)}
#page .target-toolbar select,#page .target-toolbar input{font-size:12px;max-width:180px;min-height:29px}
#page .target-summary{padding:3px 10px 6px;color:#f1d2a1;font-weight:600;font-size:12px}
#page .target-traits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:5px 10px}
#page .target-traits label{font-size:10px;color:#becdd2;text-transform:capitalize}
#page .target-traits input{font-size:11px;margin-top:3px}
#page .target-saves{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;padding:7px 10px}
#page .target-saves label{display:flex;gap:4px;flex-wrap:wrap;align-items:center;justify-content:center;background:#1a2630;border:1px solid #4b5b67;border-radius:4px;padding:5px;color:#cfd7df;font-size:10px}
#page .target-saves input{min-width:0;width:100%;text-align:center;padding:3px}
#page .target-add-form{display:flex;flex-wrap:wrap;align-items:center;gap:6px;border-top:1px solid #405260;padding:10px}
#page .target-add-form strong{font-size:11px;color:#f0d1a0;margin-right:5px}
#page .target-add-form input[name=name]{flex:1;min-width:120px}
#page .target-add-form input[type=number]{width:74px}
#page .target-add-form .button{white-space:nowrap}
#page .target-note{padding:0 10px 7px;font-size:10px;color:#b2c2ca;line-height:1.5;margin:0}
#roll-effect .pending-resolution{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:7px 0;border-top:1px solid #6b5b47;font-size:11px}
#roll-effect .pending-resolution label{display:flex;align-items:center;gap:4px}
#roll-effect .pending-resolution select{max-width:205px;padding:4px;font-size:11px}
#roll-effect .save-result-note{margin:4px 0;font-size:11px;color:#d5bb9a}
@media(max-width:720px){#page .target-traits{grid-template-columns:1fr}#page .target-saves{grid-template-columns:repeat(3,minmax(0,1fr))}#page .target-toolbar>label{flex:1;min-width:85px}}

/* Compact 2014 d20 mode selector in the existing dice widget. */
.dice-roll-options{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px}
.dice-roll-options .input{min-width:0;flex:1;max-width:190px;padding:5px 7px}
.target-conditions{display:flex;flex-wrap:wrap;gap:4px;padding:5px 0}
.target-conditions button{font-size:11px;min-height:26px;border:1px solid #59616b;background:#1d2730;color:#ded4c3;border-radius:4px;padding:3px 6px}
.target-conditions button[aria-pressed="true"]{border-color:#daa25b;background:#55422d;color:#ffdfaa}

/* Per-effect automatic charge opt-in, part of the existing buff token. */
#page .effect-auto-toggle{display:inline-flex;align-items:center;gap:4px;cursor:pointer;border-radius:4px;padding:2px 3px;color:#ffe0a6;font:600 11px system-ui,sans-serif;white-space:nowrap}
#page .effect-auto-toggle input{accent-color:#e6b670;cursor:pointer;margin:0;width:14px;height:14px}
#page .effect-auto-toggle:focus-within{outline:2px solid #e6b670;outline-offset:2px}

/* v0.24: per-character rules selection, not a separate rules database. */
#page .ruleset-control{display:flex;flex:0 0 auto;align-items:center;gap:5px;color:#d5c09e;font-size:11px;white-space:nowrap}
#page .ruleset-control select{width:auto;min-width:108px;max-width:160px;padding:5px 6px;font-size:11px;background:#202d37}

/* Practice instructions are derived from the active demo's real combat state. */
.demo-callout{display:flex;align-items:center;justify-content:space-between;gap:.85rem;flex-wrap:wrap;padding:.8rem 1rem;margin:.6rem 0;border:1px solid #91744f;border-radius:.6rem;background:rgba(198,155,83,.10);font-size:.86rem;line-height:1.55}
.demo-practice-copy{display:flex;flex-direction:column;gap:.18rem;flex:1;min-width:240px}
.demo-practice-copy strong{color:#f1d4a2}
.demo-practice-copy small{font-size:.75rem;color:var(--muted)}
.demo-practice-action{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.creature-turn-board{border-top:1px solid #6d6557;margin-top:.65rem;padding-top:.5rem}
.creature-turn-board summary{cursor:pointer;font-weight:700}
.creature-turn-board summary small{font-weight:400;color:var(--muted);margin-left:.5rem}
.creature-turn-list{display:grid;gap:.4rem;margin-top:.65rem}
.creature-turn-row{display:flex;gap:.65rem;align-items:center;flex-wrap:wrap;padding:.45rem .5rem;border:1px solid #565754;border-radius:.4rem;background:#222b30}
.creature-turn-identity{min-width:125px;display:flex;flex-direction:column}
.creature-turn-row small{font-size:.76rem;color:var(--muted)}
.creature-turn-due{flex:1;min-width:200px;display:flex;flex-direction:column;gap:.18rem}
.creature-turn-controls{display:flex;gap:.4rem}
@media(max-width:720px){.demo-practice-copy,.creature-turn-due{min-width:100%}}

/* Manual character creation: ephemeral steps, normal character/vault contract. */
.creator-dialog{width:min(780px,100%)}
#creator-form{display:flex;min-height:0;flex-direction:column;gap:11px}
.creator-step{min-height:0;overflow:auto;padding:2px 4px 10px;scrollbar-color:#96764b #17202a}
.creator-step[hidden]{display:none}
.creator-step h3{font:normal 24px Georgia,serif;color:#f3d7a6;margin:3px 0 7px}
.creator-step p{font-size:12px;line-height:1.55;color:#bccbd4;margin:4px 0 16px}
.creator-progress{display:flex;gap:8px;flex-wrap:wrap}
.creator-progress span{border:1px solid #5b6671;border-radius:20px;padding:6px 11px;font-size:11px;color:#b5c5d0}
.creator-progress span.current{border-color:#d7a45d;background:#62472a;color:#fff0d6}
.creator-fields,.creator-scores{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.creator-fields label,.creator-scores label{display:flex;flex-direction:column;gap:5px;font-size:12px;color:#ebd4aa;min-width:0}
.creator-fields .input,.creator-scores .input{width:100%;min-height:37px;min-width:0}
.creator-scores{grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:15px}
.creator-proficiencies{border:1px solid #63707b;border-radius:7px;margin:10px 0;padding:10px}
.creator-proficiencies legend,.creator-proficiencies summary{font-weight:650;color:#edd5ad;font-size:12px}
.creator-proficiencies summary{cursor:pointer}
.creator-proficiencies .creator-fields{margin-top:8px}
.creator-checks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:7px}
.creator-checks label{display:flex;align-items:center;gap:7px;color:#dbe1e5;font-size:12px}
.creator-checks input{accent-color:#d7a45d}
.creator-footer{padding-top:12px;border-top:1px solid #55616d;display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.creator-footer-actions{display:flex;gap:8px}
.creator-error{color:#ffb8a1;font-size:12px;line-height:1.45;margin:0}
.creator-error[hidden]{display:none}
.creator-caution{border-left:3px solid #d7a45d;padding:9px;background:#d7a45d12}
@media(max-width:620px){.creator-fields,.creator-scores{grid-template-columns:repeat(2,minmax(0,1fr))}.creator-checks{grid-template-columns:repeat(2,minmax(0,1fr))}.creator-footer{align-items:stretch}.creator-footer-actions{justify-content:flex-end}.creator-dialog{max-height:97dvh}}
@media(max-width:380px){.creator-fields,.creator-scores{grid-template-columns:minmax(0,1fr)}}

/* Manual character follow-up: derived from existing sheet fields, not saved tutorial progress. */
#page .character-setup{margin:10px 0 13px;padding:12px 14px;border:1px solid #957b55;background:#22303bdb;border-radius:9px;color:#e8edf0}
#page .character-setup-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}
#page .character-setup-heading strong{font:18px Georgia,serif;color:#f3d29a}
#page .character-setup-heading span{font-size:11px;color:#cfd5d7}
#page .character-setup>p{font-size:12px;line-height:1.5;color:#c5d0d5;margin:7px 0 9px}
#page .character-setup-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
#page .character-setup-row{display:flex;align-items:center;gap:8px;padding:9px;border:1px solid #536472;background:#26343ecc;border-radius:6px;min-width:0}
#page .character-setup-row>div{flex:1;min-width:0}
#page .character-setup-row strong{display:block;color:#ffdfae;font-size:12px}
#page .character-setup-row small{display:block;color:#c4ced3;font-size:11px;line-height:1.35}
#page .character-setup-status{font-size:19px;color:#e0bc7e;flex-shrink:0}
#page .character-setup-caveat{display:block;margin-top:10px;font-size:11px;color:#bfc9cc}
#page .setup-attack-fields{display:flex;flex-wrap:wrap;gap:5px;padding:5px 0}
#page .setup-attack-fields .field{flex:1 1 90px}
#page .setup-feature-editor{padding:9px;display:grid;gap:8px}
@media(max-width:640px){#page .character-setup-list{grid-template-columns:1fr}#page .character-setup-row{flex-wrap:wrap}}

/* Combat target is always visible in the action workspace; the selected
   creature is never inferred from the self/saving-throw selector. */
#page .target-quick{padding:0;margin:0 0 7px}
#page .combat-target-bar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;width:100%;padding:8px 10px;border:1px solid #79765d;border-radius:7px;background:#202c36f7;box-shadow:0 3px 12px #0005}
#page .combat-target-bar.needs-target{border-color:#bb765d;background:#352a2aef}
#page .combat-target-bar .target-label{display:flex;flex:1 1 210px;flex-direction:column;gap:4px;font-size:11px;font-weight:650;color:#edd1a1;min-width:0}
#page .combat-target-bar #combat-target{width:100%;max-width:none}
#page .combat-target-status{flex:1 1 240px;font-size:11px;color:#c7d9d5;line-height:1.45}
#page .combat-target-bar.needs-target .combat-target-status{color:#ffccae}
#page .combat-target-bar .button{white-space:nowrap}
#page .target-auto-damage{margin:5px 10px 10px;padding:8px;border:1px solid #637464;border-radius:6px;background:#25332f}
#page .target-auto-damage label{display:flex;gap:8px;align-items:center;font-size:12px;color:#e1eadc;font-weight:650}
#page .target-auto-damage input{accent-color:#e2b675;width:16px;height:16px;flex:0 0 16px}
#page .target-auto-damage small{display:block;margin:5px 0 0 24px;font-size:10px;line-height:1.55;color:#b8cfbf}
@media(max-width:700px){
 #page .combat-target-bar{gap:6px;padding:7px}
 #page .combat-target-bar .target-label,#page .combat-target-status{flex-basis:100%}
 #page .combat-target-bar .button{width:100%}
}

/* Player-first controls: ordinary sheet rolls do not require encounter setup. */
#page > .panel[data-panel="Conditions"]{width:100%;margin:0 0 7px;flex:0 0 auto}
#page > .panel[data-panel="Conditions"] .panel-content{padding:5px 10px}
#page .recipient-context{display:flex;align-items:center;flex-wrap:wrap;gap:7px;padding:8px 9px;border:1px solid #536371;border-radius:6px;background:#1e2b37}
#page .recipient-context strong{font-size:12px;margin-right:4px}
#page .recipient-context small{font-size:11px;line-height:1.35;flex:1 1 220px;opacity:.85}
#page .advanced-encounter{border:1px solid #4f5b65;border-radius:6px;padding:8px;margin-top:8px}
#page .advanced-encounter>summary{cursor:pointer;color:#d8c5a6;font-weight:600}
#page .advanced-encounter[open]>*:not(summary){margin-top:8px}
#page .advanced-encounter .attack-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
#page .advanced-encounter .attack-row small{opacity:.75}

/* v0.65: one horizontal character HUD; the existing gameplay/roll/resource
   contracts remain authoritative. The strip is presentation-only. */
#page .sheet-layout{display:flex;flex-direction:column;gap:7px;min-width:0}
#page .sheet-strip{display:flex;align-items:center;gap:10px;padding:7px 10px;border:1px solid #5c6a75;border-radius:7px;background:#202c36ed;min-width:0}
#page .strip-label{flex:0 0 auto;color:#e9bd7b;font:700 11px system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase}
#page .ability-cards{flex:1;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;min-width:0}
#page .abilities-strip .ability-card{min-width:0;padding:6px;background:#303d46;border:1px solid #61707a;border-radius:5px}
#page .ability-compact-top{display:flex;align-items:center;gap:6px;min-width:0;margin-bottom:5px}
#page .ability-abbr{font-size:12px;color:#f1c68b}
#page .abilities-strip .ability-readout{font:21px/1 Georgia,serif;color:#ffdf9d}
#page .abilities-strip .ability-mod{display:flex;align-items:center;gap:3px;margin-left:auto;font:700 9px system-ui,sans-serif;color:#b4c4d0;white-space:nowrap}
#page .abilities-strip .mod-readout{min-width:0;font:700 13px system-ui,sans-serif;color:#a9dbf5}
#page .abilities-strip .ability-number{width:47px;padding:3px}
#page .abilities-strip .ability-mod .input{width:47px;padding:3px}
#page .ability-roll-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px}
#page .ability-roll-pair button{min-height:28px;padding:3px 4px;font:600 11px system-ui,sans-serif;border:1px solid #697580;border-radius:4px;background:#25333e;color:#e7ebef;cursor:pointer;white-space:nowrap}
#page .ability-roll-pair button:hover:not(:disabled){border-color:#e2b77a;background:#46515d}
#page .ability-roll-pair .ability-save{color:#e7c48b}
#page .ability-roll-pair button:disabled{opacity:.55;cursor:not-allowed}
#page .ability-save strong{color:#a9dbf5}
#page .skills-strip{align-items:flex-start}
#page .skills-strip>.strip-label{padding-top:5px}
#page .skill-chips{display:flex;flex:1;align-items:center;flex-wrap:wrap;gap:4px;min-width:0}
#page .skill-chip-entry{min-width:0;display:flex;align-items:center;gap:3px}
#page .skill-chip{min-height:26px;display:inline-flex;align-items:center;gap:7px;padding:4px 7px;border:1px solid #566978;border-radius:5px;background:#293945;color:#e6e9ec;white-space:nowrap;font:11px system-ui,sans-serif}
#page .skill-chip strong{font-size:11px;color:#addcf5}
#page .skill-chip:hover,#page .skill-chip:focus-visible{border-color:#e0b479;background:#42515d}
#page .skills-strip .skill-search{width:125px;min-width:80px;max-width:170px;padding:4px;font-size:11px}
#page .sheet-layout[data-edit-bonuses] .bonus-editor{display:inline-block}
#page .skills-strip .bonus-editor{width:53px;max-width:53px}
#page .skills-strip .edit-bonus{order:initial;min-height:26px}
#page .resources-strip{display:block;position:relative;z-index:15}
#page .resource-strip-row{display:flex;align-items:center;gap:10px}
#page .resource-chips{display:flex;align-items:center;gap:5px;flex-wrap:wrap;min-width:0}
#page .resource-chip-wrap{position:relative;flex:0 0 auto}
#page .resource-chip{display:flex;align-items:center;gap:6px;min-height:28px;padding:4px 8px;background:#293945;border:1px solid #667380;border-radius:5px;color:#e8e5df;font:11px system-ui,sans-serif}
#page .resource-chip:hover,#page .resource-chip:focus-visible,#page .resource-chip[aria-pressed="true"]{border-color:#e2b77a;background:#4a4540}
#page .resource-glyph{font-size:14px;color:#e5b66b}
#page .resource-chip strong{color:#ffe0aa;font-variant-numeric:tabular-nums}
#page .resource-chip strong span{color:#b8c4cc;font-weight:500}
#page .resource-preview{position:absolute;top:100%;left:0;z-index:30;padding-top:4px;visibility:hidden;opacity:0;pointer-events:none;transition:opacity .1s}
#page .resource-chip-wrap:hover .resource-preview,#page .resource-chip-wrap:focus-within .resource-preview{visibility:visible;opacity:1;pointer-events:auto}
#page .resource-preview .resource-pips{box-sizing:border-box;width:max-content;min-width:265px;max-width:min(340px,90vw);padding:9px 11px;border:1px solid #af8956;border-radius:7px;background:#192630;box-shadow:0 12px 30px #000d}
#page .resource-pinned-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:7px;margin-top:7px}
#page .resource-pinned-card{position:relative;min-width:0;padding:8px 30px 8px 10px;border:1px solid #a0825b;border-radius:6px;background:#253540}
#page .resource-pinned-card .resource-pips{border:0;padding:0}
#page .resource-close{position:absolute;top:4px;right:5px;border:1px solid #687581;border-radius:4px;background:#2c3944;color:#e5d0b7;width:22px;height:22px}
#page .resource-empty{font-size:11px;color:#aebec9}
/* Same ten-wide physical pip grid in hover and pinned panels. The name and
   count stay vertically centered beside every row, including 15/19. */
#page .resources-strip .resource-pips{display:grid;grid-template-columns:minmax(75px,auto) minmax(0,1fr);align-items:center;gap:10px}
#page .resources-strip .resource-info{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;min-width:0;margin:0}
#page .resources-strip .resource-count{margin:0;font-size:13px}
#page .resources-strip .resource-info small{min-width:0;text-align:left}
#page .resources-strip .pip-track{display:flex;flex-direction:column;gap:3px;max-width:100%;align-items:flex-start}
#page .resources-strip .pip-row{display:grid;grid-template-columns:repeat(10,14px);gap:4px;min-height:14px}
/* Avoid endlessly horizontal HP meters; a normal 30-heart character gets
   three visible rows when only ten hearts fit across the available width. */
#page .hearts{flex-wrap:wrap;align-content:flex-start;overflow-x:hidden;overflow-y:auto;max-height:132px;scrollbar-width:thin}
.status-msg{position:absolute;top:0;left:0;right:auto;bottom:auto;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
/* One d20 selector remains available when the dice panel is collapsed. */
.dice-dock{position:absolute;right:12px;bottom:12px;z-index:9;display:flex;align-items:flex-end;gap:7px;max-width:calc(100% - 20px);pointer-events:none}
.dice-dock>*{pointer-events:auto}
.dice-dock .desk-controls{position:relative;right:auto;bottom:auto;z-index:auto;flex:0 1 auto}
.d20-modes{display:flex;align-items:center;gap:3px;flex:0 0 auto}
.d20-modes button{border:1px solid #746b62;border-radius:5px;background:#242e38;color:#d9e3e9;padding:6px 8px;min-height:33px;font:600 11px system-ui,sans-serif}
.d20-modes button[aria-pressed="true"]{background:#a87a42;border-color:#edc28c;color:#161d24}
.d20-modes button:hover{border-color:#d8ae77}
@media(max-width:1170px){
 #page .ability-cards{grid-template-columns:repeat(3,minmax(0,1fr))}
 #page .abilities-strip{align-items:flex-start}
 #page .abilities-strip>.strip-label{padding-top:8px}
}
@media(max-width:670px){
 #page .ability-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
 #page .sheet-strip{gap:6px;padding:6px}
 #page .abilities-strip{display:block}
 #page .abilities-strip>.strip-label{display:block;padding:0 0 6px}
 #page .skills-strip{display:block}
 #page .skills-strip>.strip-label{display:inline-block;padding:0;margin-right:6px;margin-bottom:5px}
 #page .resource-strip-row{align-items:flex-start;flex-wrap:wrap;gap:5px}
 #page .resource-strip-row>.strip-label{padding-top:6px}
 .dice-dock{right:7px;bottom:9px;flex-direction:column;align-items:flex-end;gap:4px}
 .d20-modes button{min-height:28px;padding:3px 6px;font-size:10px}
}
/* The old four-column grid has no layout responsibility after v0.65. */
