:root {
  --blue: #2d66c9;
  --blue-dark: #16468f;
  --border: #7f9fc8;
  --toolbar-h: 66px;
  --sidebar-w: 300px;
  --grid-color: rgba(32, 95, 179, .10);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  color: #161616;
}
* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; background: #dde4ec; }
button, input, textarea, select { font: inherit; }
button { user-select: none; }

.v2-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: var(--toolbar-h) minmax(0, 1fr);
  width: 100%; height: 100%;
  border: 1px solid #315f9d;
  background: white;
}
.v2-sidebar {
  grid-column: 1; grid-row: 1 / 3;
  background: #f8dfcb;
  border-right: 1px solid #315f9d;
  position: relative;
  overflow: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.v2-sidebar-brand {
  color: rgba(63,72,83,.45); font-size: 13px; letter-spacing: .04em;
  margin: 2px 0 2px 12px;
}
.v2-toolbar {
  grid-column: 2; grid-row: 1;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid #315f9d;
  background: #fafafa;
  padding: 0 10px;
  position: relative; z-index: 50;
}
.v2-tabs { display: flex; align-items: center; gap: 8px; }
.v2-tab {
  min-width: 108px; height: 40px; border: 1px solid transparent;
  border-radius: 9px; background: transparent; color: #1d5ed4;
  font-weight: 700; cursor: pointer;
}
.v2-tab.active { background: white; border-color: #d8e0ec; box-shadow: 0 1px 5px rgba(30,55,90,.18); }
.v2-tab.play { min-width: 80px; background: #9eb0c9; border-color: #315f9d; color: white; font-size: 19px; font-weight: 400; }
.v2-log-toggle {
  margin-left: 20px; display: flex; align-items: center; gap: 7px;
  min-width: 0; flex: 1;
}
.v2-triangle {
  width: 0; height: 0; padding: 0; border: 0; background: transparent; cursor: pointer;
  border-left: 12px solid transparent; border-right: 12px solid transparent; border-bottom: 20px solid #4679c5;
}
.v2-triangle.open { transform: rotate(180deg); }
.v2-status { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; color: #0d9f71; }
.v2-status::before { content: '●'; margin-right: 4px; font-size: 8px; }
.v2-icon-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.v2-icon-btn {
  width: 50px; height: 50px; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.v2-icon-btn .round {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid #34577c; box-shadow: inset 0 0 0 3px rgba(255,255,255,.55), 0 1px 2px rgba(0,0,0,.2);
  color: white; font-weight: 900; position: relative;
}
.v2-icon-btn.undo .round { border-radius: 0; border: 0; box-shadow: none; color: #060606; font-size: 46px; width: 52px; height: 48px; line-height: 1; }
.v2-icon-btn.save .round { background: linear-gradient(#69cc59,#13952e); }
.v2-icon-btn.upload .round { background: linear-gradient(#ff5a56,#d71e1e); }
.v2-icon-btn.download .round { background: linear-gradient(#68b7f2,#1976c9); }
.v2-icon-label { position: absolute; bottom: 4px; font-size: 7px; letter-spacing: -.02em; }
.v2-icon-symbol { transform: translateY(-4px); font-size: 22px; }
.v2-icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.v2-main {
  grid-column: 2; grid-row: 2;
  min-width: 0; min-height: 0; position: relative; overflow: hidden;
}
.v2-scenario-page { width: 100%; height: 100%; position: relative; overflow: hidden; }
.v2-workspace {
  width: 100%; height: 100%; position: relative; overflow: hidden;
  background-color: var(--workspace1, #e8e8e8);
  background-image:
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: var(--cell, 50px) var(--cell, 50px);
}
.v2-plus {
  position: absolute; left: 18px; top: 16px; z-index: 10;
  width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  font-size: 58px; line-height: 34px; color: #4079c9; font-weight: 900;
}
.v2-settings {
  position: absolute; right: 12px; top: 16px; z-index: 10;
  width: 48px; height: 48px; border: 0; background: transparent; cursor: pointer;
  color: #326f9e; font-size: 42px; line-height: 1;
}
.v2-figure-layer { position: absolute; inset: 0; }
.v2-figure {
  position: absolute; display: flex; align-items: center; justify-content: center;
  min-width: 45px; min-height: 45px;
  border: 1px solid #315f9d; border-radius: 9px; background: var(--figure-bg,#f7d7c0);
  cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.05); padding: 4px; text-align: center;
  overflow: hidden; font-size: var(--figure-font,18px);
  box-sizing: border-box;
}
.v2-figure > span {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v2-figure.selected { outline: 3px solid rgba(43,102,201,.30); }
.v2-figure.move-ready { cursor: move; box-shadow: 0 0 0 3px rgba(45,102,201,.18); }
.v2-figure-resize {
  position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px;
  border: 1px solid #315f9d; background: white; cursor: nwse-resize; border-radius: 2px;
}
.v2-figure-resize::after { content:'↘'; position:absolute; inset:-4px 0 0 -3px; font-size:12px; color:#315f9d; }

.v2-detail {
  position: absolute; z-index: 30; width: 150px; height: 200px; min-width: 150px; min-height: 200px;
  resize: both; overflow: auto; border: 1px solid #315f9d; background: white; box-shadow: 0 8px 26px rgba(0,0,0,.15);
}
.v2-detail-head { display: flex; justify-content: flex-end; align-items: center; gap: var(--icon-gap,5px); padding: 5px; border-bottom: 1px solid #e1e6ec; background:#f8fafc; position: sticky; top:0; z-index:2; }
.v2-detail-icon { width: var(--icon-size,20px); height: var(--icon-size,20px); border: 1px solid #b9c7d8; border-radius: 4px; background: white; cursor:pointer; padding:0; font-size:12px; display:grid; place-items:center; }
.v2-detail-icon.danger { color:#b42318; }
.v2-detail-body { display:grid; gap:7px; padding:8px; }
.v2-detail-body label { display:grid; gap:3px; font-size:10px; color:#667085; }
.v2-detail-body input, .v2-detail-body textarea { width:100%; border:1px solid #cfd8e4; border-radius:6px; padding:6px; background:#fff; color:#111; }
.v2-detail-body textarea { min-height:95px; resize:none; font-size: var(--text-font,16px); }

.v2-log-panel {
  position: fixed; z-index: 100; left: calc(var(--sidebar-w) + 310px); top: 52px;
  width: 430px; height: 310px; min-width: 320px; min-height: 150px; max-width: calc(100vw - var(--sidebar-w) - 30px); max-height: calc(100vh - 85px);
  resize: both; overflow: auto; border: 1px solid #315f9d; background: rgba(250,250,250,.98); box-shadow: 0 10px 30px rgba(0,0,0,.16); padding: 10px;
}
.v2-log-head { display:flex; align-items:center; justify-content:center; position:sticky; top:0; background:rgba(250,250,250,.98); z-index:2; margin:-2px 0 8px; }
.v2-log-panel h3 { flex:1; margin:0; text-align:center; font-size:18px; }
.v2-log-close { width:28px; height:28px; border:1px solid #cfd8e4; border-radius:6px; background:white; color:#475467; cursor:pointer; font-size:20px; line-height:1; }
.v2-log-close:hover { background:#fff1f1; color:#b42318; border-color:#efb4b4; }
.v2-log-list { display:grid; gap:6px; font-size:12px; }
.v2-log-row { display:grid; grid-template-columns:72px minmax(0,1fr); gap:8px; border-bottom:1px solid #eceff4; padding-bottom:5px; }
.v2-log-time { color:#6b7280; }

.v2-settings-panel {
  position:absolute; z-index:40; right:16px; top:72px; width:310px; max-height:calc(100% - 90px); overflow:auto;
  border:1px solid #315f9d; background:white; box-shadow:0 10px 28px rgba(0,0,0,.14); border-radius:8px;
}
.v2-settings-head { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border-bottom:1px solid #e5e9ef; }
.v2-settings-head strong { font-size:15px; }
.v2-settings-head button { border:0; background:transparent; cursor:pointer; font-size:20px; }
.v2-settings-body { display:grid; gap:10px; padding:12px; }
.v2-settings-body label { display:grid; grid-template-columns:1fr 110px; align-items:center; gap:10px; font-size:12px; }
.v2-settings-body input[type="number"] { width:100%; min-height:30px; border:1px solid #ccd6e3; border-radius:6px; padding:4px 6px; }
.v2-settings-body input[type="color"] { width:100%; height:30px; border:1px solid #ccd6e3; padding:0; background:white; }

.v2-inner {
  position:absolute; z-index:20; inset:11px; border:1px solid #315f9d; background:var(--workspace2,#f7f7f7); overflow:auto;
}
.v2-inner-head { position:sticky; top:0; z-index:5; display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:48px; padding:7px 10px 7px 16px; border-bottom:1px solid #d8e0ea; background:rgba(255,255,255,.96); }
.v2-inner-head strong { font-size:15px; }
.v2-inner-close { width:34px; height:34px; border:0; background:transparent; color:#4778bd; font-size:34px; font-weight:900; line-height:1; cursor:pointer; }
.v2-inner-content { min-height:calc(100% - 49px); color:#111827; padding:14px 18px 28px; }
.v2-inner-create-bar { display:flex; align-items:center; gap:12px; min-height:52px; }
.v2-inner-plus { flex:0 0 auto; width:52px; height:48px; border:0; background:transparent; color:#4079c9; font-size:58px; font-weight:900; line-height:42px; cursor:pointer; }
.v2-inner-create-fields { flex:1; display:grid; grid-template-columns:90px 120px minmax(260px,1fr) 92px; gap:8px; align-items:end; }
.v2-inner-create-fields[hidden] { display:none; }
.v2-inner-create-fields label { display:grid; gap:3px; color:#667085; font-size:10px; }
.v2-inner-create-fields input { width:100%; height:36px; border:1px solid #b9c7d8; border-radius:7px; background:white; padding:0 9px; color:#111827; font:16px "Segoe UI",Arial,sans-serif; }
.v2-inner-create-button { height:36px; border:1px solid #315f9d; border-radius:7px; background:#eef4ff; color:#2456ad; font-weight:700; cursor:pointer; }
.v2-inner-help { margin:4px 0 18px 65px; color:#667085; font-size:12px; }
.v2-inner-buttons-grid { position:relative; min-height:520px; margin:0 0 0 64px; padding:14px 0; border:1px dashed transparent; overflow:hidden; }
.v2-inner-buttons-grid:hover { border-color:#d7e0eb; }
.v2-inner-scenario-button { position:absolute; min-width:48px; min-height:46px; border:1px solid #315f9d; border-radius:9px; background:var(--figure-bg,#f7d7c0); padding:6px 12px; color:#111; font-size:14px; cursor:grab; box-shadow:0 1px 2px rgba(0,0,0,.05); touch-action:none; user-select:none; }
.v2-inner-scenario-button:active, .v2-inner-scenario-button.dragging { cursor:grabbing; box-shadow:0 6px 16px rgba(49,95,157,.22); z-index:3; }
.v2-inner-empty { width:100%; border:1px dashed #cbd5e1; border-radius:9px; background:rgba(255,255,255,.55); padding:18px; color:#667085; font-size:14px; }
@media (max-width: 900px) {
  .v2-inner-create-fields { grid-template-columns:80px 100px minmax(160px,1fr); }
  .v2-inner-create-button { grid-column:1 / -1; width:100px; }
  .v2-inner-help, .v2-inner-buttons-grid { margin-left:0; }
}

.v2-empty-tab { display:grid; place-items:center; width:100%; height:100%; background:#f2f4f7; color:#667085; font-size:20px; text-align:center; }
.v2-pagination { position:absolute; z-index:12; right:18px; bottom:16px; display:flex; align-items:center; gap:8px; background:rgba(255,255,255,.88); border:1px solid #cdd7e4; border-radius:9px; padding:5px 8px; }
.v2-pagination button { width:28px; height:28px; border:1px solid #c6d0de; border-radius:6px; background:white; cursor:pointer; }
.v2-pagination span { font-size:12px; min-width:46px; text-align:center; }

.v2-modal-backdrop { position:fixed; inset:0; z-index:200; display:grid; place-items:center; background:rgba(15,23,42,.22); }
.v2-modal { width:min(430px, calc(100vw - 30px)); border:1px solid #315f9d; border-radius:10px; background:white; box-shadow:0 18px 55px rgba(0,0,0,.22); padding:16px; }
.v2-modal h3 { margin:0 0 12px; }
.v2-modal input { width:100%; height:38px; border:1px solid #cbd5e1; border-radius:7px; padding:0 10px; }
.v2-modal-actions { margin-top:12px; display:flex; justify-content:flex-end; gap:8px; }
.v2-modal-actions button { min-height:34px; border:1px solid #cbd5e1; border-radius:7px; background:white; padding:0 12px; cursor:pointer; }
.v2-modal-actions .primary { background:#2d66c9; color:white; border-color:#2d66c9; }

@media (max-width: 900px) {
  :root { --sidebar-w: 110px; }
  .v2-tab { min-width:82px; }
  .v2-status { display:none; }
  .v2-log-toggle { margin-left:4px; flex:0 0 auto; }
  .v2-icon-actions { gap:4px; }
  .v2-icon-btn { width:42px; height:42px; }
  .v2-icon-btn .round { width:38px; height:38px; }
  .v2-log-panel { left:130px; width:380px; }
}


.v2-side-section { display:grid; gap:8px; }
.v2-side-title { color:#5e534c; font-size:12px; font-weight:700; letter-spacing:.02em; }
.v2-side-add,
.v2-side-danger { min-height:34px; border:1px solid #315f9d; border-radius:8px; background:#fff; color:#2456ad; font:700 13px "Segoe UI", Arial, sans-serif; cursor:pointer; padding:0 10px; }
.v2-side-danger { border-color:#d36a6a; color:#a32d2d; }
.v2-side-danger:disabled { opacity:.45; cursor:not-allowed; }
.v2-side-empty { font-size:12px; color:#7a726d; line-height:1.35; }
.v2-sound-list { display:grid; gap:6px; max-height:360px; overflow:auto; padding-right:2px; }
.v2-sound-item { display:flex; align-items:flex-start; gap:8px; font-size:12px; color:#4b4b4b; line-height:1.25; }
.v2-sound-item input { margin-top:2px; }
.v2-sound-item span { word-break:break-word; }
.v2-inner-layout { display:block; }
.v2-inner-workarea { min-width:0; }
.v2-inner-sidepanel { display:none; }
.v2-editor-group { display:grid; gap:8px; margin-bottom:14px; }
.v2-editor-group > label,
.v2-editor-title { font-size:12px; font-weight:700; color:#5e534c; }
.v2-inner-sidepanel select,
.v2-inner-sidepanel input { width:100%; min-height:32px; border:1px solid #b9c7d8; border-radius:7px; background:#fff; padding:0 8px; color:#111827; font:14px "Segoe UI", Arial, sans-serif; }
.v2-action-row { display:grid; gap:6px; margin-bottom:8px; }
.v2-action-skip { min-height:32px; display:flex; align-items:center; border:1px dashed #c6b39f; border-radius:7px; padding:0 8px; color:#7b6354; background:#fff9f3; font-size:12px; }
.v2-action-remove, .v2-editor-add { min-height:32px; border:1px solid #315f9d; border-radius:7px; background:#fff; color:#2456ad; font:700 13px "Segoe UI", Arial, sans-serif; cursor:pointer; }
.v2-action-remove { border-color:#d36a6a; color:#a32d2d; }
.v2-editor-empty { color:#5b6470; font-size:13px; line-height:1.45; }
.v2-editor-empty.small { font-size:12px; }
.v2-editor-note { font-size:11px; color:#7b6354; line-height:1.35; }
.v2-inner-scenario-button.selected { box-shadow:0 0 0 3px rgba(49,95,157,.28); border-color:#194c9f; }



.v2-side-section { display:grid; gap:8px; background:rgba(255,255,255,.28); border:1px solid rgba(49,95,157,.22); border-radius:10px; padding:10px; }
.v2-side-title { font-size:13px; font-weight:700; color:#5f4c3e; }
.v2-side-note { font-size:11px; line-height:1.35; color:#7d6c5f; }
.v2-side-row-inline { display:flex; align-items:center; gap:6px; }
.v2-side-row-inline.wrap { flex-wrap:wrap; }
.v2-side-row-inline.tight { gap:4px; }
.v2-side-add, .v2-side-danger, .v2-side-action-btn, .v2-mode-btn, .v2-side-select, .v2-side-mini {
  border:1px solid #315f9d; background:#fff; color:#2456ad; border-radius:8px; min-height:32px; padding:0 10px; cursor:pointer;
}
.v2-side-danger, .v2-side-mini.danger { border-color:#d36a6a; color:#a32d2d; }
.v2-side-add, .v2-side-danger, .v2-side-action-btn, .v2-mode-btn { font-weight:700; }
.v2-side-select { flex:1; text-align:left; padding:0 9px; }
.v2-side-mini { min-width:32px; height:32px; padding:0; display:grid; place-items:center; }
.v2-side-mini:disabled { opacity:.45; cursor:not-allowed; }
.v2-side-button-list { display:grid; gap:10px; }
.v2-side-button-card { border:1px solid rgba(49,95,157,.35); border-radius:10px; background:rgba(255,255,255,.36); padding:8px; display:grid; gap:8px; }
.v2-side-button-card.selected { box-shadow:0 0 0 2px rgba(49,95,157,.25) inset; }
.v2-side-button-head { display:flex; align-items:center; gap:6px; }
.v2-side-button-body { display:grid; gap:8px; }
.v2-side-flags { display:flex; gap:10px; flex-wrap:wrap; font-size:12px; color:#54463c; }
.v2-side-action-list { display:grid; gap:8px; }
.v2-side-action-card { display:grid; gap:6px; border:1px solid rgba(49,95,157,.2); border-radius:8px; padding:8px; background:#fff8f1; }
.v2-side-action-label { flex:1; font-size:12px; font-weight:700; color:#5d4a3d; }
.v2-side-sound-slot { display:grid; gap:6px; }
.v2-sound-list { display:grid; gap:8px; max-height:190px; overflow:auto; }
.v2-sound-item { display:grid; gap:4px; padding:6px 8px; border:1px solid rgba(49,95,157,.18); border-radius:8px; background:rgba(255,255,255,.46); font-size:12px; color:#51453f; }
.v2-sound-item label { display:flex; gap:8px; align-items:flex-start; }
.v2-side-empty { font-size:12px; color:#72675f; line-height:1.35; }
.v2-sidebar select, .v2-sidebar input[type="text"], .v2-sidebar input[type="number"] { width:100%; min-height:34px; border:1px solid #b5c8df; border-radius:8px; background:#fff; padding:0 8px; font:14px "Segoe UI", Arial, sans-serif; }
.v2-inner-toolbar2 { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:8px 0 12px; }
.v2-mode-btn.active { background:#dfe9f8; }
.v2-inner-toolbar-note { font-size:12px; color:#5f7088; }
.v2-inner-workarea { min-height:0; }
.v2-inner-lines { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible; }
.v2-inner-buttons-grid { position:relative; }
.v2-inner-scenario-button.pending { box-shadow:0 0 0 3px rgba(255,153,0,.28); }
@media (max-width: 1200px) { :root { --sidebar-w: 280px; } }


.v2-inner-workarea { position:relative; }
.v2-inner-panel-host[hidden] { display:none !important; }
.v2-inner-panel-host { position:absolute; top:18px; right:18px; z-index:9; width:290px; }
.v2-floating-panel { border:1px solid #315f9d; background:#f8dfcb; border-radius:0; padding:14px; box-shadow:0 10px 28px rgba(0,0,0,.12); }
.v2-floating-panel-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.v2-floating-panel-head strong { font-size:15px; color:#5d4d42; }
.v2-floating-close { width:28px; height:28px; border:1px solid #315f9d; border-radius:6px; background:#fff; color:#315f9d; cursor:pointer; font-size:18px; line-height:1; }
.v2-floating-panel .v2-editor-group { margin-bottom:12px; }
.v2-floating-panel .v2-editor-group label, .v2-floating-panel .v2-editor-title { font-size:12px; font-weight:700; color:#5e534c; }
.v2-floating-panel select, .v2-floating-panel input { width:100%; min-height:34px; border:1px solid #b9c7d8; border-radius:7px; background:#fff; padding:0 8px; color:#111827; font:14px "Segoe UI", Arial, sans-serif; }
@media (max-width: 1200px) { .v2-inner-panel-host { position:static; width:100%; margin:0 0 16px; } }


/* Arrow selection and precise connection geometry */
.v2-inner-lines { position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; z-index:1; }
.v2-inner-connection { stroke:#3f73c8; stroke-width:2; fill:none; pointer-events:none; }
.v2-inner-connection.selected { stroke:#f28b00; stroke-width:3.5; filter:drop-shadow(0 0 2px rgba(242,139,0,.35)); }
.v2-inner-connection-hit { stroke:transparent; stroke-width:16; fill:none; pointer-events:stroke; cursor:pointer; }
.v2-inner-scenario-button { z-index:2; }
.v2-delete-arrow-btn:disabled { opacity:.42; cursor:not-allowed; }

.v2-side-scenarios, .v2-inner-scenario-tabs { display:flex; flex-wrap:wrap; gap:8px; }
.v2-side-scenario-tab, .v2-inner-scenario-tab, .v2-inner-scenario-add {
  min-height:34px; padding:0 12px; border:1px solid #315f9d; background:#fff; color:#1d5ed4; border-radius:10px; cursor:pointer; font-weight:700;
}
.v2-side-scenario-tab.active, .v2-inner-scenario-tab.active { background:#e9f1ff; }
.v2-inner-scenario-tabs { margin-bottom:10px; align-items:center; }
.v2-inner-scenario-add[disabled], .v2-side-add[disabled] { opacity:.5; cursor:not-allowed; }

.v2-inner-scenario-add{font-size:20px;line-height:1;min-width:42px;padding:0 10px;}

.v2-inner-scenario-tabs-wrap { display:grid; gap:8px; margin-bottom:10px; }
.v2-inner-scenario-tabs { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.v2-inner-scenario-add { order:-1; width:42px; min-width:42px; padding:0; font-size:26px; font-weight:800; }
.v2-tab-create-fields { display:grid; grid-template-columns:90px 120px minmax(260px,1fr) 130px; gap:8px; align-items:end; padding:10px; border:1px solid #c8d4e4; background:#f8fbff; border-radius:9px; }
.v2-tab-create-fields[hidden] { display:none; }
.v2-tab-create-fields label { display:grid; gap:3px; font-size:10px; color:#667085; }
.v2-tab-create-fields input { width:100%; height:36px; border:1px solid #b9c7d8; border-radius:7px; background:white; padding:0 9px; color:#111827; font:16px "Segoe UI",Arial,sans-serif; }
.v2-tab-create-help { font-size:11px; color:#667085; margin-left:48px; }
.v2-active-scenario-card { background:#fff6ee; }
@media (max-width: 1000px) { .v2-tab-create-fields { grid-template-columns:1fr 1fr; } .v2-tab-create-fields .names { grid-column:1 / -1; } .v2-tab-create-help { margin-left:0; } }

.v2-side-title-row { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.v2-side-collapse { width:30px; height:28px; border:1px solid #315f9d; border-radius:7px; background:#fff; color:#2456ad; cursor:pointer; font-size:12px; }
.v2-side-mini.play { color:#1163c9; font-weight:900; }
.v2-inner-scenario-tab-wrap { display:inline-flex; align-items:stretch; border:1px solid #315f9d; border-radius:10px; overflow:hidden; background:#fff; cursor:grab; }
.v2-inner-scenario-tab-wrap.active { background:#e9f1ff; }
.v2-inner-scenario-tab-wrap.dragging { opacity:.45; cursor:grabbing; }
.v2-inner-scenario-tab-wrap.drag-over { box-shadow:0 0 0 3px rgba(45,102,201,.25); }
.v2-inner-scenario-tab-wrap .v2-inner-scenario-tab { border:0; border-radius:0; min-height:34px; }
.v2-inner-scenario-delete { width:30px; border:0; border-left:1px solid #b8c8de; background:#fff7f7; color:#b42318; font-weight:900; cursor:pointer; }
.v2-inner-scenario-delete:hover { background:#ffe8e8; }

.v2-play-scenario-btn.playing { background:#e4f7e9; border-color:#2f8f4e; color:#176c35; }
.v2-inner-scenario-button.play-enabled { cursor:pointer; }
.v2-inner-scenario-button.play-enabled:hover { box-shadow:0 0 0 3px rgba(45,102,201,.18), 0 4px 10px rgba(49,95,157,.16); transform:translateY(-1px); }


/* V2.22 — ожидание стартовой F-кнопки */
.v2-inner-scenario-button.play-disabled {
  opacity: .38;
  filter: grayscale(.25);
  cursor: not-allowed !important;
  box-shadow: none !important;
}
.v2-inner-scenario-button.play-start {
  outline: 3px solid rgba(25, 135, 84, .32);
  border-color: #198754;
  cursor: pointer !important;
}


/* V2.23 — Экран и Play */
.v2-screen-page, .v2-play-page { width:100%; height:100%; display:flex; flex-direction:column; background:#eef2f6; }
.v2-screen-toolbar, .v2-play-toolbar {
  flex:0 0 auto; min-height:58px; display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:9px 12px; background:#fff; border-bottom:1px solid #b9c8db;
}
.v2-screen-toolbar label, .v2-play-toolbar label { display:flex; align-items:center; gap:7px; font-size:12px; font-weight:700; color:#475467; }
.v2-screen-toolbar select, .v2-play-toolbar select { min-width:180px; height:36px; border:1px solid #9fb4cf; border-radius:8px; background:#fff; padding:0 9px; }
.v2-screen-toolbar button, .v2-play-toolbar button {
  min-height:36px; border:1px solid #315f9d; border-radius:8px; background:#fff; color:#2456ad; padding:0 12px; font-weight:700; cursor:pointer;
}
.v2-screen-toolbar button:disabled { opacity:.45; cursor:not-allowed; }
.v2-play-toolbar button.stop { color:#08783f; border-color:#19945b; background:#effbf4; }
.v2-screen-filename { max-width:260px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:12px; color:#667085; }
.v2-screen-hint { margin-left:auto; font-size:12px; color:#667085; }
.v2-play-status { flex:1; min-width:250px; font-size:13px; color:#08783f; font-weight:600; }
.v2-screen-stage, .v2-play-stage {
  position:relative; flex:1 1 auto; min-height:0; overflow:hidden; background:#fff; isolation:isolate;
  background-image:linear-gradient(to right, rgba(45,102,201,.06) 1px, transparent 1px),linear-gradient(to bottom, rgba(45,102,201,.06) 1px, transparent 1px);
  background-size:40px 40px;
}
.v2-screen-background { position:absolute; inset:0; z-index:1; width:100%; height:100%; object-fit:contain; pointer-events:none; user-select:none; }
.v2-screen-no-bg { position:absolute; z-index:2; left:50%; top:50%; transform:translate(-50%,-50%); color:#98a2b3; font-size:16px; pointer-events:none; }
.v2-screen-no-bg[hidden] { display:none; }
.v2-screen-button, .v2-play-button {
  position:absolute; z-index:10; transform:none; min-width:48px; min-height:46px; border:2px solid #315f9d; border-radius:50%;
  background:rgba(255,232,204,.93); color:#111827; padding:6px 10px; box-shadow:0 2px 5px rgba(0,0,0,.12); font-weight:700;
}
.v2-screen-button { cursor:grab; touch-action:none; }
.v2-screen-button:active { cursor:grabbing; }
.v2-play-button { cursor:pointer; }
.v2-play-button.inactive { opacity:.25; filter:grayscale(.6); }
.v2-play-button.start-ready { box-shadow:0 0 0 5px rgba(45,102,201,.18),0 2px 5px rgba(0,0,0,.12); background:#dbeafe; }
.v2-play-button.expected { box-shadow:0 0 0 5px rgba(15,157,103,.20),0 2px 5px rgba(0,0,0,.12); background:#dcfae6; border-color:#14935d; }
.v2-play-button.free-ready { box-shadow:0 0 0 4px rgba(245,158,11,.18); border-color:#d58a00; }
.v2-play-button:disabled { cursor:not-allowed; }
@media (max-width:900px) {
  .v2-screen-hint { display:none; }
  .v2-screen-toolbar, .v2-play-toolbar { align-items:flex-start; }
}

.v2-screen-button:hover, .v2-play-button:hover { z-index:12; }
.v2-screen-button:focus-visible, .v2-play-button:focus-visible { z-index:13; outline:3px solid rgba(45,102,201,.28); outline-offset:2px; }


/* V2.26: Play-only layer switch. Screen editor always keeps buttons above the image. */
.v2-play-layer-toggle.behind { background:#f2f4f7; color:#475467; }
.v2-play-layer-toggle.front { background:#eef4ff; color:#2456ad; }
.v2-play-stage.buttons-front .v2-play-button { z-index:10; }
.v2-play-stage.buttons-behind .v2-play-button,
.v2-play-stage.buttons-behind .v2-play-button:hover,
.v2-play-stage.buttons-behind .v2-play-button:focus-visible { z-index:0 !important; }
.v2-play-stage.buttons-behind .v2-screen-background { z-index:5; }
.v2-play-stage.buttons-front .v2-screen-background { z-index:1; }

.v2-play-edit-button {
  border-color:#315f9d !important;
  background:#eef4ff !important;
  color:#174d9c !important;
  font-weight:700 !important;
}
.v2-play-edit-button:hover { background:#dfeaff !important; }


/* V2.29 button renaming */
.v2-side-name-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 1px solid #315f9d;
  border-radius: 8px;
  background: #fff;
  color: #174f9d;
  padding: 0 10px;
  font: 16px "Segoe UI", Arial, sans-serif;
}
.v2-side-name-input:focus {
  outline: 2px solid rgba(49,95,157,.22);
  outline-offset: 1px;
}
.v2-floating-panel [data-editor-rename-button] {
  width: 100%;
  min-height: 34px;
  border: 1px solid #b9c7d8;
  border-radius: 7px;
  background: #fff;
  padding: 0 8px;
  color: #111827;
  font: 14px "Segoe UI", Arial, sans-serif;
}


/* V2.34 — pages inside 2РО */
.v2-inner-pagebar {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:0 0 12px;
  padding:8px 10px;
  border:1px solid #cbd8ea;
  border-radius:9px;
  background:rgba(255,255,255,.65);
}
.v2-inner-page-label { font-weight:700; color:#334155; font-size:14px; }
.v2-inner-pagebar select {
  min-width:180px;
  height:34px;
  border:1px solid #315f9d;
  border-radius:7px;
  background:white;
  padding:0 9px;
  color:#111827;
  font-weight:600;
}
.v2-inner-page-add,
.v2-inner-page-rename {
  width:36px;
  height:34px;
  border:1px solid #315f9d;
  border-radius:7px;
  background:white;
  color:#1d5ed4;
  font-size:20px;
  font-weight:800;
  cursor:pointer;
}
.v2-inner-page-rename { font-size:16px; }
.v2-side-page-info { background:rgba(255,255,255,.42); }
.v2-side-page-name { font-size:14px; font-weight:800; color:#315f9d; word-break:break-word; }

.v2-screen-toolbar label,
.v2-play-toolbar label { display:flex; align-items:center; gap:7px; white-space:nowrap; }
.v2-screen-toolbar select,
.v2-play-toolbar select { min-width:150px; }


/* V2.37 — Published fullscreen mode */
.v2-tab.publish { min-width:150px; background:#eef4ff; color:#174d9c; }
.v2-publish-overlay {
  position:fixed; inset:0; z-index:10000; background:#000; width:100vw; height:100vh; overflow:hidden;
}
.v2-publish-stage {
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  overflow:hidden; background:#000; isolation:isolate;
}
.v2-publish-background {
  position:absolute; inset:0; width:100%; height:100%; object-fit:contain; z-index:1; pointer-events:none; user-select:none;
}
.v2-publish-no-bg {
  position:absolute; inset:0; display:grid; place-items:center; color:#98a2b3; background:#fff; z-index:1; font-size:18px;
}
.v2-publish-button {
  position:absolute; z-index:10; min-width:48px; min-height:46px; border:2px solid #315f9d; border-radius:50%;
  background:rgba(255,232,204,.93); color:#111827; padding:6px 10px; box-shadow:0 2px 5px rgba(0,0,0,.16); font-weight:700; cursor:pointer;
}
.v2-publish-button.inactive { opacity:.25; filter:grayscale(.6); }
.v2-publish-button.start-ready { box-shadow:0 0 0 5px rgba(45,102,201,.22),0 2px 5px rgba(0,0,0,.16); background:#dbeafe; }
.v2-publish-button.expected { box-shadow:0 0 0 5px rgba(15,157,103,.22),0 2px 5px rgba(0,0,0,.16); background:#dcfae6; border-color:#14935d; }
.v2-publish-button.free-ready { box-shadow:0 0 0 4px rgba(245,158,11,.22); border-color:#d58a00; }
.v2-publish-button:disabled { cursor:not-allowed; }
.v2-publish-stage.buttons-front .v2-publish-button { z-index:10; }
.v2-publish-stage.buttons-behind .v2-publish-button { z-index:0; }
.v2-publish-stage.buttons-behind .v2-publish-background { z-index:5; }
.v2-publish-stage.buttons-front .v2-publish-background { z-index:1; }
.v2-publish-close {
  position:absolute; top:18px; right:18px; z-index:10020; width:52px; height:52px; border:0; border-radius:10px;
  background:rgba(255,255,255,.88); color:#2d66c9; font-size:40px; line-height:1; font-weight:700; cursor:pointer; box-shadow:0 3px 14px rgba(0,0,0,.18);
}
.v2-publish-page-picker {
  position:absolute; right:18px; bottom:18px; z-index:10020;
}
.v2-publish-page-picker select {
  min-width:120px; height:42px; border:1px solid #315f9d; border-radius:8px; background:rgba(255,255,255,.93); color:#111827; padding:0 34px 0 12px; font:700 16px "Segoe UI", Arial, sans-serif;
}


/* V2.40 — reliable published-page clicks even when visual buttons are behind the background */
.v2-publish-hitbox {
  position:absolute; z-index:50; min-width:48px; min-height:46px; border:2px solid transparent; border-radius:50%;
  background:transparent; color:transparent; padding:6px 10px; opacity:0; cursor:pointer; pointer-events:auto;
  font-weight:700;
}
.v2-publish-hitbox:disabled { cursor:not-allowed; pointer-events:none; }
.v2-publish-runtime-status {
  position:absolute; left:18px; bottom:18px; z-index:10020; max-width:min(70vw,760px); min-height:38px;
  display:flex; align-items:center; padding:8px 12px; border-radius:9px; background:rgba(255,255,255,.88);
  color:#08783f; font-size:13px; font-weight:700; box-shadow:0 3px 14px rgba(0,0,0,.18); pointer-events:none;
}


/* V2.41 — published canvas keeps the editor stage aspect ratio, so button coordinates do not drift */
.v2-publish-overlay { display:block; }


/* V2.43 — publish stays inside the browser tab; exact editor canvas is uniformly scaled. */
.v2-publish-overlay { width:100%; height:100%; }

/* Internet publication wrapper */
body.site-public { margin:0; overflow:hidden; background:#111827; }
body.site-public #app { visibility:hidden; }
body.site-public .v2-publish-overlay { visibility:visible; }
body.site-public-error #app { visibility:visible; }
