/* Colours come from Theme.js as CSS variables. Sizes are px; the UI size
   setting scales everything uniformly through the window zoom factor. */









.rp .muted:not(.cx *) { color: var(--muted); }
.rp .small:not(.cx *) { font-size: var(--fs-xs); }
.rp .mono:not(.cx *) { font-family: Consolas, 'Cascadia Mono', monospace; }
.rp .spacer:not(.cx *) { flex: 1; }

/* ---------- title bar ---------- */



.rp .drag-space:not(.cx *) { flex: 1; align-self: stretch; }
.rp .status-pill:not(.cx *) {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 2px;
  padding: 2px 10px; font-size: var(--fs-xs); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw;
}
.rp .status-pill > span:last-child:not(.cx *) { overflow: hidden; text-overflow: ellipsis; }
.rp .dot:not(.cx *) { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.rp .dot.on:not(.cx *), .rp .dot.online:not(.cx *) { background: #3ecf7a; box-shadow: 0 0 6px #3ecf7a88; }
.rp .dot.offline:not(.cx *) { background: #e6b84a; }
.rp .dot.denied:not(.cx *) { background: #e5484d; }
.rp .tb-btn:not(.cx *) {
  border: 0; background: transparent; padding: 5px 9px; border-radius: 2px; color: var(--muted); white-space: nowrap;
}
.rp .tb-btn:hover:not(.cx *) { background: var(--panel-2); color: var(--text); }
.rp .tb-btn.icon:not(.cx *) { font-size: var(--fs-base); padding: 3px 8px; }
.rp .tb-btn.on:not(.cx *) { color: var(--accent-line); background: var(--accent-soft); }





.rp .menu-anchor:not(.cx *) { position: relative; }
.rp .menu:not(.cx *) {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; min-width: 220px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px;
}
.rp .menu hr:not(.cx *) { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.rp .menu-label:not(.cx *) { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 2px 8px; }
.rp .menu-item:not(.cx *) { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 2px; }
.rp .menu-item:hover:not(.cx *), .rp .menu .chk:hover:not(.cx *) { background: var(--panel-2); }
.rp .menu .chk:not(.cx *) { padding: 5px 8px; border-radius: 2px; }

/* ---------- workspace + docking ---------- */
.rp .rp-work { flex: 1; min-height: 0; position: relative; display: flex; padding: 6px; }
.rp .rp-work > .split, .rp .rp-work > .dock, .rp .rp-work > .pane { flex: 1; min-width: 0; min-height: 0; }
.rp .split:not(.cx *) { display: flex; min-width: 0; min-height: 0; width: 100%; height: 100%; }
.rp .split.horiz:not(.cx *) { flex-direction: row; }
.rp .split.vert:not(.cx *) { flex-direction: column; }
.rp .pane:not(.cx *) { display: flex; min-width: 0; min-height: 0; overflow: hidden; }
.rp .pane > *:not(.cx *) { flex: 1; min-width: 0; min-height: 0; }
.rp .gutter:not(.cx *) { flex: none; position: relative; }
.rp .gutter.horiz:not(.cx *) { width: 6px; cursor: col-resize; }
.rp .gutter.vert:not(.cx *) { height: 6px; cursor: row-resize; }
.rp .gutter:not(.cx *)::after { content: ''; position: absolute; border-radius: 2px; background: transparent; transition: background .15s; }
.rp .gutter.horiz:not(.cx *)::after { inset: 20% 2px; }
.rp .gutter.vert:not(.cx *)::after { inset: 2px 20%; }
.rp .gutter:hover:not(.cx *)::after { background: var(--accent); }
body.resizing-x, body.resizing-x * { cursor: col-resize !important; }
body.resizing-y, body.resizing-y * { cursor: row-resize !important; }

.rp .dock:not(.cx *) {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.rp .dock-head:not(.cx *) {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 8px;
  border-bottom: 1px solid var(--line); background: var(--panel-2); cursor: grab; min-width: 0;
}
.rp .dock-head:active:not(.cx *) { cursor: grabbing; }
.rp .grip:not(.cx *) { color: var(--muted); font-size: var(--fs-xs); opacity: .7; }
.rp .dock-title:not(.cx *) { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.rp .dock-actions:not(.cx *) { display: flex; gap: 4px; align-items: center; flex: none; }
.rp .dock-actions:empty:not(.cx *) { display: none; }
.rp .dock-body:not(.cx *) { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.rp .dock-body > *:not(.cx *) { flex: 1; min-height: 0; }
.rp .dock.is-solo:not(.cx *) { border-color: var(--accent); }

body.dock-dragging, body.dock-dragging * { cursor: grabbing !important; user-select: none; }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none;
  background: var(--accent); color: var(--on-accent); padding: 4px 10px; border-radius: 2px; font-size: var(--fs-xs); box-shadow: var(--shadow);
}
.drop-marker {
  position: fixed; z-index: 90; pointer-events: none; display: none;
  background: var(--accent-soft); border: 2px solid var(--accent); border-radius: var(--radius);
  transition: all .08s ease-out;
}
.drop-marker[data-center="1"] { border-style: dashed; }
.rp .empty-layout:not(.cx *) { margin: auto; color: var(--muted); }

/* compact (narrow window) tabs */
.rp .rp-work[data-compact] { flex-direction: column; gap: 6px; }
.rp .tabs-bar:not(.cx *) { display: flex; gap: 4px; overflow-x: auto; flex: none; }
.rp .tab:not(.cx *) { border: 1px solid var(--line); background: var(--panel); border-radius: 2px; padding: 4px 10px; white-space: nowrap; color: var(--muted); }
.rp .tab.on:not(.cx *) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.rp .tab-body:not(.cx *) { flex: 1; min-height: 0; display: flex; }
.rp .tab-body > .dock:not(.cx *) { flex: 1; }

/* ---------- common controls ---------- */
.rp .row:not(.cx *) { display: flex; gap: 6px; align-items: center; min-width: 0; }
.rp .row.rp-wrap:not(.cx *) { flex-wrap: wrap; }
.rp .row.end:not(.cx *) { justify-content: flex-end; }
.rp .stack:not(.cx *) { display: flex; flex-direction: column; gap: 12px; }
.rp .rp-field:not(.cx *) {
  background: var(--field); border: 1px solid var(--line); border-radius: 2px;
  padding: 6px 8px; min-width: 0; outline: none; user-select: text;
}
.rp .rp-field:focus:not(.cx *) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.rp .rp-field.small:not(.cx *) { padding: 4px 6px; font-size: var(--fs-sm); }
.rp .rp-field.bad:not(.cx *) { border-color: #e5484d; box-shadow: 0 0 0 2px rgb(229 72 77 / .2); }
.rp input[type="text"].rp-field:not(.cx *) { flex: 1; width: 100%; }
.rp select.rp-field:not(.cx *) { cursor: pointer; }
.rp .btn:not(.cx *) {
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 2px; padding: 6px 12px; white-space: nowrap;
}
.rp .btn:hover:not(.cx *) { border-color: var(--accent-line); }
.rp .btn.small:not(.cx *) { padding: 3px 8px; font-size: var(--fs-xs); }
.rp .btn.primary:not(.cx *) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.rp .btn.primary:hover:not(.cx *) { filter: brightness(1.08); }
.rp .btn.danger:hover:not(.cx *) { border-color: #e5484d; color: #e5484d; }
.rp .icon-btn:not(.cx *) {
  border: 0; background: transparent; color: var(--muted); border-radius: 2px;
  width: 24px; height: 24px; display: inline-grid; place-items: center; flex: none; font-size: var(--fs-xs); padding: 0;
}
.rp .icon-btn:hover:not(.cx *) { background: var(--line); color: var(--text); }
.rp .icon-btn.on:not(.cx *) { color: var(--accent-line); background: var(--accent-soft); }
.rp .linkish:not(.cx *) { border: 0; background: none; color: var(--accent-line); padding: 2px 0; }
.rp .linkish:hover:not(.cx *) { text-decoration: underline; }
.rp .rp-seg:not(.cx *) { display: inline-flex; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; flex: none; }
.rp .seg-btn:not(.cx *) { border: 0; background: var(--field); padding: 4px 12px; color: var(--muted); }
.rp .seg-btn + .seg-btn:not(.cx *) { border-left: 1px solid var(--line); }
.rp .seg-btn.on:not(.cx *) { background: var(--accent); color: var(--on-accent); }
.rp .badge:not(.cx *) { background: var(--accent); color: var(--on-accent); border-radius: 2px; padding: 0 6px; font-size: var(--fs-2xs); font-weight: 600; }
.rp .rp-hint:not(.cx *) { color: var(--muted); font-size: var(--fs-2xs); margin-right: auto; }
.rp .section-title:not(.cx *) { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.rp input[type="checkbox"]:not(.cx *), .rp input[type="radio"]:not(.cx *) { accent-color: var(--accent); cursor: pointer; }

/* ---------- log ---------- */
.rp .log:not(.cx *) { display: flex; flex-direction: column; }
.rp .log-scroll:not(.cx *) { flex: 1; overflow-y: auto; padding: 10px 12px; user-select: text; }
.rp .log-empty:not(.cx *) { padding: 20px 4px; text-align: center; }
.rp .log-list:not(.cx *) { display: flex; flex-direction: column; gap: 2px; }
.rp .entry:not(.cx *) {
  --c: var(--accent);
  position: relative; display: flex; gap: 6px; align-items: flex-start;
  padding: 5px 8px 5px 10px; border-left: 3px solid var(--c); border-radius: 0 2px 2px 0;
  font-family: var(--log-font); font-size: calc(var(--fs-base) * var(--log-scale, 1)); line-height: 1.5;
}
.rp .entry:hover:not(.cx *) { background: var(--panel-2); }
.rp .entry-body:not(.cx *) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rp .entry-body strong:not(.cx *) { color: var(--c); }

.rp .entry .q:not(.cx *) { color: var(--text); }
.rp .entry.k-do .entry-body:not(.cx *) { font-style: normal; }
.rp .entry.k-ooc .entry-body:not(.cx *), .rp .ooc:not(.cx *) { color: var(--muted); font-family: 'Segoe UI', system-ui, sans-serif; font-size: var(--fs-sm); }
.rp .entry.k-roll:not(.cx *) { font-family: 'Segoe UI', system-ui, sans-serif; font-size: var(--fs-sm); background: var(--accent-soft); background: color-mix(in srgb, var(--c) 9%, transparent); }
.rp .entry.crit-hi:not(.cx *) { box-shadow: inset 0 0 0 1px #3ecf7a88; }
.rp .entry.crit-lo:not(.cx *) { box-shadow: inset 0 0 0 1px #e5484d88; }
.rp .entry del:not(.cx *) { opacity: .55; }
.rp .die:not(.cx *) { color: var(--c); }
.rp .entry-actions:not(.cx *) { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; flex: none; }
.rp .entry:hover .entry-actions:not(.cx *) { opacity: 1; }
.rp .entry.copy-marker:not(.cx *) { margin-bottom: 14px; }
.rp .entry.copy-marker:not(.cx *)::after {
  content: 'copied up to here'; position: absolute; left: 0; right: 0; bottom: -13px; height: 10px;
  font: var(--fs-2xs)/10px 'Segoe UI', sans-serif; color: var(--muted); text-align: center;
  border-bottom: 1px dashed var(--line);
}
.rp .host-actions:not(.cx *) { display: flex; gap: 4px; }

/* ---------- composer ---------- */
.rp .composer:not(.cx *) { display: flex; flex-direction: column; gap: 8px; padding: 10px; min-height: 0; }

.rp .lang-sel:not(.cx *) { flex: 0 1 auto; max-width: 180px; }
.rp .verb-box:not(.cx *) { display: inline-flex; align-items: center; gap: 2px; flex: 0 1 auto; min-width: 0; }
.rp .verb-box input[type="text"].verb-field:not(.cx *) { flex: 0 1 108px; width: 108px; min-width: 64px; }
.rp .verb-field:not(.cx *)::placeholder { font-style: italic; }
.rp .draft:not(.cx *) {
  flex: 1 1 60px; min-height: 48px; resize: none; line-height: 1.5;
  font-family: var(--log-font); font-size: calc(var(--fs-base) * var(--log-scale, 1));
}
.rp .preview-wrap:not(.cx *) { flex: none; display: flex; gap: 8px; align-items: baseline; max-height: 30%; overflow: auto; }
.rp .preview-label:not(.cx *) { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); flex: none; }
.rp .rp-preview:not(.cx *) { font-family: var(--log-font); font-size: calc(var(--fs-sm) * var(--log-scale, 1)); overflow-wrap: anywhere; }
.rp .rp-preview strong:not(.cx *) { color: var(--accent-line); }

/* ---------- partner ---------- */
.rp .partner:not(.cx *) { --partner: var(--accent); display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.rp .partner-name:not(.cx *) { font-weight: 600; color: var(--partner); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp .typing:not(.cx *) { font-size: var(--fs-xs); color: var(--accent-line); opacity: 0; transition: opacity .2s; margin-left: auto; white-space: nowrap; }
.rp .typing.on:not(.cx *) { opacity: 1; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.rp .partner-draft:not(.cx *) {
  flex: 1 1 40px; min-height: 40px; overflow: auto; padding: 8px 10px; border-radius: 2px;
  background: var(--field); border: 1px dashed var(--line); border-left: 3px solid var(--partner);
  font-family: var(--log-font); font-size: calc(var(--fs-md) * var(--log-scale, 1)); overflow-wrap: anywhere; user-select: text;
}
.rp .partner-draft strong:not(.cx *) { color: var(--partner); }
.rp .partner-sheet:not(.cx *) { flex: 0 1 auto; overflow: auto; max-height: 50%; display: flex; flex-direction: column; gap: 8px; }
.rp .ps-title:not(.cx *) { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.rp .ps-item:not(.cx *) { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); padding: 2px 6px; border-radius: 2px; color: var(--muted); }
.rp .ps-item.on:not(.cx *) { color: var(--text); background: var(--accent-soft); }

/* ---------- dice ---------- */
.rp .dice:not(.cx *) { display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow: auto; }
.rp .dice > *:not(.cx *) { flex: none; }
.rp .expr:not(.cx *) { flex: 1; }
.rp .quick-dice:not(.cx *) { display: flex; flex-wrap: wrap; gap: 4px; }
.rp .result:not(.cx *) { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 2px; background: var(--field); border: 1px solid var(--line); min-height: 42px; }
.rp .result .total:not(.cx *) { font-size: var(--fs-xl); font-weight: 700; color: var(--accent-line); }
.rp .result .detail:not(.cx *) { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.rp .result.crit-hi:not(.cx *) { border-color: #3ecf7a; } .rp .result.crit-hi .total:not(.cx *) { color: #3ecf7a; }
.rp .result.crit-lo:not(.cx *) { border-color: #e5484d; } .rp .result.crit-lo .total:not(.cx *) { color: #e5484d; }
.rp .sheet-head:not(.cx *) { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; margin-top: 4px; }
.rp .active-sum:not(.cx *) { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rp .sheet:not(.cx *) { display: flex; flex-direction: column; gap: 6px; }
.rp .group:not(.cx *) { border: 1px solid var(--line); border-radius: 2px; background: var(--field); }
.rp .g-head:not(.cx *) { display: flex; align-items: center; gap: 4px; padding: 4px; }
.rp .g-name:not(.cx *) { font-weight: 600; background: transparent !important; border-color: transparent !important; padding: 3px 4px !important; }
.rp .g-name:focus:not(.cx *) { border-color: var(--accent) !important; }
.rp .caret:not(.cx *) { transition: transform .15s; }
.rp .caret.open:not(.cx *) { transform: rotate(90deg); }
.rp .g-body:not(.cx *) { padding: 0 6px 6px; display: flex; flex-direction: column; gap: 3px; }
.rp .m-row:not(.cx *) { display: flex; align-items: center; gap: 4px; padding: 2px; border-radius: 2px; min-width: 0; }
.rp .m-row.on:not(.cx *) { background: var(--accent-soft); }
.rp .m-name:not(.cx *) { flex: 1 1 80px !important; padding: 3px 6px !important; }
.rp .m-val:not(.cx *) { flex: 0 1 72px !important; width: 72px; padding: 3px 6px !important; text-align: center; }
.rp .m-tools:not(.cx *) { display: flex; opacity: 0; transition: opacity .12s; }
.rp .m-row:hover .m-tools:not(.cx *), .rp .g-head:hover .m-tools:not(.cx *), .rp .m-row:focus-within .m-tools:not(.cx *) { opacity: 1; }
.rp .sheet-foot:not(.cx *) { padding-top: 2px; }

/* ---------- music ---------- */
.rp .music:not(.cx *) { display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow: auto; }
.rp .music > *:not(.cx *) { flex: none; }
.rp .music-empty:not(.cx *) { text-align: center; padding: 6px; }
.rp .music.rp-drop:not(.cx *) { outline: 2px dashed var(--accent); outline-offset: -6px; background: var(--accent-soft); }
.rp .music-busy:not(.cx *) { display: flex; flex-direction: column; gap: 4px; }
.rp .busy-row:not(.cx *) { display: flex; flex-direction: column; gap: 2px; }
.rp .busy-row progress:not(.cx *) { width: 100%; height: 6px; accent-color: var(--accent); }
.rp .drop-hint:not(.cx *) { align-self: center; }
.rp .track-icon:not(.cx *) { width: 30px; height: 30px; border-radius: 2px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-line); font-size: var(--fs-base); }
.rp .music-library:not(.cx *) { display: flex; flex-direction: column; gap: 4px; }
.rp .music-notice:not(.cx *) { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 2px; font-size: var(--fs-sm);
  border: 1px solid #e6b84a; background: rgb(230 184 74 / .1); }

/* title-bar mini player (shown while the Music panel is closed) */
.rp .mini-player:not(.cx *) { display: flex; align-items: center; gap: 4px; -webkit-app-region: no-drag; margin-right: 4px; min-width: 0; }
.rp .mini-vol:not(.cx *) { width: 70px; accent-color: var(--accent); }
.rp .mini-title:not(.cx *) { width: 150px; overflow: hidden; white-space: nowrap; font-size: var(--fs-xs); color: var(--muted); cursor: pointer;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.rp .mini-title-text:not(.cx *) { display: inline-block; }
.rp .mini-title.scroll .mini-title-text:not(.cx *) { padding-left: 100%; animation: mini-marquee 14s linear infinite; }
@keyframes mini-marquee { to { transform: translateX(-100%); } }
@media (max-width: 720px) { .rp .mini-title:not(.cx *) { display: none; } }
.rp .music-now:not(.cx *) { display: flex; flex-direction: column; gap: 4px; }
.rp .music-title:not(.cx *) { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp .loop-btn.on:not(.cx *) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-line); }
.rp .music-bar:not(.cx *) { flex: 1; accent-color: var(--accent); }
.rp .music-bar:disabled:not(.cx *) { opacity: 0.8; }
.rp .vibes:not(.cx *) { display: flex; flex-wrap: wrap; gap: 6px; }
.rp .vibe:not(.cx *) {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; max-width: 170px;
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 2px; padding: 5px 11px; font-size: var(--fs-sm); text-align: left;
}
.rp .vibe-label:not(.cx *) { font-weight: 600; }
.rp .vibe-track:not(.cx *) { font-size: var(--fs-2xs); color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp .vibe.on:not(.cx *) { border-color: var(--accent); background: var(--accent-soft); }
.rp .vibe:not(.cx *) { touch-action: none; }
.rp .vibe.dragging:not(.cx *) { cursor: grabbing; opacity: 0.85; box-shadow: var(--shadow); transform: scale(1.04); border-color: var(--accent); position: relative; z-index: 2; }
.rp .vibe.on .vibe-track:not(.cx *) { color: var(--accent-line); }
.rp .vibe:hover:not(.cx *) { border-color: var(--accent); background: var(--accent-soft); }
.rp .vibe.unset:not(.cx *) { border-style: dashed; color: var(--muted); }
.rp .vibe-edit:not(.cx *) { display: grid; grid-template-columns: 110px 1fr auto; gap: 4px; width: 100%; }
.rp .music-lists:not(.cx *) { display: flex; flex-direction: column; gap: 6px; }
.rp .track:not(.cx *) { display: flex; gap: 8px; align-items: center; min-width: 0; padding: 3px; border-radius: 2px; }
.rp .track:hover:not(.cx *) { background: var(--panel-2); }
.rp .track-info:not(.cx *) { flex: 1; min-width: 0; }
.rp .track-title:not(.cx *) { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp .track-btns:not(.cx *) { display: flex; gap: 2px; align-items: center; flex: none; }

/* ---------- snake ---------- */
.rp .snake:not(.cx *) { display: flex; flex-direction: column; padding: 6px; }
.rp .snake-stage:not(.cx *) { position: relative; flex: 1; min-height: 0; display: flex; }
.rp .snake-canvas:not(.cx *) { flex: 1; width: 100%; height: 100%; min-height: 0; display: block; border-radius: 2px; outline: none; cursor: pointer; }
.rp .snake-canvas:focus:not(.cx *) { box-shadow: 0 0 0 2px var(--accent); }
.rp .snake-overlay:not(.cx *) {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; pointer-events: none; text-align: center; padding: 10px;
}
.rp .snake-overlay strong:not(.cx *) { font-size: var(--fs-lg); }
.rp .snake-overlay span:not(.cx *) { color: var(--muted); font-size: var(--fs-xs); }
.rp .snake-overlay > *:not(.cx *) { background: color-mix(in srgb, var(--panel) 80%, transparent); padding: 2px 8px; border-radius: 2px; }
.rp .snake-score:not(.cx *) { font-weight: 700; color: var(--accent-line); }
.rp .snake-best:not(.cx *) { font-size: var(--fs-2xs); }

/* v6.14.1: choose your dice tray (Settings > Dice): a grid of themed trays, right angles */
.rp .traygrid:not(.cx *) { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; width: 100%; }
.rp .traytile:not(.cx *) { display: flex; flex-direction: column; gap: 4px; padding: 5px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; border-radius: 0; text-align: center; }
.rp .traytile:not(.cx *):hover { border-color: var(--accent); }
.rp .traytile.on:not(.cx *) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.rp .traytile img:not(.cx *) { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.rp .traynone:not(.cx *) { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 2; border: 1px dashed var(--line); color: var(--muted); font-size: var(--fs-sm); }
.rp .trayname:not(.cx *) { font-size: var(--fs-sm); }
/* ---------- 3D dice tray ---------- */
#dice-tray {
  position: fixed; left: 0; top: 0; width: 100vw; height: 100vh;
  z-index: 170; pointer-events: none; display: none;   /* above dialogs, so Test throw is visible */
}
.rp .die.spin:not(.cx *) { display: inline-block; animation: die-spin .6s linear infinite; }
@keyframes die-spin { to { transform: rotate(360deg); } }

/* ---------- toasts ---------- */
.rp.rp-toasts { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 200; align-items: center; pointer-events: none; }
.rp .rp-toast:not(.cx *) {
  pointer-events: auto; display: flex; gap: 10px; align-items: center; max-width: min(520px, 92vw);
  background: var(--panel-2); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 7px 12px; border-radius: 2px; transition: opacity .35s, transform .35s;
}
.rp .rp-toast.out:not(.cx *) { opacity: 0; transform: translateY(6px); }

/* ---------- modal ---------- */
.rp.modal-wrap { position: fixed; inset: 0; background: rgb(0 0 0 / .45); display: grid; place-items: center; z-index: 150; padding: 16px; }
.rp .rp-modal:not(.cx *) {
  /* Never taller than the window; the body scrolls instead. */
  width: min(440px, 100%); max-height: calc(100vh - 32px); min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: 2px; box-shadow: var(--shadow);
}
.rp .rp-modal.wide:not(.cx *) { width: min(640px, 100%); }
.rp .modal-head:not(.cx *) { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.rp .modal-head h2:not(.cx *) { margin: 0; font-size: var(--fs-body); }
.rp .modal-body:not(.cx *) { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px; scrollbar-gutter: stable; }
.rp .rp-modal.wide:not(.cx *) { height: min(640px, calc(100vh - 32px)); }
.rp .stabs:not(.cx *) {
  flex: none; display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 10px 0;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.rp .stab:not(.cx *) {
  border: 0; background: none; color: var(--muted); padding: 7px 11px; font-size: var(--fs-sm);
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 2px 2px 0 0; white-space: nowrap;
}
.rp .stab:hover:not(.cx *) { color: var(--text); background: var(--panel-2); }
.rp .stab.on:not(.cx *) { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.rp .test-row:not(.cx *) { position: sticky; top: -14px; z-index: 2; margin: -14px -14px 0; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.rp .slider-label:not(.cx *) { min-width: 130px; }
/* dice portraits + presets */
.rp .die-portrait:not(.cx *) { width: 30px; height: 30px; flex: none; object-fit: contain; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .35)); }
.rp .die-portrait:not([src]):not(.cx *) { visibility: hidden; }
.rp .composer .die-portrait:not(.cx *) { cursor: pointer; width: 34px; height: 34px; }
.rp .partner-head .die-portrait:not(.cx *) { width: 34px; height: 34px; }
.rp .die-portrait.big:not(.cx *) { width: 64px; height: 64px; }
.rp .preset-switch:not(.cx *) { max-width: 150px; padding: 2px 4px !important; font-size: var(--fs-xs) !important; }
.rp .presets:not(.cx *) { display: flex; flex-direction: column; gap: 8px; }
.rp .preset-grid:not(.cx *) { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 8px; }   /* v6.9.0: wide enough for Apply and its three buttons */
.rp .preset-card:not(.cx *) {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px 6px;
  border: 1px solid var(--line); border-radius: 2px; background: var(--field); min-width: 0;
}
.rp .preset-card.on:not(.cx *) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.rp .preset-name:not(.cx *) { font-size: var(--fs-xs); font-weight: 600; text-align: center; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp .preset-name .rp-field:not(.cx *) { width: 100%; }
.rp .preset-btns:not(.cx *) { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; align-items: center; max-width: 100%; }
.rp .skin-thumb:not(.cx *) { width: 34px; height: 34px; border-radius: 2px; border: 1px solid var(--line); background-size: cover; background-position: center; flex: none; }
.rp .modal-body p:not(.cx *) { margin: 0; }
.rp .settings:not(.cx *) { display: flex; flex-direction: column; gap: 18px; }
.rp .settings section:not(.cx *) { display: flex; flex-direction: column; gap: 8px; }
.rp .settings h3:not(.cx *) { margin: 0; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .07em; color: var(--accent-line); }
.rp .fld:not(.cx *) { display: flex; flex-direction: column; gap: 4px; }
.rp .fld-label:not(.cx *) { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.rp .fld-help:not(.cx *) { display: block; font-size: var(--fs-2xs); color: var(--muted); font-weight: 400; }
.rp .chk:not(.cx *) { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.rp .chk input:not(.cx *) { margin-top: 3px; }
.rp .inline:not(.cx *) { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--muted); }




.rp .tpl-row:not(.cx *) { display: grid; grid-template-columns: 110px 1fr auto; gap: 6px; align-items: center; }
.rp .tpl-label:not(.cx *) { font-size: var(--fs-xs); color: var(--muted); }
.rp .settings .rp-preview:not(.cx *) { background: var(--field); border: 1px solid var(--line); border-radius: 2px; padding: 8px 10px; line-height: 1.7; }
.rp .swatches:not(.cx *) { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.rp .swatch:not(.cx *) {
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 6px 6px; font-size: var(--fs-xs); text-align: left;
  background: linear-gradient(90deg, var(--sw) 0 10px, var(--panel-2) 10px);
  padding-left: 16px;
}

.rp .swatch.on:not(.cx *) { outline: 2px solid var(--accent); outline-offset: 1px; }
.rp input[type="color"]:not(.cx *) { width: 36px; height: 26px; border: 1px solid var(--line); border-radius: 2px; background: none; padding: 1px; cursor: pointer; }
.rp input[type="range"]:not(.cx *) { flex: 1; accent-color: var(--accent); }

@media (max-width: 480px) {
  
  .rp .tpl-row:not(.cx *) { grid-template-columns: 1fr auto; }
  .rp .tpl-label:not(.cx *) { grid-column: 1 / -1; }
}

.rp ::-webkit-scrollbar { width: 10px; height: 10px; }
.rp ::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
.rp ::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
.rp ::-webkit-scrollbar-track { background: transparent; }

/* ===================== the Codex's Table tab =====================
   The Roleplaything's look, inside the Codex: the Codex's theme gives the colours and fonts, your own colour (--me,
   Table settings) marks your name and dice. .cx is the Codex's own markup inside a panel (the dice tray, the sheet):
   none of the rules above reach into it. */
.rp {
  --panel-2: var(--panel2); --field: var(--bg2);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent); --accent-line: var(--accent);
  font: var(--fs-base)/1.45 var(--f-body); color: var(--text);
}
.view.tableview { padding: 0; overflow: hidden; display: flex; }
.rp.rp-table { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.rp .rp-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px 0; flex: none; }
.rp .rp-bar .menu { right: 0; left: auto; top: calc(100% + 4px); position: absolute; z-index: 30; min-width: 220px; padding: 6px; border-radius: 2px; background: var(--bg2); border: 1px solid var(--line); box-shadow: var(--shadow); }
.rp .rp-work { flex: 1; min-height: 0; position: relative; display: flex; padding: 6px; }
.rp .dock { background: var(--panel); border: 1px solid var(--line); }
.rp .dock-title { font-family: var(--f-sc); font-size: var(--fs-md); font-weight: 400; letter-spacing: .3px; }
.rp .rp-btn, .rp .btn:not(.cx *) { font-family: inherit; }
.rp .entry-body { font-size: var(--fs-base); }
.rp .entry.k-narrate .entry-body { font-style: italic; }
.rp .entry.private:not(.cx *) { box-shadow: inset 2px 0 0 var(--line2); }
.rp .entry-to:not(.cx *) { font-size: var(--fs-2xs); color: var(--muted); font-style: italic; margin-left: 6px; white-space: nowrap; }
.rp .entry-detail:not(.cx *) { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; font-family: system-ui, sans-serif; }
.rp .me-name:not(.cx *) { font-weight: 600; color: var(--me); white-space: nowrap; }
.rp .me-face:empty, .rp .seat-face:empty { display: none; }
.rp .as-sel:not(.cx *), .rp .to-sel:not(.cx *) { max-width: 210px; flex: 0 1 auto; }
.rp .seat-list:not(.cx *) { display: flex; flex-direction: column; gap: 10px; }
.rp .seat-card:not(.cx *) { --partner: var(--accent); display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 2px; background: var(--bg2); }
.rp .partner-sheet:not(.cx *) { font-size: var(--fs-sm); max-height: none; }
.rp .partner-sheet .dneeds { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.rp .partner-sheet .warn { color: var(--t-pol); } .rp .partner-sheet .bad { color: var(--t-rival); }
.rp .other-dice:not(.cx *) { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.rp .other-dice > summary:not(.cx *) { cursor: pointer; color: var(--muted); font-family: var(--f-sc); }
.rp .other-dice:not([open]) > :not(summary) { display: none; }
.rp .dice:not(.cx *) { gap: 10px; }
.cx { font: var(--fs-body)/1.5 var(--f-body); color: var(--text); min-height: 0; }
.rp .codex-sheet { overflow: auto; padding: 6px 10px 12px; }
.rp .codex-tray .tray { padding: 0; }
#rp-mini { display: flex; align-items: center; min-width: 0; }
#rp-mini .tb-btn { border: 0; background: transparent; color: var(--muted); padding: 2px 6px; border-radius: 2px; }
#rp-mini .tb-btn:hover { color: var(--text); background: var(--sel); }
.rp .rp-toast:not(.cx *) { font-family: system-ui, sans-serif; }

/* ---------- v4.1.0: the four seats ---------- */
.rp .seat-slot:not(.cx *) { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.rp .seat-no:not(.cx *) { font: var(--fs-xs) var(--f-sc); letter-spacing: .5px; color: var(--muted); text-transform: uppercase; }
.rp .seat-pick:not(.cx *) { max-width: 170px; }
.rp .seat-card.empty:not(.cx *) { border-style: dashed; opacity: .8; }
.rp .seat-card.me:not(.cx *) { border-color: var(--me); }
.rp .watching:not(.cx *) { margin-top: 6px; }
.rp .draft:disabled:not(.cx *) { opacity: .6; cursor: not-allowed; }

/* ===================== v5.0.0: the design pass =====================
   Every panel the same frame: a squared box, a header bar with its name in small caps, thin gaps between. */
.rp .rp-work:not(.cx *) { padding: 4px; }
.rp .gutter.horiz:not(.cx *) { width: 4px; } .rp .gutter.vert:not(.cx *) { height: 4px; }
.rp .dock:not(.cx *) { border-radius: 0; border: 1px solid var(--line2); background: var(--panel); box-shadow: none; }
.rp .dock-head:not(.cx *) { background: var(--panel2); border-bottom: 1px solid var(--line2); padding: 4px 6px 4px 8px; min-height: 30px; }
.rp .dock-title:not(.cx *) { font: 400 var(--fs-sm)/1.2 var(--f-sc); text-transform: uppercase; letter-spacing: 1.3px; color: var(--accent2); }
.rp .dock.is-solo:not(.cx *) { border-color: var(--accent); }
.rp .tab:not(.cx *) { border-radius: 0; font: var(--fs-sm) var(--f-sc); text-transform: uppercase; letter-spacing: 1px; }
.rp .tab.on:not(.cx *) { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--head); border-color: var(--accent); }
.rp .entry:not(.cx *) { border-radius: 0; border-left: 2px solid color-mix(in srgb, var(--c, var(--accent)) 70%, transparent); padding-left: 8px; margin: 1px 0; }
.rp .entry.k-ooc:not(.cx *) { border-left-color: var(--line2); }
.rp .entry.k-narrate:not(.cx *) { border-left-color: var(--line2); }
.rp .entry-body:not(.cx *) { line-height: 1.5; }
.rp .rp-btn:not(.cx *), .rp .btn:not(.cx *) { border-radius: 2px; }
.rp .rp-bar:not(.cx *) { padding: 4px 8px 0; }
.rp .status-pill:not(.cx *) { border-radius: 0; }
.rp .composer:not(.cx *) { gap: 6px; padding: 8px; }
.rp .seat-card:not(.cx *) { border-radius: 0; border-left: 3px solid var(--partner); }
.rp .seat-card.empty:not(.cx *) { border-left-style: dashed; }
.rp .tab-story:not(.cx *) { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.rp .tab-story .composer .draft:not(.cx *) { min-height: 64px; }

/* ===================== v5.7.0: seats and drafts =====================
   Only filled seats show; the GM picks its own cat and seats others from two small pickers. A long draft folds to
   about five lines, faded at the bottom, and "Show all" opens it. */
.rp .seat-mine:not(.cx *), .rp .seat-add:not(.cx *) { display: flex; align-items: center; gap: 8px; }
.rp .seat-mine[hidden], .rp .seat-add[hidden] { display: none; }
.rp .partner-draft:not(.cx *) { flex: none; max-height: 7.6em; overflow: hidden; position: relative; }
.rp .partner-draft.open:not(.cx *) { max-height: none; overflow: visible; }
.rp .partner-draft.clipped:not(.cx *)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.2em; background: linear-gradient(transparent, var(--field)); pointer-events: none; }
.rp .draft-more:not(.cx *) { align-self: flex-start; border: 0; background: none; padding: 0 2px; font-size: var(--fs-sm); color: var(--accent-line); cursor: pointer; }
.rp .draft-more:not(.cx *):hover { text-decoration: underline; }
.rp .draft-more[hidden] { display: none; }

/* v5.7.0: the table's bar (the link, Panels, 3D Dice) rides in the story sidebar's own bar */
.rp-bar.rp { display: flex; align-items: center; gap: 6px; }
.rsbar > .rp-bar.rp { flex: 1; min-width: 0; padding: 0; justify-content: flex-end; font: var(--fs-sm)/1.3 var(--f-body); letter-spacing: 0; }
.rsbar > .rp-bar.rp .drag-space { display: none; }
.rp-bar.rp .menu { right: 0; left: auto; top: calc(100% + 4px); position: absolute; z-index: 30; min-width: 220px; padding: 6px; border-radius: 2px; background: var(--bg2); border: 1px solid var(--line); box-shadow: var(--shadow); }
.rsbar:has(> .rp-bar.rp) > b { display: none; }   /* the link's own pill says "At the table" */
.rsbar > .rp-bar.rp .status-pill { flex: none; margin-right: auto; }

/* ---------- v5.10.0: Settings, a start page and a numbered index ----------
   Square, small caps for names and headings, the theme's own colours; the GM's desk is marked in gold. */
.rp .settings2 { width: min(1000px, 100%); height: min(700px, calc(100vh - 32px)); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; background: linear-gradient(var(--panel), var(--panel)), var(--bg, #0b0f1e); border: 1px solid var(--line); border-radius: 0; box-shadow: var(--shadow); }
.rp .settings2 .shead { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.rp .settings2 .shead h2 { margin: 0; flex: 1; font: 400 var(--fs-body)/1 var(--f-sc); text-transform: uppercase; letter-spacing: 1.5px; color: var(--head); }
.rp .settings2 .sfind { width: min(260px, 40vw); border-radius: 0; }
.rp .settings2 .sbody { flex: 1; min-height: 0; display: grid; grid-template-columns: 190px minmax(0, 1fr); }
.rp .settings2 .sindex { border-right: 1px solid var(--line); padding: 8px 0; overflow-y: auto; display: flex; flex-direction: column; }
.rp .settings2 .six { display: flex; align-items: center; gap: 10px; text-align: left; padding: 7px 12px; border: 0; border-left: 2px solid transparent; background: none; color: var(--muted); font-size: var(--fs-md); border-radius: 0; }
.rp .settings2 .six b { width: 26px; flex: none; font: 400 var(--fs-xs) var(--f-sc); letter-spacing: .5px; color: var(--muted); opacity: .8; }
.rp .settings2 .six:hover { background: var(--panel-2); color: var(--text); }
.rp .settings2 .six.on { border-left-color: var(--accent); background: var(--panel-2); color: var(--text); }
.rp .settings2 .sdesk { margin: 14px 12px 4px; font: 400 var(--fs-2xs) var(--f-sc); text-transform: uppercase; letter-spacing: 1.2px; color: var(--desk); }
.rp .settings2 .smain { overflow-y: auto; padding: 14px 18px 18px; scrollbar-gutter: stable; display: flex; flex-direction: column; gap: 14px; }
.rp .settings2 .slabel { font: 400 var(--fs-2xs) var(--f-sc); text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin-bottom: -8px; }
.rp .settings2 .shand { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; }
.rp .settings2 .shand .srow { flex-wrap: wrap; row-gap: 6px; }
.rp .settings2 .shand .srow-l { min-width: 150px; }
.rp .settings2 .shand .srow-c { flex: 1 1 auto; }
.rp .settings2 .shand .srow-range { width: 100%; min-width: 150px; }
.rp .settings2 .stiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.rp .settings2 .stile { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--panel-2); color: var(--text); }
.rp .settings2 .stile:hover, .rp .settings2 .stile:focus-visible { border-color: var(--accent); }
.rp .settings2 .stile.desk { border-top: 2px solid var(--desk); }
.rp .settings2 .stile-name { font: 400 var(--fs-sm) var(--f-sc); text-transform: uppercase; letter-spacing: 1px; color: var(--head); }
.rp .settings2 .stile-name b, .rp .settings2 .sfind-head b { font-weight: 400; color: var(--muted); }
.rp .settings2 .stile-blurb { font-size: var(--fs-sm); color: var(--muted); }
.rp .settings2 .sfoot { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; font-size: var(--fs-sm); color: var(--muted); padding-top: 4px; }
.rp .settings2 .slink { border: 0; background: none; padding: 0; color: var(--accent); font-size: var(--fs-sm); cursor: pointer; border-radius: 0; }
.rp .settings2 .slink:hover { text-decoration: underline; }
.rp .settings2 .scrumb { font-size: var(--fs-sm); color: var(--muted); margin-bottom: -8px; }
.rp .settings2 .stitle { margin: 0; font: 400 var(--fs-lg) var(--f-sc); text-transform: uppercase; letter-spacing: 1.5px; color: var(--head); }
.rp .settings2 .sgroup { display: flex; flex-direction: column; }
.rp .settings2 .sgroup > h3 { margin: 4px 0 2px; font: 400 var(--fs-xs) var(--f-sc); text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent2); }
.rp .settings2 .sgroup > .fld-help { margin: 4px 0; }
.rp .settings2 .sfind-head { align-self: flex-start; border: 0; background: none; padding: 0 0 2px; font: 400 var(--fs-sm) var(--f-sc); text-transform: uppercase; letter-spacing: 1px; color: var(--head); cursor: pointer; }
.rp .settings2 .sempty { color: var(--muted); padding: 24px 0; }
/* a setting: name and note on the left, the control on the right */
.rp .settings2 .srow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.rp .settings2 label.srow { cursor: pointer; }
.rp .settings2 .srow.wide { flex-direction: column; align-items: stretch; gap: 6px; }
.rp .settings2 .srow-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.rp .settings2 .srow-name { font-size: var(--fs-md); color: var(--text); }
.rp .settings2 .srow-note { font-size: var(--fs-xs); color: var(--muted); }
.rp .settings2 .srow-c { flex: 0 1 auto; display: flex; align-items: center; justify-content: flex-end; min-width: 0; }
.rp .settings2 .srow-c .rp-field, .rp .settings2 .srow-c select { max-width: 280px; }
.rp .settings2 .srow-c input.rp-field.mono { width: 260px; }
.rp .settings2 .srow-range { display: flex; align-items: center; gap: 8px; width: 230px; }
.rp .settings2 .srow-val { min-width: 44px; text-align: right; font-size: var(--fs-sm); color: var(--accent); white-space: nowrap; }
.rp .settings2 .srow-path { font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; max-width: 420px; }
.rp .settings2 .chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.rp .settings2 .chip { border: 1px solid var(--line); background: none; color: var(--muted); padding: 4px 10px; font-size: var(--fs-sm); border-radius: 0; white-space: nowrap; }
.rp .settings2 .chip:hover { color: var(--text); border-color: var(--accent-line); }
.rp .settings2 .chip.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
/* a switch: a checkbox drawn as a small square track */
.rp .settings2 input.sw { appearance: none; -webkit-appearance: none; width: 38px; height: 20px; margin: 0; flex: none; border: 1px solid var(--line); background: var(--field); position: relative; cursor: pointer; border-radius: 0; }
.rp .settings2 input.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--muted); transition: left .12s; }
.rp .settings2 input.sw:checked { background: var(--accent-soft); border-color: var(--accent); }
.rp .settings2 input.sw:checked::after { left: 20px; background: var(--accent); }
.rp .settings2 input.sw:disabled { opacity: .5; cursor: default; }
.rp .settings2 .test-row { position: sticky; top: -14px; z-index: 2; margin: -14px -18px 0; padding: 10px 18px; background: linear-gradient(var(--panel), var(--panel)), var(--bg, #0b0f1e); border-bottom: 1px solid var(--line); }
@media (max-width: 720px) {
  .rp .settings2 .sbody { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .rp .settings2 .sindex { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 0; }
  .rp .settings2 .six { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .rp .settings2 .six.on { border-bottom-color: var(--accent); }
  .rp .settings2 .sdesk { display: none; }
  .rp .settings2 .shand { grid-template-columns: 1fr; }
  .rp .settings2 .srow { flex-wrap: wrap; }
}

/* v6.0.0: the sound for new lines: mute and volume on a log's header */
.snd-ctl { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; }
.snd-ctl .snd-vol { width: 64px; accent-color: var(--accent); }
.snd-ctl .snd-vol:disabled { opacity: .4; }
.snd-ctl .snd-btn { min-width: 0; padding: 2px 6px; }

/* ===================== v6.1.0: one visual system =====================
   The Table follows the page's tokens (Warrior_Codex.html: --fs-*, --sp-*, --radius, --ctl-h, --desk): the same three
   buttons, the same fields, square corners. The story: the log, and the box you write in pinned under it. */
.rp .btn:not(.cx *) { min-height: var(--ctl-h); padding: 0 var(--sp-3); border: 1px solid var(--line2); background: transparent; color: var(--text); border-radius: var(--radius); font-size: var(--fs-md); line-height: 1.2; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.rp .btn:hover:not(.cx *) { background: var(--sel); border-color: color-mix(in srgb, var(--accent) 55%, var(--line2)); }
.rp .btn.primary:not(.cx *) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.rp .btn.primary:hover:not(.cx *) { background: var(--accent); filter: brightness(1.08); }
.rp .btn.small:not(.cx *) { min-height: var(--ctl-h-sm); padding: 0 var(--sp-2); font-size: var(--fs-sm); }
.rp .icon-btn:not(.cx *) { border-radius: var(--radius); width: var(--ctl-h-sm); height: var(--ctl-h-sm); font-size: var(--fs-xs); }
.rp .icon-btn:hover:not(.cx *) { background: var(--sel); }
.rp .rp-field:not(.cx *) { border-color: var(--line2); border-radius: var(--radius); min-height: var(--ctl-h-sm); }
.rp .rp-seg:not(.cx *) { border-color: var(--line2); border-radius: var(--radius); }
.rp .seg-btn:not(.cx *) { min-height: var(--ctl-h-sm); padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.rp .tb-btn:not(.cx *), .rp .stab:not(.cx *), .rp .menu:not(.cx *), .rp .menu-item:not(.cx *), .rp .result:not(.cx *), .rp .group:not(.cx *), .rp .vibe:not(.cx *), .rp .preset-card:not(.cx *), .rp .swatch:not(.cx *), .rp .rp-toast:not(.cx *), .rp .partner-draft:not(.cx *), .rp .seat-card:not(.cx *) { border-radius: var(--radius); }
.rp .section-title:not(.cx *), .rp .menu-label:not(.cx *), .rp .ps-title:not(.cx *), .rp .preview-label:not(.cx *), .rp .settings h3:not(.cx *) { font-family: var(--f-sc); font-weight: 400; letter-spacing: var(--track); }

/* the story: the log takes the room, the writing box sits under it at its own height */
.rp .rp-work > .storystack { flex: 1; min-width: 0; min-height: 0; }
.rp .storystack:not(.cx *) { display: flex; flex-direction: column; gap: 4px; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.rp .storystack > .story-log:not(.cx *) { flex: 1 1 0px; min-height: 140px; }
.rp .storystack > .story-box:not(.cx *) { flex: 0 0 auto; max-height: 55%; }
.rp .storystack > .story-box > .dock > .dock-body:not(.cx *) { overflow: visible; }
.rp .tab-story .composer .draft:not(.cx *), .rp .storystack .composer .draft:not(.cx *) { min-height: 72px; }
.rp .as-label:not(.cx *) { font: 400 var(--fs-2xs)/1 var(--f-sc); text-transform: uppercase; letter-spacing: var(--track); color: var(--dim); white-space: nowrap; }
.rp .composer .who-row:not(.cx *) { flex: none; padding-bottom: 2px; border-bottom: 1px solid var(--line); }

/* the 3D dice: in their lane (Dice_Tray.js sets its place and size) */
#dice-tray { width: auto; height: auto; }
