:root {
  --bg: #e6e9ee;
  --panel: #f4f6f8;
  --panel-border: #c5ccd6;
  --text: #1c2430;
  --muted: #5a6678;
  --accent: #0b6cb8;
  --accent-hover: #095a9a;
  --danger: #b33a3a;
  --toolbar: #dfe4ea;
  --viewport-bg: #f2f4f7;
  --font: "Segoe UI", "PT Sans", "Tahoma", sans-serif;
  --mono: "Cascadia Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 13px;
}

#app {
  display: grid;
  grid-template-rows: auto 1fr 24px;
  height: 100%;
}

/* —— Верхнее меню + панель инструментов —— */
.top-chrome {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5000;
  background: var(--os-bar, #2b3139);
  border-bottom: 1px solid #1a1e24;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* —— Menu —— */
.menu-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  background: linear-gradient(#f8f9fb, #e8ecf1);
  border-bottom: 1px solid var(--panel-border);
  user-select: none;
  position: relative;
  z-index: 5000;
  overflow: visible;
}
.menu-item {
  position: relative;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: default;
}
.menu-item:hover { background: #d5e8f8; }
.menu-item .dropdown {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  min-width: 220px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 24px rgba(20, 30, 50, 0.22);
  z-index: 5000;
  padding: 4px 0;
}
.menu-item:hover .dropdown,
.menu-item.open .dropdown {
  /* показ только через #menuPortal (иначе grid обрезает список) */
  display: none;
}
.dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 6px 14px;
  font: inherit;
  cursor: pointer;
}
.dropdown button:hover { background: #e3f0fb; }
.dropdown .sep {
  height: 1px;
  background: var(--panel-border);
  margin: 4px 0;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-right: 10px;
  padding: 0 8px;
  font-size: 14px;
}
.main-menu {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
  min-width: 0;
  overflow: visible;
  position: relative;
  z-index: 1;
}
.qb-sep {
  width: 1px;
  height: 18px;
  background: var(--panel-border);
  margin: 0 4px;
}
.snap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  user-select: none;
}
.menu-group-title {
  padding: 4px 14px 2px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* —— Tool area / Ribbon (внутри .top-chrome) —— */
.tool-area {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  background: linear-gradient(#eef2f6, #e2e7ee);
  border-bottom: 1px solid var(--panel-border);
  min-height: 76px;
}
.tool-sets {
  border-right: 1px solid var(--panel-border);
  overflow: auto;
  padding: 4px;
}
.tool-set-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 5px 8px;
  border-radius: 3px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.tool-set-btn.active, .tool-set-btn:hover {
  background: #cfe3f6;
  color: #064a82;
}
.tool-panels {
  padding: 4px 8px 2px;
  overflow: visible;
}
.flyout {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 24px rgba(20, 30, 50, 0.18);
  z-index: 80;
  padding: 4px;
  border-radius: 4px;
}
.flyout.open { display: block; }

/* Flyout в портале — поверх рабочего поля */
.menu-portal > .flyout {
  pointer-events: auto;
  display: block;
  position: fixed;
  min-width: 220px;
  max-height: min(70vh, 480px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--panel-border);
  box-shadow: 0 12px 32px rgba(20, 30, 50, 0.28);
  z-index: 20001;
  padding: 4px;
  border-radius: 4px;
}
.ribbon {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 100%;
  min-height: 76px;
}
.ribbon-panel {
  display: flex;
  flex-direction: column;
  padding: 2px 8px 0;
  border-right: 1px solid #c8d0da;
  min-width: 0;
}
.ribbon-panel:last-child { border-right: 0; }
.ribbon-panel-body {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 2px;
  flex: 1;
}
.ribbon-panel-title {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  padding: 2px 0 1px;
  border-top: 1px solid #d5dbe3;
  margin-top: 2px;
  white-space: nowrap;
}
.tool-group {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}
.tool-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  min-width: 64px;
  max-width: 96px;
  height: auto;
  min-height: 52px;
  padding: 3px 5px 2px;
  border: 1px solid transparent;
  border-radius: 3px 0 0 3px;
  background: transparent;
  font: inherit;
  font-size: 9px;
  line-height: 1.2;
  color: var(--text);
  cursor: pointer;
  white-space: normal;
}
.tool-group:not(.has-flyout) .tool-btn { border-radius: 3px; }
.tool-btn .caption {
  display: block;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  max-width: 90px;
  line-height: 1.2;
  -webkit-line-clamp: unset;
}
.tool-btn:hover { background: #d5e8f8; border-color: #9ec5e8; }
.tool-btn.active {
  background: #b9d8f5;
  border-color: var(--accent);
}
.tool-btn .ico {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}
.flyout-chevron {
  width: 14px;
  border: 1px solid transparent;
  border-left: 0;
  border-radius: 0 3px 3px 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  padding: 0;
}
.tool-group:hover .flyout-chevron,
.tool-group.open .flyout-chevron {
  background: #d5e8f8;
  border-color: #9ec5e8;
}
.flyout-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 6px 8px;
  border-radius: 3px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.flyout-item:hover { background: #e3f0fb; }
.flyout-item.current { background: #d4e8fa; }
.flyout-item .ico {
  width: 18px;
  text-align: center;
  color: var(--accent);
  font-weight: 700;
}

/* Floating command window */
.float-host {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}
.float-host.hidden { display: none; }
.float-win {
  pointer-events: auto;
  position: absolute;
  top: 130px;
  right: 300px;
  width: 300px;
  background: #f7f9fb;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(20, 30, 50, 0.22);
  overflow: hidden;
}
.float-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(#3a7ab8, #2f6aa3);
  color: #fff;
  cursor: move;
  user-select: none;
}
.float-title { font-weight: 600; font-size: 13px; }
.float-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.float-body {
  padding: 10px 12px 12px;
  max-height: min(60vh, 420px);
  overflow: auto;
}
.float-body h3 { display: none; }
.float-body .msg {
  background: #eef5fb;
  border: 1px solid #c5d9ec;
  border-radius: 4px;
  padding: 8px;
  color: var(--muted);
  margin-bottom: 10px;
  font-size: 12px;
}
.float-body .field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.float-body .field label { color: var(--muted); font-size: 12px; }
.float-body .field input,
.float-body .field select {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  padding: 5px 6px;
  font: inherit;
}
.float-body .actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.float-body .actions button {
  flex: 1;
  border: 1px solid var(--panel-border);
  background: #fff;
  border-radius: 3px;
  padding: 7px;
  font: inherit;
  cursor: pointer;
}
.float-body .actions button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.float-body .anim-os-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.float-body .anim-os-row button {
  border: 1px solid var(--panel-border);
  background: #fff;
  border-radius: 3px;
  padding: 7px 10px;
  font: inherit;
  cursor: pointer;
}
.float-body .anim-os-row button:hover {
  background: #e3f0fb;
  border-color: var(--accent);
}
.float-body .field input[type="range"] {
  accent-color: var(--accent);
  grid-column: 1 / -1;
}
.float-body .field:has(input[type="range"]) {
  grid-template-columns: 1fr;
}
.tool-row { display: none; }

/* —— Quick bar —— */
.quick-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: #eef1f5;
  border-bottom: 1px solid var(--panel-border);
}
.quick-bar button, .quick-bar select {
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--panel-border);
  background: #fff;
  border-radius: 3px;
  padding: 4px 8px;
  cursor: pointer;
}
.quick-bar button:hover { background: #e3f0fb; }
.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search input {
  width: 200px;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  padding: 4px 8px;
  font: inherit;
}

/* —— Workspace —— */
.workspace {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  min-height: 0;
}
.side-panel {
  background: var(--panel);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.side-panel.right {
  border-right: 0;
  border-left: 1px solid var(--panel-border);
}
.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--panel-border);
  background: #e8ecf1;
}
.panel-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px;
  font: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.panel-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  background: #fff;
}
.panel-body {
  flex: 1;
  overflow: auto;
  padding: 8px;
}
.tree-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
}
.tree-node:hover { background: #e3f0fb; }
.tree-node.lit { background: #c5dff5; box-shadow: inset 3px 0 0 #1a6dff; }
.tree-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 4px 8px;
  position: sticky;
  top: 0;
  background: var(--panel, #f4f6f8);
  z-index: 2;
}
.tree-toolbar button { font-size: 12px; padding: 4px 8px; cursor: pointer; }
.tree-node .mark {
  width: 14px;
  text-align: center;
  color: var(--accent);
  font-size: 11px;
}
.tree-node .tree-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-node .tree-draw {
  flex: 0 0 auto;
  margin-left: auto;
  border: 0;
  background: #e4edf8;
  color: #1a6dff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 3px 6px;
}
.tree-node .tree-draw:hover {
  background: #1a6dff;
  color: #fff;
}
.tree-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 10px 4px 4px;
}
.viewport-wrap {
  position: relative;
  background: var(--viewport-bg);
  min-width: 0;
}
#c {
  display: block;
  width: 100%;
  height: 100%;
}
.orient {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #cfd8e4);
  border: 1px solid #9aabbc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #345;
  font-weight: 600;
}
.confirm-corner {
  position: absolute;
  right: 12px;
  top: 96px;
  display: flex;
  gap: 6px;
  z-index: 20;
}
.confirm-corner.hidden { display: none; }
.confirm-corner button {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid #9ab;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.confirm-corner #confirmOk {
  background: #2f8f4e;
  border-color: #247a40;
  color: #fff;
}
.confirm-corner #confirmCancel {
  background: #c44;
  border-color: #a33;
  color: #fff;
}
.sketch-badge {
  position: absolute;
  right: 12px;
  top: 140px;
  background: #0b6cb8;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 20;
}
.sketch-badge.hidden { display: none; }
.hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 6px 10px;
  color: var(--muted);
  max-width: 70%;
  pointer-events: none;
}

.params h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--accent);
}
.params .msg {
  background: #eef5fb;
  border: 1px solid #c5d9ec;
  border-radius: 4px;
  padding: 8px;
  color: var(--muted);
  margin-bottom: 10px;
  min-height: 42px;
}
.field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.field label { color: var(--muted); }
.field input, .field select {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  padding: 5px 6px;
  font: inherit;
}
.actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.actions button {
  flex: 1;
  border: 1px solid var(--panel-border);
  background: #fff;
  border-radius: 3px;
  padding: 7px;
  font: inherit;
  cursor: pointer;
}
.actions button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.actions button.primary:hover { background: var(--accent-hover); }

.status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 10px;
  background: #dfe4ea;
  border-top: 1px solid var(--panel-border);
  font-size: 12px;
  color: var(--muted);
}
.status-bar .ok { color: #1a7a3c; }

.docs-tabs {
  display: flex;
  gap: 2px;
  margin-left: 8px;
}
.doc-tab {
  padding: 3px 10px;
  background: #d5dde7;
  border: 1px solid var(--panel-border);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  font-size: 12px;
}
.doc-tab.active { background: #fff; }

.hidden { display: none !important; }

/* —— Рабочее поле ARMCAD —— */
:root {
  --os-bar: #2b3138;
  --os-bar-text: #e8eaed;
  --os-accent: #1a73c7;
  --os-tab: #3a424c;
  --os-tab-active: #4a5562;
}

.armcad-app {
  grid-template-rows: auto 1fr 24px;
}
.armcad-app > .top-chrome,
.armcad-app > .workspace,
.armcad-app > .status-bar {
  position: relative;
  z-index: 1;
}
.top-chrome {
  z-index: 5000;
}

.os-doc-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  min-height: 32px;
  background: var(--os-bar);
  color: var(--os-bar-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 2;
  overflow: visible;
}
.os-doc-bar .brand {
  color: #7ec8ff;
  margin-right: 4px;
  flex: 0 0 auto;
}
.os-doc-bar .main-menu {
  flex: 1 1 auto;
  min-width: 280px;
  overflow: visible;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 0;
}
.os-doc-bar .menu-item {
  color: var(--os-bar-text);
  z-index: 1;
  flex: 0 0 auto;
  white-space: nowrap;
}
.os-doc-bar .menu-item:hover,
.os-doc-bar .menu-item.open {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.os-doc-bar .menu-item .dropdown {
  color: var(--text);
}
.os-doc-bar .menu-sep {
  width: 1px;
  align-self: center;
  height: 16px;
  margin: 0 8px;
  background: rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
}
.toolbar-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
  overflow-x: auto;
}
.toolbar-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(232, 234, 237, 0.78);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.toolbar-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.toolbar-tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-bottom-color: #7ec8ff;
}

/* Раздел «Моделирование и чертежи» — список панелей */
.menu-item--modeling {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(280px, 42vw);
}
.menu-item--modeling .modeling-label {
  font-weight: 600;
  white-space: nowrap;
}
.menu-item--modeling .modeling-current {
  font-size: 11px;
  font-weight: 700;
  color: #7ec8ff;
  background: rgba(126, 200, 255, 0.12);
  border: 1px solid rgba(126, 200, 255, 0.28);
  border-radius: 4px;
  padding: 1px 7px;
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.os-doc-bar .menu-item--modeling:hover .modeling-current,
.os-doc-bar .menu-item--modeling.open .modeling-current {
  color: #b8e0ff;
  border-color: rgba(126, 200, 255, 0.45);
}
.dropdown--modeling {
  min-width: 260px !important;
}
.dropdown--modeling .modeling-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  color: var(--text);
}
.dropdown--modeling .modeling-list-item:hover {
  background: #e3f0fb;
}
.dropdown--modeling .modeling-list-item.active {
  background: #e8f0fc;
  box-shadow: inset 3px 0 0 #2a6fd6;
}
.dropdown--modeling .modeling-list-name {
  font-weight: 700;
  font-size: 13px;
}
.dropdown--modeling .modeling-list-hint {
  font-size: 11px;
  color: var(--muted, #6a7380);
  line-height: 1.3;
  white-space: normal;
}.os-doc-title {
  font-weight: 600;
  font-size: 13px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  flex: 0 1 auto;
  min-width: 0;
}
.os-autosave {
  font-size: 11px;
  color: #8fd19e;
  margin-right: 8px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.os-doc-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}

/* Портал меню поверх ленты и WebGL */
.menu-portal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  pointer-events: none;
}
.menu-portal > .dropdown {
  pointer-events: auto;
  display: block;
  position: fixed;
  min-width: 240px;
  max-height: min(78vh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--panel-border);
  box-shadow: 0 12px 32px rgba(20, 30, 50, 0.3);
  padding: 4px 0;
  scrollbar-gutter: stable;
}
.os-doc-actions button {
  border: 1px solid #555e6a;
  background: #3a424c;
  color: #e8eaed;
  border-radius: 3px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.os-doc-actions button:hover {
  background: #4a5562;
}

.os-toolbar-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0;
  background: linear-gradient(#f8f9fb, #e8edf3);
  border-bottom: 0;
  min-height: 76px;
  overflow: visible;
  z-index: 1;
}
.os-toolbar-area .tool-sets {
  display: none;
}
.os-toolbar-area .tool-panels {
  padding: 4px 6px 2px;
  overflow-x: auto;
  overflow-y: visible;
  min-width: 0;
}
.os-toolbar-area .toolbar-quick {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 6px 10px;
  border-left: 1px solid var(--panel-border);
  background: #eef2f6;
  max-width: 340px;
}
.os-toolbar-area .toolbar-quick .search {
  min-width: 0;
}
.os-toolbar-area .toolbar-quick .search input {
  width: 110px;
  max-width: 18vw;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 4px 6px;
  font: inherit;
  background: #fff;
}
.os-toolbar-area .toolbar-quick button,
.os-toolbar-area .toolbar-quick select {
  appearance: none;
  border: 1px solid var(--panel-border);
  background: #fff;
  border-radius: 4px;
  padding: 4px 7px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.os-toolbar-area .toolbar-quick button:hover {
  background: #e3f0fb;
  border-color: var(--accent);
}
.os-toolbar-area .ribbon {
  min-height: 68px;
}
.os-toolbar-area .tool-btn {
  height: auto;
  min-height: 52px;
  min-width: 64px;
  max-width: 96px;
}

.os-workspace {
  position: relative;
}
.os-feature-list {
  display: flex;
  flex-direction: column;
  min-width: 220px;
}
.os-feature-list .panel-body {
  flex: 1;
  overflow: auto;
}
.os-parts-list {
  border-top: 1px solid var(--panel-border);
  max-height: 120px;
  overflow: auto;
  background: #fafbfc;
  padding-bottom: 4px;
}
.os-parts-list:has(.tree-node:nth-child(6)) {
  max-height: 200px;
}
.asm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.asm-actions button {
  font: inherit;
  padding: 5px 10px;
  border: 1px solid var(--panel-border);
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
}
.asm-actions button.primary,
.asm-actions button:first-child {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.proj-list {
  max-height: 280px;
  overflow: auto;
  margin: 8px 0;
}
.proj-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  margin-bottom: 6px;
  background: #fff;
}
.proj-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.proj-row-actions button {
  font: inherit;
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid var(--panel-border);
  background: #f4f6f8;
  border-radius: 3px;
  cursor: pointer;
}
.proj-row-actions button:hover {
  background: #e3f0fb;
}
.os-rollback {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-top: 1px solid var(--panel-border);
  background: #eef2f6;
  font-size: 11px;
  color: var(--muted);
}
.os-rollback input[type="range"] {
  flex: 1;
}

.tree-node {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tree-node .eye {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 0 2px;
  font-size: 12px;
  line-height: 1;
}
.tree-node .eye.off {
  opacity: 0.35;
}
.tree-node.feat-error {
  color: var(--danger, #b33a3a);
  font-weight: 600;
}
.feat-error-msg { color: var(--danger); }

.vars-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 6px;
}
.vars-table th,
.vars-table td {
  border-bottom: 1px solid var(--panel-border, #c5ccd6);
  padding: 3px 4px;
  text-align: left;
  vertical-align: middle;
}
.vars-table input {
  width: 100%;
  min-width: 0;
  font: inherit;
  border: 1px solid #b8c0cc;
  border-radius: 3px;
  padding: 2px 4px;
  background: #fff;
}
.vars-table .var-val { font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.vars-table .var-val.err { color: var(--danger); }
.vars-table .var-del {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
}
.vars-table .var-del:hover { color: var(--danger); }

.layer-row .layer-name {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  padding: 1px 4px;
}
.layer-row .layer-name:focus {
  border-color: #b8c0cc;
  background: #fff;
  border-radius: 3px;
}
.panel-tabs {
  flex-wrap: wrap;
}
.panel-tabs button {
  font-size: 11px;
  padding: 4px 6px;
}

.drw-sheet { font-size: 12px; }
.drw-views { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.drw-view-frame {
  border: 1px solid #8a94a3;
  background: linear-gradient(180deg, #fafbfc, #e8edf3);
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.drw-dim { margin: 4px 0; }
.drw-dim label { display: block; color: var(--muted); font-size: 11px; }
.drw-dim input {
  width: 100%;
  border: 1px solid #b8c0cc;
  border-radius: 3px;
  padding: 4px 6px;
}
.drw-ann { padding: 4px 0; border-bottom: 1px dashed #c5ccd6; }
.drw-bom { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 4px; }
.drw-bom th, .drw-bom td { border: 1px solid #c5ccd6; padding: 3px 5px; text-align: left; }
.drw-bom th { background: #e8ecf1; }

/* Визуальный лист чертежа (центр) */
.drawing-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.9), transparent 55%),
    linear-gradient(160deg, #d8dde4 0%, #b8c2ce 45%, #9aa6b4 100%);
  /* Leave room for the document tabs below the sheet, including its title block. */
  padding: 10px 10px 64px;
  box-sizing: border-box;
}
.drawing-overlay.hidden {
  display: none;
}
.drawing-overlay-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.drawing-overlay-title {
  font-size: 12px;
  font-weight: 600;
  color: #1c2430;
  margin-right: auto;
}
.drawing-overlay-toolbar button {
  border: 1px solid #6a7380;
  background: #f4f6f8;
  border-radius: 4px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.drawing-overlay-toolbar button:hover {
  border-color: var(--os-accent, #2f6fed);
  color: var(--os-accent, #2f6fed);
}
.drawing-canvas-host {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.drawing-canvas-host .drw-canvas-svg {
  width: min(100%, 960px);
  height: auto;
  max-height: 100%;
  box-shadow: 0 8px 28px rgba(28, 36, 48, 0.28);
  background: #fff;
}

#c.cursor-pick-face {
  cursor: crosshair;
}

.fem-legend { margin-top: 10px; }
.fem-legend-bar {
  height: 12px;
  border-radius: 2px;
  border: 1px solid #8a94a3;
  background: linear-gradient(90deg, #1a59f2 0%, #5ec8c8 33%, #e8c84a 66%, #e24a2f 100%);
}
.fem-legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted, #5a6570);
  margin-top: 4px;
  gap: 4px;
}


.os-view-cube {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid #8a94a3;
  background: linear-gradient(145deg, #fff, #dce3ec);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #334;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  z-index: 5;
  user-select: none;
}
.os-view-cube:hover {
  border-color: var(--os-accent);
  color: var(--os-accent);
}

.os-doc-tabs {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 2px;
  z-index: 6;
  pointer-events: none;
}
.os-doc-tabs .os-tab {
  pointer-events: auto;
  border: 1px solid #6a7380;
  background: var(--os-tab);
  color: #e8eaed;
  border-radius: 4px 4px 0 0;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.os-doc-tabs .os-tab.active {
  background: #fff;
  color: #1c2430;
  border-bottom-color: #fff;
  font-weight: 600;
}
.os-doc-tabs .os-tab.add {
  background: transparent;
  border-style: dashed;
  color: #555;
  border-color: #999;
}

.os-feature-dialog .params {
  background: #fff;
}
.os-feature-dialog .params h3 {
  background: var(--os-accent);
  color: #fff;
  margin: -8px -8px 10px;
  padding: 8px 10px;
  border-radius: 0;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.os-versions {
  position: fixed;
  top: 40px;
  right: 16px;
  width: 280px;
  max-height: 70vh;
  background: #fff;
  border: 1px solid var(--panel-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  z-index: 80;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
  border-radius: 6px;
}
.os-versions-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.os-versions-head button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}
.os-versions-body {
  overflow: auto;
  flex: 1;
  font-size: 12px;
}
.os-versions-body .ver-item {
  padding: 6px 8px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  margin-bottom: 6px;
  cursor: pointer;
}
.os-versions-body .ver-item:hover {
  background: #eef5fb;
}
.os-versions .primary {
  border: 0;
  background: var(--os-accent);
  color: #fff;
  border-radius: 4px;
  padding: 8px;
  font: inherit;
  cursor: pointer;
}

.viewport-wrap {
  padding-bottom: 36px;
}

/* Контекстное меню сопряжений */
.ctx {
  position: fixed;
  z-index: 40;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--panel-border, #c9d3df);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(20, 30, 45, 0.18);
}
.ctx-title {
  font-size: 11px;
  color: var(--muted, #5a6678);
  padding: 6px 8px 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ctx-item {
  display: grid;
  width: 100%;
  text-align: left;
  gap: 2px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.ctx-item span {
  font-size: 11px;
  color: var(--muted, #5a6678);
}
.ctx-item:hover {
  background: #eef5fb;
}
.ctx-item.danger {
  color: #c0392b;
  margin-top: 4px;
}
.asm-actions.pick-row button.primary {
  outline: 2px solid var(--os-accent, #3b82f6);
}

/* Справка */
.help-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.help-nav button {
  border: 1px solid var(--panel-border, #c9d3df);
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
}
.help-nav button.primary {
  background: var(--os-accent, #3b82f6);
  color: #fff;
  border-color: transparent;
}
.help-pdf-link {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 6px;
  background: #1c2430;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
}
.help-pdf-link:hover {
  background: #0b6cb8;
}
.help-doc {
  max-height: min(58vh, 520px);
  overflow: auto;
  font-size: 13px;
  line-height: 1.45;
  color: #1f2a37;
}
.help-doc h4 {
  margin: 14px 0 6px;
  font-size: 14px;
}
.help-doc h4:first-child {
  margin-top: 0;
}
.help-doc ul,
.help-doc ol {
  margin: 6px 0 10px;
  padding-left: 1.25em;
}
.help-doc li {
  margin: 3px 0;
}
.help-doc p {
  margin: 6px 0;
}
.help-doc code {
  font-size: 12px;
  background: #eef2f7;
  padding: 1px 5px;
  border-radius: 4px;
}
.float-win:has(.help-doc) {
  width: min(560px, 92vw);
  max-width: 92vw;
}

/* Toast UX */
.armcad-toast-host {
  position: fixed;
  right: 16px;
  bottom: 48px;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(360px, 90vw);
}
.armcad-toast {
  padding: 10px 14px;
  border-radius: 8px;
  background: #1f2a37;
  color: #f4f7fb;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(20, 28, 40, 0.28);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.armcad-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.armcad-toast--ok {
  background: #1a6b3c;
}
.armcad-toast--warn {
  background: #8a5a12;
}
.armcad-toast--info {
  background: #2a4a6e;
}

/* ----- ИИ Агенты / MCP ----- */
.float-win.float-win--ai {
  width: min(560px, 94vw);
  max-width: 94vw;
}
.float-win.float-win--ai .float-body {
  max-height: min(72vh, 640px);
  overflow: auto;
}

.float-win.float-win--collisions {
  width: min(480px, 94vw);
}
.float-win.float-win--collisions .float-body {
  max-height: min(72vh, 560px);
  overflow: auto;
}
.coll-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-bg, #f4f6f8);
  padding: 0 0 8px;
  margin: 0 0 8px;
  border-bottom: 1px solid var(--panel-border);
}
.coll-gap-field {
  grid-template-columns: auto 1fr;
  margin-bottom: 6px;
}
.coll-gap-field input {
  max-width: 120px;
}
.coll-report-head {
  margin: 0 0 4px;
  font-weight: 600;
}
.coll-counts {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.coll-progress {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--accent, #1a6dff);
  min-height: 1.2em;
}
.coll-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.coll-tab {
  flex: 1;
  border: 1px solid var(--panel-border);
  background: #fff;
  border-radius: 3px;
  padding: 6px 4px;
  font: inherit;
  cursor: pointer;
}
.coll-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.coll-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.coll-item {
  border: 1px solid #d5dde6;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 6px;
  background: #fff;
}
.coll-item.coll-error { border-left: 3px solid #b42318; }
.coll-item.coll-warning { border-left: 3px solid #b54708; }
.coll-item.coll-info { border-left: 3px solid #4a6a88; }
.coll-sev {
  font-size: 10px;
  text-transform: uppercase;
  color: #5a6678;
  margin-right: 6px;
}
.coll-desc, .coll-ids {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.coll-row-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.coll-row-actions button {
  border: 1px solid var(--panel-border);
  background: #fff;
  border-radius: 3px;
  padding: 4px 8px;
  font: inherit;
  cursor: pointer;
}
.coll-pane.hidden { display: none; }
.ai-agents {
  color: #2a2f36;
  font-size: 13px;
}
.ai-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid #dde2e8;
  padding-bottom: 8px;
}
.ai-tab {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 12px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: #5a6570;
}
.ai-tab.active {
  background: #e8f0fc;
  color: #1f4b8f;
  border-color: #c5d8f5;
}
.ai-sec-title {
  margin: 14px 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a93a0;
}
.ai-sec-title:first-child {
  margin-top: 0;
}
.ai-card {
  background: #f7f9fc;
  border: 1px solid #e2e7ee;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ai-card-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.ai-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.ai-label {
  font-size: 12px;
  font-weight: 600;
  color: #3a424c;
  margin: 8px 0 4px;
}
.ai-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}
.ai-badge.ok {
  background: #1f9d55;
  color: #fff;
}
.ai-badge.off {
  background: #c5ccd4;
  color: #3a424c;
}
.ai-muted {
  margin: 6px 0;
  font-size: 12px;
  color: #6a7380;
  line-height: 1.45;
}
.ai-warn {
  color: #8a5a12;
}
.ai-tok-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0;
}
.ai-tok-h {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #8a93a0;
  margin-bottom: 2px;
}
.ai-tok-v {
  font-weight: 600;
  font-size: 13px;
}
.ai-term-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ai-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c5ccd4;
  border-radius: 6px;
  overflow: hidden;
}
.ai-step-btn {
  width: 32px;
  height: 32px;
  border: 0;
  background: #eef2f6;
  cursor: pointer;
  font-size: 16px;
}
.ai-step-input {
  width: 48px;
  height: 32px;
  border: 0;
  border-left: 1px solid #c5ccd4;
  border-right: 1px solid #c5ccd4;
  text-align: center;
  font: inherit;
}
.ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ai-btn {
  border: 1px solid #b0b8c2;
  background: #fff;
  border-radius: 6px;
  padding: 7px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.ai-btn:hover {
  filter: brightness(1.03);
}
.ai-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ai-btn.primary {
  background: #3d8bfd;
  border-color: #2a6fd6;
  color: #fff;
}
.ai-btn.danger {
  background: #fff5f5;
  border-color: #e0a0a0;
  color: #a03030;
}
.ai-once {
  border-color: #f0c36a;
  background: #fffbeb;
}
.ai-subh {
  margin: 10px 0 4px;
  font-weight: 700;
  font-size: 12px;
}
.ai-code {
  margin: 0 0 8px;
  padding: 10px;
  background: #1f2a37;
  color: #e8eef6;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  overflow: auto;
  max-height: 160px;
  white-space: pre-wrap;
  word-break: break-all;
}
.ai-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c5ccd4;
  border-radius: 6px;
  padding: 7px 10px;
  font: inherit;
  margin-bottom: 4px;
  background: #fff;
}
.ai-textarea {
  resize: vertical;
  min-height: 88px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}
.ai-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
  font-weight: 600;
}
.ai-agent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-agent-card {
  border: 1px solid #e2e7ee;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.ai-agent-card.off {
  opacity: 0.65;
}
.ai-agent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.ai-ol {
  margin: 0;
  padding-left: 1.25em;
  line-height: 1.5;
}
.ai-ol li {
  margin: 4px 0;
}
@media (max-width: 520px) {
  .ai-tok-table {
    grid-template-columns: 1fr;
  }
}

/* ----- Уроки по инструментам ----- */
.float-win.float-win--lessons {
  width: min(720px, 96vw);
  max-width: 96vw;
}
.float-win.float-win--lessons .float-body {
  max-height: min(78vh, 680px);
  overflow: auto;
}
.lessons-root {
  color: #1f2a37;
  font-size: 13px;
}
.lessons-top {
  margin-bottom: 8px;
}
.lessons-search {
  width: 100%;
  box-sizing: border-box;
  height: 34px;
  padding: 6px 10px;
  border: 1px solid #c5ccd4;
  border-radius: 6px;
  font: inherit;
}
.lessons-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.lessons-cat {
  border: 1px solid #c5ccd4;
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.lessons-cat.active {
  background: #e8f0fc;
  border-color: #2a6fd6;
  color: #1f4b8f;
  font-weight: 700;
}
.lessons-layout {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(0, 1.3fr);
  gap: 12px;
  min-height: 280px;
}
@media (max-width: 640px) {
  .lessons-layout {
    grid-template-columns: 1fr;
  }
}
.lessons-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(52vh, 440px);
  overflow: auto;
  border: 1px solid #e2e7ee;
  border-radius: 8px;
  padding: 6px;
  background: #f7f9fc;
}
.lessons-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
}
.lessons-item:hover {
  border-color: #a8c4ef;
}
.lessons-item.active {
  border-color: #2a6fd6;
  background: #e8f0fc;
}
.lessons-item-title {
  font-weight: 700;
  font-size: 13px;
}
.lessons-item-meta {
  font-size: 11px;
  color: #6a7380;
}
.lessons-detail {
  border: 1px solid #e2e7ee;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}
.lessons-title {
  margin: 0 0 4px;
  font-size: 16px;
}
.lessons-summary {
  margin: 8px 0 12px;
  line-height: 1.45;
}
.lessons-sec {
  margin: 12px 0 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a93a0;
}
.lessons-steps,
.lessons-tips {
  margin: 0;
  padding-left: 1.2em;
  line-height: 1.45;
}
.lessons-steps li,
.lessons-tips li {
  margin: 4px 0;
}
.lessons-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.lessons-btn {
  border: 1px solid #b0b8c2;
  background: #fff;
  border-radius: 6px;
  padding: 7px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.lessons-btn.primary {
  background: #3d8bfd;
  border-color: #2a6fd6;
  color: #fff;
}
.lessons-muted {
  color: #6a7380;
  font-size: 12px;
  line-height: 1.4;
}
.lessons-foot {
  margin: 10px 0 0;
}

.float-win.tz-win {
  width: 440px;
  max-width: calc(100vw - 24px);
}
.float-win.tz-win .float-body {
  max-height: min(72vh, 560px);
}
.tz-panel .ai-label { display: block; }
.tz-panel select,
.tz-panel textarea,
.tz-panel input[type="text"],
.tz-panel input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--panel-border, #c5d0dc);
  border-radius: 4px;
  padding: 6px 8px;
  font: inherit;
  margin-bottom: 8px;
}
.tz-q {
  font-weight: 700;
  margin: 6px 0 4px;
}
.tz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.tz-filled {
  margin: 8px 0 12px;
  font-size: 12px;
}
.tz-line {
  margin: 3px 0;
}
