:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f1f3f6;
  --line: #e3e6eb;
  --line-2: #d3d8df;
  --text: #16191d;
  --muted: #5d6673;
  --faint: #8a93a0;
  --accent: #2563eb;
  --accent-soft: #e8efff;
  --accent-text: #ffffff;
  --danger: #d93036;
  --danger-soft: #fdecec;
  --ok: #1f8a4c;
  --ok-soft: #e6f6ec;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --k-video: #e5484d;
  --k-model: #8e4ec6;
  --k-anim: #f76b15;
  --k-quiz: #30a46c;
  --k-image: #0090ff;
  --k-head: #5d6673;
  --stage: #e9ecf0;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1114; --panel: #171a1f; --panel-2: #1e2228; --line: #2a2f37; --line-2: #363c46;
    --text: #e8ebef; --muted: #a1a9b5; --faint: #77808c; --accent: #4f8cff; --accent-soft: #1b2a47;
    --danger: #ff6369; --danger-soft: #3a1c1e; --ok: #4cc38a; --ok-soft: #15301f; --warn: #f0a44b; --warn-soft: #33260f;
    --stage: #0b0d10; --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1114; --panel: #171a1f; --panel-2: #1e2228; --line: #2a2f37; --line-2: #363c46;
  --text: #e8ebef; --muted: #a1a9b5; --faint: #77808c; --accent: #4f8cff; --accent-soft: #1b2a47;
  --danger: #ff6369; --danger-soft: #3a1c1e; --ok: #4cc38a; --ok-soft: #15301f; --warn: #f0a44b; --warn-soft: #33260f;
  --stage: #0b0d10; --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
code, .mono { font-family: var(--mono); font-size: 12px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; cursor: pointer;
  font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--text);
}
.btn:hover { background: var(--panel-2); }
.btn:disabled { opacity: .45; cursor: default; background: var(--panel); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 13px; border-radius: 7px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn svg { width: 16px; height: 16px; flex: none; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); height: 30px; padding: 0 10px; cursor: pointer; font-size: 13px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
input[type=text], input[type=url], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px;
  padding: 6px 9px; outline: none; min-height: 32px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.k-video { --k: var(--k-video); } .k-audio { --k: var(--k-video); }
.k-lab, .k-museum, .k-model3d { --k: var(--k-model); }
.k-animation { --k: var(--k-anim); }
.k-question, .k-practice, .k-pen { --k: var(--k-quiz); }
.k-image { --k: var(--k-image); }
.k-heading, .k-link { --k: var(--k-head); }
.kdot { background: var(--k); }
.empty { padding: 28px 16px; text-align: center; color: var(--faint); }

/* ---------- library ---------- */
.lib { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.lib-head h1 { font-size: 24px; letter-spacing: -.01em; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.bcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; text-decoration: none; color: inherit; }
.bcard:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16, 24, 40, .12); }
.bcover { height: 150px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.bcover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.bcover .ph { font-size: 40px; opacity: .3; }
.bbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.btitle { font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bid { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.bstats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }

/* ---------- editor shell ---------- */
.ed { display: grid; grid-template-rows: 52px 1fr; height: 100vh; }
.top { display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.top .title { font-weight: 650; min-width: 0; }
.top .sep { width: 1px; height: 22px; background: var(--line); }
.cols { display: grid; grid-template-columns: 250px minmax(0, 1fr) 440px; min-height: 0; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side.right { border-right: 0; border-left: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { border: 0; background: none; padding: 7px 10px 9px; cursor: pointer; color: var(--muted); font-weight: 550; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.scroll { overflow: auto; flex: 1; min-height: 0; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: pointer; border-left: 3px solid transparent; font-size: 13px; }
.nav-item:hover { background: var(--panel-2); }
.nav-item.on { background: var(--accent-soft); border-left-color: var(--accent); color: var(--accent); font-weight: 600; }
.nav-item .counts { margin-left: auto; display: flex; gap: 3px; }
.nav-group { padding: 12px 12px 4px; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }

.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--stage); }
.stagebar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.frame-wrap { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; padding: 16px; }
.frame-wrap iframe { border: 0; background: #fff; width: 100%; height: 100%; border-radius: 6px; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); }
.frame-wrap.phone iframe { width: 390px; height: 100%; max-height: 844px; border-radius: 22px; border: 10px solid #1c1f24; }
.frame-wrap.tablet iframe { width: 820px; height: 100%; max-height: 1180px; border-radius: 18px; border: 10px solid #1c1f24; }
.frame-wrap[data-theme=dark] iframe { background: #121417; }
.legend { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- panels / cards ---------- */
.pad { padding: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.card + .card { margin-top: 10px; }
.card h3 { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.sel-card { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chip { border: 1px solid var(--line-2); background: var(--panel); border-radius: 99px; height: 26px; padding: 0 10px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.item { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; }
.item:hover { background: var(--panel-2); }
.item.on { background: var(--accent-soft); }
.item .ic { width: 26px; height: 26px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 13px; background: color-mix(in srgb, var(--k) 14%, transparent); color: var(--k); font-weight: 700; }
.item .lbl { font-weight: 550; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .val { font-family: var(--mono); font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; font-family: var(--mono); font-size: 11.5px; }
.crumbs button { border: 0; background: var(--panel-2); border-radius: 5px; padding: 1px 6px; cursor: pointer; color: var(--muted); font: inherit; }
.crumbs button:hover { color: var(--accent); }
.crumbs .cur { background: var(--accent-soft); color: var(--accent); border-radius: 5px; padding: 1px 6px; font-weight: 600; }
.opt { display: flex; gap: 8px; align-items: flex-start; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; margin-top: 6px; }
.opt:hover { border-color: var(--line-2); background: var(--panel-2); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt .l { font-weight: 700; width: 18px; text-transform: uppercase; }
details.adv { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
details.adv summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.attr-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 5px; margin-top: 5px; align-items: center; }
.attr-row input { min-height: 28px; padding: 3px 7px; font-family: var(--mono); font-size: 12px; }
.mv { width: 100%; height: 220px; background: radial-gradient(circle at 50% 40%, var(--panel), var(--panel-2)); border-radius: 8px; border: 1px solid var(--line); display: block; }
.models { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mcard { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); }
.mcard .thumb { height: 110px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.mcard .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mcard .thumb model-viewer { width: 100%; height: 110px; }
.mcard .meta { padding: 7px 8px; font-size: 12px; }
.imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.imgs .im { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--panel-2); cursor: pointer; position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.imgs .im img { max-width: 100%; max-height: 100%; object-fit: contain; }
.imgs .im span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; padding: 2px 4px; background: rgba(0, 0, 0, .55); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-h { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 8px; }
.section-h:first-child { margin-top: 0; }
.section-h h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.code { height: calc(100vh - 230px); min-height: 300px; white-space: pre; overflow: auto; tab-size: 2; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 5px 12px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.file-row:hover { background: var(--panel-2); }
.file-row .p { font-family: var(--mono); font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.src-entry { border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-top: 8px; background: var(--panel-2); }
.banner { padding: 8px 10px; border-radius: 8px; font-size: 12.5px; margin-top: 8px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--accent-soft); color: var(--accent); }

#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; align-items: center; pointer-events: none; }
.toast { background: #1c1f24; color: #fff; padding: 9px 14px; border-radius: 9px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); font-size: 13px; max-width: 560px; animation: tin .18s ease; }
.toast.err { background: var(--danger); }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } }
.modal-bg { position: fixed; inset: 0; background: rgba(10, 12, 16, .45); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal { background: var(--panel); border-radius: 14px; width: 520px; max-width: 100%; max-height: 90vh; overflow: auto; padding: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal h2 { font-size: 16px; margin-bottom: 4px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

@media (max-width: 1180px) { .cols { grid-template-columns: 210px minmax(0, 1fr) 360px; } }
@media (max-width: 900px) {
  .ed { height: auto; grid-template-rows: auto 1fr; }
  .cols { grid-template-columns: 1fr; }
  .side { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage { height: 70vh; }
  .side.right { max-height: none; }
  .top { flex-wrap: wrap; height: auto; padding: 8px 12px; }
}

/* ---------- right panel: readable, sectioned ---------- */
.side.right { font-size: 14px; }
.side.right .tabs button { font-size: 13.5px; padding: 9px 12px 10px; }
.side.right .btn { height: 34px; font-size: 13.5px; }
.side.right .btn.sm { height: 30px; font-size: 13px; }
.side.right input, .side.right select, .side.right textarea { font-size: 14px; min-height: 36px; }
.side.right textarea.prose { font-family: inherit; font-size: 14.5px; line-height: 1.55; }
.side.right label.f { font-size: 12.5px; margin: 0 0 5px; color: var(--text); }
.fld { margin-top: 12px; }
.fld:first-child { margin-top: 0; }
.hint { font-size: 12px; color: var(--faint); margin-top: 5px; line-height: 1.4; }
.pager { display: inline-flex; align-items: center; gap: 4px; }
.pager .btn { width: 30px; padding: 0; justify-content: center; font-size: 18px; line-height: 1; }
.pageno { min-width: 52px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.pghead { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.pgtitle { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 3px 0 2px; line-height: 1.3; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; }
.stat { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.stat b { color: var(--text); }
.howto { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 12px 14px; }
.howto .ht-h { font-weight: 650; margin-bottom: 6px; }
.howto ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.howto b { color: var(--text); font-weight: 600; }
.list-h { padding: 6px 16px 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.grp { display: flex; align-items: center; gap: 7px; padding: 14px 16px 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; position: sticky; top: 0; background: var(--panel); z-index: 1; }
.grp .faint { margin-left: auto; font-weight: 600; }
.side.right .item { padding: 10px 16px; gap: 12px; }
.side.right .item .ic { width: 30px; height: 30px; font-size: 14px; }
.side.right .item .lbl { font-size: 14px; -webkit-line-clamp: 3; }
.side.right .item .val { font-size: 12px; margin-top: 2px; }
.side.right .item.on { box-shadow: inset 3px 0 0 var(--accent); }
.side.right .chips { padding: 8px 16px 10px; }
.sel-card { padding: 0; overflow: hidden; }
.sel-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: color-mix(in srgb, var(--k, var(--k-head)) 10%, var(--panel)); border-bottom: 1px solid var(--line); }
.sel-badge { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; background: var(--k, var(--k-head)); color: #fff; flex: none; }
.sel-kind { font-size: 15.5px; font-weight: 650; }
.sel-card > .sec, .sel-card > .banner, .sel-card > details { margin: 0; padding: 14px; border-top: 1px solid var(--line); }
.sel-card > .sec:first-of-type { border-top: 0; }
.sel-card > .banner { margin: 14px; border: 0; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 10px; }
.sec-h .faint { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; }
.fold > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 0; }
.fold[open] > summary { margin-bottom: 8px; }
.sel-card details.adv { margin: 0; border-top: 1px solid var(--line); padding: 14px; }
.opt { padding: 9px 11px; font-size: 14px; }
.vthumb:hover { background: var(--panel-2) !important; }

.cropstage { background: repeating-conic-gradient(#8883 0 25%, transparent 0 50%) 0 0/16px 16px; border-radius: 8px; display: flex; justify-content: center; padding: 8px; max-height: 56vh; overflow: auto; }
.cropwrap { position: relative; display: inline-block; touch-action: none; line-height: 0; }
.cropwrap canvas { max-width: 100%; max-height: 50vh; display: block; }
.cropbox { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); cursor: move; outline: 1px solid rgba(0, 0, 0, .5); }
.cropbox .hd { position: absolute; width: 14px; height: 14px; background: #fff; border: 1px solid #0006; border-radius: 3px; }
.hd-nw { left: -8px; top: -8px; cursor: nwse-resize; } .hd-ne { right: -8px; top: -8px; cursor: nesw-resize; }
.hd-sw { left: -8px; bottom: -8px; cursor: nesw-resize; } .hd-se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.hd-n { left: calc(50% - 7px); top: -8px; cursor: ns-resize; } .hd-s { left: calc(50% - 7px); bottom: -8px; cursor: ns-resize; }
.hd-w { top: calc(50% - 7px); left: -8px; cursor: ew-resize; } .hd-e { top: calc(50% - 7px); right: -8px; cursor: ew-resize; }
.modal:has(.cropstage) { width: 760px; }

.sel-card .row { flex-wrap: wrap; }
.sel-card .row .grow { flex-basis: 0; }
.modal select { width: 100%; }

/* ---------- top bars (redesign) ---------- */
.ed { grid-template-rows: 56px 1fr; }
.top { gap: 12px; padding: 0 16px; }
.top .booktitle { min-width: 0; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.top .title { font-size: 15px; letter-spacing: -.01em; line-height: 1.2; max-width: 52vw; }
.top .bookmeta { display: flex; gap: 6px; align-items: center; }
.top .bookmeta .pill { height: 18px; font-size: 11px; }
.top .group { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.top .group .btn { border: 0; border-radius: 0; height: 30px; width: 34px; padding: 0; justify-content: center; }
.top .group .btn + .btn { border-left: 1px solid var(--line-2); }
.top .btn.primary { padding: 0 14px; }
.stagebar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 14px; flex-wrap: nowrap; }
.sb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sb-mid { display: flex; justify-content: center; }
.sb-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.pagename { font-weight: 600; font-size: 14px; min-width: 0; }
.pager { background: var(--panel-2); border-radius: 9px; padding: 2px; gap: 0; flex: none; }
.pager .btn { border: 0; background: transparent; height: 28px; }
.pager .btn:hover:not(:disabled) { background: var(--panel); }
.seg.lg button { height: 34px; padding: 0 16px; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.seg.lg button svg { width: 15px; height: 15px; }
.seg.icons button { width: 38px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.seg.icons button svg { width: 17px; height: 17px; }
.btn.icon-only { width: 34px; padding: 0; justify-content: center; height: 34px; }
.legend { justify-content: center; padding: 7px 12px; background: var(--panel); border-top: 1px solid var(--line); flex: none; }
@media (max-width: 1100px) { .stagebar { grid-template-columns: 1fr auto; } .sb-mid { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; } }
