:root {
  color-scheme: light;
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 20px;
  --ui-space-6: 24px;
  --ui-space-7: 28px;
  --ui-space-8: 32px;
  --ui-font-sm: 12px;
  --ui-font-base: 14px;
  --ui-font-lg: 18px;
  --ui-transition: 0.16s ease;
  --ui-shadow-1: 0 10px 20px rgba(20, 36, 20, 0.08);
  --ui-shadow-2: 0 18px 42px rgba(20, 36, 20, 0.14);
  --ui-shadow-3: 0 24px 54px rgba(20, 36, 20, 0.22);
  --dx-bg: #f1f5eb;
  --dx-panel: rgba(255, 255, 255, 0.95);
  --dx-border: rgba(23, 49, 23, 0.12);
  --dx-shadow: var(--ui-shadow-2);
  --dx-ink: #183018;
  --dx-muted: #5a6b5a;
  --dx-accent: #2a6031;
  --dx-accent-2: #18796b;
  --dx-warn: #c98021;
  --dx-risk: #9a3d2c;
  --dx-soft: #edf4ea;
}

.dx-title,
.dx-panel,
.dx-tabs,
.dx-sliderbar,
.dx-ai-fab,
.dx-reveal,
.dx-modal-card {
  background: var(--dx-panel);
  border: 1px solid var(--dx-border);
  box-shadow: var(--dx-shadow);
  backdrop-filter: blur(10px);
}

.dx-btn,
.dx-chip,
.dx-tab,
.dx-reveal {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ui-space-2);
  text-decoration: none;
  transition:
    transform var(--ui-transition),
    box-shadow var(--ui-transition),
    opacity var(--ui-transition),
    background var(--ui-transition),
    color var(--ui-transition);
}

.dx-btn {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--dx-ink);
  box-shadow: var(--ui-shadow-1);
  font-size: 13px;
  font-weight: 700;
}

.dx-btn:hover,
.dx-chip:hover,
.dx-tab:hover,
.dx-reveal:hover {
  transform: translateY(-1px);
  box-shadow: var(--ui-shadow-2);
}

.dx-btn:active,
.dx-chip:active,
.dx-tab:active,
.dx-reveal:active {
  transform: translateY(0);
}

.dx-btn.primary {
  background: linear-gradient(135deg, var(--dx-accent), #478348);
  color: #fff;
}

.dx-btn.secondary {
  background: linear-gradient(135deg, var(--dx-accent-2), #52a193);
  color: #fff;
}

.dx-chip {
  padding: 8px 11px;
  background: #f8fbf6;
  color: var(--dx-ink);
  border: 1px solid #e2ecde;
  font-size: 12px;
  font-weight: 700;
}

.dx-chip.active {
  background: linear-gradient(135deg, #dcefd7, #eef7ec);
  border-color: #bfd7b8;
}

.dx-tab {
  padding: 10px 14px;
  white-space: nowrap;
  background: transparent;
  color: var(--dx-muted);
  font-weight: 700;
}

.dx-tab.active {
  background: linear-gradient(135deg, #dfeedd, #eff7ee);
  color: var(--dx-ink);
}

.dx-panel {
  position: absolute;
  border-radius: 24px;
  padding: 14px;
  box-sizing: border-box;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dx-border) transparent;
  z-index: 1012;
  transition:
    opacity var(--ui-transition),
    transform var(--ui-transition),
    box-shadow var(--ui-transition);
}

.dx-panel::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.dx-panel::-webkit-scrollbar-thumb {
  background: var(--dx-border);
  border-radius: 999px;
}

.dx-panel.is-minimised {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.98);
}

.dx-panel.dx-floating {
  max-height: none !important;
}

.dx-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.dx-panel-head h2,
.dx-panel-head p {
  margin: 0;
}

.dx-panel-head h2 {
  font-size: 17px;
}

.dx-panel-head p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--dx-muted);
}

.dx-panel-head.is-draggable {
  cursor: move;
  user-select: none;
  touch-action: none;
}

.dx-resize-handle {
  position: absolute;
  z-index: 4;
  background: rgba(24, 48, 24, 0.08);
  touch-action: none;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.dx-panel:hover .dx-resize-handle,
.dx-panel:focus-within .dx-resize-handle {
  opacity: 1;
}

.dx-resize-handle[data-edge="n"],
.dx-resize-handle[data-edge="s"] {
  left: 14px;
  right: 14px;
  height: 24px;
}

.dx-resize-handle[data-edge="n"] {
  top: -12px;
  cursor: ns-resize;
}

.dx-resize-handle[data-edge="s"] {
  bottom: -12px;
  cursor: ns-resize;
}

.dx-resize-handle[data-edge="e"],
.dx-resize-handle[data-edge="w"] {
  top: 14px;
  bottom: 14px;
  width: 24px;
}

.dx-resize-handle[data-edge="e"] {
  right: -12px;
  cursor: ew-resize;
}

.dx-resize-handle[data-edge="w"] {
  left: -12px;
  cursor: ew-resize;
}

.dx-resize-handle[data-edge="ne"],
.dx-resize-handle[data-edge="nw"],
.dx-resize-handle[data-edge="se"],
.dx-resize-handle[data-edge="sw"] {
  width: 34px;
  height: 34px;
  background: rgba(24, 48, 24, 0.12);
}

.dx-resize-handle[data-edge="ne"] {
  right: -16px;
  top: -16px;
  cursor: nesw-resize;
}

.dx-resize-handle[data-edge="nw"] {
  left: -16px;
  top: -16px;
  cursor: nwse-resize;
}

.dx-resize-handle[data-edge="se"] {
  right: -16px;
  bottom: -16px;
  cursor: nwse-resize;
}

.dx-resize-handle[data-edge="sw"] {
  left: -16px;
  bottom: -16px;
  cursor: nesw-resize;
}

.dx-reveal {
  position: absolute;
  display: none;
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--dx-ink);
  font-size: 18px;
  font-weight: 800;
  z-index: 1006;
}

.dx-reveal.is-visible {
  display: inline-flex;
}

.dx-toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 30, 18, 0.92);
  color: #fff;
  padding: 9px 12px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 180ms ease;
  font-size: 13px;
}

.dx-modal {
  position: absolute;
  inset: 0;
  background: rgba(18, 31, 18, 0.36);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.dx-modal.show {
  display: flex;
}

.dx-modal-card {
  width: min(760px, 100%);
  overflow: auto;
  border-radius: 24px;
  padding: 18px;
}

.dx-modal-card textarea,
.dx-modal-card pre,
.dx-modal-card input,
.dx-modal-card select {
  width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid #d7e4d1;
  padding: 10px 12px;
  background: #fbfdf9;
}

.dx-form {
  display: grid;
  gap: var(--ui-space-3);
}

.dx-field {
  display: grid;
  gap: 6px;
}

.dx-field label {
  font-size: var(--ui-font-sm);
  font-weight: 700;
  color: #335033;
}

.dx-field input,
.dx-field textarea,
.dx-field select {
  width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid #d7e4d1;
  padding: 11px 12px;
  background: #fbfdf9;
  color: var(--dx-ink);
}

.dx-select,
.dx-field-input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid #d7e4d1;
  padding: 11px 12px;
  background: #fbfdf9;
  color: var(--dx-ink);
  font: inherit;
}

.dx-panel-actions {
  display: flex;
  gap: var(--ui-space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}
