/* SPDX-License-Identifier: GPL-3.0-only. DUELL editor: a fixed full-window layout of three columns (PART 1, GLOBAL, PART 2), tuned for 1920 x 1080, no page scrolling at 1280 x 720 and up;
   below 1500 px the GLOBAL column is a view of its own, below 1000 px the columns stack and the page scrolls. The colours are the defaults; a connected unit's COLOR setting overrides them (theme.js). */
:root { --bg: #fff; --fg: #000; --dim: #666; --line: #ccc; --warn: #b00020; --ok: #0a6b2d; --panel: #f4f4f4; --acc: #000; --accfg: #fff; }
@media (prefers-color-scheme: dark) { :root { --bg: #000; --fg: #fff; --dim: #999; --line: #444; --warn: #ff6b81; --ok: #62d98a; --panel: #141414; --acc: #fff; --accfg: #000; } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 14px/1.35 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; display: flex; flex-direction: column; min-height: 100%; }
button, select, input { font: inherit; color: inherit; }
button { background: var(--acc); color: var(--accfg); border: 1px solid var(--acc); padding: 5px 14px; cursor: pointer; border-radius: 2px; }
button.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
button.ghost:hover:not(:disabled) { border-color: var(--fg); }
button.danger { background: var(--warn); border-color: var(--warn); color: #fff; }
button.ghost.danger { background: transparent; color: var(--warn); border-color: var(--warn); }
button.small { padding: 2px 8px; font-size: 12px; }
button:disabled { opacity: .35; cursor: default; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
select, input[type=text], input[type=number], input[type=search] { background: var(--bg); border: 1px solid var(--line); padding: 3px 6px; border-radius: 2px; min-width: 0; }
a { color: inherit; }
.small { font-size: 12px; color: var(--dim); }
.warn { color: var(--warn); } .good { color: var(--ok); }
.note { color: var(--dim); font-size: 12px; margin: 6px 2px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; } .row.end { justify-content: flex-end; }
.mockbar { background: #ffb347; color: #000; font-weight: 600; padding: 3px 10px; font-size: 12px; border-radius: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .mockbar button { background: #fff; color: #000; border-color: #000; }


#top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 28px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 22px; }
.brand .dev { width: 64px; height: 64px; border-radius: 6px; display: block; image-rendering: auto; }
.title { display: flex; flex-direction: column; gap: 8px; }
.title h1 { margin: 0; line-height: 0; }
.title h1 img { height: 24px; width: auto; display: block; }
.title p { margin: 0; font-size: 12px; line-height: 1.3; color: var(--dim); letter-spacing: .02em; }
.title h1 img.wm-w { display: none; }
html[data-scheme=dark] .title h1 img.wm-b { display: none; } html[data-scheme=dark] .title h1 img.wm-w { display: block; }
.mockbar[hidden] { display: none; }
.right-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 0; }
.conn { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.unit { font-size: 13px; font-weight: 600; } .unit.good { color: var(--ok); } .unit.warn { color: var(--warn); }
.tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.linkbox { display: flex; gap: 6px; align-items: center; cursor: pointer; user-select: none; }
.btnlink { border: 1px solid var(--line); padding: 2px 8px; font-size: 12px; text-decoration: none; border-radius: 2px; }
.viewsw { display: none; } .viewsw button[aria-pressed=true] { background: var(--acc); color: var(--accfg); border-color: var(--acc); }

/* tab strip of one column */
.tabs { display: flex; gap: 2px; padding: 4px 8px 0; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.tab { background: transparent; color: var(--fg); border: 1px solid transparent; border-bottom: 0; padding: 4px 10px; font-size: 12px; font-weight: 700; letter-spacing: .05em; white-space: nowrap; border-radius: 3px 3px 0 0; }
.tab[aria-selected=true] { background: var(--acc); color: var(--accfg); }
.tab:hover:not([aria-selected=true]) { border-color: var(--line); }

/* the three columns */
#main { flex: 1; min-height: 0; padding: 10px 16px; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1fr); align-content: stretch; background: var(--page, var(--bg)); }
#main[data-place=right] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr); }
#main.empty { display: block; }
.welcome { padding: 40px 10px; max-width: 560px; font-size: 15px; }
.col { min-width: 0; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); overflow: hidden; }
.colhead { padding: 6px 8px 4px; }
.rowhead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rowhead b { letter-spacing: .06em; }
.rowhead .snd { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--dim); }
.seldot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--fg); } .seldot.on { background: var(--fg); }
.colbody { flex: 1; min-height: 0; overflow: auto; padding: 8px; }
.tabbody { display: flex; flex-direction: column; gap: 8px; }
.card { margin: 0; border: 1px solid var(--line); background: var(--bg); padding: 4px 8px 6px; border-radius: 2px; }
.card h3 { margin: 0 0 2px; font-size: 11px; letter-spacing: .08em; font-weight: 700; } .card h3 small { font-weight: 400; letter-spacing: 0; color: var(--dim); }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 8px; }
.grid2 .card { min-width: 0; } .grid2 input[type=file] { max-width: 100%; }
.mixrow { display: grid; grid-template-columns: 56px repeat(3, minmax(0, 1fr)); gap: 12px; align-items: center; margin: 2px 0; }
.mixrow > b { font-size: 11px; letter-spacing: .06em; }

.cell { min-width: 0; padding: 1px 0; }
.cell .top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-size: 11px; letter-spacing: .05em; color: var(--dim); height: 16px; }
.cell .right { white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.cell .val { font-size: 13px; font-weight: 700; color: var(--fg); letter-spacing: 0; }
.cell .lab { flex: 1; min-width: 0; font-weight: 700; color: var(--fg); cursor: default; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell .unit { font-size: 10px; font-weight: 400; color: var(--dim); margin-left: 2px; letter-spacing: 0; }
.cell input[type=range] { width: 100%; margin: 0; height: 16px; accent-color: var(--acc); }
.cell select { width: 100%; height: 22px; padding: 0 2px; font-size: 12px; }
.segs { display: flex; height: 22px; } .seg { flex: 1 1 auto; padding: 0 4px; font-size: 11px; background: transparent; color: var(--fg); border-color: var(--line); border-radius: 0; min-width: min-content; white-space: nowrap; }   /* sized by their text: no 'MONC', no 'AUTC' */
.seg.on { background: var(--acc); color: var(--accfg); border-color: var(--acc); }
.cell.gone { visibility: hidden; }   /* a control that does not apply: not shown, its place stays empty (the unit leaves the card's column empty) */
.readonly .cell { opacity: .5; pointer-events: none; }

.mrow { display: grid; grid-template-columns: 18px 1fr 1.6fr 1.3fr; gap: 10px; align-items: center; margin: 1px 0; }
.mrow .mn { font-weight: 700; color: var(--dim); font-size: 12px; }

.patches { display: grid; grid-template-rows: minmax(0, 1.2fr) auto; gap: 8px; min-height: 0; height: 100%; }
.pleft { display: flex; flex-direction: column; min-height: 0; } .pright { overflow: auto; }
.pleft .row input[type=search] { flex: 1; }
.plist { list-style: none; margin: 4px 0 0; padding: 0; overflow: auto; flex: 1; min-height: 120px; border: 1px solid var(--line); background: var(--bg); }
.plist li { display: grid; grid-template-columns: 16px 40px minmax(0, 1fr) 58px 48px; gap: 6px; align-items: center; padding: 3px 8px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 13px; }
.plist li .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .plist li input[type=checkbox] { margin: 0; }
.plist li.saved .n { font-weight: 700; } .plist li:not(.saved) .n { font-weight: 400; opacity: .85; }
.plist li.sel { background: var(--acc); color: var(--accfg); } .plist li .k, .plist li .e, .plist li .c { font-size: 11px; opacity: .7; }
.pdetail h3 { margin: 8px 0 4px; font-size: 13px; }
.pdetail input[type=text] { flex: 1; }
.multis { display: grid; gap: 2px; }
.mrow2 { display: grid; grid-template-columns: 44px 1fr 120px auto auto auto; gap: 8px; align-items: center; padding: 2px 6px; border-bottom: 1px solid var(--line); }
.menu { display: grid; grid-template-columns: 1fr; gap: 6px; align-items: start; }
.menu .card:nth-child(n) .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.learn .lrow { display: grid; grid-template-columns: 70px 70px 1fr auto; gap: 8px; padding: 2px 0; align-items: center; }

.sgrid { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 2px; margin: 4px 0; }
.st { padding: 3px 0; font-size: 11px; background: transparent; color: var(--fg); border-color: var(--line); min-width: 0; }
.st.on { background: var(--panel); font-weight: 700; } .st.sel { outline: 2px solid var(--fg); }
.sedit { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.sedit label { display: flex; gap: 4px; align-items: center; } .sedit input[type=range] { width: 90px; } .sedit input[type=number] { width: 56px; }

.betawarn { margin: 0; padding: 2px 16px; font-size: 12px; color: var(--warn); border-bottom: 1px solid var(--line); }
#foot { display: flex; align-items: center; gap: 16px; padding: 4px 16px; border-top: 1px solid var(--line); min-height: 28px; flex-wrap: wrap; }
.msg { font-weight: 600; font-size: 13px; } .msg.warn { color: var(--warn); } .msg.good { color: var(--ok); } .right { margin-left: auto; }
dialog.ask { background: var(--bg); color: var(--fg); border: 1px solid var(--fg); max-width: 520px; padding: 16px 20px; } dialog.ask.wide { max-width: 760px; max-height: 80vh; overflow: auto; }
dialog.ask::backdrop { background: rgba(0, 0, 0, .5); } dialog.ask h2 { margin: 0 0 8px; font-size: 17px; } dialog.ask input { width: 100%; margin: 6px 0; }


.gbody { height: 100%; display: flex; flex-direction: column; } .gbody > .patches, .gbody > .multis { flex: 1; min-height: 0; }
.mrow { grid-template-columns: 18px minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1.2fr); gap: 8px; margin: 3px 0; }
.tabbody.matrix .mrow { margin: 6px 0; }
.sedit input[type=range] { width: 70px; } input[type=range], input[type=checkbox] { accent-color: var(--acc); }

/* no page scroll from 1000 x 600 up */
@media (min-width: 1000px) and (min-height: 600px) { html, body { height: 100%; overflow: hidden; } #main { overflow: hidden; } }
/* tall screens (1080 and up): roomier controls so the tabs fill the height */
@media (min-height: 900px) {
  .colbody { padding: 10px; } .tabbody { gap: 10px; } .card { padding: 6px 10px 10px; } .card h3 { font-size: 12px; margin-bottom: 4px; }
    .grid { gap: 8px 14px; } .cell .top { height: 20px; font-size: 12px; } .cell .val { font-size: 14px; } .cell input[type=range] { height: 22px; } .cell select, .segs { height: 28px; }
  .tab { padding: 6px 14px; font-size: 13px; } .colhead { padding: 10px 10px 6px; } .mrow { margin: 8px 0; } .sgrid { gap: 4px; } .st { padding: 6px 0; }
}
/* browser windows under 1000 px high (1080 screens with the browser's own bars): tighter panels so the MOD tab still fits */
@media (min-height: 900px) and (max-height: 999px) { .grid { gap: 4px 14px; } .card { padding: 4px 10px 6px; } .tabbody { gap: 6px; } .cell .top { height: 16px; } .cell input[type=range] { height: 18px; } .cell select, .segs { height: 24px; } .card h3 { margin-bottom: 1px; } }
/* low screens (720): compact */
@media (max-height: 800px) { #top { padding: 6px 16px; gap: 12px; } .brand .dev { width: 44px; height: 44px; } .brand { gap: 14px; } .title { gap: 4px; } .title h1 img { height: 18px; } .title p { font-size: 11px; }
  .right-side { gap: 3px; } #foot { padding: 2px 16px; min-height: 22px; } .colhead .grid3, .colhead .grid4 { gap: 8px; } }
/* below 1500: PART 1 | PART 2, the GLOBAL column is a view of its own (the PARTS / GLOBAL switch) */
@media (max-width: 1499px) {
  .viewsw { display: inline-flex; } #placeglobal { display: none; }
  #main, #main[data-place=right] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #main[data-view=parts] .col.glob { display: none; }
  #main[data-view=global] .col.part { display: none; }
  #main[data-view=global] { grid-template-columns: minmax(0, 1fr); }
  #main[data-view=global] .col.glob { display: flex; }
  #main[data-view=global] .tabbody { display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
}
@media (min-width: 1500px) { .viewsw { display: none; } }
@media (max-width: 999px) { #main, #main[data-place=right], #main[data-view=global] { grid-template-columns: 1fr; } .colbody { overflow: visible; } .menu { grid-template-columns: 1fr; } }
@media (max-height: 599px) { .colbody { overflow: visible; } }

/* the owner's header image: white artwork, 50 px of breathing space built into the file; inverted on light palettes */
.brand .hdr { height: 84px; width: auto; display: block; margin: -6px 0 -6px -18px; }
html:not([data-scheme=dark]) .brand .hdr { filter: invert(1); }
@media (max-height: 800px) { .brand .hdr { height: 64px; } }

/* the library (patches_ui.js, dropzone.js): drop targets, the wide view, the import preview */
.dropping { outline: 2px dashed var(--fg); outline-offset: -3px; }
body.dragfiles .col.part, body.dragfiles .col.glob { outline: 2px dashed var(--line); outline-offset: -3px; }
.plist li.dropok, .tile.dropok { outline: 2px solid var(--fg); outline-offset: -2px; } .plist li.dragging, .tile.dragging { opacity: .45; }
.plist li.sel .n, .plist li.sel .k, .plist li.sel .e, .plist li.sel .c { color: var(--accfg); }
.hint { margin: 2px 2px 4px; } .pleft .row { margin: 3px 0; gap: 6px; }
.grow { flex: 1; }
.pwide { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 20; background: var(--bg); color: var(--fg); border: 1px solid var(--fg); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.pgrid { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 3px; flex: 1; min-height: 0; align-content: start; }
@media (max-width: 1500px) { .pgrid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (max-width: 800px) { .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 0 4px; padding: 3px 5px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 12px; min-width: 0; min-height: 42px; }
.tile .k { grid-column: 1; font-size: 10px; opacity: .65; } .tile .e { grid-column: 2; grid-row: 1; font-size: 10px; opacity: .65; }
.tile .n { grid-column: 1 / 3; grid-row: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.tile.saved { border-color: var(--fg); background: var(--bg); } .tile.saved .n { font-weight: 700; }
.tile.sel { background: var(--acc); color: var(--accfg); border-color: var(--acc); } .tile.miss { opacity: .3; }
.segs .seg.ghost { background: transparent; color: var(--fg); } .segs .seg.ghost.on { background: var(--acc); color: var(--accfg); }
dialog.ask.imp { width: min(920px, 94vw); max-width: 94vw; max-height: 88vh; overflow: auto; }
.imptable { border: 1px solid var(--line); max-height: 44vh; overflow: auto; margin: 6px 0; }
.imphead, .improw { display: grid; grid-template-columns: 22px minmax(120px, 1.4fr) 70px 90px 64px minmax(120px, 1.6fr); gap: 8px; align-items: center; padding: 2px 8px; border-bottom: 1px solid var(--line); font-size: 12px; }
.imphead { position: sticky; top: 0; background: var(--panel); font-weight: 700; letter-spacing: .04em; } .improw.off { opacity: .45; } .improw .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.improw input[type=number] { width: 100%; padding: 1px 3px; } .imphead input, .improw input[type=checkbox] { margin: 0; }
.rep.lose { color: var(--warn); font-weight: 600; } .sum { font-weight: 600; margin: 4px 0; } .chk { display: flex; gap: 6px; align-items: center; font-size: 13px; } .chk input { width: auto; margin: 0; }
dialog.ask progress { width: 100%; height: 14px; accent-color: var(--acc); } ul.effects { margin: 6px 0; padding-left: 18px; font-size: 13px; }
dialog.ask input[type=number] { width: 90px; }
[hidden] { display: none !important; }
dialog.ask .chk input, dialog.ask input[type=checkbox] { width: auto; margin: 0; }
dialog.ask .improw input[type=number] { width: 100%; margin: 0; } dialog.ask .row input[type=number] { width: 90px; margin: 0; }
dialog.ask .row > label.row { margin: 0; }
.pgrid { align-content: stretch; grid-auto-rows: minmax(44px, 1fr); }
/* ---- 0.2.19: the piano roll (rollview.js). One text style per panel: 12 px labels, 10 px only on the keys and in the lane. */
.tabbody.rolltab { height: 100%; }
.roll { display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 380px; min-width: 0; }
.rollctl { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rolltools { display: flex; flex-wrap: wrap; gap: 3px 10px; align-items: center; font-size: 12px; }
.rolltools button { font-weight: 700; letter-spacing: .03em; padding: 2px 7px; }
.rolltools .tg { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.rolltools select { height: 22px; padding: 0 2px; font-size: 12px; }
.livebox { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; user-select: none; font-size: 12px; }
.rollnote { margin: 0; color: var(--fg); border-left: 3px solid var(--acc); padding: 2px 8px; background: var(--bg); }
.rollnote[hidden], .roll [hidden] { display: none !important; }
.rollbody { flex: 1; min-height: 0; display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: 18px minmax(0, 1fr) auto; border: 1px solid var(--line); background: var(--bg); position: relative; }
.rollbody .corner { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; gap: 2px; align-items: center; justify-content: center; }
.zb { width: 22px; height: 16px; padding: 0; font-size: 12px; line-height: 1; background: transparent; color: var(--fg); border: 1px solid var(--line); border-radius: 2px; } .zb:hover:not(:disabled) { border-color: var(--fg); }
.rruler { overflow: hidden; position: relative; border-bottom: 1px solid var(--line); }
.rulerin { position: relative; height: 17px; }
.rtick { position: absolute; top: 0; height: 17px; padding-left: 3px; font-size: 10px; line-height: 17px; color: var(--dim); border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.rtick.bar { color: var(--fg); font-weight: 700; border-left-color: var(--dim); }
.rkeys { overflow: hidden; border-right: 1px solid var(--line); }
.keysin { position: relative; }
.keysin .k { box-sizing: border-box; font-size: 10px; line-height: 1; display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; border-bottom: 1px solid #9a9a9a; overflow: hidden; white-space: nowrap; }
.keysin .k.w { background: #f4f4f4; color: #222; } .keysin .k.b { background: #2a2a2a; color: #eee; margin-right: 0; } .keysin .k.c { border-bottom-color: #222; font-weight: 700; }
.rwrap { position: relative; min-height: 0; min-width: 0; display: grid; }
.rscroll { overflow: auto; min-height: 0; min-width: 0; }
.rgrid { position: relative; outline: none; cursor: crosshair; touch-action: none; user-select: none; }
.rgrid:focus-visible { outline: 2px solid var(--fg); outline-offset: -2px; }
.rrow { box-sizing: border-box; border-bottom: 1px solid color-mix(in srgb, var(--fg) 9%, transparent); }
.rrow.blk { background: color-mix(in srgb, var(--fg) 7%, transparent); }
.rrow.out { background: color-mix(in srgb, var(--fg) 11%, transparent); }
.rrow.rt { background: color-mix(in srgb, var(--acc) 16%, transparent); }
.rrow.oct { border-bottom-color: color-mix(in srgb, var(--fg) 40%, transparent); }
.rrow.zero { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.vlines { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to right, color-mix(in srgb, var(--fg) 12%, transparent) 1px, transparent 1px), linear-gradient(to right, color-mix(in srgb, var(--fg) 26%, transparent) 1px, transparent 1px), linear-gradient(to right, color-mix(in srgb, var(--fg) 60%, transparent) 1px, transparent 1px); }
.rnotes { position: absolute; inset: 0; pointer-events: none; }
.rnote { position: absolute; box-sizing: border-box; background: var(--acc); color: var(--accfg); border: 1px solid var(--bg); border-radius: 2px; overflow: hidden; font-size: 10px; line-height: 13px; }
.rnote .nn { padding-left: 3px; white-space: nowrap; }
.rnote.sel { outline: 2px solid var(--fg); outline-offset: 1px; z-index: 2; box-shadow: 0 0 0 1px var(--bg); }
.rnote.acc { border-top: 3px solid var(--warn); }
.rnote.prob { border-style: dashed; border-color: var(--accfg); }
.rnote.sld::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(135deg, transparent 50%, var(--accfg) 50%); opacity: .8; }
.rnote .rat { position: absolute; left: 0; bottom: 0; height: 3px; background-image: repeating-linear-gradient(to right, var(--accfg) 0 60%, transparent 60% 100%); }
.rcur { position: absolute; display: none; box-sizing: border-box; border: 2px dashed var(--fg); pointer-events: none; z-index: 3; }
.rollload { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--dim); font-size: 13px; }
.lhead { border-top: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.lswitch { display: flex; flex-direction: column; justify-content: stretch; }
.lbtn { flex: 1; min-height: 0; padding: 0; font-size: 10px; background: transparent; color: var(--fg); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; letter-spacing: .03em; }
.lbtn[aria-pressed=true] { background: var(--acc); color: var(--accfg); }
.lflag { height: 18px; font-size: 10px; line-height: 18px; padding-left: 4px; color: var(--dim); border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.lscroll { overflow: hidden; border-top: 1px solid var(--line); min-width: 0; }
.lanein { position: relative; }
.lanegrid { position: relative; cursor: ns-resize; touch-action: none; user-select: none; background-image: linear-gradient(to right, color-mix(in srgb, var(--fg) 12%, transparent) 1px, transparent 1px); }
.lbar { position: absolute; bottom: 0; background: var(--acc); opacity: .75; border-radius: 1px 1px 0 0; pointer-events: none; }
.lbar.acc { background: var(--warn); opacity: .9; }
.lv { position: absolute; top: -13px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--fg); }
.lbar { overflow: visible; }
.lv.in { top: 1px; color: var(--accfg); }
.flagrow { position: relative; height: 18px; border-top: 1px solid var(--line); }
.fl { position: absolute; top: 2px; height: 14px; padding: 0; background: transparent; border: 1px solid var(--line); border-radius: 2px; box-sizing: border-box; }
.fl.on { background: var(--acc); border-color: var(--acc); } .fl.off { visibility: hidden; }
.rollstatus { font-size: 12px; color: var(--dim); min-height: 18px; overflow-wrap: anywhere; }
.rollpend { color: var(--warn); }
/* the full-width overlay */
.rolloverlay { position: fixed; z-index: 40; background: var(--page, var(--bg)); display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--fg); }
.ovhead { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ovhead b { letter-spacing: .06em; } .ovhead .tg { display: inline-flex; gap: 2px; }
.ovhead .tg button[aria-pressed=true] { background: var(--acc); color: var(--accfg); border-color: var(--acc); }
.ovbody { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.ovpane { flex: 1 0 auto; min-height: 0; display: flex; flex-direction: column; gap: 2px; background: var(--panel); color: var(--fg); padding: 6px 8px; border: 1px solid var(--line); }
.ovtitle { display: flex; gap: 10px; align-items: baseline; }
.ovpane .roll { min-height: 300px; }
.ovbody[data-both=false] .ovpane { flex: 1 1 0; min-height: 0; } .ovbody[data-both=false] .ovpane .roll { min-height: 0; }
.ovbody[data-both=true] .ovpane { flex: 1 1 0; min-height: 330px; }
@media (max-height: 800px) { .rollctl { gap: 4px 12px; } }
@media (max-width: 999px) { .tabbody.rolltab { height: 560px; } }
