.kaif-cmp-panel {
  position: fixed;
  bottom: 20px;
  inset-inline-end: 20px;
  z-index: 2147482900;
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid #eee2d8;
  border-radius: 12px;
  box-shadow: 0 16px 46px rgba(43, 24, 8, 0.18);
  font-family: inherit;
  overflow: hidden;
}

.kaif-cmp-toggle {
  width: 100%;
  height: 42px;
  border: 0;
  background: #2f1d13;
  color: #fff;
  font-weight: bold;
  font-size: 12.5px;
  cursor: pointer;
  text-align: center;
}

.kaif-cmp-panel.is-collapsed .kaif-cmp-body {
  display: none;
}

.kaif-cmp-body {
  padding: 14px;
  max-height: 70vh;
  overflow: auto;
}

.kaif-cmp-groups {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.kaif-cmp-group {
  flex: 1;
  border: 1px solid #eee2d8;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kaif-cmp-group legend {
  font-size: 10.5px;
  color: #8f3f08;
  font-weight: bold;
  padding: 0 3px;
}
.kaif-cmp-group label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: #4a3626;
}
.kaif-cmp-group input[type="date"] {
  height: 32px;
  border: 1px solid #dfd2c7;
  border-radius: 6px;
  padding: 0 6px;
  font-family: inherit;
  font-size: 11px;
}

.kaif-cmp-branch {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #4a3626;
  margin-bottom: 10px;
}
.kaif-cmp-branch select {
  height: 36px;
  border: 1px solid #dfd2c7;
  border-radius: 8px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 12px;
}

.kaif-cmp-run {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: #cb6015;
  color: #fff;
  font-weight: bold;
  font-size: 12.5px;
  cursor: pointer;
}
.kaif-cmp-run:hover {
  background: #b6520e;
}
.kaif-cmp-run:disabled {
  opacity: 0.7;
  cursor: default;
}

.kaif-cmp-results {
  margin-top: 12px;
}
.kaif-cmp-empty {
  font-size: 11.5px;
  color: #8a7565;
  margin: 0;
}
.kaif-cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.kaif-cmp-table th {
  text-align: right;
  font-size: 10px;
  color: #8a7565;
  font-weight: bold;
  padding: 5px 4px;
  border-bottom: 1.5px solid #2f1d13;
}
.kaif-cmp-table td {
  padding: 5px 4px;
  border-bottom: 1px solid #eee2d8;
  color: #2f1d13;
}
.kaif-cmp-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: bold;
  padding: 1.5px 6px;
  border-radius: 7px;
}
.kaif-cmp-chip.up {
  background: #e4f0e9;
  color: #2f7d5a;
}
.kaif-cmp-chip.down {
  background: #f6e4e1;
  color: #b33f3f;
}

@media (prefers-color-scheme: dark) {
  html.kaif-dark .kaif-cmp-panel {
    background: #1f1712;
    border-color: #3a2c20;
  }
  html.kaif-dark .kaif-cmp-group {
    border-color: #3a2c20;
  }
  html.kaif-dark .kaif-cmp-group label,
  html.kaif-dark .kaif-cmp-branch {
    color: #e7d8c9;
  }
  html.kaif-dark .kaif-cmp-group input[type="date"],
  html.kaif-dark .kaif-cmp-branch select {
    background: #2a1f17;
    border-color: #4a3626;
    color: #f3e6da;
  }
  html.kaif-dark .kaif-cmp-table td {
    color: #f3e6da;
    border-color: #3a2c20;
  }
  html.kaif-dark .kaif-cmp-table th {
    border-color: #f3e6da;
  }
  html.kaif-dark .kaif-cmp-empty {
    color: #b8a692;
  }
}
