/* ═══════════════════════════════════════════════════════════
   RNBeamX — style.css
   Design tokens, base elements, controls, dialogs, toasts.
   The workspace is themable (light / dark); the figure itself
   always keeps its own colours.
═══════════════════════════════════════════════════════════ */
:root {
  --bg: #f3f4f7;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --line: #e3e6eb;
  --line-2: #d3d8df;
  --text: #1b1e24;
  --muted: #5d6573;
  --faint: #8b93a1;
  --accent: #4f46e5;
  --accent-2: #18a7c4;
  --accent-soft: #eceafe;
  --danger: #d14343;
  --ok: #1f9d55;
  --stage: #e7e9ee;
  --grid-minor: rgba(60, 72, 98, 0.07);
  --grid-major: rgba(60, 72, 98, 0.13);
  --sel: #4f46e5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --radius: 8px;
  --radius-lg: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12141b; --panel: #191c25; --panel-2: #1e2230; --line: #2a2f3d; --line-2: #363c4d;
    --text: #e8eaf0; --muted: #a3aab8; --faint: #747c8c; --accent: #8b80ff; --accent-2: #3cc8e0;
    --accent-soft: #2a2752; --stage: #0e1016; --grid-minor: rgba(60, 72, 98, 0.07); --grid-major: rgba(60, 72, 98, 0.14);
    --sel: #8b80ff; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12141b; --panel: #191c25; --panel-2: #1e2230; --line: #2a2f3d; --line-2: #363c4d;
  --text: #e8eaf0; --muted: #a3aab8; --faint: #747c8c; --accent: #8b80ff; --accent-2: #3cc8e0;
  --accent-soft: #2a2752; --stage: #0e1016; --grid-minor: rgba(60, 72, 98, 0.07); --grid-major: rgba(60, 72, 98, 0.14);
  --sel: #8b80ff; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 13px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
kbd { font: 11px var(--mono); background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--panel); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { color: var(--danger); }
.btn.small { height: 26px; padding: 0 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { width: 30px; height: 30px; border-radius: var(--radius); border: 1px solid transparent; background: transparent; display: inline-grid; place-items: center; color: var(--muted); padding: 0; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.on { background: var(--accent-soft); color: var(--accent); }
.icon-btn:disabled { opacity: .35; }
.icon-btn svg { width: 17px; height: 17px; }
.link { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 0 4px; }
.pill { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }

/* segmented control */
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 26px; padding: 0 12px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.seg button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

/* ---------- form fields ---------- */
.field { display: grid; gap: 4px; margin-bottom: 10px; }
.field > label, .field-label { font-size: 11.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.field .hint { font-size: 11px; color: var(--faint); font-weight: 400; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
input[type=text], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 28px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--panel); outline: none; font-size: 12.5px;
}
textarea { height: auto; min-height: 54px; padding: 6px 8px; resize: vertical; font-family: var(--font); line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.unit-wrap { position: relative; }
.unit-wrap input { padding-right: 34px; }
.unit-wrap .unit { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--faint); pointer-events: none; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.range-row { display: grid; grid-template-columns: 1fr 52px; gap: 8px; align-items: center; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 8px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.color-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 6px; align-items: center; }
input[type=color] { width: 34px; height: 28px; border: 1px solid var(--line-2); border-radius: 7px; padding: 2px; background: var(--panel); cursor: pointer; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); display: inline-block; flex: none; }
.swatch-btn { width: 20px; height: 20px; border-radius: 5px; border: 1px solid rgba(0,0,0,.2); padding: 0; cursor: pointer; }
.swatch-btn:hover { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- menus ---------- */
.menu { position: fixed; z-index: 60; min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; padding: 6px 10px; border-radius: 6px; text-align: left; font-size: 12.5px; }
.menu button:hover:not(:disabled) { background: var(--accent-soft); }
.menu button:disabled { opacity: .4; cursor: default; }
.menu button .k { margin-left: auto; color: var(--faint); font: 11px var(--mono); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.menu .menu-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; padding: 6px 10px 2px; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 12, 20, .45); backdrop-filter: blur(2px); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .12s ease; }
.modal { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(720px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-head .sub { color: var(--muted); font-size: 12px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel-2); }
@keyframes fade { from { opacity: 0; } }

/* ---------- toast ---------- */
#toastRoot { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: #1b1e27; color: #fff; padding: 8px 14px; border-radius: 9px; box-shadow: var(--shadow-lg); font-size: 12.5px; animation: rise .18s ease; max-width: 520px; }
.toast.error { background: #a32727; }
.toast-act { pointer-events: auto; margin-left: 12px; background: transparent; border: 1px solid rgba(255,255,255,.45); color: #fff; border-radius: 6px; padding: 2px 10px; font: inherit; font-weight: 600; cursor: pointer; }
.toast-act:hover { background: rgba(255,255,255,.14); }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }

.progress { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .1s; }

/* ---------- Learn ---------- */
.modal.learn-modal { width: min(1180px, 100%); height: calc(100vh - 32px); }
.learn-modal .modal-body { padding: 0; overflow: hidden; flex: 1; display: flex; min-height: 0; }
.learn { display: grid; grid-template-columns: 250px 1fr; width: 100%; min-height: 0; }
.learn-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.learn-search { margin: 12px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; }
.learn-list { overflow-y: auto; padding: 0 8px 16px; flex: 1; }
.learn-list h4 { margin: 14px 6px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.learn-list button { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--text); padding: 5px 8px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; }
.learn-list button:hover { background: var(--hover, rgba(127,127,127,.1)); }
.learn-list button.on { background: var(--accent); color: #fff; }
.learn-art { overflow-y: auto; padding: 18px 26px 40px; min-height: 0; line-height: 1.6; }
.learn-art h2 { margin: 2px 0 4px; font-size: 22px; }
.learn-art h3 { margin: 22px 0 6px; font-size: 15px; }
.learn-art p { margin: 0 0 10px; }
.learn-head { display: flex; gap: 16px; align-items: center; }
.learn-icon { width: 96px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.learn-icon svg { width: 100%; height: auto; display: block; }
.learn-group { color: var(--accent); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }
.learn-one { font-size: 15px; color: var(--muted); margin: 0; }
.learn-fig { margin: 16px 0 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.learn-svg svg { width: 100%; height: auto; display: block; max-height: 340px; }
.learn-fig figcaption { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; font-size: 12px; color: #4b5563; background: #f6f7f9; border-top: 1px solid #e5e7eb; }
.learn-read { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.learn .chip { display: inline-block; padding: 2px 9px; border-radius: 99px; background: var(--hover, rgba(127,127,127,.12)); border: 1px solid var(--line); font-size: 12px; color: var(--text); }
.learn-fig .chip { background: #fff; color: #1f2937; border-color: #d6dae0; }
.learn .chip.link { cursor: pointer; font: inherit; font-size: 12.5px; }
.learn .chip.link:hover { border-color: var(--accent); color: var(--accent); }
.learn-see { display: flex; flex-wrap: wrap; gap: 6px; }
.learn-acts { gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.learn-acts .btn { flex: none; }
.learn-math { display: grid; gap: 8px; }
.learn-eq { display: grid; grid-template-columns: minmax(260px, auto) 1fr; gap: 14px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2, rgba(127,127,127,.05)); }
.learn-eq .eq { font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", Georgia, serif; font-size: 17px; line-height: 2.3; padding: 2px 0; }
.learn-eq .note-t { font-size: 12.5px; color: var(--muted); }
.learn-art ul { margin: 0; padding-left: 20px; }
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 2px; font-size: .9em; }
.fr > span:first-child { border-bottom: 1px solid currentColor; padding: 0 3px; }
.fr > span:last-child { padding: 0 3px; }
.ov { border-top: 1px solid currentColor; padding: 0 2px; }
@media (max-width: 760px) {
  .learn { grid-template-columns: 1fr; grid-template-rows: 180px 1fr; }
  .learn-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .learn-eq { grid-template-columns: 1fr; }
  .learn-art { padding: 14px; }
}

/* Learn as its own page */
body.learn-page { display: flex; flex-direction: column; height: 100vh; }
.learn-top { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.learn-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 15px; }
.learn-brand span { color: var(--accent); font-weight: 600; }
.learn-sub { color: var(--muted); font-size: 12.5px; flex: 1; min-width: 200px; }
.learn-nav { display: flex; align-items: center; gap: 8px; }
.learn-nav .theme-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.learn-nav .theme-switch button { border: 0; background: transparent; color: var(--muted); font: 600 12px/1 inherit; font-family: inherit; padding: 7px 10px; cursor: pointer; }
.learn-nav .theme-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.learn-main { flex: 1; min-height: 0; display: flex; }
.learn-main .learn { flex: 1; min-height: 0; }
.learn-art a.btn { text-decoration: none; }
.learn a.chip.link { text-decoration: none; }
@media (max-width: 760px) { .learn-sub { display: none; } .learn-top { gap: 8px; padding: 8px 12px; } }
.learn-page a.btn { text-decoration: none; color: var(--text); }
.learn-page a.btn.primary { color: #fff; }
.swatch-row { flex-wrap: wrap; gap: 4px; margin-bottom: 8px; align-items: center; }
.swatch-row small { width: 38px; color: var(--faint); font-size: 11px; }

/* ---------- Layer Studio ---------- */
.studio { position: fixed; inset: 0; z-index: 58; background: var(--bg); color: var(--text); display: flex; flex-direction: column; font-size: 13px; }
.st-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.st-title { display: flex; flex-direction: column; line-height: 1.15; margin-right: 6px; }
.st-title b { font-size: 15px; }
.st-sub { color: var(--muted); font-size: 11px; }
.studio .st-head input.st-name { width: 220px; flex: 0 1 220px; }
.st-grow { flex: 1; }
.st-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(330px, 400px) minmax(320px, 1fr) minmax(320px, 1fr); gap: 0; }
.st-col { overflow: auto; padding: 10px 14px 24px; border-right: 1px solid var(--line); min-width: 0; }
.st-col:last-child { border-right: 0; }
.st-col h4 { margin: 6px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.st-grid { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 8px; align-items: flex-end; }
.st-f { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); min-width: 84px; }
.st-f.row { flex-direction: row; align-items: center; gap: 5px; min-width: 0; }
.studio .st-f input[type=number] { width: 84px; }
.studio .st-row2 input[type=checkbox] { width: auto; margin: 0 4px; }
.st-f select { max-width: 190px; }
.st-cap { font-size: 11px; color: var(--muted); margin: 8px 0 4px; }
.st-layer { border: 1px solid var(--line); border-radius: 8px; padding: 6px; margin-bottom: 5px; background: var(--panel); }
.st-layer.st-sub { background: var(--panel-2); }
.st-row { display: grid; grid-template-columns: 26px minmax(60px, 1fr) minmax(90px, 1.3fr); gap: 4px; align-items: center; }
.st-row input[type=color] { width: 26px; height: 24px; padding: 0; border: 1px solid var(--line-2); border-radius: 5px; }
.st-row2 { display: flex; align-items: center; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.studio .st-row2 input[type=number] { width: 72px; flex: 0 0 72px; }
.st-row2 .btn.small { padding: 2px 6px; }
.st-row2 .icon-btn { width: 24px; height: 24px; }
.studio .st-row2 input.st-tag { width: 52px; flex: 0 0 52px; }
.studio .st-row2 input.st-rough { width: 58px; flex: 0 0 58px; }
.studio .st-ema { flex-wrap: wrap; row-gap: 4px; }
.studio .st-ema select { flex: 1 1 90px; min-width: 0; }
.studio .st-ema input[type=number] { width: 52px; flex: 0 0 52px; }
.st-group { border: 1.5px dashed var(--accent); border-radius: 10px; padding: 6px; margin-bottom: 6px; background: var(--accent-soft); }
.st-ghead { display: flex; align-items: center; gap: 3px; margin-bottom: 5px; font-weight: 600; flex-wrap: wrap; }
.st-ghead .icon-btn, .st-row2 .icon-btn { width: 22px; height: 22px; }
.st-row2 { gap: 2px !important; }
.studio .st-ghead input.st-gname { width: 100px; flex: 0 1 100px; }
.studio .st-ghead input.st-rep { width: 56px; flex: 0 0 56px; }
.st-row.ps-rowck { grid-template-columns: 16px 26px minmax(60px, 1fr) minmax(90px, 1.3fr); }
.ps-rgroup { border-style: solid; background: transparent; }
.ps-addrow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0; }
.ps-addrow .btn { white-space: normal; line-height: 1.2; min-height: 28px; }
.ps-rgroup > .st-player { background: var(--panel); }
.st-chart { display: block; max-width: 100%; height: auto; color: var(--text); background: var(--panel); border-radius: 8px; border: 1px solid var(--line); }
.st-cross, .st-spec, .st-map { margin-bottom: 8px; }
@media (max-width: 1100px) { .st-body { grid-template-columns: 1fr; overflow: auto; } .st-col { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); } }
.st-tabs { margin-right: 4px; }
.st-player { background: var(--panel-2); border-style: solid; border-color: var(--line-2); }
.st-shape { border: 1px solid var(--line); border-radius: 8px; padding: 5px; margin: 5px 0 0 10px; background: var(--panel); cursor: pointer; }
.st-shape.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.studio .st-shape .st-row2 input[type=number] { width: 62px; flex: 0 0 62px; }
.st-shape .st-row { grid-template-columns: 26px minmax(80px, 1fr) minmax(90px, 1.2fr); }
.st-tab { border-collapse: collapse; margin: 6px 0; font-size: 11.5px; }
.st-tab th, .st-tab td { padding: 1px 8px; text-align: right; border-bottom: 1px solid var(--line); }
.ps-cross { cursor: default; user-select: none; }

/* Part Builder */
.pb-svg { cursor: crosshair; user-select: none; background: var(--panel); }
.pb-faces { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; max-height: 260px; overflow: auto; }
.pb-face { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 6px; border: 1px solid transparent; font-size: 12px; }
.pb-face > span:first-child { flex: 1; min-width: 0; }
.pb-face select { max-width: 170px; }
.studio .pb-face input[type=number] { width: 58px; }
.pb-face.sel { border-color: var(--accent); background: var(--accent-soft); }
.pb-3dview svg { width: 100%; height: auto; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.pb-3d input[type=range] { flex: 1; }
.studio .st-tab tr.st-sel td { background: var(--accent-soft); }
.studio .st-modes .st-tab { width: 100%; font-size: 11.5px; }

/* command palette */
.cmd-pal { width: min(680px, 94vw); }
.cmd-input { width: 100%; font-size: 15px; padding: 10px 12px; margin-bottom: 8px; }
.cmd-list { max-height: 56vh; overflow: auto; display: flex; flex-direction: column; gap: 1px; }
.cmd-row { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 7px; color: var(--text); cursor: pointer; }
.cmd-row.on { background: var(--accent-soft); }
.cmd-group { flex: 0 0 74px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cmd-label { flex: 1 1 auto; }
.cmd-sub { font-size: 11px; color: var(--muted); }
.cmd-row kbd { font-size: 11px; color: var(--muted); }
.cmd-btn { font-family: var(--mono, monospace); font-size: 11px; }
/* versions */
.vs-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; }
.vs-row { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.vs-row.auto { opacity: 0.85; }
.vs-thumb { width: 110px; height: 70px; flex: 0 0 110px; background: #fff; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.vs-thumb img { max-width: 100%; max-height: 100%; }
.vs-info { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vs-info small { color: var(--muted); }
.vs-acts { display: flex; gap: 6px; align-items: center; }

/* measuring on image panels */
.ms-modal { width: min(1280px, 96vw); }
.ms-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
.ms-view { position: relative; height: min(68vh, 640px); background: #0b0d12; border-radius: 8px; overflow: hidden; }
.ms-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; outline: none; }
.ms-side { display: flex; flex-direction: column; min-width: 0; max-height: min(68vh, 640px); overflow: auto; }
.ms-side h4 { margin: 10px 0 4px; }
.ms-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ms-tab { width: 100%; font-size: 11.5px; }
.ms-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.ms-list { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.ms-item { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.ms-item b { margin-left: auto; }
.ms-item.on { background: var(--accent-soft); }
@media (max-width: 900px) { .ms-wrap { grid-template-columns: 1fr; } .ms-view { height: 52vh; } }
.ms-acts .btn { flex: 0 0 auto; }
.po-big { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 8px; }
.po-big b { font-size: 26px; }
.po-big span { color: var(--muted); }

/* image editor */
.ie-view { background: #e9ebef; }
.ie-side { gap: 2px; }
.ie-sec { border-top: 1px solid var(--line); padding: 6px 0 8px; }
.ie-sec h4 { margin: 2px 0 6px; }
.ie-row { gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0; }
.ie-row .btn { flex: 0 0 auto; }
.ie-top { margin: 0 0 8px; }
.ie-slider { display: grid; grid-template-columns: 96px minmax(0, 1fr) 74px; align-items: center; gap: 6px; font-size: 12px; margin: 2px 0; }
.ie-slider input[type=range] { width: 100%; }
.ie-val { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
