/* Digivice Color Modifier - "plum & lavender" dark theme (matches the Crest of Kindness logo) */
:root {
  color-scheme: dark;
  --bg: #1c1825; --panel: #25202f; --panel2: #2d2738; --line: #362f43; --line2: #453d56;
  --text: #e2dfe9; --muted: #a198b3; --faint: #786f8c;
  --accent: #bc98f9; --accent2: #d1b9fe; --accent-bg: #4f4365; --crest: #fea3fc; --orange: #f4c459; --green: #7bd88f; --red: #f17b7b; --blue: #7fb5ff;
  --radius: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; }
#app { display: flex; flex-direction: column; height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: #322b3f; border: 1px solid #473f58; color: var(--text); border-radius: 5px; padding: 6px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
button:hover:not(:disabled) { background: #3f374e; }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #262033; font-weight: 650; }
button.primary:hover:not(:disabled) { background: var(--accent2); }
button.danger { color: var(--red); border-color: #6b3b3b; }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover:not(:disabled) { background: #352e42; }
button.icon-only { padding: 6px; }
button.small { padding: 3px 8px; font-size: 12px; }
input, select, textarea { background: #1a1623; border: 1px solid #463c57; border-radius: 4px; padding: 6px 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9f87cb; outline-offset: -1px; }
input[type=number] { width: 90px; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
input.bad { border-color: var(--red); }
.icon { flex-shrink: 0; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.spacer { flex: 1; }
canvas.pic, .pic { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--accent2); }

/* top bar */
.topbar { height: 48px; flex-shrink: 0; display: flex; align-items: center; gap: 4px; padding: 0 10px; background: #292333; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 7px; margin-right: 10px; cursor: pointer; flex-shrink: 0; }
.brand-logo { width: 32px; height: 32px; display: block; filter: drop-shadow(0 0 6px #fea3fc40); }
.brand-name { font-size: 14px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; background: linear-gradient(90deg, var(--crest), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar.has-tools .brand-name { display: none; }
@media (max-width: 1250px) { .brand-name { display: none; } }
.topbar .sep { width: 1px; height: 22px; background: var(--line2); margin: 0 6px; }
.file-label { color: var(--muted); font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-search { width: 260px; margin-right: 6px; }
.back-btn { background: #bc98f914; border-color: #bc98f950; color: var(--accent2); margin-right: 4px; gap: 5px; }
.back-btn:hover:not(:disabled) { background: #bc98f92e; }
.back-btn .back-label { color: var(--muted); font-size: 12px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.back-btn .back-label::before { content: '· '; }
.back-btn[hidden] { display: none; }
.save-group { display: inline-flex; align-items: stretch; }
.save-group .save-bin { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.save-group .save-more { padding: 6px 5px; margin-left: 1px; border-top-left-radius: 0; border-bottom-left-radius: 0; color: #262033; }
.leave-box p { margin: 0 0 8px; line-height: 1.5; }
.ws-tools { display: flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; }
.ws-tools:empty { display: none; }
.topbar.has-tools { height: auto; min-height: 48px; flex-wrap: wrap; padding: 5px 10px; row-gap: 5px; }
.topbar.has-tools .file-label { display: none; }
.topbar.has-tools .global-search { width: 160px; }
.topbar.has-tools .tb-label { display: none; }
/* (1.45) a screen's tools take the room left and wrap inside it, so Save .bin stays in the first row */
.topbar.has-tools .ws-tools { flex: 1 1 0; }
.topbar.has-tools .ws-tools > * { flex: 1 1 auto; min-width: 0; }
.topbar.has-tools .spacer { flex: 0 0 4px; }
.status-file { color: var(--faint); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* body */
.body { flex: 1; display: flex; min-height: 0; }
.nav { width: 200px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 6px 0 20px; }
.nav-group { padding: 2px 0 6px; }
.nav-title { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); padding: 10px 14px 4px; }
.nav-item { width: 100%; justify-content: flex-start; background: none; border: 0; border-radius: 0; padding: 7px 14px; color: #cdc8d9; gap: 10px; }
.nav-item:hover { background: #312a3e !important; }
.nav-item.active { background: var(--accent-bg) !important; color: #d8c5fe; box-shadow: inset 3px 0 var(--accent); }
.nav-item[hidden], .nav-group[hidden] { display: none; }
/* the Scene Editor needs the room: the navigation shows its icons only (names in the tooltips) */
.nav.collapsed { width: 52px; overflow-x: hidden; }
.nav.collapsed .nav-title { height: 1px; padding: 0; margin: 8px 10px; background: var(--line); color: transparent; overflow: hidden; }
.nav.collapsed .nav-item { justify-content: center; padding: 8px 0; }
.nav.collapsed .nav-item span { display: none; }
/* highlighted actions (Add Warp Evolution Animations?) */
button.highlight { background: linear-gradient(135deg, #ffb347, #ff5fa2); border-color: #ff8fbd; color: #2a1626; font-weight: 700; box-shadow: 0 0 0 1px #ff5fa255, 0 0 12px #ff5fa244; }
button.highlight:hover:not(:disabled) { background: linear-gradient(135deg, #ffc56b, #ff7ab4); }
button.highlight svg { color: #2a1626; }
.center { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.workspace { flex: 1; min-height: 0; position: relative; }
.ws { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.ws[hidden] { display: none; }
.ws-header { display: flex; align-items: center; gap: 12px; padding: 12px 18px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.ws-header h1 { font-size: 18px; margin: 0; font-weight: 700; }
.ws-sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.ws-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ws-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.ws-layout.with-library { grid-template-columns: 260px minmax(0, 1fr) 360px; }
.ws-library { border-right: 1px solid var(--line); overflow-y: auto; background: #211d2b; }
.ws-main { overflow: auto; padding: 14px 18px 40px; min-width: 0; }
.ws-inspector { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 12px 14px 40px; }
.ws-inspector h2 { font-size: 15px; margin: 2px 0 10px; display: flex; align-items: center; gap: 10px; }
.inspector-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.inspector-head .big-pic { background: #16121d; border: 1px solid var(--line); border-radius: 8px; }
.inspector-head h2 { margin: 0; }
.inspector-head .sub { color: var(--muted); font-size: 12px; }
.empty-inspector { color: var(--muted); padding: 30px 6px; text-align: center; }
.error-box { margin: 20px; padding: 14px; border: 1px solid #6b3b3b; background: #3a2428; border-radius: 8px; }

/* statusbar */
.statusbar { height: 28px; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-top: 1px solid var(--line); background: #231e2d; font-size: 12px; color: var(--muted); }
.status-changes { color: var(--orange); }

/* library dock */
.library { height: clamp(140px, 27vh, 230px); flex-shrink: 0; border-top: 1px solid var(--line2); background: #201c2a; display: flex; flex-direction: column; position: relative; }
.lib-resize { position: absolute; top: -4px; left: 0; right: 0; height: 8px; cursor: ns-resize; z-index: 5; }
.lib-resize:hover { background: linear-gradient(transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px); }
@media (max-width: 1500px) { .lib-hint { display: none; } }
.library.collapsed, .library.ws-hidden { display: none; }
.lib-head { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.lib-title { font-weight: 650; display: flex; align-items: center; gap: 4px; margin-right: 6px; }
.lib-hint { color: var(--faint); font-size: 11px; margin-right: 8px; }
.lib-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.lib-tab { padding: 3px 8px; font-size: 12px; background: transparent; border-color: transparent; color: var(--muted); }
.lib-tab.on { background: var(--accent-bg); color: #d8c5fe; border-color: #796998; }
.lib-search { margin-left: auto; width: 180px; padding: 4px 8px; }
.lib-body { flex: 1; overflow-y: auto; padding: 8px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.lib-more { margin: 8px auto 0; display: flex; }

/* cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.card-grid.small { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px 6px; border: 1px solid var(--line); border-radius: 8px; background: #221e2c; cursor: pointer; user-select: none; text-align: center; min-width: 0; }
.card:hover { border-color: #625a73; background: #282232; }
.card.selected { border-color: var(--accent); background: #3a324b; box-shadow: 0 0 0 1px var(--accent) inset; }
.card .pic, .card .pic-icon { background: radial-gradient(#2d2738, #191521); border-radius: 6px; }
.card-text { min-width: 0; width: 100%; }
.card-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.compact { flex-direction: row; padding: 4px 6px; text-align: left; gap: 8px; }
.card.compact .card-name { font-size: 11.5px; }
.card.none { justify-content: center; }
.badges { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 8px; background: #3c344b; color: #dcd8e6; }
.badge.boss { background: #6a3c2a; color: #ffdcb0; }
.badge.secret { background: #2f3f5e; color: #bfd8ff; }
.badge.event { background: #2e4a3a; color: #bff0cf; }
.badge.changed { background: #5b4d21; color: #ffe6a0; }
.badge.warn { background: #5e2f2f; color: #ffc2c2; }
.pic-icon { display: flex; align-items: center; justify-content: center; color: var(--faint); background: #1b1724; border-radius: 6px; flex-shrink: 0; }
[draggable=true] { cursor: grab; }
body.dragging-ref .can-drop { box-shadow: 0 0 0 2px #9f87cb, 0 0 12px #9f87cb88; }
.drop-hover { box-shadow: 0 0 0 2px var(--accent2), 0 0 16px #bc98f9aa !important; background: #453a59 !important; }

/* slots */
.slot { display: inline-flex; flex-direction: column; gap: 3px; min-width: 96px; max-width: 100%; cursor: pointer; vertical-align: top; }
.slot.wide { display: flex; }
.slot-label { font-size: 11px; color: var(--muted); }
.slot-body { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border: 1px dashed #5c556b99; border-radius: 8px; background: #1e1a27; min-height: 40px; }
.slot:hover .slot-body { border-color: var(--accent); background: #272034; }
.slot.empty .slot-body { color: var(--faint); }
.slot.changed .slot-body { border-style: solid; border-color: var(--orange); }
.slot .pic { background: radial-gradient(#2d2738, #191521); border-radius: 6px; flex-shrink: 0; }
.slot-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.slot-name small { color: var(--faint); }
.slot-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; margin: 6px 0; }

/* fields */
.field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.field-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.field-label small { color: var(--faint); }
.field-input { display: flex; align-items: center; gap: 8px; }
.field-input .slider { flex: 1; min-width: 60px; accent-color: var(--accent); }
.field.changed > .field-label, .check.changed span { color: var(--orange); }
.field.changed input { border-color: #8c752e; }
.field-hint { font-size: 11px; color: var(--faint); }
.field-error { font-size: 11.5px; color: var(--red); }
.unit { color: var(--muted); font-size: 11.5px; }
.revert { padding: 1px 4px; background: transparent; border: 0; color: var(--orange); }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; cursor: pointer; }
.toggles { display: flex; flex-wrap: wrap; gap: 0; }
.toggle { border-radius: 0; margin-left: -1px; padding: 5px 10px; font-size: 12px; }
.toggle:first-child { border-radius: 5px 0 0 5px; margin-left: 0; }
.toggle:last-child { border-radius: 0 5px 5px 0; }
.toggle.on { background: var(--accent-bg); border-color: #9680bf; color: #d8c6fe; position: relative; z-index: 1; }
.toggle:disabled { opacity: .4; cursor: not-allowed; }
.toggle.on:disabled { opacity: .75; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.section { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 6px; }
.section > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px; font-weight: 650; padding: 8px 0; color: #e1ddeb; user-select: none; }
.section > summary::-webkit-details-marker { display: none; }
.section > summary::before { content: '▸'; color: var(--faint); font-size: 11px; width: 10px; }
.section[open] > summary::before { content: '▾'; }
.section-actions { margin-left: auto; display: flex; gap: 4px; font-weight: 400; }
.note { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
.note-box { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 6px; margin: 8px 0; font-size: 12px; line-height: 1.5; }
.note-box.info { background: #2c243c; border: 1px solid #34405e; color: #dacff3; }
.note-box.warn { background: #3a2a22; border: 1px solid #6d532c; color: #f8ddae; }
.note-box.ok { background: #1f3326; border: 1px solid #2f6b44; color: #c9f2d6; }
.note-box .icon { margin-top: 1px; }
.text-edit { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; }
.text-preview-box { background: #100d16; border: 1px solid var(--line); border-radius: 6px; padding: 6px; overflow-x: auto; min-height: 44px; }
.text-preview { image-rendering: pixelated; display: block; }
.glyph-help { font-size: 10.5px; color: var(--faint); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; }
.glyph-chip { padding: 1px 7px; font-size: 10.5px; border-radius: 10px; background: transparent; border: 1px solid var(--line2); color: var(--muted); gap: 3px; }
.glyph-chip:hover:not(:disabled) { background: #3a3150; color: var(--text); }
.glyph-chip b { color: var(--accent2); font-weight: 700; }
.sprites-btn { width: 100%; justify-content: center; margin: 12px 0 4px; padding: 8px 10px; font-weight: 600; border-color: #6c5a8c; background: #3a3150; }
.sprites-btn:hover:not(:disabled) { background: #46395f; }

/* sequences */
.sequence { display: flex; flex-wrap: wrap; gap: 4px; }
.seq-cell { position: relative; display: flex; flex-direction: column; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #1e1a27; cursor: grab; min-width: 34px; }
.seq-cell:hover { border-color: var(--accent); }
.seq-cell.changed { border-color: var(--orange); }
.seq-index { font-size: 9px; color: var(--faint); line-height: 1; margin-bottom: 2px; }
.seq-text { font-size: 11px; padding: 2px 3px; min-width: 22px; text-align: center; }

/* modal, picker, menus, toasts */
dialog.modal { background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 10px; padding: 0; width: min(560px, calc(100vw - 30px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px #000000aa; }
dialog.modal.wide { width: min(980px, calc(100vw - 30px)); }
dialog.modal::backdrop { background: #00000099; }
dialog.modal > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
dialog.modal > header h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 14px; overflow: auto; max-height: calc(100vh - 170px); }
dialog.modal > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.picker .search { width: 100%; margin-bottom: 10px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; max-height: 60vh; overflow: auto; padding: 2px; }
.picker-grid.list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.picker-grid.list .card { flex-direction: row; text-align: left; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { flex-direction: column; min-width: 80px; padding: 10px; }
.choice.on { background: var(--accent-bg); border-color: var(--accent); }
.ctx-menu { position: fixed; z-index: 1000; min-width: 210px; background: #2a2336; border: 1px solid #5a516d; border-radius: 7px; padding: 4px; box-shadow: 0 8px 28px #00000099; }
.ctx-menu button { display: flex; width: 100%; border: 0; background: none; padding: 7px 8px; justify-content: flex-start; }
.ctx-menu button:hover:not(:disabled) { background: #5d4f77; }
.ctx-menu button.danger { color: var(--red); }
.ctx-menu .sep { height: 1px; background: #453b57; margin: 4px 3px; }
.toasts { position: fixed; right: 16px; bottom: 40px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; }
.toast { display: flex; gap: 8px; align-items: center; background: #2e273b; border: 1px solid #4d4360; border-radius: 8px; padding: 9px 12px; max-width: 420px; box-shadow: 0 8px 24px #00000088; transition: opacity .3s, transform .3s; }
.toast.ok { border-color: #3c6b4a; }
.toast.error { border-color: #7a3b3b; background: #3a2528; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* tables */
table.report, table.grid { border-collapse: collapse; width: 100%; font-size: 12px; }
table.report th, table.report td, table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: left; }
table.grid td input { width: 70px; padding: 3px 5px; }
table.grid tr:hover td { background: #282232; }
table.grid tr.sel td { background: #3a324b; }

/* home */
.home { padding: 24px 28px; overflow-y: auto; height: 100%; }
.dropzone { border: 2px dashed #5f5672; border-radius: 16px; padding: 48px 20px; text-align: center; background: radial-gradient(#272034, #1e1a27); }
.dropzone h2 { margin: 10px 0 6px; font-size: 22px; }
.dropzone.drop-hover { border-color: var(--accent2); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 18px; }
.tile { border: 1px solid var(--line); border-radius: 12px; background: #221e2c; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.tile:hover { border-color: var(--accent); background: #272034; }
.tile h3 { margin: 0; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.tile p { margin: 0; color: var(--muted); font-size: 12px; }
.tile .pics { display: flex; gap: 4px; margin-top: auto; }
.tile.logo-tile { cursor: default; align-items: center; justify-content: center; text-align: center; gap: 6px; background: radial-gradient(circle at 50% 38%, #fea3fc1f, transparent 62%), #221e2c; }
.tile.logo-tile:hover { border-color: var(--line); background: radial-gradient(circle at 50% 38%, #fea3fc26, transparent 62%), #221e2c; }
.home-logo { width: 112px; height: 112px; display: block; filter: drop-shadow(0 0 12px #fea3fc55); }
.logo-name { font-size: 17px; font-weight: 800; background: linear-gradient(90deg, var(--crest), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dropzone .home-logo { margin: 0 auto 4px; }
.meter { height: 10px; background: #16121d; border-radius: 6px; overflow: hidden; display: flex; border: 1px solid var(--line); }
.meter span { display: block; height: 100%; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 4px 12px; font-size: 12.5px; }
.kv > :nth-child(odd) { color: var(--muted); }

/* boards */
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 10px; }
.lane { flex: 0 0 auto; width: 150px; border: 1px solid var(--line); border-radius: 10px; background: #201c2a; padding: 8px; }
.lane-title { font-size: 12px; font-weight: 650; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.lane .card { margin-bottom: 6px; }
.stage-band { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); margin: 8px 0 4px; }
.flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.round { width: 148px; border: 1px solid var(--line); border-radius: 10px; background: #221e2c; padding: 8px; cursor: pointer; position: relative; display: flex; flex-direction: column; gap: 4px; }
.round.selected { border-color: var(--accent); background: #3b324d; }
.round .round-no { font-size: 11px; color: var(--muted); }
.round .round-main { display: flex; gap: 6px; align-items: center; }
.round .round-info { font-size: 11px; color: var(--muted); }
.round .round-rewards { display: flex; gap: 4px; align-items: center; min-height: 26px; }
.round.boss { border-color: #8c6638; }
.round.event { border-color: #3a6a4a; }
.round.secret { border-color: #3a527a; border-style: dashed; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #352e43; color: #d6d2e0; }

/* graphics workspace */
.gfx-view { background: repeating-conic-gradient(#1c1825 0% 25%, #241f2e 0% 50%) 50% / 16px 16px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; min-height: 220px; padding: 10px; }
.frame-strip { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0; }
.frame-strip button { padding: 2px; flex-direction: column; font-size: 10px; gap: 1px; }
.frame-strip button.on { border-color: var(--accent); background: var(--accent-bg); }
.swatches { display: flex; flex-wrap: wrap; gap: 3px; }
.swatch { width: 20px; height: 20px; border-radius: 3px; border: 1px solid #00000088; cursor: pointer; position: relative; padding: 0; }
.swatch.transparent { background: repeating-conic-gradient(#66626f 0% 25%, #9995a2 0% 50%) 50% / 8px 8px; }
.swatch.changed::after { content: ''; position: absolute; top: -3px; right: -3px; width: 6px; height: 6px; background: var(--orange); border-radius: 50%; }

/* play */
.device { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; }
.device-shell { background: linear-gradient(160deg, #3f3551, #251f30); border-radius: 46px; padding: 28px 30px 30px; box-shadow: 0 18px 40px #00000099, inset 0 1px 0 #ffffff22; }
.device-screen { image-rendering: pixelated; background: #000000; border-radius: 6px; border: 6px solid #100f14; display: block; }
.device-buttons { display: grid; grid-template-columns: repeat(5, auto); gap: 10px; justify-content: center; margin-top: 16px; }
.dev-btn { width: 54px; height: 54px; border-radius: 50%; justify-content: center; font-weight: 700; background: #312840; border: 2px solid #504664; flex-direction: column; gap: 0; font-size: 11px; }
.dev-btn.held { background: var(--accent-bg); border-color: var(--accent); }
/* (1.41) the device's photo around the screen, the four arrows */
.device-shell.skin { background: none; box-shadow: none; padding: 0; border-radius: 0; display: flex; flex-direction: column; align-items: center; }
.skin-photo { position: relative; background-size: 100% 100%; background-repeat: no-repeat; filter: drop-shadow(0 14px 28px #00000080); }
.skin-photo .device-screen { border: 0; border-radius: 3px; }
.screen-wrap.round-lcd .device-screen { border-radius: 50%; }
.device-shell .device-buttons { display: flex; align-items: center; justify-content: center; gap: 26px; margin-top: 16px; grid-template-columns: none; }
.dpad { display: grid; grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(3, 54px); gap: 4px; }
.dev-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 260px; }
.dev-btn.extra-arrow { border-style: dashed; }
.skin-btn { position: absolute; cursor: pointer; border-radius: 10px; transition: background .08s, box-shadow .08s; touch-action: none; }
.skin-btn.round-btn { border-radius: 50%; }
.skin-btn.half-left { border-radius: 100% 0 0 100% / 50% 0 0 50%; }
.skin-btn.half-right { border-radius: 0 100% 100% 0 / 0 50% 50% 0; }
.skin-btn.half-top { border-radius: 100% 100% 0 0 / 100% 100% 0 0; }
.skin-btn.half-bottom { border-radius: 0 0 100% 100% / 0 0 100% 100%; }
.skin-btn:hover { box-shadow: 0 0 0 2px #ffffff66, 0 0 14px #ffffff55; }
.skin-btn.held { background: #ffffff55; box-shadow: 0 0 0 2px #ffffffaa, 0 0 18px #ffffff88; }
.play-controls { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
/* (1.42.2) the controls at the right of the device (below it when the window is too narrow) */
.play-layout { display: flex; align-items: flex-start; justify-content: center; gap: 28px; flex-wrap: wrap; }
.play-side { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 380px; max-width: 100%; padding-top: 10px; }
.play-side .play-controls { justify-content: flex-start; }
.play-controls .row-break { flex-basis: 100%; height: 0; }
.play-state { font: 12px ui-monospace, monospace; color: var(--muted); }

/* scenes workspace */
.scene-host { position: absolute; inset: 0; }

/* ---------- shared bits used by the later screens ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.sub-title { font-size: 14px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; }
.small-text { font-size: 11px; }
.users { display: flex; flex-direction: column; gap: 3px; }
.users .user { justify-content: flex-start; text-align: left; white-space: normal; }
.note-inline { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.field-grid.tight { gap: 0 8px; }
.field-grid.tight .field { margin: 2px 0; }
.field-grid.tight input[type=number] { width: 70px; }

/* templates & screens */
.screen-editor { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.screen-frame { background: #100d15; border: 1px solid var(--line2); border-radius: 8px; padding: 10px; line-height: 0; }
.screen-canvas { image-rendering: pixelated; cursor: grab; outline: none; display: block; }
.screen-canvas:active { cursor: grabbing; }
.screen-canvas.drop-hover { outline: 2px solid var(--accent); }
.screen-side { flex: 1; min-width: 240px; }
.screen-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.tlist { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.tcard { justify-content: flex-start; }
.tcard .card-name { display: flex; align-items: center; gap: 2px; }
.card-grid.screens { grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); }
.screen-thumb canvas { background: #100f14; border-radius: 4px; }

/* characters */
.ws-library .char-side { display: flex; flex-direction: column; height: 100%; }
.char-side-head { padding: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #211d2b; z-index: 1; }
.char-side-head .search { width: 100%; }
.char-side-head .note { margin: 6px 0 0; }
.char-list { display: flex; flex-direction: column; gap: 3px; padding: 6px; }
.char-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; padding: 8px; border: 1px dashed transparent; border-radius: 8px; }
.char-head h2 { margin: 0; font-size: 17px; }
.char-head.can-drop { border-color: var(--accent); }
.pose-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.pose-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 4px; border: 1px solid var(--line); border-radius: 8px; background: #221e2c; cursor: pointer; user-select: none; min-width: 0; }
.pose-cell:hover { border-color: var(--line2); background: #282232; }
.pose-cell.selected { border-color: var(--accent); background: var(--accent-bg); }
.pose-cell.empty { border-style: dashed; opacity: .55; }
.pose-cell.empty:hover { opacity: 1; }
.pose-cell.changed { box-shadow: inset 0 0 0 1px var(--orange); }
.pose-label { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pose-label b { color: var(--text); }
.pose-variant { font-size: 10px; color: var(--faint); text-align: center; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pose-cell.original { border-color: #b88fd8; background: linear-gradient(180deg, #fea3fc14, #221e2c 70%); }
.pose-cell.original .pose-label { color: var(--crest); }
.pose-cell.original.selected { border-color: var(--accent); background: var(--accent-bg); }
.pose-role { font-size: 12px; margin: -6px 0 8px; }
.pose-legend { display: flex; gap: 14px; align-items: center; font-size: 11px; color: var(--muted); margin: 0 0 8px; }
.pose-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid #b88fd8; background: #fea3fc22; vertical-align: -2px; margin-right: 5px; }
.pose-canvas { image-rendering: pixelated; width: 320px; max-width: 100%; border: 1px solid var(--line2); border-radius: 6px; cursor: grab; outline: none; display: block; margin: 6px 0; }
.pose-canvas.drop-hover { outline: 2px solid var(--accent); }
.part-row { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0; background: #221e2c; }
.part-row.selected { border-color: var(--orange); }
.part-head { display: flex; align-items: center; gap: 4px; }
.part-body { display: flex; gap: 8px; align-items: flex-start; }
.part-body .slot { flex-shrink: 0; }
.map-table { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; margin: 8px 0; }
.map-row { display: grid; grid-template-columns: 52px 1fr 20px 110px 60px; align-items: center; gap: 10px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.map-new { min-height: 48px; display: flex; align-items: center; }

/* text */
.text-list { display: flex; flex-direction: column; }
.text-row { display: grid; grid-template-columns: 44px 222px 1fr auto; align-items: center; gap: 10px; padding: 3px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.text-row:hover { background: #262030; }
.text-row.selected { background: var(--accent-bg); }
.text-row canvas { background: #0e0b12; border-radius: 3px; }
.text-id { font: 11px ui-monospace, monospace; color: var(--muted); text-align: right; }
.text-plain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.glyph-keys { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0 10px; }
.glyph { padding: 2px; min-width: 26px; height: 26px; justify-content: center; }
.glyph canvas { width: 16px; height: 16px; }
.glyph.wide { padding: 2px 6px; font-size: 12px; }
textarea.notes { width: 100%; max-width: 760px; }

/* sounds */
.sound-list { display: flex; flex-direction: column; }
.sound-row { display: grid; grid-template-columns: 30px 64px minmax(120px, 1fr) 60px 70px 70px 76px auto; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sound-row:hover { background: #262030; }
.sound-row.selected { background: var(--accent-bg); }
.sound-row.drop-hover { outline: 2px solid var(--accent); }
.sound-id { font: 11px ui-monospace, monospace; color: var(--muted); }
.sound-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-uses { font-size: 11.5px; color: var(--blue); }
.sound-actions { display: flex; gap: 3px; }

/* play */
.screen-wrap { position: relative; line-height: 0; }
.play-overlay { position: absolute; inset: 6px; background: #000000cc; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; line-height: 1.4; border-radius: 4px; }
.play-overlay[hidden], .play-banner[hidden] { display: none; }
.play-banner { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: #3a3020; border: 1px solid #6c602f; }
.dev-btn.power { width: 40px; height: 40px; align-self: center; font-size: 15px; opacity: .85; }
.dev-btn small { font-size: 9px; font-weight: 500; color: var(--muted); }
.play-controls .toggles { margin: 0; }

/* advanced */
.adv-body { padding: 12px 18px 40px; }
.const-row { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); padding: 4px 0; }
.const-info p { margin: 0 0 2px; font-size: 12px; color: var(--muted); }
.tables-view { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }
.table-names { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; max-height: calc(100vh - 190px); overflow-y: auto; }
.table-names .search { margin-bottom: 6px; }
.table-name { justify-content: space-between; background: transparent; border-color: transparent; text-align: left; padding: 4px 8px; white-space: normal; }
.table-name.on { background: var(--accent-bg); border-color: var(--accent); }
.table-main h3 { margin: 0 0 4px; }
.grid-wrap { overflow-x: auto; }
table.grid td.changed input { border-color: var(--orange); color: var(--orange); }
.cell-hint { font-size: 10.5px; color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-grid td input { width: 54px; }
.history-list { font-size: 12.5px; line-height: 1.7; max-height: 50vh; overflow-y: auto; }
.search-results { display: flex; flex-direction: column; gap: 10px; }
.search-group h3 { font-size: 13px; color: var(--muted); margin: 4px 0 6px; }
dialog.modal:focus { outline: none; }

/* added partners and forms */
.roster-enable { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.feature-on { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.feature-on .note-box { flex: 1 1 320px; margin: 0; }
.roster-enable button.warp-done svg { color: #1d5c2e; }
/* (1.41) Apply All Special Mods: the main button of the bar (gold, larger, glowing), apart from the orange Add …? buttons */
.roster-enable button.all-mods-btn { background: linear-gradient(135deg, #fff3a0, #ffd23f 35%, #ff9d00 75%, #ff6a00); border: 2px solid #fff1b8; color: #3a1d00; font-weight: 900; font-size: 14px; letter-spacing: .03em; padding: 9px 18px; text-transform: uppercase; box-shadow: 0 0 0 2px #ff9d0066, 0 0 22px #ffc93c99, 0 4px 14px #00000066; animation: allmods-glow 2.4s ease-in-out infinite; }
.roster-enable button.all-mods-btn:hover:not(:disabled) { background: linear-gradient(135deg, #fff8c4, #ffe066 35%, #ffb02e 75%, #ff7d1a); }
.roster-enable button.all-mods-btn svg { color: #3a1d00; }
@keyframes allmods-glow { 0%, 100% { box-shadow: 0 0 0 2px #ff9d0066, 0 0 18px #ffc93c88, 0 4px 14px #00000066; } 50% { box-shadow: 0 0 0 2px #ffd23faa, 0 0 30px #ffd23fcc, 0 4px 14px #00000066; } }
.allmods-progress { position: fixed; inset: 0; z-index: 9999; background: #0d0b12b3; display: flex; align-items: center; justify-content: center; }
.allmods-card { background: #241f2f; border: 1px solid #ffd23f88; border-radius: 14px; padding: 22px 28px; min-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 18px 50px #000a; }
.allmods-spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid #ffd23f33; border-top-color: #ffd23f; animation: allmods-spin .9s linear infinite; }
@keyframes allmods-spin { to { transform: rotate(360deg); } }
.allmods-what { color: var(--muted, #b9b2c8); font-size: 13px; }
.allmods-bar { width: 100%; height: 10px; border-radius: 6px; background: #ffffff14; overflow: hidden; }
.allmods-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #ffd23f, #ff9d00); transition: width .25s ease; }
.allmods-count { font-size: 12px; color: var(--muted, #b9b2c8); }
/* (1.40) Apply All Mods: the page waits while the mods go in */
body.busy, body.busy * { cursor: progress !important; }
/* (1.38) the VPet screen */
.vpet-screen > .note-box { margin: 0 0 12px; }
.vpet-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 8px; margin-top: 10px; }
.vpet-form { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line, #3a3f4b); border-radius: 8px; background: var(--panel, rgba(255, 255, 255, 0.03)); }
.vpet-form.fixed { opacity: .8; }
.vpet-walk { width: 80px; height: 80px; image-rendering: pixelated; background: #e9dcc4; border-radius: 6px; flex: none; }
.vpet-thumb { width: 48px; height: 48px; image-rendering: pixelated; background: rgba(255, 255, 255, 0.06); border-radius: 4px; }
.vpet-thumbs { display: flex; flex-direction: column; gap: 4px; margin-left: auto; }
.vpet-form-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vpet-form-name { font-weight: 700; }
.vpet-form-sub, .vpet-own { font-size: 12px; color: var(--muted); }
.vpet-pose select { max-width: 150px; }
.vpet-talks { display: flex; flex-direction: column; gap: 8px; }
.vpet-talk { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.vpet-talk-name { width: 170px; font-weight: 700; }
.vpet-scenes { display: flex; flex-direction: column; gap: 4px; }
.vpet-scene { display: flex; align-items: center; gap: 8px; }
.vpet-scene-name { min-width: 190px; }
.warp-warning { font-size: 15.5px; line-height: 1.55; margin: 4px 0; }
.warp-space { font-size: 14px; line-height: 1.5; margin: 8px 0; color: var(--text); }
.warp-copy .slot-row { gap: 10px; }
.warp-schemes { flex-wrap: wrap; }
.warp-schemes .toggle { display: inline-flex; align-items: center; gap: 6px; }
.warp-schemes .swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.35); display: inline-block; }
.feature-info p { margin: 0 0 10px; line-height: 1.5; }
.feature-info p:last-child { margin-bottom: 0; }
.feature-info b { color: var(--text); font-weight: 700; }
.warp-box ul { margin: 10px 0 0; padding-left: 20px; line-height: 1.45; }
.warp-box li + li { margin-top: 4px; }
.partners-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.card.dim { opacity: .55; }
.card.add-card { border-style: dashed; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.card.add-card:hover { color: var(--text); }
.order-list.vertical { display: flex; flex-direction: column; gap: 4px; }
.lane .order-list .card { margin-bottom: 0; }
.order-list.vertical .card .badges { position: absolute; right: 4px; top: 3px; }
.order-list.grid { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.order-list.grid .card { width: 108px; }
.order-list.grid .page-band { flex-basis: 100%; }
.page-band { font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--orange); border-top: 1px dashed #5a4a36; padding-top: 4px; margin: 6px 0 2px; }
.order-end { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px; border-radius: 6px; }
.order-end.drop-hover, .order-list .card.drop-hover { outline: 2px dashed var(--accent); outline-offset: 1px; }
.roster-lane { width: 176px; }
.add-lane { border-style: dashed; }
.tamer-choice { padding: 2px; border-radius: 6px; }
.tamer-choice.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tamer-choice span { margin-left: 4px; font-size: 12px; }
.xros-dialog > p:first-child { margin-top: 0; line-height: 1.5; }
.xros-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.xros-op { font-size: 22px; font-weight: 700; color: var(--muted); padding: 0 2px; }
.xros-friend { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.xros-friend > button { font-size: 11px; padding: 1px 6px; }
.xros-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 84px; min-height: 84px; border-style: dashed; color: var(--muted); }
.xros-add:hover { color: var(--text); }
.xros-colours { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.xros-colour { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.xros-shared { margin: 4px 0 8px; }
.xros-shared .slot-row { align-items: center; }
.xros-shared-pic { display: flex; flex-direction: column; align-items: center; font-size: 10.5px; color: var(--muted); }
.xros-shared .muted { font-size: 12px; max-width: 360px; }
.copy-options { display: flex; flex-direction: column; gap: 4px; }
.roster-dialog .field { margin-bottom: 10px; }
.roster-dialog .card-grid { max-height: 260px; overflow-y: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 2px 8px; border-radius: 10px; font-size: 11.5px; }
.cap-meters { display: flex; flex-direction: column; gap: 8px; }
.cap-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 3px; }
.cap-track { height: 7px; border-radius: 4px; background: #16121d; border: 1px solid var(--line); overflow: hidden; }
.cap-fill { height: 100%; background: var(--green); }
.cap-meter.high .cap-fill { background: var(--orange); }
.cap-meter.full .cap-fill { background: var(--red); }
.sound-wave { width: 100%; height: 64px; border-radius: 6px; border: 1px solid var(--line); margin: 4px 0 8px; image-rendering: auto; }
.play-btn.on, button.primary.on { background: var(--accent-bg); color: var(--accent2); }
.who-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; margin-top: 6px; }
.who-list.disabled { opacity: .45; pointer-events: none; }
.who-mode { align-items: flex-start; margin: 4px 0; }
/* characters: pictures in and out */
.picture-bar { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); max-width: 640px; }
.picture-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.picture-row.one { grid-template-columns: 1fr; }
.even-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gfx-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.gfx-tools .search { width: 190px; }
.inline-num { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.inline-num input { width: 64px; }
.ws-actions:has(> .gfx-tools) { flex-direction: column; align-items: flex-end; }
.even-buttons > button { justify-content: center; min-width: 210px; }
.picture-row > button { justify-content: center; width: 100%; }
.vb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.vb-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #14111a; }
.vb-cell canvas { background: repeating-conic-gradient(#241e2e 0% 25%, #1b1724 0% 50%) 0 / 8px 8px; }
.vb-cell b { font-size: 12px; }
.vb-cell small { color: var(--muted); font-size: 11px; text-align: center; }
.vb-cell.off { opacity: .45; }
.pose-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; max-height: 220px; overflow: auto; }
.pose-strip > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #14111a; }
.pose-strip small { color: var(--muted); font-size: 10px; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* graphics library: frames x colour variants */
.fv-grid { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; }
.fv-row { display: flex; align-items: flex-start; gap: 4px; }
.fv-label { flex: 0 0 64px; color: var(--muted); font-size: 11px; padding-top: 6px; }
.fv-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px; background: #14111a; }
.fv-cell.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.fv-cell small { font-size: 10px; color: var(--muted); }
/* flash usage */
.meter-tip { margin: 6px 0 4px; font-size: 12px; color: var(--text); min-height: 18px; }
.meter-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--muted); }
.meter-legend span { display: inline-flex; align-items: center; gap: 6px; }
.meter-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; box-shadow: 0 0 0 1px #ffffff22; }
.meter span { cursor: help; }
.meter span:hover { filter: brightness(1.35); }
.sound-btn { padding: 2px 5px; flex-shrink: 0; }
.sound-btn.on { color: var(--accent2); border-color: var(--accent); }
.card .sound-btn { position: absolute; right: 4px; bottom: 4px; }
.card { position: relative; }
.slot-body .sound-btn { margin-left: auto; }

/* evolution animation parts (Evolutions inspector) */
.evo-parts { display: flex; flex-direction: column; gap: 6px; }
.evo-part { display: grid; grid-template-columns: 42px 50px minmax(0, 1fr); grid-template-rows: auto auto; gap: 4px 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.evo-part-k { grid-row: 1 / 3; font-size: 11px; color: var(--muted); font-weight: 650; }
.evo-part-pic { grid-row: 1 / 3; padding: 2px; background: #16121d; justify-content: center; }
.evo-part-info { min-width: 0; }
.evo-part-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evo-part-sub { font-size: 11px; color: var(--muted); }
.evo-part-actions { grid-column: 3; display: flex; gap: 4px; flex-wrap: wrap; }
.evo-part-actions button { padding: 3px 7px; font-size: 11.5px; }
.evo-part.empty { grid-template-columns: 42px minmax(0, 1fr); border-style: dashed; background: transparent; }
.evo-part.empty .evo-part-actions { grid-column: 2; }
.evo-part.drop-hover, .evo-part.can-drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
/* one top bar for narrower windows: the screen's own buttons keep their place */
@media (max-width: 1520px) {
  .topbar.has-tools .back-label, .topbar.has-tools .global-search { display: none; }
  .topbar.has-tools .scene-tools > button:not(#swap-gfx):not(.text-tool) span { display: none; }
}

/* Reduce colours */
.reduce-views { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; margin-top: 8px; }
.reduce-views figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.reduce-views figcaption { color: var(--muted); font-size: 12px; }
.reduce-hint { font-size: 12px; max-width: 720px; margin: 10px 0 0; }
.reduce-pic, .reduce-busy { background: repeating-conic-gradient(#2a2433 0% 25%, #1f1a27 0% 50%) 0 0 / 16px 16px; border: 1px solid var(--line); border-radius: 4px; }
.reduce-busy { display: flex; align-items: center; justify-content: center; color: var(--muted); min-width: 64px; min-height: 64px; }
.reduce-slots { display: flex; gap: 4px; flex-wrap: wrap; margin: 2px 0 10px; }
.reduce-slots button.on { background: var(--accent-bg); border-color: var(--accent); color: var(--accent2); }
.reduce-save { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.reduce-save > button { justify-content: center; }

/* Digivice LED colours */
.led-row { display: flex; gap: 6px; margin: 4px 0 2px; flex-wrap: wrap; }
.led-dot { width: 20px; height: 20px; min-width: 0; padding: 0; border: 0; border-radius: 50%; box-shadow: 0 0 0 1px #0006 inset; opacity: .55; cursor: pointer; }
.led-dot:hover { opacity: .85; }
.led-dot.on { opacity: 1; box-shadow: 0 0 0 2px var(--accent), 0 0 8px currentColor; }
.lib-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 2px 4px; }
.lib-group:first-child { margin-top: 2px; }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px 8px; }
.tile .kv { grid-template-columns: max-content 1fr; }
.tile .kv > span { overflow-wrap: anywhere; }
.led-defs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 14px; margin-bottom: 8px; }
.led-def { display: flex; gap: 10px; align-items: center; font-size: 12px; }
.led-def .mono { font-size: 10.5px; }
.led-steps { display: grid; grid-template-columns: repeat(4, 26px); gap: 3px; }
.led-pick-wrap { display: inline-flex; border-radius: 6px; padding: 1px; }
.led-pick-wrap.changed { outline: 2px solid var(--orange); }
input.led-pick { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: none; cursor: pointer; }
.led-steps input.led-pick { width: 26px; height: 22px; }

/* Scene Editor: Paste animation, Speed & timing, Remove animation */
dialog.modal.anim-modal { width: min(600px, calc(100vw - 30px)); }
.anim-dialog .note b { color: var(--text); font-weight: 600; }
.anim-dialog select, .anim-dialog input[type=number] { width: 100%; }
.anim-parts { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.anim-parts .check { margin: 4px 0; }
.anim-dialog .anim-forever { align-self: end; margin-bottom: 14px; }
.anim-summary { margin: 10px 0 4px; font-size: 13px; line-height: 1.45; }
.anim-warning { margin: 4px 0; font-size: 12.5px; color: var(--orange); min-height: 1em; }
.anim-warning.error { color: var(--red); }
.anim-warning:empty { display: none; }
.anim-dialog [hidden] { display: none !important; }
.apply-all .settings-check{display:flex;align-items:center;gap:8px;margin:8px 0}
.apply-all .settings-check input:disabled+span{opacity:.55}
.xros-music-note { margin: 6px 0 0; font-size: 12px; }
.xros-music .note-box { margin-top: 6px; }
.picker-grid > .picker-section { grid-column: 1 / -1; margin: 8px 2px 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.picker-grid > .picker-section:first-child { margin-top: 0; }

/* DigiXros (ui/workspaces/digixros.js) */
.xros-scenes { display: flex; flex-direction: column; gap: 4px; }
.xros-scene-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; background: var(--panel2, #24202c); }
.xros-scene-name { font-weight: 600; min-width: 220px; }
.xros-scene-row .muted { flex: 1; }
.xros-search input { width: 100%; max-width: 320px; }
.xros-ways { display: flex; flex-wrap: wrap; gap: 6px; }
.xros-way-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 14px; border: 1px solid #3c344b; background: transparent; color: inherit; cursor: pointer; }
.xros-way-btn.on { border-color: #c9a7ff; background: #3a2e52; font-weight: 700; }
.xros-swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.4); display: inline-block; }
.xros-look { display: flex; flex-wrap: wrap; gap: 8px; }
.xros-look-pic { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; }
.badge.xros-way { font-weight: 800; }
/* (1.32) Advanced › Space */
.space-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; flex-wrap: wrap; }
.space-row .slot { min-width: 200px; }
.space-arrow { color: var(--muted); display: inline-flex; }
.space-status { font-size: 12px; color: var(--muted); }
.space-status.ok { color: var(--green); }
.space-status.done { color: var(--blue); }
.space-status.warn { color: var(--orange); }
.space-add { opacity: .9; border-top: 1px dashed #4a4159; padding-top: 6px; }
.space-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.space-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; }
.space-chip { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid #4a4159; border-radius: 8px; background: #2a2435; }
.space-chip.in-use { border-color: var(--orange); }
.space-chip.done { opacity: .7; }
.space-chip-text { display: flex; flex-direction: column; font-size: 11px; line-height: 1.2; }
.space-chip-text small { color: var(--muted); }
.space-remove { padding: 2px 4px; }
/* (1.35) Expand Image Storage */
.feature-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 8px; }
.expand-bar { display: flex; gap: 8px; margin: 0 0 12px; }
.expand-info h4 { margin: 14px 0 6px; }
.expand-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 8px; max-height: 300px; overflow: auto; padding: 2px; margin: 6px 0 8px; }
.expand-map { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px; border: 1px solid #4a4159; border-radius: 8px; background: #2a2435; text-align: center; }
.expand-map canvas { border-radius: 4px; }
.expand-map.on { border-color: var(--green); box-shadow: 0 0 0 2px var(--green) inset; }
.expand-map-name { font-size: 12px; }
.expand-map small { color: var(--muted); font-size: 11px; }
/* (1.32) Maps › Apply to all */
.apply-all .apply-field { border-left: 2px solid #4a4159; padding-left: 8px; margin: 6px 0; }
.apply-all .apply-summary { margin-top: 12px; font-weight: 600; }
/* (1.37) imports: the size and the colours of new pictures; Replace image and delete it */
.import-dialog .import-strip small { max-width: 130px; }
.import-dialog .import-colour-note { margin: 4px 0 2px; }
.import-dialog .import-result { color: var(--text); margin: 2px 0 8px; }
.delete-dialog .delete-users { max-height: 200px; overflow: auto; margin: 4px 0 8px; padding-left: 20px; }
.delete-dialog .pose-strip { align-items: center; }
/* Edition & gifts */
.edition-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.edition-choice { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line2); border-radius: 10px; background: #221e2c; color: var(--text); text-align: left; cursor: pointer; white-space: normal; }
.edition-choice:hover:not(:disabled) { border-color: var(--accent); background: #272034; }
.edition-choice.on, .edition-choice.on:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 1px var(--accent) inset; cursor: default; }
.edition-choice > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.edition-choice b { font-size: 13.5px; }
.edition-choice small { color: var(--muted); font-size: 11px; }
.edition-choice.on small { color: #d8c5fe; }
.edition-gifts { display: flex; flex-direction: column; gap: 8px; }
.edition-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #221e2c; }
.edition-row.current { border-color: var(--accent); }
.edition-row-name { width: 150px; display: flex; flex-direction: column; font-size: 12.5px; }
.edition-row-name small { color: var(--muted); font-size: 11px; }
.edition-list { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.edition-list.edition-all { margin: 0 0 10px; }
.edition-choice small, .sig-hex { overflow-wrap: anywhere; }

/* (1.43.0) Spritesheets & Resources */
.res-controls { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: flex-end; margin: 4px 0 8px; }
.res-controls .field { margin: 0; }
.res-search { flex: 1 1 300px; }
.res-search .field-input { display: flex; gap: 6px; }
.res-query { flex: 1; min-width: 180px; }
.res-status p { margin: 4px 0; }
.res-count { margin: 6px 0 10px; color: var(--muted); }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.res-card { position: relative; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; cursor: pointer; min-width: 0; }
.res-card:hover { border-color: var(--line2); }
.res-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.res-pic { height: 112px; display: flex; align-items: center; justify-content: center; background: #15121c; border-radius: 6px; overflow: hidden; }
.res-img { width: 128px; height: 112px; object-fit: contain; image-rendering: pixelated; image-rendering: crisp-edges; }
.res-pic.baby .res-img { width: 96px; height: 72px; }
.res-nopic { font-size: 11px; color: var(--faint); }
.res-name { font-weight: 650; font-size: 13px; margin-top: 6px; overflow-wrap: anywhere; }
.res-meta, .res-src { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.res-dl { position: absolute; top: 12px; right: 12px; opacity: .85; }
.res-more { font-size: 13px; margin: 16px 0 8px; color: var(--muted); }
.res-page { margin: 12px 0; display: flex; align-items: center; gap: 8px; }
.res-site { align-self: center; color: var(--accent2); }
.res-side-meta { margin: 2px 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.res-sheet { margin: 10px 0; }
.res-sheet-img { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; border-radius: 4px; }
.res-file { font-size: 11px; overflow-wrap: anywhere; }
.res-big { overflow: auto; }
.res-big-img { display: block; image-rendering: pixelated; image-rendering: crisp-edges; max-width: none; }

/* (1.44) My Other Projects, Contact Me */
.about-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; }
.about-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; }
.about-card:hover { border-color: var(--accent); }
.about-card div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.about-card b { font-size: 14px; }
.about-text { max-width: 720px; font-size: 14px; line-height: 1.6; }
.about-text a, .ws-inspector a { color: var(--accent2); overflow-wrap: anywhere; }
a.button-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 5px; background: var(--accent); color: #262033; font-weight: 650; text-decoration: none; margin-right: 8px; }
a.button-link:hover { background: var(--accent2); }
