/* ====================================================================
   Tablas — Estilo Windows Desktop Nativo Profesional
   Diseñado para simular un software desktop (Mozaik, Cabinet Vision, Pro100)
   ==================================================================== */

:root {
  --win-bg: #ece9d8;
  --win-face: #f0f0f0;
  --win-header: #2D6B1F;
  --win-header-grad: linear-gradient(180deg, #378226 0%, #205016 100%);
  --win-border: #707070;
  --win-border-light: #dcdcdc;
  --win-active: #0078d7;
  --win-hover: #e5f1fb;
  --win-hover-border: #70c0e7;
  --win-btn: #e1e1e1;
  --win-btn-border: #adadad;
  --win-ink: #1e1e1e;
  --win-muted: #595959;
  --win-inset-bg: #ffffff;
  --cimca-amber: #F39C12;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 12px; color: var(--win-ink); background: var(--win-face);
  user-select: none; -webkit-user-select: none;
  overflow: hidden;
}

/* ====================================================================
   1. Window Frame / Titlebar
   ==================================================================== */
#winTitlebar {
  height: 30px;
  background: var(--win-header-grad);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 10px;
  border-bottom: 1px solid #1a3c13;
  flex-shrink: 0;
}
.win-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.win-title-left img { width: 16px; height: 16px; display: block; }
.win-doc-name { color: #fdf5d6; font-weight: normal; margin-left: 6px; }

.win-title-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.win-badge {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 11px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}
.win-online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #73f75e; box-shadow: 0 0 5px #73f75e;
}
.win-sys-select {
  background: #ffffff;
  border: 1px solid #707070;
  border-radius: 2px;
  padding: 1px 4px;
  font-size: 11px;
  font-family: inherit;
  color: var(--win-ink);
  outline: none;
  height: 20px;
}
.win-controls {
  display: flex;
  margin-left: 4px;
}
.win-ctrl-btn {
  width: 24px; height: 20px;
  background: transparent;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  border-radius: 2px;
  opacity: 0.85;
}
.win-ctrl-btn:hover { background: rgba(255,255,255,0.22); opacity: 1; }
.win-ctrl-close:hover { background: #e81123 !important; color: #fff; }

/* ====================================================================
   2. Menu Bar (Estilo Windows Nativo)
   ==================================================================== */
#winMenubar {
  height: 24px;
  background: var(--win-face);
  border-bottom: 1px solid var(--win-border-light);
  display: flex;
  align-items: center;
  padding: 0 4px;
  flex-shrink: 0;
}
.menu-item {
  position: relative;
}
.menu-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 2px 8px;
  font-size: 12px;
  font-family: inherit;
  color: var(--win-ink);
  cursor: pointer;
  height: 20px;
  display: flex;
  align-items: center;
  outline: none;
}
.menu-btn u { text-decoration: underline; }
.menu-btn:hover, .menu-item.active .menu-btn {
  background: var(--win-hover);
  border-color: var(--win-hover-border);
}

/* Dropdown Menu */
.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid var(--win-border);
  box-shadow: 2px 4px 12px rgba(0,0,0,0.18);
  padding: 3px 0;
  z-index: 1000;
}
.menu-item.open > .menu-dropdown { display: block; }

.menu-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 4px 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--win-ink);
  position: relative;
  text-decoration: none;
}
.menu-entry:hover {
  background: #2D6B1F;
  color: #ffffff;
}
.menu-entry:hover .menu-shortcut { color: #fdf5d6; }
.menu-entry:hover .menu-arrow { color: #ffffff; }
.menu-entry:hover svg path, .menu-entry:hover svg rect, .menu-entry:hover svg circle {
  stroke-opacity: 0.9;
}
.menu-entry.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.menu-entry-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.menu-shortcut {
  font-size: 11px;
  color: var(--win-muted);
  margin-left: 20px;
}
.menu-arrow {
  font-size: 10px;
  color: #666;
  margin-left: 14px;
}
.menu-sep {
  height: 1px;
  background: #e2e2e2;
  margin: 3px 6px;
}

/* Submenu Flyout */
.submenu {
  position: relative;
}
.submenu > .menu-dropdown {
  top: -4px;
  left: 100%;
}
.submenu:hover > .menu-dropdown {
  display: block;
}

/* ====================================================================
   3. Toolbar (Windows Ribbon / Tool Palette)
   ==================================================================== */
#winToolbar {
  height: 34px;
  background: #fdfdfd;
  border-bottom: 1px solid var(--win-border-light);
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 2px;
  flex-shrink: 0;
  overflow-x: auto;
}
.tool-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 3px 7px;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  color: var(--win-ink);
  outline: none;
  white-space: nowrap;
}
.tool-btn:hover {
  background: var(--win-hover);
  border-color: var(--win-hover-border);
}
.tool-btn:active {
  background: #cce4f7;
  border-color: #48a0d4;
}
.tool-btn.active {
  background: #e1f0fa;
  border-color: #2b7bb9;
  font-weight: 600;
}
.tool-sep {
  width: 1px;
  height: 18px;
  background: #d4d4d4;
  margin: 0 4px;
  flex-shrink: 0;
}

/* ====================================================================
   4. Main Workspace Layout
   ==================================================================== */
#winWorkspace {
  display: grid;
  grid-template-columns: 310px 1fr;
  height: calc(100vh - 30px - 24px - 34px - 24px);
  width: 100%;
  background: #eef1ec;
  overflow: hidden;
}

/* Left Sidebar (Inspector & Control Panel) */
#winSidebar {
  background: #f7f9f6;
  border-right: 1px solid var(--win-border-light);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.sidebar-header {
  background: #e4ebe0;
  border-bottom: 1px solid #d2ded0;
  padding: 5px 10px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--win-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

/* Windows Group Box */
.win-group {
  border: 1px solid #d3ded0;
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: #ffffff;
}
.win-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--win-header);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Form inputs & controls in Sidebar */
.win-field {
  margin-bottom: 6px;
}
.win-field label {
  display: block;
  font-size: 11px;
  color: var(--win-muted);
  margin-bottom: 2px;
}
.win-input {
  width: 100%;
  height: 24px;
  padding: 2px 6px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid #abadb3;
  border-radius: 2px;
  background: #ffffff;
  outline: none;
}
.win-input:focus { border-color: #2D6B1F; box-shadow: 0 0 3px rgba(45,107,31,0.4); }
.win-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* Minimal "En la pared" button */
.btn-on-wall {
  background: #ffffff;
  border: 1px solid #707070;
  border-radius: 2px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  color: #2D6B1F;
  font-weight: 600;
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-on-wall.active {
  background: #2D6B1F;
  color: #ffffff;
  border-color: #1a4212;
}
.btn-on-wall:hover { border-color: #2D6B1F; }

/* Unit List in sidebar */
.unit-list-box {
  border: 1px solid #abadb3;
  background: #ffffff;
  max-height: 140px;
  overflow-y: auto;
  border-radius: 2px;
}
.unit-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 11px;
  cursor: pointer;
}
.unit-item-row:hover { background: var(--win-hover); }
.unit-item-row.selected { background: #d7e8d3; font-weight: 600; }
.unit-item-del {
  color: #c53030;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 1px 4px;
  font-size: 11px;
}
.unit-item-del:hover { background: #fed7d7; border-radius: 2px; }

/* Support info banner */
.support-bar {
  background: #f3f7f1;
  border: 1px solid #d4e2d0;
  border-radius: 3px;
  padding: 5px 8px;
  font-size: 11px;
  color: #255819;
  margin-top: 6px;
}

/* ====================================================================
   5. Canvas & Main Viewport Area
   ==================================================================== */
#winMainArea {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #1c271b;
}

/* Canvas Tabs */
.canvas-tabs {
  height: 28px;
  background: #e3e8e1;
  border-bottom: 1px solid #c8d3c5;
  display: flex;
  align-items: flex-end;
  padding: 0 6px;
  gap: 2px;
  flex-shrink: 0;
}
.c-tab {
  height: 24px;
  background: #d8dfd5;
  border: 1px solid #abadb3;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  padding: 0 12px;
  font-size: 11px;
  font-family: inherit;
  color: var(--win-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.c-tab:hover { background: #eef2ec; }
.c-tab.active {
  background: #ffffff;
  height: 26px;
  border-color: #92998f;
  font-weight: 600;
  color: var(--win-header);
}

/* Tab Panels */
.tab-panel {
  display: none;
  flex: 1;
  width: 100%;
  height: calc(100% - 28px);
  position: relative;
  overflow: hidden;
}
.tab-panel.active { display: block; }

/* 3D Canvas Container */
#threeViewport {
  width: 100%;
  height: 100%;
  position: relative;
  background: #182216;
}
#threeViewport canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* 3D Overlays (HUD) */
.hud-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 20;
  pointer-events: auto;
}
.hud-btn {
  background: rgba(255,255,255,0.94);
  border: 1px solid #707070;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 108px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  color: #1f2a1b;
  font-weight: 600;
}
.hud-btn:hover { background: #ffffff; border-color: #2D6B1F; color: #2D6B1F; }

/* Gizmo circular de rotación sobre la pieza */
.rot-gizmo {
  position: absolute;
  width: 120px;
  height: 120px;
  margin-left: -60px;
  margin-top: -60px;
  border-radius: 50%;
  border: 3px solid #F39C12;
  background: rgba(20,28,18,0.55);
  box-shadow: 0 0 0 2px rgba(243,156,18,0.35), 0 6px 18px rgba(0,0,0,0.35);
  z-index: 25;
  pointer-events: auto;
}
.rot-gizmo::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.55);
}
.rot-gizmo-btn {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #2D6B1F;
  background: #ffffff;
  color: #2D6B1F;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rot-gizmo-btn:hover { background: #2D6B1F; color: #fff; }
.rot-ccw { left: 8px; top: 43px; }
.rot-cw { right: 8px; top: 43px; }
.rot-90 { left: 43px; top: 8px; font-size: 11px; }
.rot-flip { left: 43px; bottom: 8px; }
.rot-wall { right: 8px; bottom: 12px; width: 26px; height: 26px; font-size: 11px; background: #F39C12; border-color: #8a5a12; color: #1f2a1b; }
.rot-wall:hover { background: #8a5a12; color: #fff; }
.rot-gizmo-close {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #888;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
}

.hud-measure {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(20,28,18,0.88);
  border: 1px solid #4a6b42;
  border-radius: 4px;
  padding: 6px 12px;
  color: #f7faf5;
  font-size: 11px;
  z-index: 10;
  backdrop-filter: blur(4px);
  max-width: 320px;
}
.hud-measure b { color: var(--cimca-amber); font-size: 13px; }

/* 2D Plan Container */
#planContainer {
  width: 100%;
  height: 100%;
  background: #ffffff;
  overflow: auto;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}
#planContainer svg {
  max-width: 95%;
  max-height: 95%;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  border-radius: 4px;
}

/* Tables in Other Tabs */
.grid-container {
  width: 100%;
  height: 100%;
  background: #ffffff;
  overflow: auto;
  padding: 10px;
}
.win-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.win-table th, .win-table td {
  padding: 5px 8px;
  border: 1px solid #dcdcdc;
  text-align: left;
}
.win-table th {
  background: #f0f3ee;
  color: var(--win-header);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}
.win-table tr:hover { background: #f7faf5; }

/* ====================================================================
   6. Windows Native Tooltip System
   ==================================================================== */
#winTooltip {
  position: fixed;
  display: none;
  background: #ffffdc;
  color: #1a1a1a;
  border: 1px solid #767676;
  border-radius: 2px;
  padding: 3px 7px;
  font-size: 11px;
  font-family: inherit;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.18);
  pointer-events: none;
  z-index: 99999;
  white-space: pre-line;
  max-width: 280px;
  line-height: 1.3;
}

/* ====================================================================
   7. Windows Status Bar
   ==================================================================== */
#winStatusbar {
  height: 24px;
  background: var(--win-face);
  border-top: 1px solid #d4d4d4;
  display: flex;
  align-items: center;
  padding: 0 4px;
  gap: 4px;
  flex-shrink: 0;
}
.status-msg {
  flex: 1;
  padding: 2px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--win-ink);
}
.status-pane {
  border: 1px inset #dcdcdc;
  padding: 2px 8px;
  font-size: 11px;
  background: #fdfdfd;
  white-space: nowrap;
}

/* ====================================================================
   8. Windows Native Dialogs / Modals
   ==================================================================== */
.win-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}
.win-modal {
  background: #f0f0f0;
  border: 1px solid #707070;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  min-width: 420px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: winPop 0.15s ease-out;
}
@keyframes winPop {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.win-modal-title {
  background: var(--win-header-grad);
  color: #ffffff;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 10px;
  font-weight: 600;
  font-size: 12px;
}
.win-modal-close {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  width: 22px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px;
}
.win-modal-close:hover { background: #e81123; }

.win-modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
  background: #ffffff;
}
.win-modal-footer {
  padding: 8px 12px;
  background: #f0f0f0;
  border-top: 1px solid #dcdcdc;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.win-btn {
  background: var(--win-btn);
  border: 1px solid var(--win-btn-border);
  border-radius: 2px;
  padding: 4px 16px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  min-width: 75px;
  outline: none;
}
.win-btn:hover { background: var(--win-hover); border-color: var(--win-hover-border); }
.win-btn.primary {
  background: #2D6B1F;
  color: #ffffff;
  border-color: #1a4212;
}
.win-btn.primary:hover { background: #378226; }

/* Visual Library Item Grid */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px;
}
.lib-card {
  border: 1px solid #d4dcd2;
  border-radius: 4px;
  background: #fafcfa;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s;
}
.lib-card:hover {
  border-color: #2D6B1F;
  background: #f0f6ee;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.lib-card-svg {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.lib-card-name {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--win-ink);
}
.lib-card-dim {
  font-size: 10px;
  color: var(--win-muted);
  margin-top: 2px;
}

/* ¿Cómo Quedará? Render Modal */
.render-full-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.render-image-frame {
  position: relative;
  max-width: 100%;
  border: 2px solid #2D6B1F;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  background: #182216;
}
.render-image-frame img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
}
.render-watermark {
  position: absolute;
  top: 10px;
  left: 12px;
  background: rgba(255,255,255,0.92);
  padding: 4px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.render-watermark img { height: 20px; }
.render-watermark span { font-weight: 700; color: #2D6B1F; font-size: 12px; }

/* Presupuesto Formal Printable */
@media print {
  body * { visibility: hidden; }
  #printQuoteArea, #printQuoteArea * { visibility: visible; }
  #printQuoteArea {
    position: absolute;
    left: 0; top: 0; width: 100%;
    margin: 0; padding: 20px; background: #fff;
  }
}

/* ====================================================================
   Mi Asistente — Diseñador Inteligente & Chat
   ==================================================================== */
.assistant-side-panel {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 320px;
  height: calc(100% - 20px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #707070;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  z-index: 40;
  font-family: inherit;
  font-size: 12px;
}
.assistant-header {
  background: var(--win-header-grad);
  color: #fff;
  padding: 6px 10px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}
.assistant-close {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}
.assistant-chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ast-msg {
  padding: 8px 10px;
  border-radius: 4px;
  line-height: 1.4;
  font-size: 11.5px;
}
.ast-msg.ai {
  background: #f0f5ee;
  border: 1px solid #d0e0cc;
  color: #1f2a1b;
}
.ast-msg.user {
  background: #e3effd;
  border: 1px solid #b9d5f7;
  color: #0b2e59;
  align-self: flex-end;
}
.assistant-input-box {
  padding: 8px;
  border-top: 1px solid #dcdcdc;
  display: flex;
  gap: 6px;
  background: #f7f7f7;
}
.assistant-input-box input {
  flex: 1;
  height: 26px;
  padding: 2px 6px;
  font-size: 12px;
  border: 1px solid #abadb3;
  border-radius: 2px;
}

/* Wizard Modal de Mi Asistente */
.ast-wizard-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: #eef4ea;
  padding: 6px;
  border-radius: 4px;
}
.ast-step-pill {
  flex: 1;
  text-align: center;
  padding: 4px 2px;
  font-size: 10.5px;
  color: #7a8a73;
  border-radius: 3px;
  font-weight: 600;
}
.ast-step-pill.active {
  background: #2D6B1F;
  color: #fff;
}
.ast-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ast-choice-card {
  border: 1px solid #c9d2c4;
  border-radius: 4px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s ease;
}
.ast-choice-card:hover {
  border-color: #2D6B1F;
  background: #f4f7f1;
}
.ast-choice-card.selected {
  border-color: #2D6B1F;
  background: #eef4ea;
  box-shadow: 0 0 4px rgba(45, 107, 31, 0.4);
}
.ast-choice-card strong {
  display: block;
  font-size: 13px;
  color: #2D6B1F;
  margin-bottom: 4px;
}
.ast-choice-card span {
  font-size: 11px;
  color: #555;
}

.win-modal--wide { width: 1160px; max-width: 96vw; }
.ctr-layout { display: flex; gap: 10px; font-size: 12px; }
.ctr-col-left { width: 236px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.ctr-col-center { flex: 1; min-width: 340px; display: flex; flex-direction: column; gap: 4px; }
.ctr-col-right { width: 258px; flex-shrink: 0; }
.ctr-box {
  border: 1px solid #c9d2c4; border-radius: 4px; background: #f4f7f1;
  padding: 6px;
}
.ctr-box h4 {
  margin: 0 0 5px 0; font-size: 11px; color: #2D6B1F;
  text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid #dce8d7;
  padding-bottom: 3px;
}
.ctr-toolbar { display: flex; flex-wrap: wrap; gap: 3px; }
.ctr-btn {
  background: #fff; border: 1px solid #adb3ac; border-radius: 3px;
  padding: 3px 6px; font-size: 10.5px; cursor: pointer; color: #1f2a1b;
  white-space: nowrap;
}
.ctr-btn:hover { background: #e7efe4; border-color: #2D6B1F; }
.ctr-btn:active { background: #d3e3cd; }
.ctr-btn.primary { background: #2D6B1F; color: #fff; border-color: #245316; }
.ctr-btn.danger { color: #b23b2e; border-color: #d9b3af; }
.ctr-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 4px; }
.ctr-mini {
  width: 100%; height: 22px; padding: 1px 5px; font-size: 11px;
  border: 1px solid #adb3ac; border-radius: 2px; background: #fff;
}
.ctr-tree { max-height: 200px; overflow-y: auto; margin-top: 3px; }
.ctr-tree-item {
  padding: 3px 5px; border-radius: 2px; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; gap: 4px; color: #2b3526;
}
.ctr-tree-item:hover { background: #eef4ea; }
.ctr-tree-item.sel { background: #2D6B1F; color: #fff; }
.ctr-tree-item .ctr-tree-ico { width: 12px; text-align: center; color: #7a8a73; }
.ctr-tree-item.sel .ctr-tree-ico { color: #cfe5c8; }
.ctr-preview {
  width: 100%; height: 400px; border: 1px solid #3a4a35; border-radius: 4px;
  background: #182216; cursor: grab; position: relative;
}
.ctr-hint { font-size: 10px; color: #8a9384; margin-top: 2px; }
.ctr-prop-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 4px; }
.ctr-prop-row label { font-size: 10px; color: #7a8a73; display: block; }
.ctr-prop-row input, .ctr-prop-row select {
  width: 100%; height: 22px; padding: 1px 5px; font-size: 11px;
  border: 1px solid #adb3ac; border-radius: 2px; background: #fff;
}
.ctr-empty {
  color: #8a9384; text-align: center; padding: 30px 10px; font-size: 11px;
}

